improved upper/lower case handling
This commit is contained in:
@ -966,9 +966,6 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
|
|
||||||
iter = lines.begin();
|
iter = lines.begin();
|
||||||
while ((iter != lines.end()) && !error) {
|
while ((iter != lines.end()) && !error) {
|
||||||
// everything to lower case first
|
|
||||||
iter->fLine.ToLower();
|
|
||||||
|
|
||||||
// tokenize line
|
// tokenize line
|
||||||
tokens = iter->fLine.Tokenize(" \t");
|
tokens = iter->fLine.Tokenize(" \t");
|
||||||
if (!tokens) {
|
if (!tokens) {
|
||||||
@ -978,7 +975,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// RUN line ----------------------------------------------
|
// RUN line ----------------------------------------------
|
||||||
if (iter->fLine.BeginsWith("run")) {
|
if (iter->fLine.BeginsWith("run", TString::kIgnoreCase)) {
|
||||||
|
|
||||||
if (!first) // not the first run in the list
|
if (!first) // not the first run in the list
|
||||||
fRuns.push_back(param);
|
fRuns.push_back(param);
|
||||||
@ -1007,7 +1004,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// fittype -------------------------------------------------
|
// fittype -------------------------------------------------
|
||||||
if (iter->fLine.BeginsWith("fittype")) {
|
if (iter->fLine.BeginsWith("fittype", TString::kIgnoreCase)) {
|
||||||
if (tokens->GetEntries() < 2) {
|
if (tokens->GetEntries() < 2) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
@ -1030,7 +1027,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// alpha -------------------------------------------------
|
// alpha -------------------------------------------------
|
||||||
if (iter->fLine.BeginsWith("alpha")) {
|
if (iter->fLine.BeginsWith("alpha", TString::kIgnoreCase)) {
|
||||||
if (tokens->GetEntries() < 2) {
|
if (tokens->GetEntries() < 2) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
@ -1044,7 +1041,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// beta -------------------------------------------------
|
// beta -------------------------------------------------
|
||||||
if (iter->fLine.BeginsWith("beta")) {
|
if (iter->fLine.BeginsWith("beta", TString::kIgnoreCase)) {
|
||||||
if (tokens->GetEntries() < 2) {
|
if (tokens->GetEntries() < 2) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
@ -1058,7 +1055,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// norm -------------------------------------------------
|
// norm -------------------------------------------------
|
||||||
if (iter->fLine.BeginsWith("norm")) {
|
if (iter->fLine.BeginsWith("norm", TString::kIgnoreCase)) {
|
||||||
if (tokens->GetEntries() < 2) {
|
if (tokens->GetEntries() < 2) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
@ -1079,7 +1076,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// backgr.fit --------------------------------------------
|
// backgr.fit --------------------------------------------
|
||||||
if (iter->fLine.BeginsWith("backgr.fit")) {
|
if (iter->fLine.BeginsWith("backgr.fit", TString::kIgnoreCase)) {
|
||||||
if (tokens->GetEntries() < 2) {
|
if (tokens->GetEntries() < 2) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
@ -1093,7 +1090,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// rphase ------------------------------------------------
|
// rphase ------------------------------------------------
|
||||||
if (iter->fLine.BeginsWith("rphase")) {
|
if (iter->fLine.BeginsWith("rphase", TString::kIgnoreCase)) {
|
||||||
if (tokens->GetEntries() < 2) {
|
if (tokens->GetEntries() < 2) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
@ -1107,7 +1104,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// lifetime ------------------------------------------------
|
// lifetime ------------------------------------------------
|
||||||
if (iter->fLine.BeginsWith("lifetime ")) {
|
if (iter->fLine.BeginsWith("lifetime ", TString::kIgnoreCase)) {
|
||||||
if (tokens->GetEntries() < 2) {
|
if (tokens->GetEntries() < 2) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
@ -1121,12 +1118,12 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// lifetimecorrection ---------------------------------------
|
// lifetimecorrection ---------------------------------------
|
||||||
if (iter->fLine.BeginsWith("lifetimecorrection")) {
|
if (iter->fLine.BeginsWith("lifetimecorrection", TString::kIgnoreCase)) {
|
||||||
param.fLifetimeCorrection = true;
|
param.fLifetimeCorrection = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// map ------------------------------------------------------
|
// map ------------------------------------------------------
|
||||||
if (iter->fLine.BeginsWith("map")) {
|
if (iter->fLine.BeginsWith("map", TString::kIgnoreCase)) {
|
||||||
for (int i=1; i<tokens->GetEntries(); i++) {
|
for (int i=1; i<tokens->GetEntries(); i++) {
|
||||||
ostr = dynamic_cast<TObjString*>(tokens->At(i));
|
ostr = dynamic_cast<TObjString*>(tokens->At(i));
|
||||||
str = ostr->GetString();
|
str = ostr->GetString();
|
||||||
@ -1150,7 +1147,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// forward ------------------------------------------------
|
// forward ------------------------------------------------
|
||||||
if (iter->fLine.BeginsWith("forward")) {
|
if (iter->fLine.BeginsWith("forward", TString::kIgnoreCase)) {
|
||||||
if (tokens->GetEntries() < 2) {
|
if (tokens->GetEntries() < 2) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
@ -1164,7 +1161,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// backward -----------------------------------------------
|
// backward -----------------------------------------------
|
||||||
if (iter->fLine.BeginsWith("backward")) {
|
if (iter->fLine.BeginsWith("backward", TString::kIgnoreCase)) {
|
||||||
if (tokens->GetEntries() < 2) {
|
if (tokens->GetEntries() < 2) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
@ -1178,7 +1175,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// backgr.fix ----------------------------------------------
|
// backgr.fix ----------------------------------------------
|
||||||
if (iter->fLine.BeginsWith("backgr.fix")) {
|
if (iter->fLine.BeginsWith("backgr.fix", TString::kIgnoreCase)) {
|
||||||
if (tokens->GetEntries() != 3) {
|
if (tokens->GetEntries() != 3) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
@ -1194,7 +1191,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// background ---------------------------------------------
|
// background ---------------------------------------------
|
||||||
if (iter->fLine.BeginsWith("background")) {
|
if (iter->fLine.BeginsWith("background", TString::kIgnoreCase)) {
|
||||||
if ((tokens->GetEntries() != 3) && (tokens->GetEntries() != 5)) {
|
if ((tokens->GetEntries() != 3) && (tokens->GetEntries() != 5)) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
@ -1210,7 +1207,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// data --------------------------------------------------
|
// data --------------------------------------------------
|
||||||
if (iter->fLine.BeginsWith("data")) {
|
if (iter->fLine.BeginsWith("data", TString::kIgnoreCase)) {
|
||||||
if ((tokens->GetEntries() != 3) && (tokens->GetEntries() != 5)) {
|
if ((tokens->GetEntries() != 3) && (tokens->GetEntries() != 5)) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
@ -1226,7 +1223,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// t0 -----------------------------------------------------
|
// t0 -----------------------------------------------------
|
||||||
if (iter->fLine.BeginsWith("t0")) {
|
if (iter->fLine.BeginsWith("t0", TString::kIgnoreCase)) {
|
||||||
if ((tokens->GetEntries() != 2) && (tokens->GetEntries() != 3)) {
|
if ((tokens->GetEntries() != 2) && (tokens->GetEntries() != 3)) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
@ -1242,7 +1239,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// fit -----------------------------------------------------
|
// fit -----------------------------------------------------
|
||||||
if (iter->fLine.BeginsWith("fit ")) {
|
if (iter->fLine.BeginsWith("fit ", TString::kIgnoreCase)) {
|
||||||
if (tokens->GetEntries() < 3) {
|
if (tokens->GetEntries() < 3) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
@ -1258,7 +1255,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// packing --------------------------------------------------
|
// packing --------------------------------------------------
|
||||||
if (iter->fLine.BeginsWith("packing")) {
|
if (iter->fLine.BeginsWith("packing", TString::kIgnoreCase)) {
|
||||||
if (tokens->GetEntries() != 2) {
|
if (tokens->GetEntries() != 2) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
@ -1272,7 +1269,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// rrffrequency --------------------------------------------------
|
// rrffrequency --------------------------------------------------
|
||||||
if (iter->fLine.BeginsWith("rrffrequency")) {
|
if (iter->fLine.BeginsWith("rrffrequency", TString::kIgnoreCase)) {
|
||||||
if (tokens->GetEntries() != 2) {
|
if (tokens->GetEntries() != 2) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
@ -1286,7 +1283,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// rrfpacking --------------------------------------------------
|
// rrfpacking --------------------------------------------------
|
||||||
if (iter->fLine.BeginsWith("rrfpacking")) {
|
if (iter->fLine.BeginsWith("rrfpacking", TString::kIgnoreCase)) {
|
||||||
if (tokens->GetEntries() != 2) {
|
if (tokens->GetEntries() != 2) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
@ -1300,7 +1297,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// alpha2 --------------------------------------------------
|
// alpha2 --------------------------------------------------
|
||||||
if (iter->fLine.BeginsWith("alpha2")) {
|
if (iter->fLine.BeginsWith("alpha2", TString::kIgnoreCase)) {
|
||||||
if (tokens->GetEntries() != 2) {
|
if (tokens->GetEntries() != 2) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
@ -1314,7 +1311,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// beta2 --------------------------------------------------
|
// beta2 --------------------------------------------------
|
||||||
if (iter->fLine.BeginsWith("beta2")) {
|
if (iter->fLine.BeginsWith("beta2", TString::kIgnoreCase)) {
|
||||||
if (tokens->GetEntries() != 2) {
|
if (tokens->GetEntries() != 2) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
@ -1328,7 +1325,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// right --------------------------------------------------
|
// right --------------------------------------------------
|
||||||
if (iter->fLine.BeginsWith("right")) {
|
if (iter->fLine.BeginsWith("right", TString::kIgnoreCase)) {
|
||||||
if (tokens->GetEntries() != 2) {
|
if (tokens->GetEntries() != 2) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
@ -1342,7 +1339,7 @@ bool PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// left --------------------------------------------------
|
// left --------------------------------------------------
|
||||||
if (iter->fLine.BeginsWith("left")) {
|
if (iter->fLine.BeginsWith("left", TString::kIgnoreCase)) {
|
||||||
if (tokens->GetEntries() != 2) {
|
if (tokens->GetEntries() != 2) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -190,7 +190,6 @@ bool PRunDataHandler::FileExistsCheck(PMsrRunStructure &runInfo)
|
|||||||
TString str;
|
TString str;
|
||||||
TString ext;
|
TString ext;
|
||||||
|
|
||||||
runInfo.fRunName.ToLower();
|
|
||||||
runInfo.fBeamline.ToLower();
|
runInfo.fBeamline.ToLower();
|
||||||
runInfo.fInstitute.ToLower();
|
runInfo.fInstitute.ToLower();
|
||||||
runInfo.fFileFormat.ToLower();
|
runInfo.fFileFormat.ToLower();
|
||||||
|
Reference in New Issue
Block a user