How to retrieve ROOT::Minuit2::Minuit2Minimizer - object?


I am trying to use Minuit2 by setting it as a default fitter and later I fit some histogram with some function:

TVirtualFitter::SetDefaultFitter("Minuit2"); ... h->Fit(func); ...
How can I retrieve ‘ROOT::Minuit2::Minuit2Minimizer’ -object in order to have access to its methods (like Contour() and etc.) ? Many thanks in advance.

Best regards,


there is no public method to retrieve the Minuit2Minimizer, :frowning:
but for doing scan or contours you can work via the TVirtualFitter
(or TBackCompFitter class) and from there you can also retrieve the FitResult.
For example for contours you can do (after having fit an histogram)

TGraph * graph  = new TGraph(npoints);   
TBackCompFitter * fitter = (TBackCompFitter*) TVirtualFitter::GetFitter(); 
fitter->Contour(ipar, jpar, graph, confLevel); 

I should maybe consider to add in the TBackCompFitter also a method to retrieve the Minimizer

Best Regards