gMinuit?

Hi,

I’d like to limit the number of iterations (to somehow avoid endless fitting) and used to use (in a CINT script)

gMinuit->SetMaxIterations(10);

with older ROOT versions. This doesn’t seem to work anymore (the problem is, that gMinuit==0; I already tried gSystem->Load(“libMinuit”))

So how can I do this now, or is there a smarter solution?
Is this also appropriate for compiled scripts?

Thank you very much in advance,
Klaus

Hello,

if you are using TMinuit directly, you need first to create an instance of the TMinuit class, by doing :

gMinuit = new TMinuit(npar); 

where npar is the number of parameters used by Minuit.
See for example the tutorial Ifit.C :

root.cern.ch/root/html/examples/Ifit.C.html

Regards,

Lorenzo

Hi,
Maybe I misread Klaus’ post, but I think he’s asking how to set the max iterations when you do something like

myHistPtr->Fit("gaus");

not when you roll your own.

(Even if that’s not what he wanted, I want to know, so… :smiley: )

Cheers,
Charles

If this is the case, then you do not need to use gMinuit,
it is enough to do before calling TH1::Fit:

TVirtualFitter::SetMaxIterations(maxiter); 

Lorenzo