corrected the handling of the positive error flag

This commit is contained in:
nemu 2008-09-08 05:08:39 +00:00
parent 43693a3412
commit c106294e32

View File

@ -120,7 +120,11 @@ bool PFitter::DoFit()
SetParameters();
bool status;
bool minosUsed = false;
// init positive errors to default false, if minos is called, it will be set true there
for (unsigned int i=0; i<fParams.size(); i++) {
fRunInfo->SetMsrParamPosErrorPresent(i, false);
}
for (unsigned int i=0; i<fCmdList.size(); i++) {
switch (fCmdList[i]) {
case PMN_INTERACTIVE:
@ -150,7 +154,10 @@ bool PFitter::DoFit()
break;
case PMN_MINOS:
status = ExecuteMinos();
minosUsed = true;
// set positive errors true
for (unsigned int i=0; i<fParams.size(); i++) {
fRunInfo->SetMsrParamPosErrorPresent(i, true);
}
break;
case PMN_PLOT:
cout << endl << "**WARNING** from PFitter::DoFit() : the command PLOT is not yet implemented.";
@ -183,13 +190,6 @@ bool PFitter::DoFit()
}
}
// if minos was not used, there are NO valid positive errors
if (!minosUsed) {
for (unsigned int i=0; i<fParams.size(); i++) {
fRunInfo->SetMsrParamPosErrorPresent(i, false);
}
}
return true;
}