bug in TMinuit calling "fcn" function

From: stefan kluth (skluth@mh1.lbl.gov)
Date: Sat Jan 09 1999 - 02:12:24 MET


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

---Stefan Kluth---------------Lynen Fellow----------------|\--|\-------
-  LBNL, MS 50A 2160       -  phone:  +1 510 495 2376  -  |/  |/      -
-  1 Cyclotron Rd.         -  fax:    +1 510 495 2957  -  |\/\|\/\|'  -
---Berkeley, CA94720, USA-----e-mail: SKluth@lbl.gov------|/\/|/\/|----



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