some more work towards a full encapsulation

This commit is contained in:
nemu
2009-11-04 21:09:54 +00:00
parent e6f62ff445
commit 208e6b97c2
10 changed files with 168 additions and 98 deletions

View File

@ -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].GetBkgsFix().size(); j++) {
for (UInt_t j=0; j<fRuns[runNo].GetBkgFixSize(); j++) {
fout.precision(prec);
fout.width(12);
fout << left << fRuns[runNo].GetBkgFix(j);
@ -647,7 +647,7 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages)
} else if (sstr.BeginsWith("background")) {
fout.width(16);
fout << left << "background";
for (UInt_t j=0; j<fRuns[runNo].GetBkgRanges().size(); j++) {
for (UInt_t j=0; j<fRuns[runNo].GetBkgRangeSize(); j++) {
fout.width(8);
fout << left << fRuns[runNo].GetBkgRange(j);
}
@ -655,7 +655,7 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages)
} else if (sstr.BeginsWith("data")) {
fout.width(16);
fout << left << "data";
for (UInt_t j=0; j<fRuns[runNo].GetDataRanges().size(); j++) {
for (UInt_t j=0; j<fRuns[runNo].GetDataRangeSize(); j++) {
fout.width(8);
fout << left << fRuns[runNo].GetDataRange(j);
}
@ -663,9 +663,9 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages)
} else if (sstr.BeginsWith("t0")) {
fout.width(16);
fout << left << "t0";
for (UInt_t j=0; j<fRuns[runNo].fT0.size(); j++) {
for (UInt_t j=0; j<fRuns[runNo].GetT0Size(); j++) {
fout.width(8);
fout << left << fRuns[runNo].fT0[j];
fout << left << fRuns[runNo].GetT0(j);
}
fout << endl;
} else if (sstr.BeginsWith("xy-data")) {
@ -697,11 +697,11 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages)
fout.width(16);
fout << left << "fit";
for (UInt_t j=0; j<2; j++) {
if (fRuns[runNo].fFitRange[j] == -1)
if (fRuns[runNo].GetFitRange(j) == -1)
break;
fout.width(8);
fout.precision(2);
fout << left << fixed << fRuns[runNo].fFitRange[j];
fout << left << fixed << fRuns[runNo].GetFitRange(j);
}
fout << endl;
} else if (sstr.BeginsWith("packing")) {
@ -1087,13 +1087,13 @@ void PMsrHandler::SetMsrT0Entry(UInt_t runNo, UInt_t idx, Int_t bin)
return;
}
if ((idx < 0) || (idx > 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<TObjString*>(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<TObjString*>(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;

View File

@ -810,3 +810,67 @@ void PMsrRunBlock::SetDataRange(Int_t ival, UInt_t idx)
fDataRange[idx] = ival;
}
//--------------------------------------------------------------------------
// GetT0
//--------------------------------------------------------------------------
/**
* <p> 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
//--------------------------------------------------------------------------
/**
* <p> 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
//--------------------------------------------------------------------------
/**
* <p> 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
//--------------------------------------------------------------------------
/**
* <p> 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;
}

View File

@ -529,7 +529,7 @@ void PMusrCanvas::UpdateInfoPad()
for (UInt_t i=0; i<fData.size(); i++) {
// run label = run_name/histo/T=0K/B=0G/E=0keV/...
runNo = (UInt_t)plotInfo.fRuns[i].Re()-1;
if (runs[runNo].GetRunNames().size() > 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;

View File

@ -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

View File

@ -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; i<fRunInfo->GetRunNames().size(); i++) {
for (UInt_t i=1; i<fRunInfo->GetRunNameSize(); 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

View File

@ -144,7 +144,7 @@ Bool_t PRunDataHandler::ReadFile()
}
for (UInt_t i=0; i<runList->size(); i++) {
for (UInt_t j=0; j<runList->at(i).GetRunNames().size(); j++) {
for (UInt_t j=0; j<runList->at(i).GetRunNameSize(); j++) {
fRunName = *(runList->at(i).GetRunName(j));
// check is file is already read
if (FileAlreadyRead(*(runList->at(i).GetRunName(j))))

View File

@ -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();

View File

@ -120,7 +120,7 @@ Double_t PRunSingleHisto::CalcChiSquare(const std::vector<Double_t>& 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<Double_t>& 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; i<fRunInfo->GetRunNames().size(); i++) {
for (UInt_t i=1; i<fRunInfo->GetRunNameSize(); 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;