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 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)
|
||||||
|
@ -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,31 +952,20 @@ 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
|
||||||
str = " chisq = ";
|
if (fStatistic.fChisq)
|
||||||
|
str = " chisq = ";
|
||||||
|
else
|
||||||
|
str = " maxLH = ";
|
||||||
str += fStatistic.fMin;
|
str += fStatistic.fMin;
|
||||||
str += ", NDF = ";
|
str += ", NDF = ";
|
||||||
str += fStatistic.fNdf;
|
str += fStatistic.fNdf;
|
||||||
str += ", chisq/NDF = ";
|
if (fStatistic.fChisq)
|
||||||
str += fStatistic.fMin / fStatistic.fNdf;
|
str += ", chisq/NDF = ";
|
||||||
fout << str.Data() << endl;
|
else
|
||||||
if (messages)
|
str += ", maxLH/NDF = ";
|
||||||
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 += fStatistic.fMin;
|
|
||||||
str += ", NDF = ";
|
|
||||||
str += fStatistic.fNdf;
|
|
||||||
str += ", maxLH/NDF = ";
|
|
||||||
str += fStatistic.fMin / fStatistic.fNdf;
|
str += fStatistic.fMin / fStatistic.fNdf;
|
||||||
fout << str.Data() << endl;
|
fout << str.Data() << endl;
|
||||||
if (messages)
|
if (messages)
|
||||||
@ -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];
|
||||||
|
Reference in New Issue
Block a user