Re: [ROOT] TH1D, getmean, getRMS, getMinimum...

From: Rene Brun (brun@pcbrun.cern.ch)
Date: Wed Jun 02 2004 - 22:36:37 MEST


Hi Bernd,

I do not understand your question. All what you request is already
provided by the TH1 class.
Assuming TH1* h, you can do
  h->GetMean()
  h->GetRMS()
  h->GetEntries()
  h->GetMinimum(minval); //Return minimum value greater than minval of 
     bins in the range
  h->GetMaximum(maxval); //Return maximum value smaller than maxval of 
     bins in the range
  h->GetXaxis()->GetXmin(), Xmax, Nbins, etc
  h->GetYaxis()....

Rene Brun


On Wed, 
2 Jun 2004, Bernd Reinhold wrote:

> Hi!
> 
> Is there a way to get the following information from the histogram? (TH1D as
> input to the function (as reference), and as output the following infos:)
> 
> mean, RMS, entries do work - that works with h1.GetMean(), h1.GetRMS,
> h1.GetEntries()
> minimum - I tried GetMinimum(), however this didn't work as expected. I want
> to have the minimum entry in the histogram, that is bigger than xmin.
> maximum - didn't work as expected, either...
> xmin, xmax, numberofbins (the last three parameters in the TH1D-constructor)
> 
> thank you for your help, Bernd.
> 
> 



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:08 MET