Re: bug in TMinuit calling "fcn" function

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Jan 11 1999 - 10:05:58 MET


stefan kluth wrote:
> 
> Hi,
> 
> with root 2.20/06 I find that in
> 
> void fcn( Int_t &npar, Double_t *gin, Double_t &f,
>           Double_t *par, Int_t iflag) {
> 
>   // my fit code
> 
> }
> 
> which is called by MINUIT through TMinuit the parameter iflag is not
> passed correctly. Even calling fcn explicitly with
> 
>   ...
>   arglist[0]= 4;
>   gMinuit->mnexcm( "CALL", arglist, 1, ierflg );
>   ...
> 
> I get nonsense (i.e something like iflag= 6585878) for iflag in fcn. This
> is bad, because traditionally in MINUIT style fits one has if-blocks in
> the fcn function which test the value of iflag to initialise, calculate
> the fit function or do some final calculation after the fit is done. At
> the moment, I have a workaround by using an extra constant fit parameter
> to pass a value for iflag, but this is quite ugly.
> 
> cheers, Stefan
> 

Hi Stefan,
I cannot reproduce this problem.
We provide a simple test program in $ROOTSYS/test/minexam.
Could you put a print statement in the function fcnk0 of the example
and tell me if you get what is expected. I have no problems with it.

Rene Brun



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:28 MET