Getting the value of error bands

Dear experts,

I am writing to see if there is a way to get the value of the error bands for a fit? I’ve read some previous threads but the solution is still not clear to me…

I tried to access the plotted error bands (which are RooCurve objects) and use GetX() and GetErrorYhigh(), but ended up with -1 for both values…

Here is a segment of my code:

int N_points = frame->getCurve("err1")->GetN();
TGraph* upBound = new TGraph(N_points);
TGraph* loBound = new TGraph(N_points);
for( int j = 0; j < N_points; ++j ){
    upBound->SetPoint(j, frame->getCurve("err1")->GetX()[j], frame->getCurve("err1")->GetErrorYhigh(j));
    loBound->SetPoint(j, frame->getCurve("err1")->GetX()[j], frame->getCurve("err1")->GetErrorYlow(j));
  for(int xxx = 0; xxx < 1001; xxx+=10){
    cout<<upBound->Eval(xxx)<<" "<<loBound->Eval(xxx)<<endl;

and I got:

-1 -1 
-1 -1 

Any suggestions?

Thanks a lot!

Best regards,

The argument of Eval should be an x coordinate, not a point number. Maybe you want GetPointY(xxx).

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