Re: Histogram mean

From: Stefan Piperov <piperov_at_fnal.gov>
Date: Tue, 13 Sep 2011 22:06:22 +0200

This issue - that ROOT reports histogram's momenta based on unbinned data - has been discussed several times now, but without much consequences...

It is plain wrong, of course, to report quantities related to the initial dataset as belonging to the histogram, but this is how ROOT was designed from the very beginning, so it's too late now to change, I guess. What we can do, though, is to spread the word, so that at least the users know of this problem, and do not rely on TH1::GetMean() to get the mean of the binned data.

Stefan.

On Tue, 13 Sep 2011, Arthur E. Snyder wrote:

> Aamer,
>
> It doesn't work on subtracted histograms. I had to 'roll-my-own' to do that
> (though there might be something existing that does this that I just didn't
> find).
>
> As I recall |root] does unbinned mean, so you get the same result regardless
> of binning. It's not clear what it does the case of subtracted histograms,
> but if the histograms is asymmetric the result can be wildly wrong.
>
> -Art S.
>
> A.E. Snyder, The Former Group C (TFC) \!c*p?/
> SLAC Mail Stop #95 ((. .))
> Box 4349 |
> Stanford, Ca, USA, 94309 '\|/`
> e-mail:snyder_at_slac.stanford.edu o
> phone:650-926-2701 _
> http://www.slac.stanford.edu/~snyder BaBar
> FAX:707-313-0250 Collaboration
> &
> Fermi/GLAST
>
>
>
> On Tue, 13 Sep 2011, Aamer Wali Rauf wrote:
>
>> Hi,
>> I have always assumed (and thus used) that the TH1::GetMean(1) method gives
>> out the weighted mean value
>> of the x-axis of the histogram. Visibly it looks to me that way but is it
>> really so? Can someone
>> comment on that please?
>>
>> Thanks in advance,
>> Aamer
>>
>>
>

*---------------------------------------------------------------------*
  Stefan Piperov      Mail: FNAL P.O.Box 500, MS 205, Batavia, IL-60510
  Phone: (630) 840-5176                        E-Mail: piperov_at_fnal.gov
*---------------------------------------------------------------------*
"Give a skeptic an inch... and he'll measure it." Received on Tue Sep 13 2011 - 22:06:35 CEST

This archive was generated by hypermail 2.2.0 : Tue Sep 13 2011 - 23:50:02 CEST