Eval at given y

Hello Rooters,

To evaluate a y value given x, i use TGraph::Eval(x). Is it possible to evaluate a x at given y?

Hi ,

I guess you want the interpolated value x corresponding to the given y. There is no direct method to do this from the TGraph, but a possibility is to use a root finder algorithm, like the BrentRootFinder (or TF1::GetX).
An example of how this is done is in this piece of ROOT code

root.cern.ch/root/html/src/RooSt … html#DDS5d

Best Regards

Lorenzo