How to know maximum value of histogram?

Hello,
I would like to know a method to find maximum value of a histo. I do not find a TH1 function GetXMaximum()? Any idea?

1 Like

Hi,

see root.cern.ch/root/html/TH1#TH1:GetMaximum

Axel.

and if you want to know the X position corresponding to the maximum content, do

int binmax = h->GetMaximumBin(); double x = h->GetXaxis()->GetBinCenter(binmax);

Rene

2 Likes

In fact, I exposed my problem badly. I do not want to know the maximum value of the histogramm but the maximum value of the x-axis (abscissa up to which there are data). I have some histogramms which do not contain anymore data from one point. I would like to know position of this point.

1 Like

see TH1::FindFirstBinAbove and FindlastBinAbove

Rene

1 Like