Hello,
I’m facing a problem with changing the minimizer options when performing my unbinned weighted likelihood fit.
The ROOT::Math::MinimizerOptions commands do not change anything in the RooMinuit or RooMinimizer which is used in fitTo in the following code :
ROOT::Math::MinimizerOptions::SetDefaultTolerance(1.0);
ROOT::Math::MinimizerOptions::SetDefaultMaxIterations(10000);
ROOT::Math::MinimizerOptions::SetDefaultMaxFunctionCalls(10000);
ROOT::Math::MinimizerOptions::SetDefaultMinimizer("Minuit2");
RooFitResult *r = sig->fitTo(wdata, Save(), SumW2Error(kTRUE), PrintLevel(0));
I have tried many changes, like using RooMinimizer directly, but this is not a very satisfactory solution for me because it does not correct the covariance matrix like the SumW2Error(kTRUE) option does above.
I can only change the Minimizer in fitTo but I’d also like to change e.g the tolerance and the number of calls…
Here is what i tried with RooMinimizer:
RooFitResult *r = 0;
RooNLLVar *nllt = new RooNLLVar("nllt","-log(L)",*sig,wdata,DataError(RooAbsData::SumW2)) ;
RooMinimizer mini(*nllt) ;
mini.optimizeConst(kTRUE) ;
mini.setEps(100);
mini.setMaxIterations(10000);
mini.minimize("Minuit2","Migrad") ;
mini.hesse() ;
r = mini.save() ;
Can anyone please help me?
Cheers,
Fabrice