Re: [ROOT] TH1->GetMaximumBin()

From: Rene Brun (Rene.Brun@cern.ch)
Date: Sat May 19 2001 - 19:30:59 MEST


Hi Mat,

TH1::GetMaxBin returns the bin number with the maximum bin content.
TH1::GetMinBin returns the bin number with the minim bin content.
In case of 2 or more bins having the max/min value, the first bin is
taken.

Rene Brun



On Sat, 19 May 2001, Matthew Martin wrote:

> Seems to give an answer twice as small as how big the thing actually is:
> 
>    TH1F *hist_bp_PtResidWeight = new TH1F("hist_bp_PtResidWeight","bp pt
> weighted residual",40,-4.0,4.0);
> 
>  
> 
> then I fill the thing.
> 
> Then:
> 
> TH1F histTest(*hist_bp_PtResidWeight);
>    
> 
> cout<<"Max bin: "<<histTest.GetMaximumBin()<<"Min bin:
> "<<histTest.GetMinimumBin()<<" 1st bin centre:
> "<<histTest.GetBinCenter(1)<<endl;
> 
> 
> 
> 
> 
> This gives:
> 
> Max bin: 20Min bin: 1 1st bin centre: -3.9
> 
> 
> 
> 
> Max bin should be 40 non?
> 
> cheers
> 
> Mat
> 



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:46 MET