Andrei, The member fTsumwx is incremented in the TH1::Fill methods using the true value of the x coordinate. TH1::GetMean returns the mean using this value. However, when you zoom via TAxis::SetRange, ROOT recomputes the mean value using the bin contents and the center of each bin. I do not see any problems with this method. If you have evidence of the contrary, please send the shortest possible running script showing the problem. Rene Brun Andrei Kuznetsov wrote: > > Hello, > > it looks like ROOT calculates fTsumwx (and hence Mean of a histogram) in > TH1 incorrectly. > > But if you perform > your_histogram->GetXaxis()->SetRange(a,b); > after the filling (or "zoom" by hands) it works correctly. > > It looks likes in the first case it is not used the center of bin when > fTsumwx is calculated. > > Best regards, > Andrei.
This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:09 MET