Re: Histogram mean

From: Philip Rodrigues <p.rodrigues1_at_physics.ox.ac.uk>
Date: Wed, 14 Sep 2011 16:57:26 -0400


Hi Rene,
It would be useful if that comprehensive explanation was added to the documentation for TH1::GetMean(), which currently doesn't say anything about the difference between "binned" and "unbinned" calculations, and when each one is used.

Cheers,
Phil

On Wednesday, September 14, 2011 12:50:41 AM Rene Brun wrote:
> Let me come with some clarification as I have the impression that
> senders are confusing each-other.
>
> When filling a histogram with Fill(x,w), ROOT keeps track of the sums of
> w, w*x and w*x*x such that later the mean, rms can be computed precisely
> over the FULL bin range.
> When you set the bin range to a subset of the original range, ROOT does
> what it can only do, ie recompute the statistics quantities starting
> with the center of each bin in the range BECAUSE THE ORIGINAL ENTRIES IN
> THIS RANGE ARE NOT AVAILABLE ANYMORE.
> In the case of Philip, there is no way to know that you have restricted
> the range without excluding any entries.
> Once you restrict the range, there is no way of offering an "UNBINNED"
> option for binned data because the original data is lost.
> ntuples have been invented many decades ago to solve your problem. You
> always start from unbinned data.
> ROOT has an option (not well known) via TH1::SetBuffer to keep all
> entries to TH1::Fill in memory such that the statistics are always
> accurate, but, of course, this scheme can only be used for histograms
> with small number of entries.
> So, use TNtupleD or TTrees and project the data in the desired range if
> you want/need very precise statistics.
Received on Wed Sep 14 2011 - 22:57:33 CEST

This archive was generated by hypermail 2.2.0 : Thu Sep 15 2011 - 11:50:01 CEST