Hi,
Using ROOT 4.02/00 or ROOT 5.10/00 on windows we see the following behavior:
root [0] h = new TH1S("","",100,0,100)
(class TH1S*)0xc4c2a00
root [1] h.SetBinContent(1,100)
root [2] h.SetBinContent(90,100)
root [3] h.GetMean()
(const Double_t)4.50000000000000000e+001
root [4] h.Fill(20)
(Int_t)21
root [5] h.GetMean()
(const Double_t)2.00000000000000000e+001
Why does the mean seem to ignore bins 1 and 90? Initially I thought perhaps the range was getting reset to something that excluded bins 1 and 90 - but I can’t find evidence that is the case.
I also check the results of GetStats:
root [11] h.GetStats(stats)
root [12] stats[0]
(Double_t)1.00000000000000000e+000
root [13] stats[1]
(Double_t)1.00000000000000000e+000
root [14] stats[2]
(Double_t)2.00000000000000000e+001
root [15] stats[3]
(Double_t)4.00000000000000000e+002
Which is consistent with the GetMean value of 20, but I’m still not sure why that is happening.
Is this a feature?
Take care,
Heather