My understanding is that when I fit a TH2 histogram that has been “zoomed in” with a previous call to the SetRangeUser() method, only the “visible” part of the histogram is included in the range fit.
I compared this with an explicit range specification in the Fit method (where I can specify the range only for the x-axis):
//Case 1 h2.GetXaxis()->UnZoom(); h2.GetXaxis()->SetRangeUser(h2.GetMean()-3*h2.GetRMS() , h2.GetMean()+3*h2.GetRMS()); h2.Fit(&model,"VLE"); //Case2 h2.GetXaxis()->UnZoom(); h2.Fit(&model,"VLE", "", h2.GetMean()-3*h2.GetRMS() , h2.GetMean()+3*h2.GetRMS());
The results are almost but not exactly exactly identical. In particular the number of degrees of freedom (it is reported even if it was a likelihood fit, hopefully it is reliable for my next statement) suggests that a different number of bins is included, maybe because of different rounding to the bin index (because you cannot include only half bin, right?) between SetRangeUser() and the Fit method range specification.
Is there any reason that explains the difference?
Since the TH2::Fit method does not allow to set a range also for the Y axis, I would like to know if I get the same effect by zooming in the histogram.
ROOT Version: 6.16
Platform: Debian 9
Compiler: gcc 6.3