Setting Minuit maximum iterations

I am using the Fit method with polN option. I want to increase the number of iterations that MMINUIT allows. How do I do it?


before fitting do :

TVirtualFitter::SetMaxIterations( maxiter );

the default value is 5000.

However, if you are fitting a polynomial (polN), by default the linear fitter is used and in that case the solution is found directly, without using an iterative algorithm like Minuit.
If you want to use Minuit you need to fit with the option “F”.

Best Regards


MINUIT fails in MIGRAD with “CALL LIMIT EXCEEDED”. Increasing the number of iterations with SetMaxIterations above the value given by MINUIT in the situation that the call limit is reached, does not help.
In fact the member fMaxIterations seems not to be used at all in TMinuit. (v5.15.04)

Any idea?

fMaxIterations is not a member of TMinuit, but of TVirtualFitter.
TFitter is a concrete implementation of TVirtualFitter and it uses TMinuit.
TFitter::SetMaxIterations do set the max number of iterations in TMinuit.


Hi Rene,

thanks for your reply.

I am sorry to be reluctant, but I do not see TVirtualFitter::fgMaxiter, nor TVirtualFitter::GetMaxIterations being used in TFitter. (TVirtualFitter::SetMaxIterations only touches fgMaxiter)

More striking for me is of course the (experimental) fact that using SetMaxIterations (with a number of iterations higher than the number of calls where Minuit aborted before) does not have any effect…


see the following 3 lines in TH1::Fit or TGraph::Fit

[quote] arglist[0] = TVirtualFitter::GetMaxIterations();
arglist[1] = sumw2*TVirtualFitter::GetPrecision();
fitResult += grFitter->ExecuteCommand(“MIGRAD”,arglist,2);



thanks! That explains why it did not work for me…

I call MIGRAD myself. Thus I also have to propagate the iterations and the precision myself in that call…