Re: statistics information from 2-D (and 3-D) histos
Rene Brun (Rene.Brun@cern.ch)
Tue, 28 Jul 1998 19:10:15 +0200
stefan kluth wrote:
>
> Hello,
>
> I have an application in which I need to get statistics information like
> mean and rms from the individual dimensions of a 2-D histogram. The
> accessors GetMean() and GetRMS() give me these numbers for the
> x-dimension, but for y (or z) I couldn't find a way on how to do this.
>
> For the moment I compute mean and rms from the bin-contents, but I would
> prefer to have these computed at filling time, because computing from
> bin-contents is only an approximation.
>
> So, I would like to propose that the functions GetMean() and GetRMS() are
> extended to take an argument to specify the dimension for which the
> quantities should be computed:
>
> stat_t GetMean( dim= 1 )
> stat_t GetRMS( dim= 1 )
>
> In addition, a new accessor function which returns the covariance between
> two dimensions would be very useful:
>
> stat_t GetCov( dim1= 1, dim2= 2 )
>
> Their implementation should be trivial, fully backwards compatible and
> very efficient, since we already have the weighted sums fTsumwx, fTsumwy,
> fTsumwx2, fTsumwy2 and fTsumwxy as data members of TH1 and TH2.
>
> How about it?
>
Hi Stefan,
I agree with your proposal and will try to implement the changes
for the coming release.
Rene Brun