TMinuit and SetPrintLevel()

Hello everyone!

I am using a fit using TMinuit in my script with 7 different parameters. The fit itsself is working fine, but I get a lot of output for the fit parameters like:

[code]PARAMETER DEFINITIONS:
NO. NAME VALUE STEP SIZE LIMITS
1 alpha 0.00000e+00 1.00000e-01 -3.15000e+00 3.15000e+00
2 r 8.46914e+01 constant


** 1 **FIX 2 **********
PARAMETER 2 IS CONSTANT. IGNORED.
PARAMETER DEFINITIONS:
NO. NAME VALUE STEP SIZE LIMITS
3 dphi 2.01915e+00 constant


** 2 **FIX 3


[…] [/code]

I read in the TMinuit documentation about the SetPrintLevel(…) function and I use SetPrintLevel(-1). Following the documentation this should stop ANY output of TMinuit, but I am still getting the output mentioned above.

Running this with a big sample and interactively watching the output on the shell this is slowing down the script extremely…

Is there any command to set TMinuit into total silent mode, not getting any output but still getting a good fit?

Hi,

SetPrintLevel should work. Maybe some other code is calling afterwards SetPrintLevel with an higher level. I would need to see your code,
Best Regards
Lorenzo

Ok I think I found my mistake.

Basically I was doing it like this:

  TMinuit *fit = new TMinuit(7);
  fit->SetFCN(my_function);
  [...]
  fit->DefineParameter(...);
  fit->FixParameter(...);
  fit->SetPrintLevel(-1);
  fit->Migrad();
  fit->GetParameter(...);

I was not really aware of at which step the actual output is generated. But placing the SetPrintLevel(-1) line right after initializing the TMinuit Pointer totally does the job. So problem solved :wink:

Workaround:

  TMinuit *fit = new TMinuit(7);
  fit->SetPrintLevel(-1);
  [...]