massive cleanup
This commit is contained in:
parent
1c1b08ace1
commit
a8043ce89c
@ -342,8 +342,6 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages)
|
||||
}
|
||||
|
||||
// add some counters needed in connection to addruns
|
||||
Int_t addForwardHistoNoCounter = 0;
|
||||
Int_t addBackwardHistoNoCounter = 0;
|
||||
Int_t addT0Counter = 0;
|
||||
|
||||
ifstream fin;
|
||||
@ -429,10 +427,7 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages)
|
||||
tag = MSR_TAG_RUN;
|
||||
runNo++;
|
||||
|
||||
// reset addrun helper counters
|
||||
addForwardHistoNoCounter = 0;
|
||||
addBackwardHistoNoCounter = 0;
|
||||
addT0Counter = 0;
|
||||
addT0Counter = 0; // reset counter
|
||||
} else if (str.BeginsWith("COMMANDS")) { // COMMANDS block tag
|
||||
tag = MSR_TAG_COMMANDS;
|
||||
fout << str.Data() << endl;
|
||||
@ -669,23 +664,6 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages)
|
||||
}
|
||||
fout << endl;
|
||||
}
|
||||
} else if (sstr.BeginsWith("addforward")) {
|
||||
if (fRuns[runNo].GetAddForwardHistoNoSize(addForwardHistoNoCounter) <= 0) {
|
||||
cerr << endl << ">> PMsrHandler::WriteMsrLogFile: **WARNING** 'addforward' tag without any data found!";
|
||||
cerr << endl << ">> Something is VERY fishy, please check your msr-file carfully." << endl;
|
||||
} else if (addForwardHistoNoCounter >= fRuns[runNo].GetAddForwardHistoNoSize(addForwardHistoNoCounter)) {
|
||||
cerr << endl << ">> PMsrHandler::WriteMsrLogFile: **WARNING** More 'addforward' tags present than addforward data!";
|
||||
cerr << endl << ">> Something is VERY fishy, please check your msr-file carfully." << endl;
|
||||
} else {
|
||||
fout.width(16);
|
||||
fout << left << "addforward";
|
||||
for (Int_t i=0; i<fRuns[runNo].GetAddForwardHistoNoSize(addForwardHistoNoCounter); i++) {
|
||||
fout.width(8);
|
||||
fout << fRuns[runNo].GetAddForwardHistoNo(addForwardHistoNoCounter, i);
|
||||
}
|
||||
fout << endl;
|
||||
addForwardHistoNoCounter++;
|
||||
}
|
||||
} else if (sstr.BeginsWith("backward")) {
|
||||
if (fRuns[runNo].GetBackwardHistoNoSize() == 0) {
|
||||
cerr << endl << ">> PMsrHandler::WriteMsrLogFile: **WARNING** 'backward' tag without any data found!";
|
||||
@ -699,23 +677,6 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages)
|
||||
}
|
||||
fout << endl;
|
||||
}
|
||||
} else if (sstr.BeginsWith("addbackward")) {
|
||||
if (fRuns[runNo].GetAddBackwardHistoNoSize(addBackwardHistoNoCounter) <= 0) {
|
||||
cerr << endl << ">> PMsrHandler::WriteMsrLogFile: **WARNING** 'addbackward' tag without any data found!";
|
||||
cerr << endl << ">> Something is VERY fishy, please check your msr-file carfully." << endl;
|
||||
} else if (addBackwardHistoNoCounter >= fRuns[runNo].GetAddBackwardHistoNoSize(addBackwardHistoNoCounter)) {
|
||||
cerr << endl << ">> PMsrHandler::WriteMsrLogFile: **WARNING** More 'addbackward' tags present than addbackward data!";
|
||||
cerr << endl << ">> Something is VERY fishy, please check your msr-file carfully." << endl;
|
||||
} else {
|
||||
fout.width(16);
|
||||
fout << left << "addbackward";
|
||||
for (Int_t i=0; i<fRuns[runNo].GetAddBackwardHistoNoSize(addBackwardHistoNoCounter); i++) {
|
||||
fout.width(8);
|
||||
fout << fRuns[runNo].GetAddBackwardHistoNo(addBackwardHistoNoCounter, i);
|
||||
}
|
||||
fout << endl;
|
||||
addBackwardHistoNoCounter++;
|
||||
}
|
||||
} else if (sstr.BeginsWith("backgr.fix")) {
|
||||
fout.width(15);
|
||||
fout << left << "backgr.fix";
|
||||
@ -1631,9 +1592,6 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
||||
TObjArray *tokens = 0;
|
||||
TObjString *ostr = 0;
|
||||
|
||||
// add some counters needed in connection to addruns
|
||||
UInt_t addForwardHistoNoCounter = 0;
|
||||
UInt_t addBackwardHistoNoCounter = 0;
|
||||
UInt_t addT0Counter = 0;
|
||||
|
||||
Int_t ival;
|
||||
@ -1682,10 +1640,7 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
||||
param.SetFileFormat(str);
|
||||
}
|
||||
|
||||
// reset addrun helper counters
|
||||
addForwardHistoNoCounter = 0;
|
||||
addBackwardHistoNoCounter = 0;
|
||||
addT0Counter = 0;
|
||||
addT0Counter = 0; // reset counter
|
||||
}
|
||||
|
||||
// ADDRUN line ---------------------------------------------
|
||||
@ -1921,32 +1876,6 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
||||
}
|
||||
}
|
||||
|
||||
// addforward ---------------------------------------------
|
||||
if (iter->fLine.BeginsWith("addforward", TString::kIgnoreCase)) {
|
||||
|
||||
runLinePresent = false; // this is needed to make sure that a run line is present before and ADDRUN is following
|
||||
|
||||
if (tokens->GetEntries() < 2) {
|
||||
error = true;
|
||||
} else {
|
||||
for (Int_t i=1; i<tokens->GetEntries(); i++) {
|
||||
ostr = dynamic_cast<TObjString*>(tokens->At(i));
|
||||
str = ostr->GetString();
|
||||
if (str.IsDigit()) {
|
||||
ival = str.Atoi();
|
||||
if (ival > 0)
|
||||
param.SetAddForwardHistoNo(ival, addForwardHistoNoCounter, i-1);
|
||||
else
|
||||
error = true;
|
||||
} else {
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addForwardHistoNoCounter++;
|
||||
}
|
||||
|
||||
// backward -----------------------------------------------
|
||||
if (iter->fLine.BeginsWith("backward", TString::kIgnoreCase)) {
|
||||
|
||||
@ -1971,32 +1900,6 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
||||
}
|
||||
}
|
||||
|
||||
// addbackward ---------------------------------------------
|
||||
if (iter->fLine.BeginsWith("addbackward", TString::kIgnoreCase)) {
|
||||
|
||||
runLinePresent = false; // this is needed to make sure that a run line is present before and ADDRUN is following
|
||||
|
||||
if (tokens->GetEntries() < 2) {
|
||||
error = true;
|
||||
} else {
|
||||
for (Int_t i=1; i<tokens->GetEntries(); i++) {
|
||||
ostr = dynamic_cast<TObjString*>(tokens->At(i));
|
||||
str = ostr->GetString();
|
||||
if (str.IsDigit()) {
|
||||
ival = str.Atoi();
|
||||
if (ival > 0)
|
||||
param.SetAddBackwardHistoNo(ival, addBackwardHistoNoCounter, i-1);
|
||||
else
|
||||
error = true;
|
||||
} else {
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addBackwardHistoNoCounter++;
|
||||
}
|
||||
|
||||
// backgr.fix ----------------------------------------------
|
||||
if (iter->fLine.BeginsWith("backgr.fix", TString::kIgnoreCase)) {
|
||||
|
||||
@ -3827,35 +3730,6 @@ Bool_t PMsrHandler::CheckAddRunParameters()
|
||||
|
||||
for (UInt_t i=0; i<fRuns.size(); i++) {
|
||||
if (fRuns[i].GetRunNameSize() > 1) {
|
||||
// checks concerning forward <-> backward, addforward <-> addbackward
|
||||
if (fRuns[i].GetAddForwardHistoNoEntries() != 0) { // addforward given, make some consistency checks
|
||||
if (fRuns[i].GetRunNameSize()-1 != fRuns[i].GetAddForwardHistoNoEntries()) {
|
||||
cerr << endl << ">> PMsrHandler::CheckAddRunParameters: **ERROR** # of addruns != # of addforwards found.";
|
||||
cerr << endl << ">> Run #" << i+1;
|
||||
cerr << endl;
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
if (fRuns[i].GetFitType() == MSR_FITTYPE_ASYM) {
|
||||
if (fRuns[i].GetAddForwardHistoNoEntries() != fRuns[i].GetAddBackwardHistoNoEntries()) {
|
||||
cerr << endl << ">> PMsrHandler::CheckAddRunParameters: **ERROR** # of addforward entries != # of addbackward entries.";
|
||||
cerr << endl << ">> Run #" << i+1;
|
||||
cerr << endl;
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (UInt_t j=0; j<fRuns[i].GetAddForwardHistoNoEntries(); j++) {
|
||||
if (fRuns[i].GetAddForwardHistoNoSize(j) != static_cast<Int_t>(fRuns[i].GetForwardHistoNoSize())) {
|
||||
cerr << endl << ">> PMsrHandler::CheckAddRunParameters: **ERROR** # of addforward histos != # of forward histos.";
|
||||
cerr << endl << ">> Run #" << i+1;
|
||||
cerr << endl;
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check concerning the addt0 tags
|
||||
if (fRuns[i].GetAddT0Entries() != 0) {
|
||||
if (fRuns[i].GetAddT0Entries() != fRuns[i].GetRunNameSize()-1) {
|
||||
@ -3866,15 +3740,6 @@ Bool_t PMsrHandler::CheckAddRunParameters()
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else { // no addrun present, check if addforward, addbackward, ... is present (which doesn't make any sense)
|
||||
if ((fRuns[i].GetAddForwardHistoNoEntries() != 0) || (fRuns[i].GetAddBackwardHistoNoEntries() != 0) ||
|
||||
(fRuns[i].GetAddT0Entries() != 0)) {
|
||||
cerr << endl << ">> PMsrHandler::CheckAddRunParameters: **WARNING** found one of the following tags in Run #" << i+1 << ":";
|
||||
cerr << endl << ">> addforward, addbackward, or addt0";
|
||||
cerr << endl << ">> this doesn't make any sense if there no addrun present.";
|
||||
cerr << endl << ">> Will ignore these entires for this run!";
|
||||
cerr << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -596,13 +596,7 @@ void PMsrRunBlock::CleanUp()
|
||||
fInstitute.clear();
|
||||
fFileFormat.clear();
|
||||
fForwardHistoNo.clear();
|
||||
for (UInt_t i=0; i<fAddForwardHistoNo.size(); i++)
|
||||
fAddForwardHistoNo[i].clear();
|
||||
fAddForwardHistoNo.clear();
|
||||
fBackwardHistoNo.clear();
|
||||
for (UInt_t i=0; i<fAddBackwardHistoNo.size(); i++)
|
||||
fAddBackwardHistoNo[i].clear();
|
||||
fAddBackwardHistoNo.clear();
|
||||
fMap.clear();
|
||||
fT0.clear();
|
||||
for (UInt_t i=0; i<fAddT0.size(); i++)
|
||||
@ -802,72 +796,6 @@ void PMsrRunBlock::SetForwardHistoNo(Int_t histoNo, Int_t idx)
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// GetAddForwardHistoNoSize
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p> get forward histo number size of the addrun at index addRunIdx
|
||||
*
|
||||
* \param addRunIdx index of the addrun
|
||||
*/
|
||||
Int_t PMsrRunBlock::GetAddForwardHistoNoSize(UInt_t addRunIdx)
|
||||
{
|
||||
if (fAddForwardHistoNo.empty())
|
||||
return -1;
|
||||
|
||||
if (addRunIdx > fAddForwardHistoNo.size())
|
||||
return -1;
|
||||
|
||||
return fAddForwardHistoNo[addRunIdx].size();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// GetAddForwardHistoNo
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p> get forward histo number of the addrun (index addRunIdx) at index histoIdx
|
||||
*
|
||||
* \param addRunIdx index of the addrun
|
||||
* \param histoIdx index of the add forward histo number value
|
||||
*/
|
||||
Int_t PMsrRunBlock::GetAddForwardHistoNo(UInt_t addRunIdx, UInt_t histoIdx)
|
||||
{
|
||||
if (fAddForwardHistoNo.empty())
|
||||
return -1;
|
||||
|
||||
if (addRunIdx > fAddForwardHistoNo.size())
|
||||
return -1;
|
||||
|
||||
if (fAddForwardHistoNo[addRunIdx].empty())
|
||||
return -1;
|
||||
|
||||
if (histoIdx > fAddForwardHistoNo[addRunIdx].size())
|
||||
return -1;
|
||||
|
||||
return fAddForwardHistoNo[addRunIdx][histoIdx];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// SetAddForwardHistoNo
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p> set add forward histogram value at index idx
|
||||
*
|
||||
* \param histoNo histogram value
|
||||
* \param addRunIdx addrun index
|
||||
* \param histoNoIdx index whithin the fAddForwardHistoNo vector where to set the value.
|
||||
*/
|
||||
void PMsrRunBlock::SetAddForwardHistoNo(Int_t histoNo, UInt_t addRunIdx, UInt_t histoNoIdx)
|
||||
{
|
||||
if (addRunIdx >= fAddForwardHistoNo.size())
|
||||
fAddForwardHistoNo.resize(addRunIdx+1);
|
||||
|
||||
if (histoNoIdx >= fAddForwardHistoNo[addRunIdx].size())
|
||||
fAddForwardHistoNo[addRunIdx].resize(histoNoIdx+1);
|
||||
|
||||
fAddForwardHistoNo[addRunIdx][histoNoIdx] = histoNo;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// GetBackwardHistoNo
|
||||
//--------------------------------------------------------------------------
|
||||
@ -908,72 +836,6 @@ void PMsrRunBlock::SetBackwardHistoNo(Int_t histoNo, Int_t idx)
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// GetAddBackwardHistoNoSize
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p> get backward histo number size of the addrun at index addRunIdx
|
||||
*
|
||||
* \param addRunIdx index of the addrun
|
||||
*/
|
||||
Int_t PMsrRunBlock::GetAddBackwardHistoNoSize(UInt_t addRunIdx)
|
||||
{
|
||||
if (fAddBackwardHistoNo.empty())
|
||||
return -1;
|
||||
|
||||
if (addRunIdx > fAddBackwardHistoNo.size())
|
||||
return -1;
|
||||
|
||||
return fAddBackwardHistoNo[addRunIdx].size();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// GetAddBackwardHistoNo
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p> get backward histo number of the addrun (index addRunIdx) at index histoIdx
|
||||
*
|
||||
* \param addRunIdx index of the addrun
|
||||
* \param histoIdx index of the add backward histo number value
|
||||
*/
|
||||
Int_t PMsrRunBlock::GetAddBackwardHistoNo(UInt_t addRunIdx, UInt_t histoIdx)
|
||||
{
|
||||
if (fAddBackwardHistoNo.empty())
|
||||
return -1;
|
||||
|
||||
if (addRunIdx > fAddBackwardHistoNo.size())
|
||||
return -1;
|
||||
|
||||
if (fAddBackwardHistoNo[addRunIdx].empty())
|
||||
return -1;
|
||||
|
||||
if (histoIdx > fAddBackwardHistoNo[addRunIdx].size())
|
||||
return -1;
|
||||
|
||||
return fAddBackwardHistoNo[addRunIdx][histoIdx];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// SetAddBackwardHistoNo
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p> set add backward histogram value of the addrun at index histoNoIdx
|
||||
*
|
||||
* \param histoNo histogram value
|
||||
* \param addRunIdx addrun index
|
||||
* \param histoNoIdx index whithin the fAddBackwardHistoNo vector where to set the value.
|
||||
*/
|
||||
void PMsrRunBlock::SetAddBackwardHistoNo(Int_t histoNo, UInt_t addRunIdx, UInt_t histoNoIdx)
|
||||
{
|
||||
if (addRunIdx >= fAddBackwardHistoNo.size())
|
||||
fAddBackwardHistoNo.resize(addRunIdx+1);
|
||||
|
||||
if (histoNoIdx >= fAddBackwardHistoNo[addRunIdx].size())
|
||||
fAddBackwardHistoNo[addRunIdx].resize(histoNoIdx+1);
|
||||
|
||||
fAddBackwardHistoNo[addRunIdx][histoNoIdx] = histoNo;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// GetMap
|
||||
//--------------------------------------------------------------------------
|
||||
|
@ -409,14 +409,8 @@ class PMsrRunBlock {
|
||||
virtual Int_t GetMap(UInt_t idx);
|
||||
virtual UInt_t GetForwardHistoNoSize() { return fForwardHistoNo.size(); }
|
||||
virtual Int_t GetForwardHistoNo(UInt_t idx=0);
|
||||
virtual UInt_t GetAddForwardHistoNoEntries() { return fAddForwardHistoNo.size(); }
|
||||
virtual Int_t GetAddForwardHistoNoSize(UInt_t addRunIdx);
|
||||
virtual Int_t GetAddForwardHistoNo(UInt_t addRunIdx, UInt_t histoIdx);
|
||||
virtual UInt_t GetBackwardHistoNoSize() { return fBackwardHistoNo.size(); }
|
||||
virtual Int_t GetBackwardHistoNo(UInt_t idx=0);
|
||||
virtual UInt_t GetAddBackwardHistoNoEntries() { return fAddBackwardHistoNo.size(); }
|
||||
virtual Int_t GetAddBackwardHistoNoSize(UInt_t addRunIdx);
|
||||
virtual Int_t GetAddBackwardHistoNo(UInt_t addRunIdx, UInt_t histoIdx);
|
||||
virtual Double_t GetBkgFix(UInt_t idx);
|
||||
virtual Int_t GetBkgRange(UInt_t idx);
|
||||
virtual Int_t GetDataRange(UInt_t idx);
|
||||
@ -446,9 +440,7 @@ class PMsrRunBlock {
|
||||
virtual void SetLifetimeCorrection(Bool_t bval) { fLifetimeCorrection = bval; }
|
||||
virtual void SetMap(Int_t mapVal, Int_t idx=-1);
|
||||
virtual void SetForwardHistoNo(Int_t histoNo, Int_t idx=-1);
|
||||
virtual void SetAddForwardHistoNo(Int_t histoNo, UInt_t addRunIdx, UInt_t histoNoIdx);
|
||||
virtual void SetBackwardHistoNo(Int_t histoNo, Int_t idx=-1);
|
||||
virtual void SetAddBackwardHistoNo(Int_t histoNo, UInt_t addRunIdx, UInt_t histoNoIdx);
|
||||
virtual void SetBkgFix(Double_t dval, Int_t idx=-1);
|
||||
virtual void SetBkgRange(Int_t ival, Int_t idx);
|
||||
virtual void SetDataRange(Int_t ival, Int_t idx);
|
||||
@ -476,9 +468,7 @@ class PMsrRunBlock {
|
||||
Bool_t fLifetimeCorrection; ///< lifetime correction flag for viewing (fit type 0)
|
||||
PIntVector fMap; ///< map vector needed to switch parameters for different runs within a single theory
|
||||
PIntVector fForwardHistoNo; ///< forward histogram number (fit type 0, 2, 4)
|
||||
vector<PIntVector> fAddForwardHistoNo; ///< forward histogram number for addrun's
|
||||
PIntVector fBackwardHistoNo; ///< backward histogram number (fit type 2, 4)
|
||||
vector<PIntVector> fAddBackwardHistoNo; ///< backward histogram number for addrun's
|
||||
Double_t fBkgFix[2]; ///< fixed background in (1/ns) (fit type 0, 2, 4)
|
||||
Int_t fBkgRange[4]; ///< background bin range (fit type 0, 2, 4)
|
||||
Int_t fDataRange[4]; ///< data bin range (fit type 0, 2, 4)
|
||||
|
Loading…
x
Reference in New Issue
Block a user