fixed mangled chisq/maxLH issue (MUSR-148)

This commit is contained in:
nemu
2010-10-07 05:42:21 +00:00
parent 4d56897d13
commit c41fe09422
2 changed files with 17 additions and 27 deletions

View File

@ -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 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 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 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 y-unzoom failure for musrt0 (MUSR-77)
FIXED fitting issue for boundaries none/none (MUSR-136) FIXED fitting issue for boundaries none/none (MUSR-136)
FIXED formatting of the ASCII fit output file for long parameter names (MUSR-142) FIXED formatting of the ASCII fit output file for long parameter names (MUSR-142)

View File

@ -247,6 +247,13 @@ Int_t PMsrHandler::ReadMsrFile()
if (!HandleStatisticEntry(statistic)) if (!HandleStatisticEntry(statistic))
result = PMUSR_MSR_SYNTAX_ERROR; 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 // fill parameter-in-use vector
if (result == PMUSR_SUCCESS) if (result == PMUSR_SUCCESS)
FillParameterInUse(theory, functions, run); FillParameterInUse(theory, functions, run);
@ -945,30 +952,19 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages)
if (sstr.BeginsWith("STATISTIC")) { if (sstr.BeginsWith("STATISTIC")) {
TDatime dt; TDatime dt;
fout << "STATISTIC --- " << dt.AsSQLString() << endl; fout << "STATISTIC --- " << dt.AsSQLString() << endl;
} else if (sstr.BeginsWith("chisq")) { } else if (sstr.BeginsWith("chisq") || sstr.BeginsWith("maxLH")) {
partialStatisticBlockFound = false; partialStatisticBlockFound = false;
if (fStatistic.fValid) { // valid fit result if (fStatistic.fValid) { // valid fit result
if (fStatistic.fChisq)
str = " chisq = "; str = " chisq = ";
str += fStatistic.fMin; else
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
str = " maxLH = "; str = " maxLH = ";
str += fStatistic.fMin; str += fStatistic.fMin;
str += ", NDF = "; str += ", NDF = ";
str += fStatistic.fNdf; str += fStatistic.fNdf;
if (fStatistic.fChisq)
str += ", chisq/NDF = ";
else
str += ", maxLH/NDF = "; str += ", maxLH/NDF = ";
str += fStatistic.fMin / fStatistic.fNdf; str += fStatistic.fMin / fStatistic.fNdf;
fout << str.Data() << endl; fout << str.Data() << endl;
@ -3718,13 +3714,6 @@ Bool_t PMsrHandler::HandleStatisticEntry(PMsrLines &lines)
return true; 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 str[128];
Char_t date[128]; Char_t date[128];
Char_t time[128]; Char_t time[128];