GetX(y), GetY(x), IntegralAndError() and IntegralError() methods

Hello,

I am using ROOT 5.34/03. I am trying to get the x value corresponding to a given y value from TH1 histograms (TH1*h1) and vice versa.

I have tried various things including h1->GetX(y,xmin,xmax) and h1->GetY(x,ymin,ymax) only the get error messages like the one below:

“Error: Can’t call TH1::GetY(2,0,40921300) in current scope plot.C:56:
Possible candidates are…
(in TH1)”

How can I do that?

I have also tried to get the error on an integral of TH1* h1 via the h1->GetIntegralAndError () and h1->GetIntegralError() methods yielding:

“Error: Can’t call TH1::GetIntegralAndError() in current scope plot.C:97:
Possible candidates are…
(in TH1)”

and

“Error: Can’t call TH1::GetIntegralError() in current scope plot.C:97:
Possible candidates are…
(in TH1)”

correspondingly.

Note that I am aware that both of the above methods also take the bin limits as parameters. I have tried it with those as well. I have, to no avail, also tried the h1->IntergralAndError() and h1->IntegralError() methods in a similar manner.

How can I do that?

Mohamed Hassan

Hi Mohamed,

ROOT does not have methods TH1::GetY(), TH1::GetX(), TH1::GetIntegralAndError() or TH1::GetIntegralError(). And what do you mean by “error on the integral of TH1”? Why an integral would have its error?