I have root version 6.09/02. I drew TH1F histogram with this code:
TCanvas *c = new TCanvas(“c”, “histogram”, 600, 400);
TH1F *h4=new TH1F(“h1”,"",1000,5,6);
This code gives me a correct value of std parameter, but when I zoom (I put the cursor on the x axis and scroll with the mouse wheel) the x axis just a little (so I don’t lose any data), the value of std changes. When I unzoom the x axis, the value doesn’t change back. Can you advice me?
This is a known issue of the histogram, because in the first case the statistics is computed at filling time. After setting a range it will be computed using the bin cemters.
If you call. after filling h.ResetStats() you will get the same Mean/RMS values
The original std-deviation is based on the actual values passed to the Fill function. Since the histogram records only the number of entry per bin and does not record each and every value passed to Fill (for that you ought to use a TTree), upon any recalculation of the statistic it can only use the bin center as a substitute. for the input values.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.