modernized code to C++11 and newer.
This allows to analyze the code by external code analyzers. Since a lot is adopted, the version is changed to 1.4.3 Conflicts: src/classes/PFitter.cpp src/classes/PFourier.cpp src/classes/PMsrHandler.cpp src/classes/PMusrCanvas.cpp src/classes/PRunAsymmetry.cpp src/classes/PRunAsymmetryRRF.cpp src/classes/PRunListCollection.cpp src/classes/PRunSingleHisto.cpp src/classes/PRunSingleHistoRRF.cpp src/classes/PStartupHandler.cpp src/include/PFourier.h src/include/PRunListCollection.h src/musrFT.cpp
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2016 by Andreas Suter *
|
||||
* Copyright (C) 2007-2019 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -36,7 +36,6 @@
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
#include <TString.h>
|
||||
#include <TObjArray.h>
|
||||
@@ -86,9 +85,9 @@ PRunMuMinus::PRunMuMinus(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t
|
||||
fPacking = fMsrInfo->GetMsrGlobal()->GetPacking();
|
||||
}
|
||||
if (fPacking == -1) { // this should NOT happen, somethin is severely wrong
|
||||
cerr << endl << ">> PRunMuMinus::PRunMuMinus: **SEVERE ERROR**: Couldn't find any packing information!";
|
||||
cerr << endl << ">> This is very bad :-(, will quit ...";
|
||||
cerr << endl;
|
||||
std::cerr << std::endl << ">> PRunMuMinus::PRunMuMinus: **SEVERE ERROR**: Couldn't find any packing information!";
|
||||
std::cerr << std::endl << ">> This is very bad :-(, will quit ...";
|
||||
std::cerr << std::endl;
|
||||
fValid = false;
|
||||
return;
|
||||
}
|
||||
@@ -102,9 +101,9 @@ PRunMuMinus::PRunMuMinus(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t
|
||||
fEndTimeBin = -1;
|
||||
|
||||
if (!PrepareData()) {
|
||||
cerr << endl << ">> PRunMuMinus::PRunMuMinus: **SEVERE ERROR**: Couldn't prepare data for fitting!";
|
||||
cerr << endl << ">> This is very bad :-(, will quit ...";
|
||||
cerr << endl;
|
||||
std::cerr << std::endl << ">> PRunMuMinus::PRunMuMinus: **SEVERE ERROR**: Couldn't prepare data for fitting!";
|
||||
std::cerr << std::endl << ">> This is very bad :-(, will quit ...";
|
||||
std::cerr << std::endl;
|
||||
fValid = false;
|
||||
}
|
||||
}
|
||||
@@ -159,7 +158,7 @@ Double_t PRunMuMinus::CalcChiSquare(const std::vector<Double_t>& par)
|
||||
#pragma omp parallel for default(shared) private(i,time,diff) schedule(dynamic,chunk) reduction(+:chisq)
|
||||
#endif
|
||||
for (i=fStartTimeBin; i < fEndTimeBin; ++i) {
|
||||
time = fData.GetDataTimeStart() + (Double_t)i*fData.GetDataTimeStep();
|
||||
time = fData.GetDataTimeStart() + static_cast<Double_t>(i)*fData.GetDataTimeStep();
|
||||
diff = fData.GetValue()->at(i) - fTheory->Func(time, par, fFuncValues);
|
||||
chisq += diff*diff / (fData.GetError()->at(i)*fData.GetError()->at(i));
|
||||
}
|
||||
@@ -207,7 +206,7 @@ Double_t PRunMuMinus::CalcChiSquareExpected(const std::vector<Double_t>& par)
|
||||
#pragma omp parallel for default(shared) private(i,time,diff) schedule(dynamic,chunk) reduction(+:chisq)
|
||||
#endif
|
||||
for (i=fStartTimeBin; i < fEndTimeBin; ++i) {
|
||||
time = fData.GetDataTimeStart() + (Double_t)i*fData.GetDataTimeStep();
|
||||
time = fData.GetDataTimeStart() + static_cast<Double_t>(i)*fData.GetDataTimeStep();
|
||||
theo = fTheory->Func(time, par, fFuncValues);
|
||||
diff = fData.GetValue()->at(i) - theo;
|
||||
chisq += diff*diff / theo;
|
||||
@@ -256,14 +255,14 @@ Double_t PRunMuMinus::CalcMaxLikelihood(const std::vector<Double_t>& par)
|
||||
#pragma omp parallel for default(shared) private(i,time,theo,data) schedule(dynamic,chunk) reduction(-:mllh)
|
||||
#endif
|
||||
for (i=fStartTimeBin; i < fEndTimeBin; ++i) {
|
||||
time = fData.GetDataTimeStart() + (Double_t)i*fData.GetDataTimeStep();
|
||||
time = fData.GetDataTimeStart() + static_cast<Double_t>(i)*fData.GetDataTimeStep();
|
||||
// calculate theory for the given parameter set
|
||||
theo = fTheory->Func(time, par, fFuncValues);
|
||||
|
||||
data = fData.GetValue()->at(i);
|
||||
|
||||
if (theo <= 0.0) {
|
||||
cerr << ">> PRunMuMinus::CalcMaxLikelihood: **WARNING** NEGATIVE theory!!" << endl;
|
||||
std::cerr << ">> PRunMuMinus::CalcMaxLikelihood: **WARNING** NEGATIVE theory!!" << std::endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -308,8 +307,8 @@ UInt_t PRunMuMinus::GetNoOfFitBins()
|
||||
*/
|
||||
void PRunMuMinus::SetFitRangeBin(const TString fitRange)
|
||||
{
|
||||
TObjArray *tok = 0;
|
||||
TObjString *ostr = 0;
|
||||
TObjArray *tok = nullptr;
|
||||
TObjString *ostr = nullptr;
|
||||
TString str;
|
||||
Ssiz_t idx = -1;
|
||||
Int_t offset = 0;
|
||||
@@ -318,7 +317,7 @@ void PRunMuMinus::SetFitRangeBin(const TString fitRange)
|
||||
|
||||
if (tok->GetEntries() == 3) { // structure FIT_RANGE fgb+n0 lgb-n1
|
||||
// handle fgb+n0 entry
|
||||
ostr = (TObjString*) tok->At(1);
|
||||
ostr = dynamic_cast<TObjString*>(tok->At(1));
|
||||
str = ostr->GetString();
|
||||
// check if there is an offset present
|
||||
idx = str.First("+");
|
||||
@@ -330,7 +329,7 @@ void PRunMuMinus::SetFitRangeBin(const TString fitRange)
|
||||
fFitStartTime = (fGoodBins[0] + offset - fT0s[0]) * fTimeResolution;
|
||||
|
||||
// handle lgb-n1 entry
|
||||
ostr = (TObjString*) tok->At(2);
|
||||
ostr = dynamic_cast<TObjString*>(tok->At(2));
|
||||
str = ostr->GetString();
|
||||
// check if there is an offset present
|
||||
idx = str.First("-");
|
||||
@@ -344,11 +343,11 @@ void PRunMuMinus::SetFitRangeBin(const TString fitRange)
|
||||
Int_t pos = 2*(fRunNo+1)-1;
|
||||
|
||||
if (pos + 1 >= tok->GetEntries()) {
|
||||
cerr << endl << ">> PRunMuMinus::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange << "'";
|
||||
cerr << endl << ">> will ignore it. Sorry ..." << endl;
|
||||
std::cerr << std::endl << ">> PRunMuMinus::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange << "'";
|
||||
std::cerr << std::endl << ">> will ignore it. Sorry ..." << std::endl;
|
||||
} else {
|
||||
// handle fgb+n0 entry
|
||||
ostr = (TObjString*) tok->At(pos);
|
||||
ostr = dynamic_cast<TObjString*>(tok->At(pos));
|
||||
str = ostr->GetString();
|
||||
// check if there is an offset present
|
||||
idx = str.First("+");
|
||||
@@ -360,7 +359,7 @@ void PRunMuMinus::SetFitRangeBin(const TString fitRange)
|
||||
fFitStartTime = (fGoodBins[0] + offset - fT0s[0]) * fTimeResolution;
|
||||
|
||||
// handle lgb-n1 entry
|
||||
ostr = (TObjString*) tok->At(pos+1);
|
||||
ostr = dynamic_cast<TObjString*>(tok->At(pos+1));
|
||||
str = ostr->GetString();
|
||||
// check if there is an offset present
|
||||
idx = str.First("-");
|
||||
@@ -372,8 +371,8 @@ void PRunMuMinus::SetFitRangeBin(const TString fitRange)
|
||||
fFitEndTime = (fGoodBins[1] - offset - fT0s[0]) * fTimeResolution;
|
||||
}
|
||||
} else { // error
|
||||
cerr << endl << ">> PRunMuMinus::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange << "'";
|
||||
cerr << endl << ">> will ignore it. Sorry ..." << endl;
|
||||
std::cerr << std::endl << ">> PRunMuMinus::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange << "'";
|
||||
std::cerr << std::endl << ">> will ignore it. Sorry ..." << std::endl;
|
||||
}
|
||||
|
||||
// clean up
|
||||
@@ -429,7 +428,7 @@ void PRunMuMinus::CalcTheory()
|
||||
Double_t resolution = fData.GetDataTimeStep();
|
||||
Double_t time;
|
||||
for (UInt_t i=0; i<size; i++) {
|
||||
time = start + (Double_t)i*resolution;
|
||||
time = start + static_cast<Double_t>(i)*resolution;
|
||||
fData.AppendTheoryValue(fTheory->Func(time, par, fFuncValues));
|
||||
}
|
||||
|
||||
@@ -463,8 +462,8 @@ Bool_t PRunMuMinus::PrepareData()
|
||||
// get the proper run
|
||||
PRawRunData* runData = fRawData->GetRunData(*fRunInfo->GetRunName());
|
||||
if (!runData) { // couldn't get run
|
||||
cerr << endl << ">> PRunMuMinus::PrepareData(): **ERROR** Couldn't get run " << fRunInfo->GetRunName()->Data() << "!";
|
||||
cerr << endl;
|
||||
std::cerr << std::endl << ">> PRunMuMinus::PrepareData(): **ERROR** Couldn't get run " << fRunInfo->GetRunName()->Data() << "!";
|
||||
std::cerr << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -474,10 +473,10 @@ Bool_t PRunMuMinus::PrepareData()
|
||||
histoNo.push_back(fRunInfo->GetForwardHistoNo(i));
|
||||
|
||||
if (!runData->IsPresent(histoNo[i])) {
|
||||
cerr << endl << ">> PRunMuMinus::PrepareData(): **PANIC ERROR**:";
|
||||
cerr << endl << ">> histoNo found = " << histoNo[i] << ", which is NOT present in the data file!?!?";
|
||||
cerr << endl << ">> Will quit :-(";
|
||||
cerr << endl;
|
||||
std::cerr << std::endl << ">> PRunMuMinus::PrepareData(): **PANIC ERROR**:";
|
||||
std::cerr << std::endl << ">> histoNo found = " << histoNo[i] << ", which is NOT present in the data file!?!?";
|
||||
std::cerr << std::endl << ">> Will quit :-(";
|
||||
std::cerr << std::endl;
|
||||
histoNo.clear();
|
||||
return false;
|
||||
}
|
||||
@@ -485,8 +484,8 @@ Bool_t PRunMuMinus::PrepareData()
|
||||
|
||||
// keep the time resolution in (us)
|
||||
fTimeResolution = runData->GetTimeResolution()/1.0e3;
|
||||
cout.precision(10);
|
||||
cout << endl << ">> PRunMuMinus::PrepareData(): time resolution=" << fixed << runData->GetTimeResolution() << "(ns)" << endl;
|
||||
std::cout.precision(10);
|
||||
std::cout << std::endl << ">> PRunMuMinus::PrepareData(): time resolution=" << std::fixed << runData->GetTimeResolution() << "(ns)" << std::endl;
|
||||
|
||||
// get all the proper t0's and addt0's for the current RUN block
|
||||
if (!GetProperT0(runData, globalBlock, histoNo)) {
|
||||
@@ -494,7 +493,7 @@ Bool_t PRunMuMinus::PrepareData()
|
||||
}
|
||||
|
||||
// keep the histo of each group at this point (addruns handled below)
|
||||
vector<PDoubleVector> forward;
|
||||
std::vector<PDoubleVector> forward;
|
||||
forward.resize(histoNo.size()); // resize to number of groups
|
||||
for (UInt_t i=0; i<histoNo.size(); i++) {
|
||||
forward[i].resize(runData->GetDataBin(histoNo[i])->size());
|
||||
@@ -508,9 +507,9 @@ Bool_t PRunMuMinus::PrepareData()
|
||||
|
||||
// get run to be added to the main one
|
||||
addRunData = fRawData->GetRunData(*fRunInfo->GetRunName(i));
|
||||
if (addRunData == 0) { // couldn't get run
|
||||
cerr << endl << ">> PRunMuMinus::PrepareData(): **ERROR** Couldn't get addrun " << fRunInfo->GetRunName(i)->Data() << "!";
|
||||
cerr << endl;
|
||||
if (addRunData == nullptr) { // couldn't get run
|
||||
std::cerr << std::endl << ">> PRunMuMinus::PrepareData(): **ERROR** Couldn't get addrun " << fRunInfo->GetRunName(i)->Data() << "!";
|
||||
std::cerr << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -520,8 +519,9 @@ Bool_t PRunMuMinus::PrepareData()
|
||||
addRunSize = addRunData->GetDataBin(histoNo[k])->size();
|
||||
for (UInt_t j=0; j<addRunData->GetDataBin(histoNo[k])->size(); j++) { // loop over the bin indices
|
||||
// make sure that the index stays in the proper range
|
||||
if (((Int_t)j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] >= 0) && (j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] < addRunSize)) {
|
||||
forward[k][j] += addRunData->GetDataBin(histoNo[k])->at(j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k]);
|
||||
if ((static_cast<Int_t>(j)+static_cast<Int_t>(fAddT0s[i-1][k])-static_cast<Int_t>(fT0s[k]) >= 0) &&
|
||||
(j+static_cast<Int_t>(fAddT0s[i-1][k])-static_cast<Int_t>(fT0s[k]) < addRunSize)) {
|
||||
forward[k][j] += addRunData->GetDataBin(histoNo[k])->at(j+static_cast<Int_t>(fAddT0s[i-1][k])-static_cast<Int_t>(fT0s[k]));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -538,8 +538,8 @@ Bool_t PRunMuMinus::PrepareData()
|
||||
for (UInt_t i=1; i<histoNo.size(); i++) { // loop over the groupings
|
||||
for (UInt_t j=0; j<runData->GetDataBin(histoNo[i])->size(); j++) { // loop over the bin indices
|
||||
// make sure that the index stays within proper range
|
||||
if (((Int_t)j+fT0s[i]-fT0s[0] >= 0) && (j+fT0s[i]-fT0s[0] < runData->GetDataBin(histoNo[i])->size())) {
|
||||
fForward[j] += forward[i][j+(Int_t)fT0s[i]-(Int_t)fT0s[0]];
|
||||
if ((static_cast<Int_t>(j)+fT0s[i]-fT0s[0] >= 0) && (j+fT0s[i]-fT0s[0] < runData->GetDataBin(histoNo[i])->size())) {
|
||||
fForward[j] += forward[i][j+static_cast<Int_t>(fT0s[i])-static_cast<Int_t>(fT0s[0])];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -589,11 +589,11 @@ Bool_t PRunMuMinus::PrepareFitData(PRawRunData* runData, const UInt_t histoNo)
|
||||
// for the single histo fit, just the rebinned raw data are copied
|
||||
|
||||
// fill data set
|
||||
Int_t t0 = (Int_t)fT0s[0];
|
||||
Int_t t0 = static_cast<Int_t>(fT0s[0]);
|
||||
Double_t value = 0.0;
|
||||
// data start at data_start-t0
|
||||
// time shifted so that packing is included correctly, i.e. t0 == t0 after packing
|
||||
fData.SetDataTimeStart(fTimeResolution*((Double_t)fGoodBins[0]-(Double_t)t0+(Double_t)(fPacking-1)/2.0));
|
||||
fData.SetDataTimeStart(fTimeResolution*(static_cast<Double_t>(fGoodBins[0])-static_cast<Double_t>(t0)+static_cast<Double_t>(fPacking-1)/2.0));
|
||||
fData.SetDataTimeStep(fTimeResolution*fPacking);
|
||||
for (Int_t i=fGoodBins[0]; i<fGoodBins[1]; i++) {
|
||||
if (fPacking == 1) {
|
||||
@@ -652,7 +652,7 @@ Bool_t PRunMuMinus::PrepareRawViewData(PRawRunData* runData, const UInt_t histoN
|
||||
// calculate necessary norms
|
||||
Double_t theoryNorm = 1.0;
|
||||
if (fMsrInfo->GetMsrPlotList()->at(0).fViewPacking > 0) {
|
||||
theoryNorm = (Double_t)fMsrInfo->GetMsrPlotList()->at(0).fViewPacking/(Double_t)fPacking;
|
||||
theoryNorm = static_cast<Double_t>(fMsrInfo->GetMsrPlotList()->at(0).fViewPacking)/static_cast<Double_t>(fPacking);
|
||||
}
|
||||
|
||||
// raw data, since PMusrCanvas is doing ranging etc.
|
||||
@@ -662,12 +662,12 @@ Bool_t PRunMuMinus::PrepareRawViewData(PRawRunData* runData, const UInt_t histoN
|
||||
Int_t end = start + ((fForward.size()-start)/packing)*packing;
|
||||
// check if data range has been provided, and if not try to estimate them
|
||||
if (start < 0) {
|
||||
Int_t offset = (Int_t)(10.0e-3/fTimeResolution);
|
||||
start = ((Int_t)fT0s[0]+offset) - (((Int_t)fT0s[0]+offset)/packing)*packing;
|
||||
Int_t offset = static_cast<Int_t>(10.0e-3/fTimeResolution);
|
||||
start = (static_cast<Int_t>(fT0s[0])+offset) - ((static_cast<Int_t>(fT0s[0])+offset)/packing)*packing;
|
||||
end = start + ((fForward.size()-start)/packing)*packing;
|
||||
cerr << endl << ">> PRunMuMinus::PrepareData(): **WARNING** data range was not provided, will try data range start = " << start << ".";
|
||||
cerr << endl << ">> NO WARRANTY THAT THIS DOES MAKE ANY SENSE.";
|
||||
cerr << endl;
|
||||
std::cerr << std::endl << ">> PRunMuMinus::PrepareData(): **WARNING** data range was not provided, will try data range start = " << start << ".";
|
||||
std::cerr << std::endl << ">> NO WARRANTY THAT THIS DOES MAKE ANY SENSE.";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
// check if start, end, and t0 make any sense
|
||||
// 1st check if start and end are in proper order
|
||||
@@ -677,15 +677,15 @@ Bool_t PRunMuMinus::PrepareRawViewData(PRawRunData* runData, const UInt_t histoN
|
||||
start = keep;
|
||||
}
|
||||
// 2nd check if start is within proper bounds
|
||||
if ((start < 0) || (start > (Int_t)fForward.size())) {
|
||||
cerr << endl << ">> PRunMuMinus::PrepareRawViewData(): **ERROR** start data bin doesn't make any sense!";
|
||||
cerr << endl;
|
||||
if ((start < 0) || (start > static_cast<Int_t>(fForward.size()))) {
|
||||
std::cerr << std::endl << ">> PRunMuMinus::PrepareRawViewData(): **ERROR** start data bin doesn't make any sense!";
|
||||
std::cerr << std::endl;
|
||||
return false;
|
||||
}
|
||||
// 3rd check if end is within proper bounds
|
||||
if ((end < 0) || (end > (Int_t)fForward.size())) {
|
||||
cerr << endl << ">> PRunMuMinus::PrepareRawViewData(): **ERROR** end data bin doesn't make any sense!";
|
||||
cerr << endl;
|
||||
if ((end < 0) || (end > static_cast<Int_t>(fForward.size()))) {
|
||||
std::cerr << std::endl << ">> PRunMuMinus::PrepareRawViewData(): **ERROR** end data bin doesn't make any sense!";
|
||||
std::cerr << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -696,11 +696,11 @@ Bool_t PRunMuMinus::PrepareRawViewData(PRawRunData* runData, const UInt_t histoN
|
||||
}
|
||||
|
||||
// everything looks fine, hence fill data set
|
||||
Int_t t0 = (Int_t)fT0s[0];
|
||||
Int_t t0 = static_cast<Int_t>(fT0s[0]);
|
||||
Double_t value = 0.0;
|
||||
// data start at data_start-t0
|
||||
// time shifted so that packing is included correctly, i.e. t0 == t0 after packing
|
||||
fData.SetDataTimeStart(fTimeResolution*((Double_t)start-(Double_t)t0+(Double_t)(packing-1)/2.0));
|
||||
fData.SetDataTimeStart(fTimeResolution*(static_cast<Double_t>(start)-static_cast<Double_t>(t0)+static_cast<Double_t>(packing-1)/2.0));
|
||||
fData.SetDataTimeStep(fTimeResolution*packing);
|
||||
|
||||
for (Int_t i=start; i<end; i++) {
|
||||
@@ -735,7 +735,7 @@ Bool_t PRunMuMinus::PrepareRawViewData(PRawRunData* runData, const UInt_t histoN
|
||||
Double_t factor = 1.0;
|
||||
if (fData.GetValue()->size() * 10 > fForward.size()) {
|
||||
size = fData.GetValue()->size() * 10;
|
||||
factor = (Double_t)fForward.size() / (Double_t)size;
|
||||
factor = static_cast<Double_t>(fForward.size()) / static_cast<Double_t>(size);
|
||||
}
|
||||
Double_t time;
|
||||
Double_t theoryValue;
|
||||
@@ -791,7 +791,7 @@ Bool_t PRunMuMinus::GetProperT0(PRawRunData* runData, PMsrGlobalBlock *globalBlo
|
||||
|
||||
// fill in the T0's from the GLOBAL block section (if present)
|
||||
for (UInt_t i=0; i<globalBlock->GetT0BinSize(); i++) {
|
||||
if (fT0s[i] == -1) { // i.e. not given in the RUN block section
|
||||
if (fT0s[i] == -1.0) { // i.e. not given in the RUN block section
|
||||
fT0s[i] = globalBlock->GetT0Bin(i);
|
||||
}
|
||||
}
|
||||
@@ -812,19 +812,19 @@ Bool_t PRunMuMinus::GetProperT0(PRawRunData* runData, PMsrGlobalBlock *globalBlo
|
||||
fT0s[i] = runData->GetT0BinEstimated(histoNo[i]);
|
||||
fRunInfo->SetT0Bin(fT0s[i], i); // keep value for the msr-file
|
||||
|
||||
cerr << endl << ">> PRunMuMinus::GetProperT0(): **WARRNING** NO t0's found, neither in the run data nor in the msr-file!";
|
||||
cerr << endl << ">> run: " << fRunInfo->GetRunName()->Data();
|
||||
cerr << endl << ">> will try the estimated one: forward t0 = " << runData->GetT0BinEstimated(histoNo[i]);
|
||||
cerr << endl << ">> NO WARRANTY THAT THIS OK!! For instance for LEM this is almost for sure rubbish!";
|
||||
cerr << endl;
|
||||
std::cerr << std::endl << ">> PRunMuMinus::GetProperT0(): **WARRNING** NO t0's found, neither in the run data nor in the msr-file!";
|
||||
std::cerr << std::endl << ">> run: " << fRunInfo->GetRunName()->Data();
|
||||
std::cerr << std::endl << ">> will try the estimated one: forward t0 = " << runData->GetT0BinEstimated(histoNo[i]);
|
||||
std::cerr << std::endl << ">> NO WARRANTY THAT THIS OK!! For instance for LEM this is almost for sure rubbish!";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
// check if t0 is within proper bounds
|
||||
for (UInt_t i=0; i<fRunInfo->GetForwardHistoNoSize(); i++) {
|
||||
if ((fT0s[i] < 0) || (fT0s[i] > (Int_t)runData->GetDataBin(histoNo[i])->size())) {
|
||||
cerr << endl << ">> PRunMuMinus::GetProperT0(): **ERROR** t0 data bin (" << fT0s[i] << ") doesn't make any sense!";
|
||||
cerr << endl;
|
||||
if ((fT0s[i] < 0) || (fT0s[i] > static_cast<Int_t>(runData->GetDataBin(histoNo[i])->size()))) {
|
||||
std::cerr << std::endl << ">> PRunMuMinus::GetProperT0(): **ERROR** t0 data bin (" << fT0s[i] << ") doesn't make any sense!";
|
||||
std::cerr << std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -837,9 +837,9 @@ Bool_t PRunMuMinus::GetProperT0(PRawRunData* runData, PMsrGlobalBlock *globalBlo
|
||||
|
||||
// get run to be added to the main one
|
||||
addRunData = fRawData->GetRunData(*fRunInfo->GetRunName(i));
|
||||
if (addRunData == 0) { // couldn't get run
|
||||
cerr << endl << ">> PRunMuMinus::GetProperT0(): **ERROR** Couldn't get addrun " << fRunInfo->GetRunName(i)->Data() << "!";
|
||||
cerr << endl;
|
||||
if (addRunData == nullptr) { // couldn't get run
|
||||
std::cerr << std::endl << ">> PRunMuMinus::GetProperT0(): **ERROR** Couldn't get addrun " << fRunInfo->GetRunName(i)->Data() << "!";
|
||||
std::cerr << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -870,19 +870,19 @@ Bool_t PRunMuMinus::GetProperT0(PRawRunData* runData, PMsrGlobalBlock *globalBlo
|
||||
fAddT0s[i-1][j] = addRunData->GetT0BinEstimated(histoNo[j]);
|
||||
fRunInfo->SetAddT0Bin(fAddT0s[i-1][j], i-1, j); // keep value for the msr-file
|
||||
|
||||
cerr << endl << ">> PRunMuMinus::GetProperT0(): **WARRNING** NO t0's found, neither in the run data nor in the msr-file!";
|
||||
cerr << endl << ">> run: " << fRunInfo->GetRunName(i)->Data();
|
||||
cerr << endl << ">> will try the estimated one: forward t0 = " << addRunData->GetT0BinEstimated(histoNo[j]);
|
||||
cerr << endl << ">> NO WARRANTY THAT THIS OK!! For instance for LEM this is almost for sure rubbish!";
|
||||
cerr << endl;
|
||||
std::cerr << std::endl << ">> PRunMuMinus::GetProperT0(): **WARRNING** NO t0's found, neither in the run data nor in the msr-file!";
|
||||
std::cerr << std::endl << ">> run: " << fRunInfo->GetRunName(i)->Data();
|
||||
std::cerr << std::endl << ">> will try the estimated one: forward t0 = " << addRunData->GetT0BinEstimated(histoNo[j]);
|
||||
std::cerr << std::endl << ">> NO WARRANTY THAT THIS OK!! For instance for LEM this is almost for sure rubbish!";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
// check if t0 is within proper bounds
|
||||
for (UInt_t j=0; j<fRunInfo->GetForwardHistoNoSize(); j++) {
|
||||
if ((fAddT0s[i-1][j] < 0) || (fAddT0s[i-1][j] > (Int_t)addRunData->GetDataBin(histoNo[j])->size())) {
|
||||
cerr << endl << ">> PRunMuMinus::GetProperT0(): **ERROR** addt0 data bin (" << fAddT0s[i-1][j] << ") doesn't make any sense!";
|
||||
cerr << endl;
|
||||
if ((fAddT0s[i-1][j] < 0) || (fAddT0s[i-1][j] > static_cast<Int_t>(addRunData->GetDataBin(histoNo[j])->size()))) {
|
||||
std::cerr << std::endl << ">> PRunMuMinus::GetProperT0(): **ERROR** addt0 data bin (" << fAddT0s[i-1][j] << ") doesn't make any sense!";
|
||||
std::cerr << std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -923,19 +923,19 @@ Bool_t PRunMuMinus::GetProperDataRange()
|
||||
|
||||
// check if data range has been provided, and if not try to estimate them
|
||||
if (start < 0) {
|
||||
Int_t offset = (Int_t)(10.0e-3/fTimeResolution);
|
||||
start = (Int_t)fT0s[0]+offset;
|
||||
Int_t offset = static_cast<Int_t>(10.0e-3/fTimeResolution);
|
||||
start = static_cast<Int_t>(fT0s[0])+offset;
|
||||
fRunInfo->SetDataRange(start, 0);
|
||||
cerr << endl << ">> PRunMuMinus::GetProperDataRange(): **WARNING** data range was not provided, will try data range start = t0+" << offset << "(=10ns) = " << start << ".";
|
||||
cerr << endl << ">> NO WARRANTY THAT THIS DOES MAKE ANY SENSE.";
|
||||
cerr << endl;
|
||||
std::cerr << std::endl << ">> PRunMuMinus::GetProperDataRange(): **WARNING** data range was not provided, will try data range start = t0+" << offset << "(=10ns) = " << start << ".";
|
||||
std::cerr << std::endl << ">> NO WARRANTY THAT THIS DOES MAKE ANY SENSE.";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
if (end < 0) {
|
||||
end = fForward.size();
|
||||
fRunInfo->SetDataRange(end, 1);
|
||||
cerr << endl << ">> PRunMuMinus::GetProperDataRange(): **WARNING** data range was not provided, will try data range end = " << end << ".";
|
||||
cerr << endl << ">> NO WARRANTY THAT THIS DOES MAKE ANY SENSE.";
|
||||
cerr << endl;
|
||||
std::cerr << std::endl << ">> PRunMuMinus::GetProperDataRange(): **WARNING** data range was not provided, will try data range end = " << end << ".";
|
||||
std::cerr << std::endl << ">> NO WARRANTY THAT THIS DOES MAKE ANY SENSE.";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
|
||||
// check if start and end make any sense
|
||||
@@ -946,15 +946,15 @@ Bool_t PRunMuMinus::GetProperDataRange()
|
||||
start = keep;
|
||||
}
|
||||
// 2nd check if start is within proper bounds
|
||||
if ((start < 0) || (start > (Int_t)fForward.size())) {
|
||||
cerr << endl << ">> PRunMuMinus::GetProperDataRange(): **ERROR** start data bin (" << start << ") doesn't make any sense!";
|
||||
cerr << endl;
|
||||
if ((start < 0) || (start > static_cast<Int_t>(fForward.size()))) {
|
||||
std::cerr << std::endl << ">> PRunMuMinus::GetProperDataRange(): **ERROR** start data bin (" << start << ") doesn't make any sense!";
|
||||
std::cerr << std::endl;
|
||||
return false;
|
||||
}
|
||||
// 3rd check if end is within proper bounds
|
||||
if ((end < 0) || (end > (Int_t)fForward.size())) {
|
||||
cerr << endl << ">> PRunMuMinus::GetProperDataRange(): **ERROR** end data bin (" << end << ") doesn't make any sense!";
|
||||
cerr << endl;
|
||||
if ((end < 0) || (end > static_cast<Int_t>(fForward.size()))) {
|
||||
std::cerr << std::endl << ">> PRunMuMinus::GetProperDataRange(): **ERROR** end data bin (" << end << ") doesn't make any sense!";
|
||||
std::cerr << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1008,7 +1008,7 @@ void PRunMuMinus::GetProperFitRange(PMsrGlobalBlock *globalBlock)
|
||||
if ((fFitStartTime == PMUSR_UNDEFINED) || (fFitEndTime == PMUSR_UNDEFINED)) {
|
||||
fFitStartTime = (fGoodBins[0] - fT0s[0]) * fTimeResolution; // (fgb-t0)*dt
|
||||
fFitEndTime = (fGoodBins[1] - fT0s[0]) * fTimeResolution; // (lgb-t0)*dt
|
||||
cerr << ">> PRunMuMinus::GetProperFitRange(): **WARNING** Couldn't get fit start/end time!" << endl;
|
||||
cerr << ">> Will set it to fgb/lgb which given in time is: " << fFitStartTime << "..." << fFitEndTime << " (usec)" << endl;
|
||||
std::cerr << ">> PRunMuMinus::GetProperFitRange(): **WARNING** Couldn't get fit start/end time!" << std::endl;
|
||||
std::cerr << ">> Will set it to fgb/lgb which given in time is: " << fFitStartTime << "..." << fFitEndTime << " (usec)" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user