Suppress iMinuit2 commands

Dear Rooters,
I am using a python script to perform some fits using Minuit2. I get a lot of printout on my terminal, something like this -

W MnPosDef Matrix forced pos-def by adding to diagonal 0.537081

Is it possible to suppress these messages, and print out the fit result on the screen ?
Thank you very much !

Best,
Shreya

Hi @Shreya_Saha!

Here are the RooAbsPdf::fitTo() commands that I usually use to make my fits silent and print the result in a nice way:

using namespace RooFit;
RooFitResult* fitResult = model.fitTo(*data,
                              Verbose(false), PrintLevel(-1), Save());
fitResult->Print();
delete fitResult;

The Verbose and the PrintLevel commands are to silence the output, and the Save command is to get the result of the fit as a RooFitResult object, which the fitResult pointer will point to and has the responsibility of deleting.

I hope this is what you were looking for, if you have any further questions please let me know!

Cheers,
Jonas

Hi @jonas,
Thanks a lot for the commands, is there a way to use it in python, by any chance. I am currently using a python script to do the fits, which imports iminuit. I am using a script similar to this one - pyhf/ImpactPlot.ipynb at master · scikit-hep/pyhf · GitHub
Thanks !
Best,
Shreya

Hi @Shreya_Saha,

but that’s not RooFit, it’s pyhf :sweat_smile: We can’t help you here then, you have to ask in the pyhf support channels. Maybe this link helps:

Cheers and good luck!
Jonas

Hi @jonas,
Thanks for the clarification, and the link :smiley: I will have a look and ask them !
Best,
Shreya

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.