Error related to function call limits during fitting

Hello Experts

I was trying to perform the fitting using fit function of root and while fitting I am getting the error as shown below(1).
What I understand from the error that the minimisation has been terminated due to limited call of function.
I searched and found that we can change no of the function call using TMath::Minimizer::SetDefaultMaxFunctionCalls(n);
But when I am putting this line in my code before doing fitting, it is giving again error->

///Processing CrystalBall.C…
doing ee sample with quadratic background
bin width is: 0.666667
Error: Function SetDefaultMaxFunctionCalls(10000) is not defined in current scope CrystalBall.C:124:
*** Interpreter error recovered ***

Could you please suggest something?

Thanks & Regards
Bhawna Gomber


Processing CrystalBall.C…
doing ee sample with quadratic background
bin width is: 0.666667
Warning in : Abnormal termination of minimization.
FCN=121.57 FROM MIGRAD STATUS=CALL LIMIT 2710 CALLS 2711 TOTAL
EDM=0.000141731 STRATEGY= 1 ERROR MATRIX UNCERTAINTY 16.9 per cent
EXT PARAMETER APPROXIMATE STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 norm 2.06924e+02 6.88259e+00 9.71437e-06 9.09332e-01
2 alpha 1.17956e+00 1.07422e-01 5.57946e-04 3.48621e-02
3 n 4.99996e+01 2.09735e-04 -1.72331e-08 0.00000e+00
4 m 9.04587e+01 9.94221e-02 -6.56115e-05 -5.33518e-01
5 sigma 2.55721e+00 1.38510e-01 1.78611e-04 -7.72857e-02
6 quad -1.11920e-03 2.58874e-04 -1.47544e-07 2.18939e+03
7 lin 2.47045e-01 4.35619e-02 3.03611e-05 2.11667e+01
8 const -9.88676e+00 1.21130e+01 -9.61625e-03 5.43810e-02
9 gauss mean 9.68930e+01 1.12938e+00 2.50093e-03 3.77280e-02
10 gauss width 1.79387e+00 3.48726e-01 3.32310e-04 1.88700e-02
11 gauss amplitude 1.88210e+01 4.78515e+00 -5.88770e-06 -5.95273e+00
TotalIntegral: 1658.2
Warning in TBackCompFitter::GetCovarianceMatrix: Invalid fit result
Error in : Fitter has no covariance matrix
TotalIntegralErr: 0
QuadBkgIntegral: 176.761
SignalIntegral: 1481.44


Hi,

The call you have to do to increase the function call is:

ROOT::Math::MinimizerOptions::SetDefaultMaxFunctionCalls( ncalls)

Lorenzo

1 Like