diff --git a/src/classes/PMsrHandler.cpp b/src/classes/PMsrHandler.cpp index d9761206..c8a3d9a5 100644 --- a/src/classes/PMsrHandler.cpp +++ b/src/classes/PMsrHandler.cpp @@ -638,7 +638,7 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages) } else if (sstr.BeginsWith("backgr.fix")) { fout.width(15); fout << left << "backgr.fix"; - for (UInt_t j=0; j fRuns[runNo].fT0.size())) { // error - cerr << endl << "PMsrHandler::SetMsrT0Entry: **ERROR** idx = " << idx << ", is out of valid range 0.." << fRuns[runNo].fT0.size(); + if ((idx < 0) || (idx > fRuns[runNo].GetT0Size())) { // error + cerr << endl << "PMsrHandler::SetMsrT0Entry: **ERROR** idx = " << idx << ", is out of valid range 0.." << fRuns[runNo].GetT0Size(); cerr << endl; return; } - fRuns[runNo].fT0[idx] = bin; + fRuns[runNo].SetT0(bin, idx); } //-------------------------------------------------------------------------- @@ -1114,8 +1114,8 @@ void PMsrHandler::SetMsrDataRangeEntry(UInt_t runNo, UInt_t idx, Int_t bin) return; } - if ((idx < 0) || (idx > fRuns[runNo].GetDataRanges().size())) { // error - cerr << endl << "PMsrHandler::SetMsrDataRangeEntry: **ERROR** idx = " << idx << ", is out of valid range 0.." << fRuns[runNo].GetDataRanges().size(); + if ((idx < 0) || (idx > fRuns[runNo].GetDataRangeSize())) { // error + cerr << endl << "PMsrHandler::SetMsrDataRangeEntry: **ERROR** idx = " << idx << ", is out of valid range 0.." << fRuns[runNo].GetDataRangeSize(); cerr << endl; return; } @@ -1141,8 +1141,8 @@ void PMsrHandler::SetMsrBkgRangeEntry(UInt_t runNo, UInt_t idx, Int_t bin) return; } - if ((idx < 0) || (idx > fRuns[runNo].GetBkgRanges().size())) { // error - cerr << endl << "PMsrHandler::SetMsrBkgRangeEntry: idx = " << idx << ", is out of valid range 0.." << fRuns[runNo].GetBkgRanges().size(); + if ((idx < 0) || (idx > fRuns[runNo].GetBkgRangeSize())) { // error + cerr << endl << "PMsrHandler::SetMsrBkgRangeEntry: idx = " << idx << ", is out of valid range 0.." << fRuns[runNo].GetBkgRangeSize(); cerr << endl; return; } @@ -1727,7 +1727,7 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines) ostr = dynamic_cast(tokens->At(i)); str = ostr->GetString(); if (str.IsDigit()) - param.fT0.push_back(str.Atoi()); + param.AppendT0(str.Atoi()); else error = true; } @@ -1743,7 +1743,7 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines) ostr = dynamic_cast(tokens->At(i)); str = ostr->GetString(); if (str.IsFloat()) - param.fFitRange[i-1] = str.Atof(); + param.SetFitRange(str.Atof(), i-1); else error = true; } @@ -1899,9 +1899,9 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines) Bool_t found; if (fRuns[i].GetBkgFitParamNo() >= 0) { // check if backgr.fit is given found = true; - } else if (fRuns[i].GetBkgsFix().size() > 0) { // check if backgr.fix is given + } else if (fRuns[i].GetBkgFixSize() > 0) { // check if backgr.fix is given found = true; - } else if (fRuns[i].GetBkgRanges().size() > 0) { // check if background window is given + } else if (fRuns[i].GetBkgRangeSize() > 0) { // check if background window is given found = true; } else { found = false; diff --git a/src/classes/PMusr.cpp b/src/classes/PMusr.cpp index c6b43364..5fbfff59 100644 --- a/src/classes/PMusr.cpp +++ b/src/classes/PMusr.cpp @@ -810,3 +810,67 @@ void PMsrRunBlock::SetDataRange(Int_t ival, UInt_t idx) fDataRange[idx] = ival; } + +//-------------------------------------------------------------------------- +// GetT0 +//-------------------------------------------------------------------------- +/** + *

get T0 value at position i + * + * \param i index of the T0 value to be returned + */ +Int_t PMsrRunBlock::GetT0(UInt_t i) +{ + if (i>fT0.size()) + return -1; + + return fT0[i]; +} + +//-------------------------------------------------------------------------- +// SetT0 +//-------------------------------------------------------------------------- +/** + *

set T0 value at position i + * + * \param i index of the T0 value to be set + */ +void PMsrRunBlock::SetT0(Int_t ival, UInt_t idx) +{ + if (idx>fT0.size()) + fT0.resize(idx+1); + + fT0[idx] = ival; +} + +//-------------------------------------------------------------------------- +// GetFitRange +//-------------------------------------------------------------------------- +/** + *

get fit range value at position i + * + * \param i index of the fit range value to be returned + */ +Double_t PMsrRunBlock::GetFitRange(UInt_t i) +{ + if (i>2) + return PMUSR_UNDEFINED; + + return fFitRange[i]; +} + +//-------------------------------------------------------------------------- +// SetFitRange +//-------------------------------------------------------------------------- +/** + *

set fit range value at position i + * + * \param i index of the fit range value to be set + */ +void PMsrRunBlock::SetFitRange(Double_t dval, UInt_t idx) +{ + if (idx>=2) + return; + + fFitRange[idx] = dval; +} diff --git a/src/classes/PMusrCanvas.cpp b/src/classes/PMusrCanvas.cpp index 9c66f3a5..5a81de98 100644 --- a/src/classes/PMusrCanvas.cpp +++ b/src/classes/PMusrCanvas.cpp @@ -529,7 +529,7 @@ void PMusrCanvas::UpdateInfoPad() for (UInt_t i=0; i 1) + if (runs[runNo].GetRunNameSize() > 1) tstr = "++" + *runs[runNo].GetRunName() + TString(","); // run_name else tstr = *runs[runNo].GetRunName() + TString(","); // run_name @@ -1402,11 +1402,11 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data) // check if 'use_fit_range' plotting is whished if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fUseFitRanges) { - start = fMsrHandler->GetMsrRunList()->at(runNo).fFitRange[0]; // needed to estimate size - end = fMsrHandler->GetMsrRunList()->at(runNo).fFitRange[1]; // needed to estimate size + start = fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(0); // needed to estimate size + end = fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(1); // needed to estimate size size = (Int_t) ((end - start) / data->GetDataTimeStep()) + 1; start = data->GetDataTimeStart() + - (Int_t)((fMsrHandler->GetMsrRunList()->at(runNo).fFitRange[0] - data->GetDataTimeStart())/data->GetDataTimeStep()) * data->GetDataTimeStep() - + (Int_t)((fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(0) - data->GetDataTimeStart())/data->GetDataTimeStep()) * data->GetDataTimeStep() - data->GetDataTimeStep()/2.0; // closesd start value compatible with the user given end = start + size * data->GetDataTimeStep(); // closesd end value compatible with the user given } @@ -1434,8 +1434,8 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data) // check if 'use_fit_range' plotting is whished if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fUseFitRanges) { - startBin = (UInt_t)((fMsrHandler->GetMsrRunList()->at(runNo).fFitRange[0] - data->GetDataTimeStart())/data->GetDataTimeStep()); - endBin = (UInt_t)((fMsrHandler->GetMsrRunList()->at(runNo).fFitRange[1] - data->GetDataTimeStart())/data->GetDataTimeStep()); + startBin = (UInt_t)((fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(0) - data->GetDataTimeStart())/data->GetDataTimeStep()); + endBin = (UInt_t)((fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(1) - data->GetDataTimeStart())/data->GetDataTimeStep()); } // check if 'sub_ranges' plotting is whished @@ -1482,11 +1482,11 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data) // check if 'use_fit_range' plotting is whished if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fUseFitRanges) { - start = fMsrHandler->GetMsrRunList()->at(runNo).fFitRange[0]; // needed to estimate size - end = fMsrHandler->GetMsrRunList()->at(runNo).fFitRange[1]; // needed to estimate size + start = fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(0); // needed to estimate size + end = fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(1); // needed to estimate size size = (Int_t) ((end - start) / data->GetTheoryTimeStep()) + 1; start = data->GetTheoryTimeStart() + - (Int_t)((fMsrHandler->GetMsrRunList()->at(runNo).fFitRange[0] - data->GetTheoryTimeStart())/data->GetTheoryTimeStep()) * data->GetTheoryTimeStep() - + (Int_t)((fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(0) - data->GetTheoryTimeStart())/data->GetTheoryTimeStep()) * data->GetTheoryTimeStep() - data->GetTheoryTimeStep()/2.0; // closesd start value compatible with the user given end = start + size * data->GetTheoryTimeStep(); // closesd end value compatible with the user given } @@ -1513,8 +1513,8 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data) // check if 'use_fit_range' plotting is whished if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fUseFitRanges) { - startBin = (UInt_t)((fMsrHandler->GetMsrRunList()->at(runNo).fFitRange[0] - data->GetDataTimeStart())/data->GetTheoryTimeStep()); - endBin = (UInt_t)((fMsrHandler->GetMsrRunList()->at(runNo).fFitRange[1] - data->GetDataTimeStart())/data->GetTheoryTimeStep()); + startBin = (UInt_t)((fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(0) - data->GetDataTimeStart())/data->GetTheoryTimeStep()); + endBin = (UInt_t)((fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(1) - data->GetDataTimeStart())/data->GetTheoryTimeStep()); } //cout << endl << ">> PMusrCanvas::HandleDataSet(): theory: startBin = " << startBin << ", endBin = " << endBin << endl; diff --git a/src/classes/PMusrT0.cpp b/src/classes/PMusrT0.cpp index 57c5603f..8a8a05e5 100644 --- a/src/classes/PMusrT0.cpp +++ b/src/classes/PMusrT0.cpp @@ -325,10 +325,10 @@ void PMusrT0::InitDataAndBkg() Int_t t0Bin = 0; switch (fDetectorTag) { case DETECTOR_TAG_FORWARD: - t0Bin = fMsrHandler->GetMsrRunList()->at(fRunNo).fT0[0 + fAddRunNo * fAddRunOffset/2]; + t0Bin = fMsrHandler->GetMsrRunList()->at(fRunNo).GetT0(0 + fAddRunNo * fAddRunOffset/2); break; case DETECTOR_TAG_BACKWARD: - t0Bin = fMsrHandler->GetMsrRunList()->at(fRunNo).fT0[1 + fAddRunNo * fAddRunOffset/2]; + t0Bin = fMsrHandler->GetMsrRunList()->at(fRunNo).GetT0(1 + fAddRunNo * fAddRunOffset/2); break; case DETECTOR_TAG_RIGHT: // not clear yet what to be done diff --git a/src/classes/PRunAsymmetry.cpp b/src/classes/PRunAsymmetry.cpp index a4c74ccf..5ed81a73 100644 --- a/src/classes/PRunAsymmetry.cpp +++ b/src/classes/PRunAsymmetry.cpp @@ -294,13 +294,13 @@ Bool_t PRunAsymmetry::PrepareData() fTimeResolution = runData->GetTimeResolution()/1.0e3; // keep start/stop time for fit - fFitStartTime = fRunInfo->fFitRange[0]; - fFitStopTime = fRunInfo->fFitRange[1]; + fFitStartTime = fRunInfo->GetFitRange(0); + fFitStopTime = fRunInfo->GetFitRange(1); //cout << endl << "start/stop (fit): " << fFitStartTime << ", " << fFitStopTime << endl; // check if the t0's are given in the msr-file - if (fRunInfo->fT0.size() == 0) { // t0's are NOT in the msr-file + if (fRunInfo->GetT0Size() == 0) { // t0's are NOT in the msr-file // check if the t0's are in the data file if (runData->GetT0s().size() != 0) { // t0's in the run data // keep the proper t0's. For asymmetry runs, forward/backward are holding the histo no @@ -316,23 +316,23 @@ Bool_t PRunAsymmetry::PrepareData() // check if t0's are given in the data file if (runData->GetT0s().size() != 0) { // compare t0's of the msr-file with the one in the data file - if (fabs(fRunInfo->fT0[0]-runData->GetT0(fRunInfo->GetForwardHistoNo()-1))>5.0) { // given in bins!! + if (fabs(fRunInfo->GetT0(0)-runData->GetT0(fRunInfo->GetForwardHistoNo()-1))>5.0) { // given in bins!! cerr << endl << "PRunAsymmetry::PrepareData(): **WARNING**: forward histo"; - cerr << endl << " t0 from the msr-file is " << fRunInfo->fT0[0]; + cerr << endl << " t0 from the msr-file is " << fRunInfo->GetT0(0); cerr << endl << " t0 from the data file is " << runData->GetT0(fRunInfo->GetForwardHistoNo()-1); cerr << endl << " This is quite a deviation! Is this done intentionally??"; cerr << endl; } - if (fabs(fRunInfo->fT0[1]-runData->GetT0(fRunInfo->GetBackwardHistoNo()-1))>5.0) { // given in bins!! + if (fabs(fRunInfo->GetT0(1)-runData->GetT0(fRunInfo->GetBackwardHistoNo()-1))>5.0) { // given in bins!! cerr << endl << "PRunAsymmetry::PrepareData(): **WARNING**: backward histo"; - cerr << endl << " t0 from the msr-file is " << fRunInfo->fT0[1]; + cerr << endl << " t0 from the msr-file is " << fRunInfo->GetT0(1); cerr << endl << " t0 from the data file is " << runData->GetT0(fRunInfo->GetBackwardHistoNo()-1); cerr << endl << " This is quite a deviation! Is this done intentionally??"; cerr << endl; } } - fT0s.push_back(fRunInfo->fT0[0]); // forward t0 - fT0s.push_back(fRunInfo->fT0[1]); // backward t0 + fT0s.push_back(fRunInfo->GetT0(0)); // forward t0 + fT0s.push_back(fRunInfo->GetT0(1)); // backward t0 } // check if post pile up data shall be used @@ -358,9 +358,9 @@ Bool_t PRunAsymmetry::PrepareData() // check if addrun's are present, and if yes add data // check if there are runs to be added to the current one - if (fRunInfo->GetRunNames().size() > 1) { // runs to be added present + if (fRunInfo->GetRunNameSize() > 1) { // runs to be added present PRawRunData *addRunData; - for (UInt_t i=1; iGetRunNames().size(); i++) { + for (UInt_t i=1; iGetRunNameSize(); i++) { // get run to be added to the main one addRunData = fRawData->GetRunData(*(fRunInfo->GetRunName(i))); if (addRunData == 0) { // couldn't get run @@ -372,7 +372,7 @@ Bool_t PRunAsymmetry::PrepareData() // get T0's of the to be added run Int_t t0Add[2] = {0, 0}; // check if the t0's are given in the msr-file - if (2*i+1 >= fRunInfo->fT0.size()) { // t0's are NOT in the msr-file + if (2*i+1 >= fRunInfo->GetT0Size()) { // t0's are NOT in the msr-file // check if the t0's are in the data file if (addRunData->GetT0s().size() != 0) { // t0's in the run data // keep the proper t0's. For asymmetry runs, forward/backward are holding the histo no @@ -386,23 +386,23 @@ Bool_t PRunAsymmetry::PrepareData() } } else { // t0's in the msr-file // check if t0's are given in the data file - if (2*i+1 < fRunInfo->fT0.size()) { - t0Add[0] = fRunInfo->fT0[2*i]; - t0Add[1] = fRunInfo->fT0[2*i+1]; + if (2*i+1 < fRunInfo->GetT0Size()) { + t0Add[0] = fRunInfo->GetT0(2*i); + t0Add[1] = fRunInfo->GetT0(2*i+1); } else { cerr << endl << "PRunAsymmetry::PrepareData(): **WARNING** NO t0's found, neither in the addrun data ("; cerr << fRunInfo->GetRunName(i)->Data(); cerr << "), nor in the msr-file! Will try to use the T0 of the run data ("; cerr << fRunInfo->GetRunName(i)->Data(); cerr << ") without any warranty!"; - t0Add[0] = fRunInfo->fT0[0]; - t0Add[1] = fRunInfo->fT0[1]; + t0Add[0] = fRunInfo->GetT0(0); + t0Add[1] = fRunInfo->GetT0(1); } if (addRunData->GetT0s().size() != 0) { // compare t0's of the msr-file with the one in the data file if (fabs(t0Add[0]-addRunData->GetT0(fRunInfo->GetForwardHistoNo()-1))>5.0) { // given in bins!! cerr << endl << "PRunAsymmetry::PrepareData(): **WARNING**: forward histo"; - cerr << endl << " t0 from the msr-file is " << fRunInfo->fT0[2*i]; + cerr << endl << " t0 from the msr-file is " << fRunInfo->GetT0(2*i); cerr << endl << " t0 from the data file is " << addRunData->GetT0(fRunInfo->GetForwardHistoNo()-1); cerr << endl << " This is quite a deviation! Is this done intentionally??"; cerr << endl << " addrun: " << fRunInfo->GetRunName(i)->Data(); @@ -410,7 +410,7 @@ Bool_t PRunAsymmetry::PrepareData() } if (fabs(t0Add[1]-addRunData->GetT0(fRunInfo->GetBackwardHistoNo()-1))>5.0) { // given in bins!! cerr << endl << "PRunAsymmetry::PrepareData(): **WARNING**: backward histo"; - cerr << endl << " t0 from the msr-file is " << fRunInfo->fT0[2*i+1]; + cerr << endl << " t0 from the msr-file is " << fRunInfo->GetT0(2*i+1); cerr << endl << " t0 from the data file is " << addRunData->GetT0(fRunInfo->GetBackwardHistoNo()-1); cerr << endl << " This is quite a deviation! Is this done intentionally??"; cerr << endl << " addrun: " << fRunInfo->GetRunName(i)->Data(); @@ -440,8 +440,8 @@ Bool_t PRunAsymmetry::PrepareData() } // subtract background from histogramms ------------------------------------------ - if (fRunInfo->GetBkgsFix().size() == 0) { // no fixed background given - if (fRunInfo->GetBkgRanges().size() != 0) { + if (fRunInfo->GetBkgFixSize() == 0) { // no fixed background given + if (fRunInfo->GetBkgRangeSize() != 0) { if (!SubtractEstimatedBkg()) return false; } else { // no background given to do the job diff --git a/src/classes/PRunDataHandler.cpp b/src/classes/PRunDataHandler.cpp index f4084b79..916a6e6b 100644 --- a/src/classes/PRunDataHandler.cpp +++ b/src/classes/PRunDataHandler.cpp @@ -144,7 +144,7 @@ Bool_t PRunDataHandler::ReadFile() } for (UInt_t i=0; isize(); i++) { - for (UInt_t j=0; jat(i).GetRunNames().size(); j++) { + for (UInt_t j=0; jat(i).GetRunNameSize(); j++) { fRunName = *(runList->at(i).GetRunName(j)); // check is file is already read if (FileAlreadyRead(*(runList->at(i).GetRunName(j)))) diff --git a/src/classes/PRunNonMusr.cpp b/src/classes/PRunNonMusr.cpp index 575137e6..acad7aea 100644 --- a/src/classes/PRunNonMusr.cpp +++ b/src/classes/PRunNonMusr.cpp @@ -158,7 +158,7 @@ Bool_t PRunNonMusr::PrepareData() //cout << endl << "in PRunNonMusr::PrepareData(): will feed fFitData"; - if (fRunInfo->GetRunNames().size() > 1) { // ADDRUN present which is not supported for NonMusr + if (fRunInfo->GetRunNameSize() > 1) { // ADDRUN present which is not supported for NonMusr cerr << endl << ">> PRunNonMusr::PrepareData(): **WARNING** ADDRUN NOT SUPPORTED FOR THIS FIT TYPE, WILL IGNORE IT." << endl; } @@ -184,8 +184,8 @@ Bool_t PRunNonMusr::PrepareFitData() Bool_t success = true; // keep start/stop time for fit: here the meaning is of course start x, stop x - fFitStartTime = fRunInfo->fFitRange[0]; - fFitStopTime = fRunInfo->fFitRange[1]; + fFitStartTime = fRunInfo->GetFitRange(0); + fFitStopTime = fRunInfo->GetFitRange(1); // get x-, y-index UInt_t xIndex = GetXIndex(); diff --git a/src/classes/PRunSingleHisto.cpp b/src/classes/PRunSingleHisto.cpp index 4fc4b926..1ecccd17 100644 --- a/src/classes/PRunSingleHisto.cpp +++ b/src/classes/PRunSingleHisto.cpp @@ -120,7 +120,7 @@ Double_t PRunSingleHisto::CalcChiSquare(const std::vector& par) // get background Double_t bkg; if (fRunInfo->GetBkgFitParamNo() == -1) { // bkg not fitted - if (fRunInfo->GetBkgsFix().size() == 0) { // no fixed background given (background interval) + if (fRunInfo->GetBkgFixSize() == 0) { // no fixed background given (background interval) bkg = fBackground; } else { // fixed bkg given bkg = fRunInfo->GetBkgFix(0); @@ -184,7 +184,7 @@ Double_t PRunSingleHisto::CalcMaxLikelihood(const std::vector& par) // get background Double_t bkg; if (fRunInfo->GetBkgFitParamNo() == -1) { // bkg not fitted - if (fRunInfo->GetBkgsFix().size() == 0) { // no fixed background given (background interval) + if (fRunInfo->GetBkgFixSize() == 0) { // no fixed background given (background interval) bkg = fBackground; } else { // fixed bkg given bkg = fRunInfo->GetBkgFix(0); @@ -258,7 +258,7 @@ void PRunSingleHisto::CalcTheory() // get background Double_t bkg; if (fRunInfo->GetBkgFitParamNo() == -1) { // bkg not fitted - if (fRunInfo->GetBkgsFix().size() == 0) { // no fixed background given (background interval) + if (fRunInfo->GetBkgFixSize() == 0) { // no fixed background given (background interval) bkg = fBackground; } else { // fixed bkg given bkg = fRunInfo->GetBkgFix(0); @@ -319,7 +319,7 @@ Bool_t PRunSingleHisto::PrepareData() } // check if the t0's are given in the msr-file - if (fRunInfo->fT0.size() == 0) { // t0's are NOT in the msr-file + if (fRunInfo->GetT0Size() == 0) { // t0's are NOT in the msr-file // check if the t0's are in the data file if (runData->GetT0s().size() != 0) { // t0's in the run data // keep the proper t0's. For single histo runs, forward is holding the histo no @@ -335,15 +335,15 @@ Bool_t PRunSingleHisto::PrepareData() // check if t0's are given in the data file if (runData->GetT0s().size() != 0) { // compare t0's of the msr-file with the one in the data file - if (fabs(fRunInfo->fT0[0]-runData->GetT0(fRunInfo->GetForwardHistoNo()-1))>5.0) { // given in bins!! + if (fabs(fRunInfo->GetT0(0)-runData->GetT0(fRunInfo->GetForwardHistoNo()-1))>5.0) { // given in bins!! cerr << endl << "PRunSingleHisto::PrepareData(): **WARNING**:"; - cerr << endl << " t0 from the msr-file is " << fRunInfo->fT0[0]; + cerr << endl << " t0 from the msr-file is " << fRunInfo->GetT0(0); cerr << endl << " t0 from the data file is " << runData->GetT0(fRunInfo->GetForwardHistoNo()-1); cerr << endl << " This is quite a deviation! Is this done intentionally??"; cerr << endl; } } - fT0s.push_back(fRunInfo->fT0[0]); + fT0s.push_back(fRunInfo->GetT0(0)); } // check if t0 is within proper bounds @@ -355,9 +355,9 @@ Bool_t PRunSingleHisto::PrepareData() } // check if there are runs to be added to the current one - if (fRunInfo->GetRunNames().size() > 1) { // runs to be added present + if (fRunInfo->GetRunNameSize() > 1) { // runs to be added present PRawRunData *addRunData; - for (UInt_t i=1; iGetRunNames().size(); i++) { + for (UInt_t i=1; iGetRunNameSize(); i++) { // get run to be added to the main one addRunData = fRawData->GetRunData(*fRunInfo->GetRunName(i)); @@ -370,7 +370,7 @@ Bool_t PRunSingleHisto::PrepareData() // get T0's of the to be added run Int_t t0Add; // check if the t0's are given in the msr-file - if (i >= fRunInfo->fT0.size()) { // t0's are NOT in the msr-file + if (i >= fRunInfo->GetT0Size()) { // t0's are NOT in the msr-file // check if the t0's are in the data file if (addRunData->GetT0s().size() != 0) { // t0's in the run data // keep the proper t0's. For single histo runs, forward is holding the histo no @@ -386,17 +386,17 @@ Bool_t PRunSingleHisto::PrepareData() // check if t0's are given in the data file if (addRunData->GetT0s().size() != 0) { // compare t0's of the msr-file with the one in the data file - if (fabs(fRunInfo->fT0[i]-addRunData->GetT0(fRunInfo->GetForwardHistoNo()-1))>5.0) { // given in bins!! + if (fabs(fRunInfo->GetT0(i)-addRunData->GetT0(fRunInfo->GetForwardHistoNo()-1))>5.0) { // given in bins!! cerr << endl << "PRunSingleHisto::PrepareData(): **WARNING**:"; - cerr << endl << " t0 from the msr-file is " << fRunInfo->fT0[i]; + cerr << endl << " t0 from the msr-file is " << fRunInfo->GetT0(i); cerr << endl << " t0 from the data file is " << addRunData->GetT0(fRunInfo->GetForwardHistoNo()-1); cerr << endl << " This is quite a deviation! Is this done intentionally??"; cerr << endl << " addrun: " << fRunInfo->GetRunName(i)->Data(); cerr << endl; } } - if (i < fRunInfo->fT0.size()) { - t0Add = fRunInfo->fT0[i]; + if (i < fRunInfo->GetT0Size()) { + t0Add = fRunInfo->GetT0(i); } else { cerr << endl << "PRunSingleHisto::PrepareData(): **WARNING** NO t0's found, neither in the addrun data ("; cerr << fRunInfo->GetRunName(i)->Data(); @@ -404,7 +404,7 @@ Bool_t PRunSingleHisto::PrepareData() cerr << fRunInfo->GetRunName(i)->Data(); cerr << ") without any warranty!"; cerr << endl; - t0Add = fRunInfo->fT0[0]; + t0Add = fRunInfo->GetT0(0); } } @@ -443,8 +443,8 @@ Bool_t PRunSingleHisto::PrepareData() Bool_t PRunSingleHisto::PrepareFitData(PRawRunData* runData, const UInt_t histoNo) { // keep start/stop time for fit - fFitStartTime = fRunInfo->fFitRange[0]; - fFitStopTime = fRunInfo->fFitRange[1]; + fFitStartTime = fRunInfo->GetFitRange(0); + fFitStopTime = fRunInfo->GetFitRange(1); //cout << endl << "start/stop (fit): " << fFitStartTime << ", " << fFitStopTime; // transform raw histo data. This is done the following way (for details see the manual): @@ -478,8 +478,8 @@ Bool_t PRunSingleHisto::PrepareFitData(PRawRunData* runData, const UInt_t histoN // check how the background shall be handled if (fRunInfo->GetBkgFitParamNo() == -1) { // bkg shall **NOT** be fitted // subtract background from histogramms ------------------------------------------ - if (fRunInfo->GetBkgsFix().size() == 0) { // no fixed background given - if (fRunInfo->GetBkgRanges().size() != 0) { + if (fRunInfo->GetBkgFixSize() == 0) { // no fixed background given + if (fRunInfo->GetBkgRangeSize() != 0) { if (!EstimateBkg(histoNo)) return false; } else { // no background given to do the job @@ -651,7 +651,7 @@ cout << endl << ">> data start time = " << fData.GetDataTimeStart(); // get background Double_t bkg; if (fRunInfo->GetBkgFitParamNo() == -1) { // bkg not fitted - if (fRunInfo->GetBkgsFix().size() == 0) { // no fixed background given (background interval) + if (fRunInfo->GetBkgFixSize() == 0) { // no fixed background given (background interval) if (!EstimateBkg(histoNo)) return false; bkg = fBackground; @@ -776,7 +776,7 @@ Bool_t PRunSingleHisto::PrepareViewData(PRawRunData* runData, const UInt_t histo // get background Double_t bkg; if (fRunInfo->GetBkgFitParamNo() == -1) { // bkg not fitted - if (fRunInfo->GetBkgsFix().size() == 0) { // no fixed background given (background interval) + if (fRunInfo->GetBkgFixSize() == 0) { // no fixed background given (background interval) if (!EstimateBkg(histoNo)) return false; bkg = fBackground; diff --git a/src/include/PMusr.h b/src/include/PMusr.h index 61edf2dc..f6797e36 100644 --- a/src/include/PMusr.h +++ b/src/include/PMusr.h @@ -363,13 +363,13 @@ class PMsrRunBlock { virtual ~PMsrRunBlock(); virtual void CleanUp(); - virtual PStringVector GetRunNames() { return fRunName; } + virtual UInt_t GetRunNameSize() { return fRunName.size(); } virtual TString *GetRunName(UInt_t i=0); - virtual PStringVector GetBeamlines() { return fBeamline; } + virtual UInt_t GetBeamlineSize() { return fBeamline.size(); } virtual TString *GetBeamline(UInt_t i=0); - virtual PStringVector GetInstitutes() { return fInstitute; } + virtual UInt_t GetInstituteSize() { return fInstitute.size(); } virtual TString *GetInstitute(UInt_t i=0); - virtual PStringVector GetFileFormats() { return fFileFormat; } + virtual UInt_t GetFileFormatSize() { return fFileFormat.size(); } virtual TString *GetFileFormat(UInt_t i=0); virtual Int_t GetFitType() { return fFitType; } virtual Int_t GetAlphaParamNo() { return fAlphaParamNo; } @@ -383,15 +383,15 @@ class PMsrRunBlock { virtual Int_t GetMap(UInt_t idx); virtual Int_t GetForwardHistoNo() { return fForwardHistoNo; } virtual Int_t GetBackwardHistoNo() { return fBackwardHistoNo; } - virtual PDoubleVector GetBkgsFix() { return fBkgFix; } + virtual UInt_t GetBkgFixSize() { return fBkgFix.size(); } virtual Double_t GetBkgFix(UInt_t i=0); - virtual PIntVector GetBkgRanges() { return fBkgRange; } + virtual UInt_t GetBkgRangeSize() { return fBkgRange.size(); } virtual Int_t GetBkgRange(UInt_t i=0); - virtual PIntVector GetDataRanges() { return fDataRange; } + virtual UInt_t GetDataRangeSize() { return fDataRange.size(); } virtual Int_t GetDataRange(UInt_t i=0); -// virtual Int_t GetT0(UInt_t i=0); -// virtual Double_t GetFitRangeFirst() { return fFitRange[0]; } -// virtual Double_t GetFitRangeLast() { return fFitRange[1]; } + virtual UInt_t GetT0Size() { return fT0.size(); } + virtual Int_t GetT0(UInt_t i=0); + virtual Double_t GetFitRange(UInt_t i); // virtual Int_t GetPacking() { return fPacking; } // virtual Double_t GetRRFFreq() { return fRRFFreq; } // virtual Int_t GetAlpha2ParamNo() { return fAlpha2ParamNo; } @@ -429,10 +429,9 @@ class PMsrRunBlock { virtual void SetBkgRange(Int_t ival, UInt_t idx); virtual void AppendDataRange(Int_t ival) { fDataRange.push_back(ival); } virtual void SetDataRange(Int_t ival, UInt_t idx); -// virtual void AppendT0(Int_t ival) { fT0.push_back(ival); } -// virtual void SetT0(Int_t ival, UInt_t idx); -// virtual void SetFitRangeFirst(Double_t dval) { fFitRange[0] = dval; } -// virtual void SetFitRangeLast(Double_t dval) { fFitRange[1] = dval; } + virtual void AppendT0(Int_t ival) { fT0.push_back(ival); } + virtual void SetT0(Int_t ival, UInt_t idx); + virtual void SetFitRange(Double_t dval, UInt_t idx); // virtual void SetPacking(Int_t ival) { fPacking = ival; } // virtual void SetRRFFreq(Double_t dval) { fRRFFreq = dval; } // virtual void SetAlpha2ParamNo(Int_t ival) { fAlpha2ParamNo = ival; } @@ -444,8 +443,6 @@ class PMsrRunBlock { // virtual void SetXDataLabel(TString& str) { fXYDataLabel[0] = str; } // virtual void SetYDataLabel(TString& str) { fXYDataLabel[1] = str; } - PIntVector fT0; ///< t0 bins (fit type 0, 2, 4). if fit type 0 -> f0, f1, f2, ...; if fit type 2, 4 -> f0, b0, f1, b1, ... - Double_t fFitRange[2]; ///< fit range in (us) Int_t fPacking; ///< packing/rebinning Double_t fRRFFreq; ///< rotating reference frequency (fit type 4) Int_t fRRFPacking; ///< rotating reference packing (fit type 4) @@ -475,8 +472,17 @@ class PMsrRunBlock { PDoubleVector fBkgFix; ///< fixed background in (1/ns) (fit type 0, 2, 4) PIntVector fBkgRange; ///< background bin range (fit type 0, 2, 4) PIntVector fDataRange; ///< data bin range (fit type 0, 2, 4) -// PIntVector fT0; ///< t0 bins (fit type 0, 2, 4). if fit type 0 -> f0, f1, f2, ...; if fit type 2, 4 -> f0, b0, f1, b1, ... -// PDoublePair fFitRange; ///< fit range in (us) + PIntVector fT0; ///< t0 bins (fit type 0, 2, 4). if fit type 0 -> f0, f1, f2, ...; if fit type 2, 4 -> f0, b0, f1, b1, ... + Double_t fFitRange[2]; ///< fit range in (us) +// Int_t fPacking; ///< packing/rebinning +// Double_t fRRFFreq; ///< rotating reference frequency (fit type 4) +// Int_t fRRFPacking; ///< rotating reference packing (fit type 4) +// Int_t fAlpha2ParamNo; ///< rotating reference alpha2 (fit type 4) +// Int_t fBeta2ParamNo; ///< rotating reference beta2 (fit type 4) +// Int_t fRightHistoNo; ///< rotating reference right histogram number (fit type 4) +// Int_t fLeftHistoNo; ///< rotating reference left histogram number (fit type 4) +// Int_t fXYDataIndex[2]; ///< used to get the data indices when using db-files (fit type 8) +// TString fXYDataLabel[2]; ///< used to get the indices via labels when using db-files (fit type 8) }; //------------------------------------------------------------- diff --git a/src/musrt0.cpp b/src/musrt0.cpp index bd02f933..e89ea806 100644 --- a/src/musrt0.cpp +++ b/src/musrt0.cpp @@ -245,7 +245,7 @@ int main(int argc, char *argv[]) for (unsigned int i=0; isize(); i++) { switch (runList->at(i).GetFitType()) { case MSR_FITTYPE_SINGLE_HISTO: - for (unsigned int j=0; jat(i).GetRunNames().size(); j++) { // necessary in case of ADDRUN + for (unsigned int j=0; jat(i).GetRunNameSize(); j++) { // necessary in case of ADDRUN if (!musrt0_item(app, msrHandler, dataHandler->GetRunData(*(runList->at(i).GetRunName(j))), i, runList->at(i).GetForwardHistoNo(), 0, j)) { musrt0_cleanup(saxParser, startupHandler, msrHandler, dataHandler); exit(0); @@ -253,7 +253,7 @@ int main(int argc, char *argv[]) } break; case MSR_FITTYPE_ASYM: - for (unsigned int j=0; jat(i).GetRunNames().size(); j++) { // necessary in case of ADDRUN + for (unsigned int j=0; jat(i).GetRunNameSize(); j++) { // necessary in case of ADDRUN if (!musrt0_item(app, msrHandler, dataHandler->GetRunData(*(runList->at(i).GetRunName(j))), i, runList->at(i).GetForwardHistoNo(), 0, j)) { musrt0_cleanup(saxParser, startupHandler, msrHandler, dataHandler); exit(0); @@ -265,7 +265,7 @@ int main(int argc, char *argv[]) } break; case MSR_FITTYPE_ASYM_RRF: - for (unsigned int j=0; jat(i).GetRunNames().size(); j++) { // necessary in case of ADDRUN + for (unsigned int j=0; jat(i).GetRunNameSize(); j++) { // necessary in case of ADDRUN if (!musrt0_item(app, msrHandler, dataHandler->GetRunData(*(runList->at(i).GetRunName(j))), i, runList->at(i).GetForwardHistoNo(), 0, j)) { musrt0_cleanup(saxParser, startupHandler, msrHandler, dataHandler); exit(0);