Re: Projection and histo maximum

From: Lorenzo Moneta <Lorenzo.Moneta_at_cern.ch>
Date: Mon, 1 Feb 2010 15:04:26 +0100


Hi,

 The method TH1::GetMaximum() calculates the maximum value using the current bin content the first time the function is called and set the fMaximum value. If you have problem, because you have called SetMaximum before, you can use also h1->GetBinContent( h1->GetMaximumBin() );

But what exactly is your problem ? You should post eventually a macro reproducing it,  Best Regards

 Lorenzo
On Jan 31, 2010, at 6:59 PM, Manuel Mussini wrote:

> Hi all,
> I'm doing this two simple things (I havo to cast fSlices[0] because it's previously declared as TH1D):
>
> fSlices[i] = ((TH2D *)fSlices[0])->ProjectionY(name, 12, 21);
> fSlices[i]->GetYaxis()->SetRangeUser(0., fSlices[i]->GetMaximum() * 1.2);
>
> My problem is that it looks like the TH1D::fMaximum data member is not evaluated for the projected object so I get a wrong y axis setting when I draw it!
>
> Is this correct? Is there a TH1 method to evaluate it or I have to do it manually?
>
> Thanks in advance!
>
>
> Bye...
Received on Mon Feb 01 2010 - 15:04:33 CET

This archive was generated by hypermail 2.2.0 : Tue Feb 02 2010 - 11:50:01 CET