Error band on fitted RooCurve


This is mostly a plotting issue: I have a fitted curve to come data.
The corresponding up and down uncertainties on the fit are two more RooCurve objects.
Is there a way to draw a fill area using the up/ down curves such that it shows up as an uncertainty band around the central fit?



You can create a TGraphErrors from the two RooCurve with the graph lower/upper error corresponds to the down/up values of the RooCurve objects.
Then you can draw the TGraphErrors as an error band using option E3 or E4, see




thanks. this is exactly what I did.

I was expecting to use the RooCurve::makeErrorBand methods. But I could not figure out the passing of vector<RooCurve*> as arguments.
Seemed to me that the makeErrorBand does exactly the same as the TGraphErrors under the hood.
BTW, why does this method need a vector of pointers? It does not modify the original curve at all, right?


The makeErrorBand computes the upper/down uncertainty in the curve. It needs a vector of curves representing a random sample of variations of the parameters. The parameter variations are obtained by sampling from the fit covariance matrix result.
Otherwise you can provide as input the upper and lower variations of the curve versus the parameters (so two vectors which have as size the number of parameters) and in addition the fit covariance matrix.

You can see how the methods are used internally in RooAbsReal::plotOnwithErrorBand


Thanks. I could try this as well.

Like I said, the problem was to pass a vector of pointers to RooCurve.

Admittedly, this is probably more of a PyRoot problem than RooFit.


Have you tried to create a vector of RooCurve pointers in PyROOT as following

v = ROOT.std.vector('RooCurve *')()

and then use push_back to fill it with the RooCurve objects


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