make sure that the run template number has at least 4 digits before proceeding.

This commit is contained in:
suter_a 2024-09-17 16:27:04 +02:00
parent 00b012d0dd
commit 7838901fbe
2 changed files with 9 additions and 1 deletions

View File

@ -697,6 +697,14 @@ bool PMsr2Data::PrepareGlobalInputFile(unsigned int tempRun, const std::string &
// std::cout << "debug> " << msrParamList->at(i).fNo << ": " << msrParamList->at(i).fName.Data() << " is global: " << msrParamList->at(i).fIsGlobal << std::endl; // std::cout << "debug> " << msrParamList->at(i).fNo << ": " << msrParamList->at(i).fName.Data() << " is global: " << msrParamList->at(i).fIsGlobal << std::endl;
} }
// there should be at least one run specific parameter, otherwise the GLOBAL option doesn't make sense
if (fNumSpecParam == 0) {
std::cout << ">> msr2data: **ERROR** found NO run specific parameter, hence the GLOBAL option doesn't make sense." << std::endl;
std::cout << ">> msr2data: Could it be, that your run specific labling is < 4 digits? Please check your msr-Input-File." << std::endl;
return false;
}
// check if parameters have been sorted correctly from the beginning // check if parameters have been sorted correctly from the beginning
bool wasSorted(true); bool wasSorted(true);
for (unsigned int i(0); i < fNumGlobalParam; ++i) { for (unsigned int i(0); i < fNumGlobalParam; ++i) {

View File

@ -765,7 +765,7 @@ int main(int argc, char *argv[])
// Check if all given run numbers are covered by the formatting of the data file name // Check if all given run numbers are covered by the formatting of the data file name
status = msr2dataHandler->CheckRunNumbersInRange(); status = msr2dataHandler->CheckRunNumbersInRange();
if(status) { if (status) {
std::cerr << std::endl; std::cerr << std::endl;
std::cerr << ">> msr2data: **ERROR** At least one given run number is out of range! Quitting..." << std::endl; std::cerr << ">> msr2data: **ERROR** At least one given run number is out of range! Quitting..." << std::endl;
return status; return status;