fix 'possible msr2data in global+ mode bug' bug report #16 gitea
This commit is contained in:
+14
-14
@@ -1453,14 +1453,22 @@ bool PMsr2Data::PrepareGlobalInputFile(unsigned int tempRun, const std::string &
|
||||
|
||||
//std::cout << "Number of run specific parameters: " << fNumSpecParam << std::endl;
|
||||
|
||||
if (newRunNumber.str().compare(tempRunNumber.str())) { // first run number does not match the template run number
|
||||
// in global+ mode, read in the single run msr-file of the corresponding run
|
||||
if (globalPlus) {
|
||||
singleRunMsrFile = GetSingleRunMsrFile();
|
||||
if (singleRunMsrFile == nullptr)
|
||||
return false;
|
||||
// in global+ mode, read in the single-run msr-file of the first run and use its
|
||||
// fitted values/steps as starting values for the run-specific parameters -
|
||||
// also when the first run coincides with the template run
|
||||
if (globalPlus) {
|
||||
singleRunMsrFile = GetSingleRunMsrFile();
|
||||
if (singleRunMsrFile == nullptr)
|
||||
return false;
|
||||
for (unsigned int l(fNumGlobalParam); l < msrParamList->size(); ++l) {
|
||||
fMsrHandler->SetMsrParamValue(l, singleRunMsrFile->GetMsrParamList()->at(l).fValue);
|
||||
fMsrHandler->SetMsrParamStep(l, singleRunMsrFile->GetMsrParamList()->at(l).fStep);
|
||||
}
|
||||
delete singleRunMsrFile;
|
||||
singleRunMsrFile = nullptr;
|
||||
}
|
||||
|
||||
if (newRunNumber.str().compare(tempRunNumber.str())) { // first run number does not match the template run number
|
||||
// substitute the template run-numbers in the parameter names
|
||||
for (unsigned int l(fNumGlobalParam); l < msrParamList->size(); ++l) {
|
||||
tempParamName = msrParamList->at(l).fName.Data();
|
||||
@@ -1468,20 +1476,12 @@ bool PMsr2Data::PrepareGlobalInputFile(unsigned int tempRun, const std::string &
|
||||
if ( loc != std::string::npos ) {
|
||||
tempParamName.replace(loc, fRunNumberDigits, newRunNumber.str());
|
||||
msrParamList->at(l).fName = tempParamName;
|
||||
if (globalPlus && singleRunMsrFile) {
|
||||
fMsrHandler->SetMsrParamValue(l, singleRunMsrFile->GetMsrParamList()->at(l).fValue);
|
||||
fMsrHandler->SetMsrParamStep(l, singleRunMsrFile->GetMsrParamList()->at(l).fStep);
|
||||
}
|
||||
} else {
|
||||
std::cerr << std::endl << ">> msr2data: **ERROR** The indices of the run specific parameters do not match the template run number!";
|
||||
std::cerr << std::endl << ">> msr2data: **ERROR** This should not happen! Please report a bug!";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
}
|
||||
if (singleRunMsrFile) {
|
||||
delete singleRunMsrFile;
|
||||
singleRunMsrFile = nullptr;
|
||||
}
|
||||
|
||||
// substitute the template run-numbers in the RUN names
|
||||
for (unsigned int i(0); i < fNumTempRunBlocks; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user