fixed wrong chisq output in musrview if expected chisq ispresent

This commit is contained in:
2012-09-24 11:02:06 +00:00
parent 4ad5b37441
commit 6c0fdb6ab8
3 changed files with 20 additions and 7 deletions

View File

@ -3928,13 +3928,23 @@ Bool_t PMsrHandler::HandleStatisticEntry(PMsrLines &lines)
}
// extract chisq
if (lines[i].fLine.Contains("chisq =")) {
fStatistic.fValid = true;
strncpy(str, lines[i].fLine.Data(), sizeof(str));
status = sscanf(str+lines[i].fLine.Index("chisq = ")+8, "%lf", &dval);
if (status == 1) {
fStatistic.fMin = dval;
} else {
fStatistic.fMin = -1.0;
if (lines[i].fLine.Contains("expected")) { // expected chisq
strncpy(str, lines[i].fLine.Data(), sizeof(str));
status = sscanf(str+lines[i].fLine.Index("chisq = ")+8, "%lf", &dval);
if (status == 1) {
fStatistic.fMinExpected = dval;
} else {
fStatistic.fMinExpected = -1.0;
}
} else { // chisq
fStatistic.fValid = true;
strncpy(str, lines[i].fLine.Data(), sizeof(str));
status = sscanf(str+lines[i].fLine.Index("chisq = ")+8, "%lf", &dval);
if (status == 1) {
fStatistic.fMin = dval;
} else {
fStatistic.fMin = -1.0;
}
}
}
// extract maxLH