TMinuit warning message

Dear ROOTers!

I have a problem concerned with TMinuit warning messages:

"Warning: wrong member access operator '.' "   - reference to line 2
"Warning: wrong member access operator '.' "   - reference to line 3
"Warning: wrong member access operator '.' "   - reference to line 7
"Warning: wrong member access operator '.' "   - reference to line 8

Here is the piece of corresponding code:

   TMinuit gMinuit(1);
   gMinuit.SetPrintLevel(-1);
   gMinuit.SetFCN(fcn);
   int ierflg = 0;
   double arglist[10];
   arglist[0] = 0.5; 
   gMinuit.mnexcm("SET ERR",arglist,1,ierflg);
   gMinuit.mnparm(0,"a",0.5,0.0001,0.,0.,ierflg);
   arglist[0] = 5000;                              	
   arglist[1] = 1.;                               

It should be mentioned that script itself works fine without any errors.

Then I rewrite the code using pointer

TMinuit *gMinuit = new TMinuit (1);

and there were no such messages.

So I think TMinuit class expects me to create the pointer rather than usual variable.
Is that bug?

Regards

Hi,

You cannot call inside the ROOT prompt a new instance of TMinuit as gMinuit. Minuit is a global pointer of TMinuit created at sturt-up time. Due to a bug/limitation, CINT will not report this problem, but in ROOT 6 you will get an error.

Just do:

 gMinuit = new TMinuit(1); 

or

 TMinuit minuit(1);

Lorenzo

Dear Lorenzo

So that’s what this is all about! It turns out that
"gMinuit is a global pointer of TMinuit created at sturt-up time "
I renamed gMinuit to minuit and messages have disappeared.
Thank you a lot!

Regards