Re: Suppressing TMinuit warnings

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Thu, 01 Mar 2007 18:00:00 +0100


Hi Andre,

In your version, when calling

    minuit->SetPrintLevel(-1);
this removes all prints from Minuit except Warnings and errors. You can disable the printing of warnings by calling

    Int_t ierr=0;
    minuit>mnexcm("SET NOWarnings",0,0,ierr);

In the CVS version, I have modified TMinuit::SetPrintLevel such that it also disable the printing
of the Warning messages when the argument is negative.

Rene Brun

Andre Lebedev wrote:
> Hi, Rene.
>
> Attached is the macro which when I execute I get:
> root [0] .L minMacro.C
> root [1] doMinuit()
> MINUIT WARNING IN PARAMETR
> ============== VARIABLE2 BROUGHT BACK INSIDE LIMITS.
>
> Thanks,
> Andre.
>
> Rene Brun wrote:
>> Andre,
>>
>> Could you send a short example when this happen?
>> I cannot reproduce the problem when disabling Minuit error messages.
>>
>> Rene Brun
>>
>> Andre Lebedev wrote:
>>> Hello, rooters.
>>>
>>> I am wondering whether there is a way to suppress TMinuit warning
>>> messages. I call TMinuit::SetPrintLevel(-1), which makes it fairly
>>> quiet, but I get lots of print statements like
>>> MINUIT WARNING IN PARAMETR
>>> ============== VARIABLE2 BROUGHT BACK INSIDE LIMITS.
>>> MINUIT WARNING IN PARAMETR
>>> ============== VARIABLE2 IS AT ITS UPPER ALLOWED LIMIT.
>>>
>>> In this particular instance, I do expect a large number of fits
>>> which will start close to the boundary of the imposed limits, so any
>>> help in suppressing these is greatly appreciated!
>>>
>>> Thanks,
>>> Andre.
> ------------------------------------------------------------------------
>
> void MinFCN(int& /*npar*/, double* /*gin*/, double& f,
> double* par, int /*iflag*/)
> {
>
> double x[10] = {0, 1, 1, 2, 3, 5, 6, 8, 8.5, 9};
> double y[10] = {-0.110079, 1.91072, 1.89933, 3.95169, 6.12023,
> 10.1611, 12.5725, 17.4555, 15.9894, 17.0093};
>
> for (int i = 0; i < 10; ++i) {
> double dy = par[0] + par[1] * x[i] - y[i];
> f += dy * dy;
> }
> }
>
> void doMinuit()
> {
>
> TMinuit* minu = new TMinuit(2);
> minu->SetFCN(MinFCN);
> minu->SetPrintLevel(-1);
> minu->DefineParameter(0, "Offset", 0, 0.1, -0.5, 0.5);
> minu->DefineParameter(1, "Slope", 1.6, 0.2, 1.5, 2.5);
> minu->Migrad();
> }
>
Received on Thu Mar 01 2007 - 18:00:12 CET

This archive was generated by hypermail 2.2.0 : Fri Mar 02 2007 - 11:50:01 CET