Histogram axis problem

Hi there

I am wanting to find the value for x on my histogram for which y = largest value.

So to find the maximum value for y (the peak of the histogram) I have

const Double_t MaxY = myHisto->GetMaximum();

but how do I then determine what the corresponding value on the x-axis is?

Many thanks
kate

[quote]Hi there

I am wanting to find the value for x on my histogram for which y = largest value.

So to find the maximum value for y (the peak of the histogram) I have

const Double_t MaxY = myHisto->GetMaximum();

but how do I then determine what the corresponding value on the x-axis is?

Many thanks
kate[/quote]

What about int maxBin = hist->GetMaximumBin()? And hist->GetXaxis()->GetBinCenter(maxBin) ?

Or hist->GetBinCenter(maxBin)?

Great

maxBin = hist->GetMaximumBin()
gets the bin I want (which correspondes to maximum Y value), then I multiply it by the bin size and got the value for x.

Thanks very much!
Kate