Re: reducing TMinuit printout

From: Arthur E. Snyder <snyder_at_slac.stanford.edu>
Date: Fri, 1 May 2009 12:34:16 -0700


You might want to make only one TMinuit for another reason, if you're using it a lot as would be indicated by your desire to reduce print. That is "new" is rather expensive in C++ and if your fit is pretty simple and you're just doing the fit many times, the "new" many times might be a big contributor to the CPU used. Using a single instance should not be a problem as long as you reset parameters to appropriate initial values before each fit.

-Art S.

A.E. Snyder, Group EC                        \!c*p?/
SLAC Mail Stop #95                          ((.   .))
Box 4349                                        |
Stanford, Ca, USA, 94309                      '\|/`
e-mail:snyder_at_slac.stanford.edu                 o
phone:650-926-2701                              _
http://www.slac.stanford.edu/~snyder          BaBar
FAX:650-926-2657                          Collaboration



On Fri, 1 May 2009, Tom Roberts wrote:

> I am using TMinuit for a special fitting task, and am creating a TMinuit
> object and calling Migrad() thousands of times. This completely overwhelms
> the output, because it prints a page per call. This is a large C++ simulation
> program linked with the Root libraries.
>
> How can I avoid ALL printout from TMinuit() and Migrad() ?
>
> I'm now doing this:
> TMinuit *tm = new Tminuit();
> tm->SetPrintLevel(0);
> tm->Command("SET PRINTOUT -1");
> ... use tm
>
> But I still get 3 lines per instance:
> **********
> ** 1 **SET PRINT 0
> **********
>
> How can I avoid that? It seems to be using the global function Printf(),
> which I could not find in the reference manual and there's no source file
> Printf.cxx. I am willing to omit even warnings and error messages, so how can
> I turn Printf() off?
>
> I tried:
> stderr = stdout = fopen("/dev/null","w");
> but that did not stop the output (!).
>
>
> Perhaps I could just create a single TMinuit object and re-use it, thus
> reducing this to 3 rather strange lines of output. But that requires changing
> a lot of code, and I'd rather not do it (how much state from the previous fit
> does TMinuit keep? -- I don't know, and would rather not make my program
> depend on the answer).
>
>
> Tom Roberts
>
>
Received on Fri May 01 2009 - 21:34:23 CEST

This archive was generated by hypermail 2.2.0 : Fri May 01 2009 - 23:50:01 CEST