To write the equivalent code with RooMinimizer, am I right that I can construct the object and set strategy the same way, but need to split the fitting part up myself? In essence:
RooAbsReal* nll_hf = model_modified->createNLL(*data);
RooMinimizer* minuit_hf = new RooMinimizer(*nll_hf);
minuit_hf->setStrategy(2);
minuit_hf->hesse(); //Calculate errors for initial step size
minuit_hf->migrad(); //Fit
minuit_hf->hesse(); //Calculate final errors
Thanks a lot @Jonas . When I run the first minuit_hf->hesse();, RooMinimizer complains that I need to run MIGRAD before running HESSE. I want to run HESSE before MIGRAD to get the initial step size (just like how my old code does, as explained above in my question). Is there a way of overcoming that issue?
Hi! It is not necessary to do the initial Hesse explicitly like this. If the step size is not estimated yet when running migrad for the first time with Minuit strategy 2, it will do an initial Hesse anyway. The new interface is more pedantic there so the user does not do unnecessary steps.
But still, there seem to have been cases where this initial Hesse can help with the fit, as this tutorial indicates:
I don’t see how this would help, but it would be good to also get @moneta’s opinion on that. Was at a mistake to prevent this initial Hesse call in the RooMinimzier? It was never possible with the RooMinimizer because of this check:
If calling HESSE before Migrad would actually be useful, it’s very surprising that nobody reported that it doesn’t work.
The only thing that I can say for certain is that if your fit converges, it’s fine
Does the initial Hesse actually help in your fit? If yes, could you please let us know so we can understand these cases where forcing an initial Hesse call is necessary?