You can get the maximum (for a TGraph gr
of size n
) with
Double_t max = TMath::MaxElement(n,gr->GetY());
then you can loop over all the n points of the graph and find the x corresponding to that y (there might be more than one such point, so take care of that), using GetPoint.