Get Maximum coordinates from a histogram


I have a curve with only one maximum plotted using THist and I’d like to retrieve the x coordinate of the maximum position. I used the GetMaximumBin() method to retrieve the bin where the maximum falls. But, how can I retrieve the corresponding x value?


Once you have the bin use GetBinCenter

can I write "hist->GetXaxis()->GetBinCenter(hist->GetMaximumBin())?

Yes, that should work :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.