fixed mangled chisq/maxLH issue (MUSR-148)
This commit is contained in:
@ -19,6 +19,7 @@ NEW integration of a few external musrfit plug-ins into the standard build proce
|
||||
NEW default estimates for 'data' and 'background' entries in RUN blocks
|
||||
NEW directory with some msr- and data-files for quick testing of new musrfit installations
|
||||
NEW option to musrt0: the key 'T' will set the t0 cursor to the maximum of the histogram
|
||||
FIXED chisq/maxLH lables in the statistics block are properly handled now (MUSR-148)
|
||||
FIXED y-unzoom failure for musrt0 (MUSR-77)
|
||||
FIXED fitting issue for boundaries none/none (MUSR-136)
|
||||
FIXED formatting of the ASCII fit output file for long parameter names (MUSR-142)
|
||||
|
@ -247,6 +247,13 @@ Int_t PMsrHandler::ReadMsrFile()
|
||||
if (!HandleStatisticEntry(statistic))
|
||||
result = PMUSR_MSR_SYNTAX_ERROR;
|
||||
|
||||
// check if chisq or max.log likelihood
|
||||
fStatistic.fChisq = true;
|
||||
for (UInt_t i=0; i<fCommands.size(); i++) {
|
||||
if (fCommands[i].fLine.Contains("MAX_LIKELIHOOD"))
|
||||
fStatistic.fChisq = false; // max.log likelihood
|
||||
}
|
||||
|
||||
// fill parameter-in-use vector
|
||||
if (result == PMUSR_SUCCESS)
|
||||
FillParameterInUse(theory, functions, run);
|
||||
@ -945,30 +952,19 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages)
|
||||
if (sstr.BeginsWith("STATISTIC")) {
|
||||
TDatime dt;
|
||||
fout << "STATISTIC --- " << dt.AsSQLString() << endl;
|
||||
} else if (sstr.BeginsWith("chisq")) {
|
||||
} else if (sstr.BeginsWith("chisq") || sstr.BeginsWith("maxLH")) {
|
||||
partialStatisticBlockFound = false;
|
||||
if (fStatistic.fValid) { // valid fit result
|
||||
if (fStatistic.fChisq)
|
||||
str = " chisq = ";
|
||||
str += fStatistic.fMin;
|
||||
str += ", NDF = ";
|
||||
str += fStatistic.fNdf;
|
||||
str += ", chisq/NDF = ";
|
||||
str += fStatistic.fMin / fStatistic.fNdf;
|
||||
fout << str.Data() << endl;
|
||||
if (messages)
|
||||
cout << endl << str.Data() << endl;
|
||||
} else {
|
||||
fout << "*** FIT DID NOT CONVERGE ***" << endl;
|
||||
if (messages)
|
||||
cout << endl << "*** FIT DID NOT CONVERGE ***" << endl;
|
||||
}
|
||||
} else if (sstr.BeginsWith("maxLH")) {
|
||||
partialStatisticBlockFound = false;
|
||||
if (fStatistic.fValid) { // valid fit result
|
||||
else
|
||||
str = " maxLH = ";
|
||||
str += fStatistic.fMin;
|
||||
str += ", NDF = ";
|
||||
str += fStatistic.fNdf;
|
||||
if (fStatistic.fChisq)
|
||||
str += ", chisq/NDF = ";
|
||||
else
|
||||
str += ", maxLH/NDF = ";
|
||||
str += fStatistic.fMin / fStatistic.fNdf;
|
||||
fout << str.Data() << endl;
|
||||
@ -3718,13 +3714,6 @@ Bool_t PMsrHandler::HandleStatisticEntry(PMsrLines &lines)
|
||||
return true;
|
||||
}
|
||||
|
||||
// check if chisq or max.log likelihood
|
||||
fStatistic.fChisq = true;
|
||||
for (UInt_t i=0; i<fCommands.size(); i++) {
|
||||
if (fCommands[i].fLine.Contains("MAX_LIKELIHOOD"))
|
||||
fStatistic.fChisq = false; // max.log likelihood
|
||||
}
|
||||
|
||||
Char_t str[128];
|
||||
Char_t date[128];
|
||||
Char_t time[128];
|
||||
|
Reference in New Issue
Block a user