How to see each 1D fitted form from a 2D fitted histogram?

Hello Experts,

I have a 2-dimensional histogram(x,y) and fitted it with a 2-dimensional fitting function (x, y). And the fitting is working. But now I want to see how the 2D fitting passes in each dimension, like x and y, for a range of y and x, respectively, like a 1-dimension fitted form of a 2-dimension fitted histogram.
It is kind of I want to make a 1D projection of a 2D fitted histogram. I mean, the projection is simultaneously on the histogram and the 2D fitted function.

Could someone please help?

Thanks & Regards,
Sayan Chatterjee

I guess @moneta can help you

You can use the function TH2::ProjectX/Y to perform the projection of your histogram. The fitted function is not automatically projected, but you can use the trick to transform in an histogram (using TF2::GetHistogram and then project the function as well.
If you are unable to do this, I could send you an example code (but it will take a bit of time)



1 Like

Dear Moneta,

Many thanks for the help. It would be very helpful for me if you could send a piece of code.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.