some more rigrous checking of the STATISTIC block when reading it

This commit is contained in:
nemu 2009-06-25 08:31:15 +00:00
parent e60a6fc1bd
commit 8cb69a2011

View File

@ -2686,7 +2686,22 @@ bool PMsrHandler::HandleStatisticEntry(PMsrLines &lines)
int status;
double dval;
unsigned int ival;
TString tstr;
for (unsigned int i=0; i<lines.size(); i++) {
// check if the statistic block line is illegal
tstr = lines[i].fLine;
tstr.Remove(TString::kLeading, ' ');
if (tstr.Length() > 0) {
if (!tstr.BeginsWith("#") && (!tstr.BeginsWith("STATISTIC")) && (!tstr.BeginsWith("chisq")) && (!tstr.BeginsWith("maxLH"))) {
cout << endl << ">> PMsrHandler::HandleStatisticEntry: **SYNTAX ERROR** in line " << lines[i].fLineNo;
cout << endl << ">> '" << lines[i].fLine.Data() << "'";
cout << endl << ">> not a valid STATISTIC block line";
cout << endl << ">> If you do not understand this, just remove the STATISTIC block, musrfit will recreate after fitting";
cout << endl << endl;
return false;
}
}
// filter date and chisq etc from strings
// extract date and time
if (lines[i].fLine.Contains("STATISTIC")) {