73 DeclareOptionRef(fErrorLevel = 1,
"ErrorLevel",
"TMinuit: error level: 0.5=logL fit, 1=chi-squared fit" );
74 DeclareOptionRef(fPrintLevel = -1,
"PrintLevel",
"TMinuit: output level: -1=least, 0, +1=all garbage" );
75 DeclareOptionRef(fFitStrategy = 2,
"FitStrategy",
"TMinuit: fit strategy: 2=best" );
76 DeclareOptionRef(fPrintWarnings =
kFALSE,
"PrintWarnings",
"TMinuit: suppress warnings" );
77 DeclareOptionRef(fUseImprove =
kTRUE,
"UseImprove",
"TMinuit: use IMPROVE" );
78 DeclareOptionRef(fUseMinos =
kTRUE,
"UseMinos",
"TMinuit: use MINOS" );
79 DeclareOptionRef(fBatch =
kFALSE,
"SetBatch",
"TMinuit: use batch mode" );
80 DeclareOptionRef(fMaxCalls = 1000,
"MaxCalls",
"TMinuit: approximate maximum number of function calls" );
81 DeclareOptionRef(fTolerance = 0.1,
"Tolerance",
"TMinuit: tolerance to the function value at the minimum" );
92 if (!fBatch) Log() << kINFO <<
"<MinuitFitter> Init " <<
Endl;
105 args[0] = fPrintLevel;
106 fMinWrap->ExecuteCommand(
"SET PRINTOUT", args, 1 );
108 if (fBatch) fMinWrap->ExecuteCommand(
"SET BAT", args, 0 );
114 args[0] = fErrorLevel;
115 fMinWrap->ExecuteCommand(
"SET ERR", args, 1 );
118 if (!fPrintWarnings) fMinWrap->ExecuteCommand(
"SET NOWARNINGS", args, 0 );
121 args[0] = fFitStrategy;
122 fMinWrap->ExecuteCommand(
"SET STRATEGY", args, 1 );
134 if ( !fBatch ) Log() << kINFO <<
"<MinuitFitter> Fitting, please be patient ... " <<
Endl;
137 if ((
Int_t)pars.size() != GetNpars())
138 Log() << kFATAL <<
"<Run> Mismatch in number of parameters: (a)"
139 << GetNpars() <<
" != " << pars.size() <<
Endl;
143 if (!fBatch) timer =
new Timer();
146 for (
Int_t ipar=0; ipar<fNpars; ipar++) {
148 pars[ipar], fRanges[ipar]->GetWidth()/100.0,
149 fRanges[ipar]->GetMin(), fRanges[ipar]->GetMax() );
150 if (fRanges[ipar]->GetWidth() == 0.0) fMinWrap->FixParameter( ipar );
157 args[1] = fTolerance;
160 fMinWrap->ExecuteCommand(
"MIGrad", args, 2 );
163 if (fUseImprove) fMinWrap->ExecuteCommand(
"IMProve", args, 0 );
168 fMinWrap->ExecuteCommand(
"MINOs", args, 1 );
177 fMinWrap->GetStats( chi2, edm, errdef, nvpar, nparx );
180 if (GetNpars() != nparx) {
181 Log() << kFATAL <<
"<Run> Mismatch in number of parameters: "
182 << GetNpars() <<
" != " << nparx <<
Endl;
186 for (
Int_t ipar=0; ipar<GetNpars(); ipar++) {
187 Double_t errp, errm, errsym, globcor, currVal, currErr;
188 fMinWrap->GetParameter( ipar, currVal, currErr );
189 pars[ipar] = currVal;
190 fMinWrap->GetErrors( ipar, errp, errm, errsym, globcor );