I’d like to fit the 2D histogram in attachment. I tried to fit it with a 2D gaussian like show in the example fit2dHist.C : root.cern.ch/doc/master/fit2dHist_8C.html.
This example was adapted to my situation (see the code in attachment). It works ( ) but ( ) I don’t achieve to a good fit (I change all parameters several times).
Maybe I should not use a 2D gaussian fit for this situation. I think of not being so far from the good fit, I hope though …
If you have any idea about this fit-fail I’ll take it…
The code is fine, the problem is your histogram. It looks to be filled in a strange way, like there is some background offset value, but only in some part of the histogram.
It is difficult in this case to simply fit with just a 2d gaussian
Ok I understand… But moneta, I don’t understand what do you mean by “like there is some background offset value, but only in some part of the histogram” . Actually this histogram is fill with chi square results.
I’d like to fit this histogram to have the values of the minimum on the X and Y axis.
OK, but what the histogram represents ? It does not seems to me to be just a 2d gaussian, for this reason the fit fails. You should use a function which is representative of the histogram
This histogram is a chi square test between a reference cross section and other cross sections computed for differents mass and width of the W boson.
To fill it, I computed the cross section for fixed values of (M, width) and I compared it with a reference cross section (obtained with PDG value of M and width). On the X axis is represented the mass variations and on Y axis the width variations. By minimization I’d like to access at the minimum value on X and Y axis (without projections in order to preserve the correlation).
I haven’t a function which represents this histogram or I don’t know how to find it.
It’s not necessarily a 2D-gaussian, it was just an idea because I don’t find how to fit that…
What would you like to get exactly from the histogram ? If you are interested only in finding the minimum, then you can just use the function GetMinimumBin