TF1 cannot release the fixed parameter

Dear experts

I had a problem when I fitted the mass distribution of a particle. I wrote a macro called massfitting.C, then I called it in the macro dcaFittingOptimal.C. And it gave

Unknown function:           0.00000e+00     fixed
Unknown function:           0.00000e+00     fixed
Unknown function:           0.00000e+00     fixed
Unknown function:           0.00000e+00     fixed
Unknown function:           0.00000e+00     fixed
Unknown function:           0.00000e+00     fixed

I think the TF1 function is well-defined. I am not sure where it went wrong.

Also I attach the macros and root files to the post.

Thanks in advance.
dcaFittingOptimal.C (1.9 KB)
massfitting.C (5.2 KB)
myAnaConsts.h (1.1 KB)
npd0ana_dca_hists.root (35.5 KB)


ROOT Version: root v 6.06/01 & root v 6.16/00
Platform:
Compiler: gcc5.3 for v6.06, gcc 7.4 for v6.16


Either, in the “dcaFittingOptimal.C”, use:

         TF1 f = massfitting(hMassData, hMassMCNPD0, hMassMCNPD0All, TString::Format("mva%d", iMva));

or, in the “massfitting.C”, replace all “Fit(fname” with “Fit(&f” (that’s what I recommend).

Thank you, Wile!

The problem has been solved.

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