Re: Histogram Mean (Y axis)

From: Arthur E. Snyder <snyder_at_slac.stanford.edu>
Date: Wed, 6 Sep 2006 13:43:58 -0700 (PDT)


I think total in plot or plot range divide by number of bins should be the average in bins. Thus,

<n> = h->Integral(i1,i2)/(i2-i1+1)

-Art S.

A.E. Snyder, Group EC                        \!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:650-926-2657                          Collaboration



On Wed, 6 Sep 2006, Rene Brun wrote:

> GetMean(1) works for 1D, 2d and 3D histograms
> GetMean(2) works for 2D and 3D histograms
> GetMean(3) works only for 3D histograms.
>
> One could extend GetMean(2) to also work for 1D histograms and GetMean(3)
> to work for 2D histograms.
> Anna,Lorenzo could you implement this feature?
>
> Rene Brun
>
> Marco Calviani wrote:
> > Hi rooters,
> > i have a 1D histogram of which i want to calculate the mean on the
> > Y axis (that is the mean of the bin contents on all the range). I've
> > tried using the GetMean(2) function, but it always give me 0. Is there
> > another function to perform this task? (the solution is to do that
> > manually with a loop, but i would like to know if a function exists).
> >
> > Thanks in advance,
> > Marco
>
>
Received on Wed Sep 06 2006 - 22:44:09 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:00 MET