I have a fitting routine where I am computing an integral error using the fit covariance matrix, following the example in root.cern.ch/root/html/TF1.html … egralError. My code is:
TFitResultPtr fit = h1->Fit(fyAll,"QIROMES"); TMatrixDSym cov = fit->GetCovarianceMatrix(); fit->Print("V"); ... T2_int_err = frT2->IntegralError(0.0,tCyc,par,cov.GetMatrixArray());
where frT2 is another function, having the same signature and parameters as the fitting function fyAll.
This has worked perfectly in the past, but I have made a lot of changes to fyAll recently. Now I am getting T2_int_err = 0. If I print the components of cov.GetMatrixArray() immediately after defining cov, I get all zeros there as well. However, I get believable non-zero values for the covariance matrix from the fit->Print(“V”) command.
I tried using IntegralError without passing it par and cov, which I believe should also work as I only do one fit, and got the same problem of 0 errors. I constructed a test code using a much simpler (gaussian) function regressing on a randomly generated histogram, and there the problem does not appear: I can print non-zero cov components and get the IntegralError. So it doesn’t seem to be a problem with ROOT.
So I am now trying to understand what I might have done within fyAll to make cov show all 0’s. If anyone has any insight it would be much appreciated!