Integral form a TF1 object

Hello ROOTers
1.) I have a gr object, gr1*.
2.) I have two TF1* objects, fGaussLin and fGaussOnly defined as:
fGaussLin = new TF1(“mygr1”,“pol1(0)+gaus(2)”);
fGaussOnly = new TF1(“peakSingleton”,“gaus”);
3.) I set the range on my fGaussLin as a subrange of gr1 defined by
double xl
double xh
4.) I call gr1->Fit(“mygr1”,“BR+”,“A”);
5.) I set the parameters (and their errors) of fGaussOnly obj based on fGaussLin obj:
6.) If I call fGaussLin->IntegrateError(xl,xh); WORKS!!!
7.) If I call fGaussOnly->IntegrateError(xl,xh); FAILS!!! Returns zero and the following error message:

From the TF1 online documentation:

I would like to use an auxiliar TF1 object to contain the parameters of a peak of interest which is defined by another function (in my example a linear+gauss function). I am able to perform the integration on my auxiliar function but I cannot retrieve the error of the integration because as you can see from my algorithm, I have not fitted my auxiliar function on data points. I guess the error is because some covariance error matrix has not been initialized properly (my assumption, probly wrong). My question is, is there any way to initialized my auxiliar function properly so to be able to retrieve the error of the integration???

Thank you,


IntegralError uses the covariance matrix from the last fit, which it is taken from a static fitter object.
I will need to update the TF1::IntegralError function to be able to pass a covariance matrix given by the user.
I’ll let you know when this will be available in ROOT

Best Regards


Hi Lorenzo,

I can see this has been added for ROOT, but not for PyROOT:

IntegralError(self, Int_t n, const Double_t* a, const Double_t* b, Double_t epsilon=9.9999999999999998e-13) method of PyLHCb.Physics.RadiativeDecays.KStarGamma.TF1 instance
Double_t TF1::IntegralError(Double_t a, Double_t b, Double_t epsilon = 1e-12)
Double_t TF1::IntegralError(Int_t n, const Double_t* a, const Double_t* b, Double_t epsilon = 1e-12)

Is there any way to access the underlying ROOT class, I need to do the same as Cristian from PyROOT.

Thanks a lot,

Hi Albert,

Please post this item in the PyROOT forum,



most likely that you have an older version of ROOT that does not contain the updated parameter list. It’s fine in trunk AFAICS.