Hi,
i'm Davide Sgalaberna. I have some problems with TMinuit. I have to do a likelihood fit. I use both MIGRAD and MINOS for the fit.
When the job calls MINOS it hungs.
This is the main part of code:
double arglist[10];
int ierflg = 0;
TMinuit *MYgMinuit = new TMinuit(4); // Max 4 parameters to be fitted: Cross,JES,Nb_1tag,Nb_2Mtag
MYgMinuit->SetFCN(fcn); // fcn is a likelihood function
// set PRINT / NO PRINT (arglist[0] = -1/0/1/2/3
arglist[0] = 2; MYgMinuit->mnexcm("SET PRI", arglist, 1, ierflg);ierflg);
// set WARNINGS / NO WARNINGS (arglist[0] = 1/-1)
arglist[0] = +1; MYgMinuit->mnexcm("SET WAR", arglist, 1, ierflg);
// set accurancy
arglist[0] = 1.E-15L; MYgMinuit->mnexcm("SET EPS", arglist, 1, ierflg);
// set error (0.5 for likelihood, 1 for Chi2)
arglist[0] = 0.5; MYgMinuit->mnexcm("SET ERR", arglist, 1, ierflg);
// set strategy (default is 1, 2 is the more accurate)
arglist[0] = 1.0; //arglist [0] = 2.0; MYgMinuit->mnexcm("SET STR", arglist, 1, ierflg); MYgMinuit->mnexcm("CLE",arglist,0,ierflg); MYgMinuit->mncler(); /// it should be the same as mnexcm("CLE",arglist,0,
// after some code lines, after setting vstart and vstep of my fit parameters:
cout << " Executing fit with " <<NUMFITPAR << " parameters " << endl;
cout << " Call MIGRAD " << endl; arglist[0] = 10000; //100000; // max iterations arglist[1] = 0.1; // related to errors MYgMinuit->mnexcm("MIGRAD",arglist,2,ierflg); // do it // calculate MINOS errors for all the parameters cout << " Call MINOS " << endl; arglist[0] = 10000; // 100000; MYgMinuit->mnexcm("MINOS",arglist,1,ierflg); // do it
The job hunged after the warnings below:
This is the cout before stopping:
NO. NAME VALUE ERROR SIZE DERIVATIVE 1 CROSS_fit 7.90840e+00 7.07366e-01 4.58159e-02 1.59218e-03
2 JES_fit -1.76171e+00 2.88172e-01 2.36167e-02 -1.36947e-02 3 Bkg_fit_1tag 4.00907e+03 8.20403e+01 6.83956e+00 -2.79731e-06 4 Bkg_fit_2Mtag 1.22077e+03 3.45308e+01 3.15515e+00 2.61296e-05 ERR DEF= 0.5Call MINOS
Thanks
Davide
Received on Mon May 31 2010 - 17:07:37 CEST
This archive was generated by hypermail 2.2.0 : Mon May 31 2010 - 23:50:01 CEST