fix issue MUSR-110

This commit is contained in:
nemu 2009-12-10 15:54:16 +00:00
parent b793c76e58
commit 88c7978ab9
2 changed files with 31 additions and 8 deletions

View File

@ -340,13 +340,29 @@ Bool_t PRunAsymmetry::PrepareData()
fT0s.push_back(fRunInfo->GetT0(1)); // backward t0 fT0s.push_back(fRunInfo->GetT0(1)); // backward t0
} }
// first check if forward/backward given in the msr-file are valid
if (fRunInfo->GetForwardHistoNo() <= 0) {
cerr << endl << "PRunAsymmetry::PrepareData(): **PANIC ERROR**:";
cerr << endl << " forward histoNo found = " << fRunInfo->GetForwardHistoNo() << ". Only histoNo > 0 are allowed.";
cerr << endl << " Will quit :-(";
cerr << endl;
return false;
}
if (fRunInfo->GetBackwardHistoNo() <= 0) {
cerr << endl << "PRunAsymmetry::PrepareData(): **PANIC ERROR**:";
cerr << endl << " backward histoNo found = " << fRunInfo->GetBackwardHistoNo() << ". Only histoNo > 0 are allowed.";
cerr << endl << " Will quit :-(";
cerr << endl;
return false;
}
// check if post pile up data shall be used // check if post pile up data shall be used
UInt_t histoNo[2]; // forward/backward UInt_t histoNo[2]; // forward/backward
histoNo[0] = fRunInfo->GetForwardHistoNo()-1; histoNo[0] = fRunInfo->GetForwardHistoNo()-1;
histoNo[1] = fRunInfo->GetBackwardHistoNo()-1; histoNo[1] = fRunInfo->GetBackwardHistoNo()-1;
// first check if forward/backward given in the msr-file are valid // first check if forward/backward given in the msr-file are valid
if ((runData->GetNoOfHistos() < histoNo[0]+1) || (histoNo[0] < 0) || if ((runData->GetNoOfHistos() < histoNo[0]+1) ||
(runData->GetNoOfHistos() < histoNo[1]+1) || (histoNo[1] < 0)) { (runData->GetNoOfHistos() < histoNo[1]+1)) {
cerr << endl << "PRunAsymmetry::PrepareData(): **PANIC ERROR**:"; cerr << endl << "PRunAsymmetry::PrepareData(): **PANIC ERROR**:";
cerr << endl << " forward/backward histo no found = " << histoNo[0]+1; cerr << endl << " forward/backward histo no found = " << histoNo[0]+1;
cerr << ", " << histoNo[1]+1 << ", but there are only " << runData->GetNoOfHistos() << " histo sets!?!?"; cerr << ", " << histoNo[1]+1 << ", but there are only " << runData->GetNoOfHistos() << " histo sets!?!?";

View File

@ -307,13 +307,20 @@ Bool_t PRunSingleHisto::PrepareData()
} }
// check if post pile up data shall be used // check if post pile up data shall be used
UInt_t histoNo; if (fRunInfo->GetForwardHistoNo() <= 0) {
histoNo = fRunInfo->GetForwardHistoNo()-1;
if ((runData->GetNoOfHistos() < histoNo) || (histoNo < 0)) {
cerr << endl << "PRunSingleHisto::PrepareData(): **PANIC ERROR**:"; cerr << endl << "PRunSingleHisto::PrepareData(): **PANIC ERROR**:";
cerr << endl << " histoNo found = " << histoNo << ", but there are only " << runData->GetNoOfHistos() << " runs!?!?"; cerr << endl << " histoNo found = " << fRunInfo->GetForwardHistoNo() << ". Only histoNo > 0 are allowed.";
cerr << endl << " Will quite :-("; cerr << endl << " Will quit :-(";
cerr << endl;
return false;
}
UInt_t histoNo = fRunInfo->GetForwardHistoNo()-1;
if (runData->GetNoOfHistos() <= histoNo) {
cerr << endl << "PRunSingleHisto::PrepareData(): **PANIC ERROR**:";
cerr << endl << " histoNo found = " << histoNo+1 << ", but there are only " << runData->GetNoOfHistos() << " runs!?!?";
cerr << endl << " Will quit :-(";
cerr << endl; cerr << endl;
return false; return false;
} }