some more work on the encapsulation
This commit is contained in:
@ -315,7 +315,7 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages)
|
|||||||
Int_t runNo = -1, addRunNo = 0;
|
Int_t runNo = -1, addRunNo = 0;
|
||||||
Int_t plotNo = -1;
|
Int_t plotNo = -1;
|
||||||
string line;
|
string line;
|
||||||
TString str, sstr;
|
TString str, sstr, *pstr;
|
||||||
TObjArray *tokens = 0;
|
TObjArray *tokens = 0;
|
||||||
TObjString *ostr = 0;
|
TObjString *ostr = 0;
|
||||||
Bool_t found = false;
|
Bool_t found = false;
|
||||||
@ -492,31 +492,55 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages)
|
|||||||
sstr.Remove(TString::kLeading, ' ');
|
sstr.Remove(TString::kLeading, ' ');
|
||||||
if (sstr.BeginsWith("RUN")) {
|
if (sstr.BeginsWith("RUN")) {
|
||||||
fout << "RUN " << fRuns[runNo].GetRunName()->Data() << " ";
|
fout << "RUN " << fRuns[runNo].GetRunName()->Data() << " ";
|
||||||
str = fRuns[runNo].fBeamline[0];
|
pstr = fRuns[runNo].GetBeamline();
|
||||||
str.ToUpper();
|
if (pstr == 0) {
|
||||||
fout << str.Data() << " ";
|
cerr << endl << ">> PMsrHandler::WriteMsrLogFile: **ERROR** Couldn't obtain beamline data." << endl;
|
||||||
str = fRuns[runNo].fInstitute[0];
|
assert(0);
|
||||||
str.ToUpper();
|
}
|
||||||
fout << str.Data() << " ";
|
pstr->ToUpper();
|
||||||
str = fRuns[runNo].fFileFormat[0];
|
fout << pstr->Data() << " ";
|
||||||
str.ToUpper();
|
pstr = fRuns[runNo].GetInstitute();
|
||||||
fout << str.Data() << " (name beamline institute data-file-format)" << endl;
|
if (pstr == 0) {
|
||||||
|
cerr << endl << ">> PMsrHandler::WriteMsrLogFile: **ERROR** Couldn't obtain institute data." << endl;
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
pstr->ToUpper();
|
||||||
|
fout << pstr->Data() << " ";
|
||||||
|
pstr = fRuns[runNo].GetFileFormat();
|
||||||
|
if (pstr == 0) {
|
||||||
|
cerr << endl << ">> PMsrHandler::WriteMsrLogFile: **ERROR** Couldn't obtain file format data." << endl;
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
pstr->ToUpper();
|
||||||
|
fout << pstr->Data() << " (name beamline institute data-file-format)" << endl;
|
||||||
} else if (sstr.BeginsWith("ADDRUN")) {
|
} else if (sstr.BeginsWith("ADDRUN")) {
|
||||||
addRunNo++;
|
addRunNo++;
|
||||||
fout << "ADDRUN " << fRuns[runNo].GetRunName(addRunNo)->Data() << " ";
|
fout << "ADDRUN " << fRuns[runNo].GetRunName(addRunNo)->Data() << " ";
|
||||||
str = fRuns[runNo].fBeamline[addRunNo];
|
pstr = fRuns[runNo].GetBeamline(addRunNo);
|
||||||
str.ToUpper();
|
if (pstr == 0) {
|
||||||
fout << str.Data() << " ";
|
cerr << endl << ">> PMsrHandler::WriteMsrLogFile: **ERROR** Couldn't obtain beamline data (addrun)." << endl;
|
||||||
str = fRuns[runNo].fInstitute[addRunNo];
|
assert(0);
|
||||||
str.ToUpper();
|
}
|
||||||
fout << str.Data() << " ";
|
pstr->ToUpper();
|
||||||
str = fRuns[runNo].fFileFormat[addRunNo];
|
fout << pstr->Data() << " ";
|
||||||
str.ToUpper();
|
pstr = fRuns[runNo].GetInstitute(addRunNo);
|
||||||
fout << str.Data() << " (name beamline institute data-file-format)" << endl;
|
if (pstr == 0) {
|
||||||
|
cerr << endl << ">> PMsrHandler::WriteMsrLogFile: **ERROR** Couldn't obtain institute data (addrun)." << endl;
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
pstr->ToUpper();
|
||||||
|
fout << pstr->Data() << " ";
|
||||||
|
pstr = fRuns[runNo].GetFileFormat(addRunNo);
|
||||||
|
if (pstr == 0) {
|
||||||
|
cerr << endl << ">> PMsrHandler::WriteMsrLogFile: **ERROR** Couldn't obtain file format data (addrun)." << endl;
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
pstr->ToUpper();
|
||||||
|
fout << pstr->Data() << " (name beamline institute data-file-format)" << endl;
|
||||||
} else if (sstr.BeginsWith("fittype")) {
|
} else if (sstr.BeginsWith("fittype")) {
|
||||||
addRunNo = 0;
|
addRunNo = 0;
|
||||||
fout.width(16);
|
fout.width(16);
|
||||||
switch (fRuns[runNo].fFitType) {
|
switch (fRuns[runNo].GetFitType()) {
|
||||||
case MSR_FITTYPE_SINGLE_HISTO:
|
case MSR_FITTYPE_SINGLE_HISTO:
|
||||||
fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO << " (single histogram fit)" << endl;
|
fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO << " (single histogram fit)" << endl;
|
||||||
break;
|
break;
|
||||||
@ -545,53 +569,53 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages)
|
|||||||
} else if (sstr.BeginsWith("alpha ")) {
|
} else if (sstr.BeginsWith("alpha ")) {
|
||||||
fout.width(16);
|
fout.width(16);
|
||||||
fout << left << "alpha";
|
fout << left << "alpha";
|
||||||
fout << fRuns[runNo].fAlphaParamNo << endl;
|
fout << fRuns[runNo].GetAlphaParamNo() << endl;
|
||||||
} else if (sstr.BeginsWith("beta ")) {
|
} else if (sstr.BeginsWith("beta ")) {
|
||||||
fout.width(16);
|
fout.width(16);
|
||||||
fout << left << "beta";
|
fout << left << "beta";
|
||||||
fout << fRuns[runNo].fBetaParamNo << endl;
|
fout << fRuns[runNo].GetBetaParamNo() << endl;
|
||||||
} else if (sstr.BeginsWith("alpha2")) {
|
} else if (sstr.BeginsWith("alpha2")) {
|
||||||
fout.width(16);
|
fout.width(16);
|
||||||
fout << left << "alpha2";
|
fout << left << "alpha2";
|
||||||
fout << fRuns[runNo].fAlphaParamNo << endl;
|
fout << fRuns[runNo].fAlpha2ParamNo << endl;
|
||||||
} else if (sstr.BeginsWith("beta2")) {
|
} else if (sstr.BeginsWith("beta2")) {
|
||||||
fout.width(16);
|
fout.width(16);
|
||||||
fout << left << "beta2";
|
fout << left << "beta2";
|
||||||
fout << fRuns[runNo].fBetaParamNo << endl;
|
fout << fRuns[runNo].fBeta2ParamNo << endl;
|
||||||
} else if (sstr.BeginsWith("norm")) {
|
} else if (sstr.BeginsWith("norm")) {
|
||||||
fout.width(16);
|
fout.width(16);
|
||||||
fout << left << "norm";
|
fout << left << "norm";
|
||||||
// check if norm is give as a function
|
// check if norm is give as a function
|
||||||
if (fRuns[runNo].fNormParamNo >= MSR_PARAM_FUN_OFFSET)
|
if (fRuns[runNo].GetNormParamNo() >= MSR_PARAM_FUN_OFFSET)
|
||||||
fout << "fun" << fRuns[runNo].fNormParamNo-MSR_PARAM_FUN_OFFSET;
|
fout << "fun" << fRuns[runNo].GetNormParamNo()-MSR_PARAM_FUN_OFFSET;
|
||||||
else
|
else
|
||||||
fout << fRuns[runNo].fNormParamNo;
|
fout << fRuns[runNo].GetNormParamNo();
|
||||||
fout << endl;
|
fout << endl;
|
||||||
} else if (sstr.BeginsWith("backgr.fit")) {
|
} else if (sstr.BeginsWith("backgr.fit")) {
|
||||||
fout.width(16);
|
fout.width(16);
|
||||||
fout << left << "backgr.fit";
|
fout << left << "backgr.fit";
|
||||||
fout << fRuns[runNo].fBkgFitParamNo << endl;
|
fout << fRuns[runNo].GetBkgFitParamNo() << endl;
|
||||||
} else if (sstr.BeginsWith("rphase")) {
|
} else if (sstr.BeginsWith("rphase")) {
|
||||||
fout.width(16);
|
fout.width(16);
|
||||||
fout << left << "rphase";
|
fout << left << "rphase";
|
||||||
fout << fRuns[runNo].fPhaseParamNo << endl;
|
fout << fRuns[runNo].GetPhaseParamNo() << endl;
|
||||||
} else if (sstr.BeginsWith("lifetime ")) {
|
} else if (sstr.BeginsWith("lifetime ")) {
|
||||||
fout.width(16);
|
fout.width(16);
|
||||||
fout << left << "lifetime";
|
fout << left << "lifetime";
|
||||||
fout << fRuns[runNo].fLifetimeParamNo << endl;
|
fout << fRuns[runNo].GetLifetimeParamNo() << endl;
|
||||||
} else if (sstr.BeginsWith("lifetimecorrection")) {
|
} else if (sstr.BeginsWith("lifetimecorrection")) {
|
||||||
if ((fRuns[runNo].fLifetimeCorrection) && (fRuns[runNo].fFitType == MSR_FITTYPE_SINGLE_HISTO)) {
|
if ((fRuns[runNo].IsLifetimeCorrected()) && (fRuns[runNo].GetFitType() == MSR_FITTYPE_SINGLE_HISTO)) {
|
||||||
fout << "lifetimecorrection" << endl;
|
fout << "lifetimecorrection" << endl;
|
||||||
}
|
}
|
||||||
} else if (sstr.BeginsWith("map")) {
|
} else if (sstr.BeginsWith("map")) {
|
||||||
fout << "map ";
|
fout << "map ";
|
||||||
for (UInt_t j=0; j<fRuns[runNo].fMap.size(); j++) {
|
for (UInt_t j=0; j<fRuns[runNo].GetMap()->size(); j++) {
|
||||||
fout.width(5);
|
fout.width(5);
|
||||||
fout << right << fRuns[runNo].fMap[j];
|
fout << right << fRuns[runNo].GetMap(j);
|
||||||
}
|
}
|
||||||
// if there are less maps then 10 fill with zeros
|
// if there are less maps then 10 fill with zeros
|
||||||
if (fRuns[runNo].fMap.size() < 10) {
|
if (fRuns[runNo].GetMap()->size() < 10) {
|
||||||
for (UInt_t j=fRuns[runNo].fMap.size(); j<10; j++)
|
for (UInt_t j=fRuns[runNo].GetMap()->size(); j<10; j++)
|
||||||
fout << " 0";
|
fout << " 0";
|
||||||
}
|
}
|
||||||
fout << endl;
|
fout << endl;
|
||||||
@ -1448,13 +1472,13 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
param.AppendRunName(ostr->GetString());
|
param.AppendRunName(ostr->GetString());
|
||||||
// beamline
|
// beamline
|
||||||
ostr = dynamic_cast<TObjString*>(tokens->At(2));
|
ostr = dynamic_cast<TObjString*>(tokens->At(2));
|
||||||
param.fBeamline.push_back(ostr->GetString());
|
param.AppendBeamline(ostr->GetString());
|
||||||
// institute
|
// institute
|
||||||
ostr = dynamic_cast<TObjString*>(tokens->At(3));
|
ostr = dynamic_cast<TObjString*>(tokens->At(3));
|
||||||
param.fInstitute.push_back(ostr->GetString());
|
param.AppendInstitute(ostr->GetString());
|
||||||
// data file format
|
// data file format
|
||||||
ostr = dynamic_cast<TObjString*>(tokens->At(4));
|
ostr = dynamic_cast<TObjString*>(tokens->At(4));
|
||||||
param.fFileFormat.push_back(ostr->GetString());
|
param.AppendFileFormat(ostr->GetString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1469,13 +1493,13 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
param.AppendRunName(ostr->GetString());
|
param.AppendRunName(ostr->GetString());
|
||||||
// beamline
|
// beamline
|
||||||
ostr = dynamic_cast<TObjString*>(tokens->At(2));
|
ostr = dynamic_cast<TObjString*>(tokens->At(2));
|
||||||
param.fBeamline.push_back(ostr->GetString());
|
param.AppendBeamline(ostr->GetString());
|
||||||
// institute
|
// institute
|
||||||
ostr = dynamic_cast<TObjString*>(tokens->At(3));
|
ostr = dynamic_cast<TObjString*>(tokens->At(3));
|
||||||
param.fInstitute.push_back(ostr->GetString());
|
param.AppendInstitute(ostr->GetString());
|
||||||
// data file format
|
// data file format
|
||||||
ostr = dynamic_cast<TObjString*>(tokens->At(4));
|
ostr = dynamic_cast<TObjString*>(tokens->At(4));
|
||||||
param.fFileFormat.push_back(ostr->GetString());
|
param.AppendFileFormat(ostr->GetString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1492,7 +1516,7 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
(fittype == MSR_FITTYPE_ASYM) ||
|
(fittype == MSR_FITTYPE_ASYM) ||
|
||||||
(fittype == MSR_FITTYPE_ASYM_RRF) ||
|
(fittype == MSR_FITTYPE_ASYM_RRF) ||
|
||||||
(fittype == MSR_FITTYPE_NON_MUSR)) {
|
(fittype == MSR_FITTYPE_NON_MUSR)) {
|
||||||
param.fFitType = fittype;
|
param.SetFitType(fittype);
|
||||||
} else {
|
} else {
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
@ -1510,7 +1534,7 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
ostr = dynamic_cast<TObjString*>(tokens->At(1));
|
ostr = dynamic_cast<TObjString*>(tokens->At(1));
|
||||||
str = ostr->GetString();
|
str = ostr->GetString();
|
||||||
if (str.IsDigit())
|
if (str.IsDigit())
|
||||||
param.fAlphaParamNo = str.Atoi();
|
param.SetAlphaParamNo(str.Atoi());
|
||||||
else
|
else
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
@ -1524,7 +1548,7 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
ostr = dynamic_cast<TObjString*>(tokens->At(1));
|
ostr = dynamic_cast<TObjString*>(tokens->At(1));
|
||||||
str = ostr->GetString();
|
str = ostr->GetString();
|
||||||
if (str.IsDigit())
|
if (str.IsDigit())
|
||||||
param.fBetaParamNo = str.Atoi();
|
param.SetBetaParamNo(str.Atoi());
|
||||||
else
|
else
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
@ -1538,11 +1562,11 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
ostr = dynamic_cast<TObjString*>(tokens->At(1));
|
ostr = dynamic_cast<TObjString*>(tokens->At(1));
|
||||||
str = ostr->GetString();
|
str = ostr->GetString();
|
||||||
if (str.IsDigit()) {
|
if (str.IsDigit()) {
|
||||||
param.fNormParamNo = str.Atoi();
|
param.SetNormParamNo(str.Atoi());
|
||||||
} else if (str.Contains("fun")) {
|
} else if (str.Contains("fun")) {
|
||||||
Int_t no;
|
Int_t no;
|
||||||
if (FilterNumber(str, "fun", MSR_PARAM_FUN_OFFSET, no))
|
if (FilterNumber(str, "fun", MSR_PARAM_FUN_OFFSET, no))
|
||||||
param.fNormParamNo = no;
|
param.SetNormParamNo(no);
|
||||||
else
|
else
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
@ -1559,7 +1583,7 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
ostr = dynamic_cast<TObjString*>(tokens->At(1));
|
ostr = dynamic_cast<TObjString*>(tokens->At(1));
|
||||||
str = ostr->GetString();
|
str = ostr->GetString();
|
||||||
if (str.IsDigit())
|
if (str.IsDigit())
|
||||||
param.fBkgFitParamNo = str.Atoi();
|
param.SetBkgFitParamNo(str.Atoi());
|
||||||
else
|
else
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
@ -1573,7 +1597,7 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
ostr = dynamic_cast<TObjString*>(tokens->At(1));
|
ostr = dynamic_cast<TObjString*>(tokens->At(1));
|
||||||
str = ostr->GetString();
|
str = ostr->GetString();
|
||||||
if (str.IsDigit())
|
if (str.IsDigit())
|
||||||
param.fPhaseParamNo = str.Atoi();
|
param.SetPhaseParamNo(str.Atoi());
|
||||||
else
|
else
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
@ -1587,7 +1611,7 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
ostr = dynamic_cast<TObjString*>(tokens->At(1));
|
ostr = dynamic_cast<TObjString*>(tokens->At(1));
|
||||||
str = ostr->GetString();
|
str = ostr->GetString();
|
||||||
if (str.IsDigit())
|
if (str.IsDigit())
|
||||||
param.fLifetimeParamNo = str.Atoi();
|
param.SetLifetimeParamNo(str.Atoi());
|
||||||
else
|
else
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
@ -1595,7 +1619,7 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
|
|
||||||
// lifetimecorrection ---------------------------------------
|
// lifetimecorrection ---------------------------------------
|
||||||
if (iter->fLine.BeginsWith("lifetimecorrection", TString::kIgnoreCase)) {
|
if (iter->fLine.BeginsWith("lifetimecorrection", TString::kIgnoreCase)) {
|
||||||
param.fLifetimeCorrection = true;
|
param.SetLifetimeCorrection(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// map ------------------------------------------------------
|
// map ------------------------------------------------------
|
||||||
@ -1604,14 +1628,14 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
ostr = dynamic_cast<TObjString*>(tokens->At(i));
|
ostr = dynamic_cast<TObjString*>(tokens->At(i));
|
||||||
str = ostr->GetString();
|
str = ostr->GetString();
|
||||||
if (str.IsDigit())
|
if (str.IsDigit())
|
||||||
param.fMap.push_back(str.Atoi());
|
param.AppendMap(str.Atoi());
|
||||||
else
|
else
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
// check map entries, i.e. if the map values are within parameter bounds
|
// check map entries, i.e. if the map values are within parameter bounds
|
||||||
for (UInt_t i=0; i<param.fMap.size(); i++) {
|
for (UInt_t i=0; i<param.GetMap()->size(); i++) {
|
||||||
if ((param.fMap[i] < 0) || (param.fMap[i] > (Int_t) fParam.size())) {
|
if ((param.GetMap(i) < 0) || (param.GetMap(i) > (Int_t) fParam.size())) {
|
||||||
cerr << endl << ">> PMsrHandler::HandleRunEntry: **SEVERE ERROR** map value " << param.fMap[i] << " in line " << iter->fLineNo << " is out of range!";
|
cerr << endl << ">> PMsrHandler::HandleRunEntry: **SEVERE ERROR** map value " << param.GetMap(i) << " in line " << iter->fLineNo << " is out of range!";
|
||||||
error = true;
|
error = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1869,11 +1893,11 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
|||||||
|
|
||||||
// check if for fittypes: single histo, asymmetry, RRF any background info is given
|
// check if for fittypes: single histo, asymmetry, RRF any background info is given
|
||||||
for (UInt_t i=0; i<fRuns.size(); i++) {
|
for (UInt_t i=0; i<fRuns.size(); i++) {
|
||||||
if ((fRuns[i].fFitType == MSR_FITTYPE_SINGLE_HISTO) ||
|
if ((fRuns[i].GetFitType() == MSR_FITTYPE_SINGLE_HISTO) ||
|
||||||
(fRuns[i].fFitType == MSR_FITTYPE_ASYM) ||
|
(fRuns[i].GetFitType() == MSR_FITTYPE_ASYM) ||
|
||||||
(fRuns[i].fFitType == MSR_FITTYPE_ASYM_RRF)) {
|
(fRuns[i].GetFitType() == MSR_FITTYPE_ASYM_RRF)) {
|
||||||
Bool_t found;
|
Bool_t found;
|
||||||
if (fRuns[i].fBkgFitParamNo >= 0) { // check if backgr.fit is given
|
if (fRuns[i].GetBkgFitParamNo() >= 0) { // check if backgr.fit is given
|
||||||
found = true;
|
found = true;
|
||||||
} else if (fRuns[i].fBkgFix.size() > 0) { // check if backgr.fix is given
|
} else if (fRuns[i].fBkgFix.size() > 0) { // check if backgr.fix is given
|
||||||
found = true;
|
found = true;
|
||||||
@ -3234,9 +3258,9 @@ Bool_t PMsrHandler::CheckMaps()
|
|||||||
for (UInt_t i=0; i<mapVec.size(); i++) { // loop over found maps in theory- and function-block
|
for (UInt_t i=0; i<mapVec.size(); i++) { // loop over found maps in theory- and function-block
|
||||||
found = false;
|
found = false;
|
||||||
for (UInt_t j=0; j<fRuns.size(); j++) { // loop over all run-blocks
|
for (UInt_t j=0; j<fRuns.size(); j++) { // loop over all run-blocks
|
||||||
if ((mapVec[i]-MSR_PARAM_MAP_OFFSET-1 < (Int_t)fRuns[j].fMap.size()) &&
|
if ((mapVec[i]-MSR_PARAM_MAP_OFFSET-1 < (Int_t)fRuns[j].GetMap()->size()) &&
|
||||||
(mapVec[i]-MSR_PARAM_MAP_OFFSET-1 >= 0)) { // map value smaller than run-block map length
|
(mapVec[i]-MSR_PARAM_MAP_OFFSET-1 >= 0)) { // map value smaller than run-block map length
|
||||||
if (fRuns[j].fMap[mapVec[i]-MSR_PARAM_MAP_OFFSET-1] != 0) { // map value in the run-block != 0
|
if (fRuns[j].GetMap(mapVec[i]-MSR_PARAM_MAP_OFFSET-1) != 0) { // map value in the run-block != 0
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -3313,8 +3337,8 @@ Bool_t PMsrHandler::CheckFuncs()
|
|||||||
|
|
||||||
// check if func is present in the run-block
|
// check if func is present in the run-block
|
||||||
for (UInt_t i=0; i<fRuns.size(); i++) {
|
for (UInt_t i=0; i<fRuns.size(); i++) {
|
||||||
if (fRuns[i].fNormParamNo >= MSR_PARAM_FUN_OFFSET) { // function found
|
if (fRuns[i].GetNormParamNo() >= MSR_PARAM_FUN_OFFSET) { // function found
|
||||||
funVec.push_back(fRuns[i].fNormParamNo);
|
funVec.push_back(fRuns[i].GetNormParamNo());
|
||||||
funBlock.push_back(1); // 1 = run-block
|
funBlock.push_back(1); // 1 = run-block
|
||||||
funLineBlockNo.push_back(i+1);
|
funLineBlockNo.push_back(i+1);
|
||||||
}
|
}
|
||||||
|
@ -580,3 +580,131 @@ void PMsrRunBlock::SetRunName(TString &str, UInt_t i)
|
|||||||
|
|
||||||
fRunName[i] = str;
|
fRunName[i] = str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// GetBeamline
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p> get beamline name at position i
|
||||||
|
*
|
||||||
|
* \param i index of the beamline to be returned
|
||||||
|
*/
|
||||||
|
TString* PMsrRunBlock::GetBeamline(UInt_t i)
|
||||||
|
{
|
||||||
|
if (i>fBeamline.size())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return &fBeamline[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// SetBeamline
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p> set beamline name at position i
|
||||||
|
*
|
||||||
|
* \param i index of the beamline name to be set
|
||||||
|
*/
|
||||||
|
void PMsrRunBlock::SetBeamline(TString &str, UInt_t i)
|
||||||
|
{
|
||||||
|
if (i>fBeamline.size())
|
||||||
|
fBeamline.resize(i+1);
|
||||||
|
|
||||||
|
fBeamline[i] = str;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// GetInstitute
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p> get institute name at position i
|
||||||
|
*
|
||||||
|
* \param i index of the institute to be returned
|
||||||
|
*/
|
||||||
|
TString* PMsrRunBlock::GetInstitute(UInt_t i)
|
||||||
|
{
|
||||||
|
if (i>fInstitute.size())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return &fInstitute[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// SetInstitute
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p> set institute name at position i
|
||||||
|
*
|
||||||
|
* \param i index of the run name to be set
|
||||||
|
*/
|
||||||
|
void PMsrRunBlock::SetInstitute(TString &str, UInt_t i)
|
||||||
|
{
|
||||||
|
if (i>fInstitute.size())
|
||||||
|
fInstitute.resize(i+1);
|
||||||
|
|
||||||
|
fInstitute[i] = str;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// GetFileFormat
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p> get file format name at position i
|
||||||
|
*
|
||||||
|
* \param i index of the file format to be returned
|
||||||
|
*/
|
||||||
|
TString* PMsrRunBlock::GetFileFormat(UInt_t i)
|
||||||
|
{
|
||||||
|
if (i>fFileFormat.size())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return &fFileFormat[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// SetFileFormat
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p> set file format name at position i
|
||||||
|
*
|
||||||
|
* \param i index of the file format name to be set
|
||||||
|
*/
|
||||||
|
void PMsrRunBlock::SetFileFormat(TString &str, UInt_t i)
|
||||||
|
{
|
||||||
|
if (i>fFileFormat.size())
|
||||||
|
fFileFormat.resize(i+1);
|
||||||
|
|
||||||
|
fFileFormat[i] = str;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// GetMap
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p> get map value at position i
|
||||||
|
*
|
||||||
|
* \param i index of the map value to be returned
|
||||||
|
*/
|
||||||
|
Int_t PMsrRunBlock::GetMap(UInt_t i)
|
||||||
|
{
|
||||||
|
if (i>fMap.size())
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return fMap[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// SetMap
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p> set file format name at position i
|
||||||
|
*
|
||||||
|
* \param i index of the file format name to be set
|
||||||
|
*/
|
||||||
|
void PMsrRunBlock::SetMap(Int_t mapVal, UInt_t idx)
|
||||||
|
{
|
||||||
|
if (idx>fMap.size())
|
||||||
|
fMap.resize(idx+1);
|
||||||
|
|
||||||
|
fMap[idx] = mapVal;
|
||||||
|
}
|
||||||
|
@ -390,9 +390,9 @@ void PMusrCanvas::UpdateDataTheoryPad()
|
|||||||
runNo = (UInt_t)plotInfo.fRuns[i].Re()-1;
|
runNo = (UInt_t)plotInfo.fRuns[i].Re()-1;
|
||||||
//cout << endl << ">> runNo = " << runNo;
|
//cout << endl << ">> runNo = " << runNo;
|
||||||
//cout << endl;
|
//cout << endl;
|
||||||
if (fPlotType != runs[runNo].fFitType) {
|
if (fPlotType != runs[runNo].GetFitType()) {
|
||||||
fValid = false;
|
fValid = false;
|
||||||
cerr << endl << "PMusrCanvas::UpdateDataTheoryPad: **ERROR** plottype = " << fPlotType << ", fittype = " << runs[runNo].fFitType << ", however they have to correspond!";
|
cerr << endl << "PMusrCanvas::UpdateDataTheoryPad: **ERROR** plottype = " << fPlotType << ", fittype = " << runs[runNo].GetFitType() << ", however they have to correspond!";
|
||||||
cerr << endl;
|
cerr << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -404,7 +404,7 @@ void PMusrCanvas::UpdateDataTheoryPad()
|
|||||||
data = 0;
|
data = 0;
|
||||||
runNo = (UInt_t)plotInfo.fRuns[i].Re()-1;
|
runNo = (UInt_t)plotInfo.fRuns[i].Re()-1;
|
||||||
// get data depending on the fittype
|
// get data depending on the fittype
|
||||||
switch (runs[runNo].fFitType) {
|
switch (runs[runNo].GetFitType()) {
|
||||||
case MSR_FITTYPE_SINGLE_HISTO:
|
case MSR_FITTYPE_SINGLE_HISTO:
|
||||||
data = fRunList->GetSingleHisto(runNo, PRunListCollection::kRunNo);
|
data = fRunList->GetSingleHisto(runNo, PRunListCollection::kRunNo);
|
||||||
if (!data) { // something wrong
|
if (!data) { // something wrong
|
||||||
@ -530,15 +530,15 @@ void PMusrCanvas::UpdateInfoPad()
|
|||||||
// run label = run_name/histo/T=0K/B=0G/E=0keV/...
|
// run label = run_name/histo/T=0K/B=0G/E=0keV/...
|
||||||
runNo = (UInt_t)plotInfo.fRuns[i].Re()-1;
|
runNo = (UInt_t)plotInfo.fRuns[i].Re()-1;
|
||||||
if (runs[runNo].GetRunNames().size() > 1)
|
if (runs[runNo].GetRunNames().size() > 1)
|
||||||
tstr = "++" + *(runs[runNo].GetRunName()) + TString(","); // run_name
|
tstr = "++" + *runs[runNo].GetRunName() + TString(","); // run_name
|
||||||
else
|
else
|
||||||
tstr = *(runs[runNo].GetRunName()) + TString(","); // run_name
|
tstr = *runs[runNo].GetRunName() + TString(","); // run_name
|
||||||
// histo info (depending on the fittype
|
// histo info (depending on the fittype
|
||||||
if (runs[runNo].fFitType == MSR_FITTYPE_SINGLE_HISTO) {
|
if (runs[runNo].GetFitType() == MSR_FITTYPE_SINGLE_HISTO) {
|
||||||
tstr += TString("h:");
|
tstr += TString("h:");
|
||||||
tstr += runs[runNo].fForwardHistoNo;
|
tstr += runs[runNo].fForwardHistoNo;
|
||||||
tstr += TString(",");
|
tstr += TString(",");
|
||||||
} else if (runs[runNo].fFitType == MSR_FITTYPE_ASYM) {
|
} else if (runs[runNo].GetFitType() == MSR_FITTYPE_ASYM) {
|
||||||
tstr += TString("h:");
|
tstr += TString("h:");
|
||||||
tstr += runs[runNo].fForwardHistoNo;
|
tstr += runs[runNo].fForwardHistoNo;
|
||||||
tstr += TString("/");
|
tstr += TString("/");
|
||||||
@ -546,7 +546,7 @@ void PMusrCanvas::UpdateInfoPad()
|
|||||||
tstr += TString(",");
|
tstr += TString(",");
|
||||||
}
|
}
|
||||||
// temperature if present
|
// temperature if present
|
||||||
ddvec = fRunList->GetTemp(*(runs[runNo].GetRunName()));
|
ddvec = fRunList->GetTemp(*runs[runNo].GetRunName());
|
||||||
if (ddvec.empty()) {
|
if (ddvec.empty()) {
|
||||||
tstr += TString("T=");
|
tstr += TString("T=");
|
||||||
tstr += TString("??,");
|
tstr += TString("??,");
|
||||||
@ -564,7 +564,7 @@ void PMusrCanvas::UpdateInfoPad()
|
|||||||
}
|
}
|
||||||
// field if present
|
// field if present
|
||||||
tstr += TString("B=");
|
tstr += TString("B=");
|
||||||
dval = fRunList->GetField(*(runs[runNo].GetRunName()));
|
dval = fRunList->GetField(*runs[runNo].GetRunName());
|
||||||
if (dval == PMUSR_UNDEFINED) {
|
if (dval == PMUSR_UNDEFINED) {
|
||||||
tstr += TString("??,");
|
tstr += TString("??,");
|
||||||
} else {
|
} else {
|
||||||
@ -573,7 +573,7 @@ void PMusrCanvas::UpdateInfoPad()
|
|||||||
}
|
}
|
||||||
// energy if present
|
// energy if present
|
||||||
tstr += TString("E=");
|
tstr += TString("E=");
|
||||||
dval = fRunList->GetEnergy(*(runs[runNo].GetRunName()));
|
dval = fRunList->GetEnergy(*runs[runNo].GetRunName());
|
||||||
//cout << endl << ">> dval = " << dval << " (Engery)";
|
//cout << endl << ">> dval = " << dval << " (Engery)";
|
||||||
if (dval == PMUSR_UNDEFINED) {
|
if (dval == PMUSR_UNDEFINED) {
|
||||||
tstr += TString("??,");
|
tstr += TString("??,");
|
||||||
@ -582,7 +582,7 @@ void PMusrCanvas::UpdateInfoPad()
|
|||||||
tstr += TString(sval) + TString("keV,");
|
tstr += TString(sval) + TString("keV,");
|
||||||
}
|
}
|
||||||
// setup if present
|
// setup if present
|
||||||
tstr += fRunList->GetSetup(*(runs[runNo].GetRunName()));
|
tstr += fRunList->GetSetup(*runs[runNo].GetRunName());
|
||||||
// add entry
|
// add entry
|
||||||
fInfoPad->AddEntry(fData[i].data, tstr.Data(), "p");
|
fInfoPad->AddEntry(fData[i].data, tstr.Data(), "p");
|
||||||
}
|
}
|
||||||
@ -1390,7 +1390,7 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data)
|
|||||||
|
|
||||||
// dataHisto -------------------------------------------------------------
|
// dataHisto -------------------------------------------------------------
|
||||||
// create histo specific infos
|
// create histo specific infos
|
||||||
name = *(fMsrHandler->GetMsrRunList()->at(runNo).GetRunName()) + "_DataRunNo";
|
name = *fMsrHandler->GetMsrRunList()->at(runNo).GetRunName() + "_DataRunNo";
|
||||||
name += (Int_t)runNo;
|
name += (Int_t)runNo;
|
||||||
name += "_";
|
name += "_";
|
||||||
name += fPlotNumber;
|
name += fPlotNumber;
|
||||||
@ -1472,7 +1472,7 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data)
|
|||||||
|
|
||||||
// theoHisto -------------------------------------------------------------
|
// theoHisto -------------------------------------------------------------
|
||||||
// create histo specific infos
|
// create histo specific infos
|
||||||
name = *(fMsrHandler->GetMsrRunList()->at(runNo).GetRunName()) + "_TheoRunNo";
|
name = *fMsrHandler->GetMsrRunList()->at(runNo).GetRunName() + "_TheoRunNo";
|
||||||
name += (Int_t)runNo;
|
name += (Int_t)runNo;
|
||||||
name += "_";
|
name += "_";
|
||||||
name += fPlotNumber;
|
name += fPlotNumber;
|
||||||
@ -2378,7 +2378,7 @@ void PMusrCanvas::PlotData()
|
|||||||
PMsrRunList *runList = fMsrHandler->GetMsrRunList();
|
PMsrRunList *runList = fMsrHandler->GetMsrRunList();
|
||||||
switch (fPlotType) {
|
switch (fPlotType) {
|
||||||
case MSR_PLOT_SINGLE_HISTO:
|
case MSR_PLOT_SINGLE_HISTO:
|
||||||
if (runList->at(0).fLifetimeCorrection) { // lifetime correction
|
if (runList->at(0).IsLifetimeCorrected()) { // lifetime correction
|
||||||
yAxisTitle = "asymmetry";
|
yAxisTitle = "asymmetry";
|
||||||
} else { // no liftime correction
|
} else { // no liftime correction
|
||||||
yAxisTitle = "N(t) per nsec";
|
yAxisTitle = "N(t) per nsec";
|
||||||
@ -2413,8 +2413,8 @@ void PMusrCanvas::PlotData()
|
|||||||
PMsrRunList runs = *fMsrHandler->GetMsrRunList();
|
PMsrRunList runs = *fMsrHandler->GetMsrRunList();
|
||||||
PMsrPlotStructure plotInfo = fMsrHandler->GetMsrPlotList()->at(fPlotNumber);
|
PMsrPlotStructure plotInfo = fMsrHandler->GetMsrPlotList()->at(fPlotNumber);
|
||||||
UInt_t runNo = (UInt_t)plotInfo.fRuns[0].Re()-1;
|
UInt_t runNo = (UInt_t)plotInfo.fRuns[0].Re()-1;
|
||||||
TString xAxisTitle = fRunList->GetXAxisTitle(*(runs[runNo].GetRunName()), runNo);
|
TString xAxisTitle = fRunList->GetXAxisTitle(*runs[runNo].GetRunName(), runNo);
|
||||||
TString yAxisTitle = fRunList->GetYAxisTitle(*(runs[runNo].GetRunName()), runNo);
|
TString yAxisTitle = fRunList->GetYAxisTitle(*runs[runNo].GetRunName(), runNo);
|
||||||
|
|
||||||
if (fNonMusrData.size() > 0) {
|
if (fNonMusrData.size() > 0) {
|
||||||
// check if fMultiGraphData needs to be created, and if yes add all data and theory
|
// check if fMultiGraphData needs to be created, and if yes add all data and theory
|
||||||
@ -2472,8 +2472,8 @@ void PMusrCanvas::PlotData()
|
|||||||
PStringVector legendLabel;
|
PStringVector legendLabel;
|
||||||
for (UInt_t i=0; i<plotInfo.fRuns.size(); i++) {
|
for (UInt_t i=0; i<plotInfo.fRuns.size(); i++) {
|
||||||
runNo = (UInt_t)plotInfo.fRuns[i].Re()-1;
|
runNo = (UInt_t)plotInfo.fRuns[i].Re()-1;
|
||||||
xAxisTitle = fRunList->GetXAxisTitle(*(runs[runNo].GetRunName()), runNo);
|
xAxisTitle = fRunList->GetXAxisTitle(*runs[runNo].GetRunName(), runNo);
|
||||||
yAxisTitle = fRunList->GetYAxisTitle(*(runs[runNo].GetRunName()), runNo);
|
yAxisTitle = fRunList->GetYAxisTitle(*runs[runNo].GetRunName(), runNo);
|
||||||
legendLabel.push_back(xAxisTitle + " vs. " + yAxisTitle);
|
legendLabel.push_back(xAxisTitle + " vs. " + yAxisTitle);
|
||||||
}
|
}
|
||||||
for (UInt_t i=0; i<fNonMusrData.size(); i++) {
|
for (UInt_t i=0; i<fNonMusrData.size(); i++) {
|
||||||
@ -2531,7 +2531,7 @@ void PMusrCanvas::PlotDifference()
|
|||||||
PMsrRunList runs = *fMsrHandler->GetMsrRunList();
|
PMsrRunList runs = *fMsrHandler->GetMsrRunList();
|
||||||
PMsrPlotStructure plotInfo = fMsrHandler->GetMsrPlotList()->at(fPlotNumber);
|
PMsrPlotStructure plotInfo = fMsrHandler->GetMsrPlotList()->at(fPlotNumber);
|
||||||
UInt_t runNo = (UInt_t)plotInfo.fRuns[0].Re()-1;
|
UInt_t runNo = (UInt_t)plotInfo.fRuns[0].Re()-1;
|
||||||
TString xAxisTitle = fRunList->GetXAxisTitle(*(runs[runNo].GetRunName()), runNo);
|
TString xAxisTitle = fRunList->GetXAxisTitle(*runs[runNo].GetRunName(), runNo);
|
||||||
|
|
||||||
// if fMultiGraphDiff is not present create it and add the diff data
|
// if fMultiGraphDiff is not present create it and add the diff data
|
||||||
if (!fMultiGraphDiff) {
|
if (!fMultiGraphDiff) {
|
||||||
|
@ -243,7 +243,7 @@ void PMusrT0::SetMsrHandler(PMsrHandler *msrHandler)
|
|||||||
void PMusrT0::InitDataAndBkg()
|
void PMusrT0::InitDataAndBkg()
|
||||||
{
|
{
|
||||||
// get addRun offset which depends on the fit type
|
// get addRun offset which depends on the fit type
|
||||||
Int_t fitType = fMsrHandler->GetMsrRunList()->at(fRunNo).fFitType;
|
Int_t fitType = fMsrHandler->GetMsrRunList()->at(fRunNo).GetFitType();
|
||||||
if (fitType == MSR_FITTYPE_SINGLE_HISTO) {
|
if (fitType == MSR_FITTYPE_SINGLE_HISTO) {
|
||||||
fAddRunOffset = 2;
|
fAddRunOffset = 2;
|
||||||
} else if (fitType == MSR_FITTYPE_ASYM) {
|
} else if (fitType == MSR_FITTYPE_ASYM) {
|
||||||
|
@ -66,15 +66,15 @@ PRunAsymmetry::PRunAsymmetry(PMsrHandler *msrInfo, PRunDataHandler *rawData, UIn
|
|||||||
PMsrParamList *param = msrInfo->GetMsrParamList();
|
PMsrParamList *param = msrInfo->GetMsrParamList();
|
||||||
|
|
||||||
// check if alpha is given
|
// check if alpha is given
|
||||||
if (fRunInfo->fAlphaParamNo == -1) { // no alpha given
|
if (fRunInfo->GetAlphaParamNo() == -1) { // no alpha given
|
||||||
cerr << endl << "PRunAsymmetry::PRunAsymmetry(): **ERROR** no alpha parameter given! This is needed for an asymmetry fit!";
|
cerr << endl << "PRunAsymmetry::PRunAsymmetry(): **ERROR** no alpha parameter given! This is needed for an asymmetry fit!";
|
||||||
cerr << endl;
|
cerr << endl;
|
||||||
fValid = false;
|
fValid = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// check if alpha parameter is within proper bounds
|
// check if alpha parameter is within proper bounds
|
||||||
if ((fRunInfo->fAlphaParamNo < 0) || (fRunInfo->fAlphaParamNo > (Int_t)param->size())) {
|
if ((fRunInfo->GetAlphaParamNo() < 0) || (fRunInfo->GetAlphaParamNo() > (Int_t)param->size())) {
|
||||||
cerr << endl << "PRunAsymmetry::PRunAsymmetry(): **ERROR** alpha parameter no = " << fRunInfo->fAlphaParamNo;
|
cerr << endl << "PRunAsymmetry::PRunAsymmetry(): **ERROR** alpha parameter no = " << fRunInfo->GetAlphaParamNo();
|
||||||
cerr << endl << " This is out of bound, since there are only " << param->size() << " parameters.";
|
cerr << endl << " This is out of bound, since there are only " << param->size() << " parameters.";
|
||||||
cerr << endl;
|
cerr << endl;
|
||||||
fValid = false;
|
fValid = false;
|
||||||
@ -82,24 +82,24 @@ PRunAsymmetry::PRunAsymmetry(PMsrHandler *msrInfo, PRunDataHandler *rawData, UIn
|
|||||||
}
|
}
|
||||||
// check if alpha is fixed
|
// check if alpha is fixed
|
||||||
Bool_t alphaFixedToOne = false;
|
Bool_t alphaFixedToOne = false;
|
||||||
//cout << endl << ">> alpha = " << (*param)[fRunInfo->fAlphaParamNo-1].fValue << ", " << (*param)[fRunInfo->fAlphaParamNo-1].fStep;
|
//cout << endl << ">> alpha = " << (*param)[fRunInfo->GetAlphaParamNo()-1].fValue << ", " << (*param)[fRunInfo->GetAlphaParamNo()-1].fStep;
|
||||||
if (((*param)[fRunInfo->fAlphaParamNo-1].fStep == 0.0) &&
|
if (((*param)[fRunInfo->GetAlphaParamNo()-1].fStep == 0.0) &&
|
||||||
((*param)[fRunInfo->fAlphaParamNo-1].fValue == 1.0))
|
((*param)[fRunInfo->GetAlphaParamNo()-1].fValue == 1.0))
|
||||||
alphaFixedToOne = true;
|
alphaFixedToOne = true;
|
||||||
|
|
||||||
// check if beta is given
|
// check if beta is given
|
||||||
Bool_t betaFixedToOne = false;
|
Bool_t betaFixedToOne = false;
|
||||||
if (fRunInfo->fBetaParamNo == -1) { // no beta given hence assuming beta == 1
|
if (fRunInfo->GetBetaParamNo() == -1) { // no beta given hence assuming beta == 1
|
||||||
betaFixedToOne = true;
|
betaFixedToOne = true;
|
||||||
} else if ((fRunInfo->fBetaParamNo < 0) || (fRunInfo->fBetaParamNo > (Int_t)param->size())) { // check if beta parameter is within proper bounds
|
} else if ((fRunInfo->GetBetaParamNo() < 0) || (fRunInfo->GetBetaParamNo() > (Int_t)param->size())) { // check if beta parameter is within proper bounds
|
||||||
cerr << endl << "PRunAsymmetry::PRunAsymmetry(): **ERROR** beta parameter no = " << fRunInfo->fBetaParamNo;
|
cerr << endl << "PRunAsymmetry::PRunAsymmetry(): **ERROR** beta parameter no = " << fRunInfo->GetBetaParamNo();
|
||||||
cerr << endl << " This is out of bound, since there are only " << param->size() << " parameters.";
|
cerr << endl << " This is out of bound, since there are only " << param->size() << " parameters.";
|
||||||
cerr << endl;
|
cerr << endl;
|
||||||
fValid = false;
|
fValid = false;
|
||||||
return;
|
return;
|
||||||
} else { // check if beta is fixed
|
} else { // check if beta is fixed
|
||||||
if (((*param)[fRunInfo->fBetaParamNo-1].fStep == 0.0) &&
|
if (((*param)[fRunInfo->GetBetaParamNo()-1].fStep == 0.0) &&
|
||||||
((*param)[fRunInfo->fBetaParamNo-1].fValue == 1.0))
|
((*param)[fRunInfo->GetBetaParamNo()-1].fValue == 1.0))
|
||||||
betaFixedToOne = true;
|
betaFixedToOne = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ Double_t PRunAsymmetry::CalcChiSquare(const std::vector<Double_t>& par)
|
|||||||
|
|
||||||
// calculate functions
|
// calculate functions
|
||||||
for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++) {
|
for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++) {
|
||||||
fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), fRunInfo->fMap, par);
|
fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), *fRunInfo->GetMap(), par);
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate chisq
|
// calculate chisq
|
||||||
@ -165,18 +165,18 @@ Double_t PRunAsymmetry::CalcChiSquare(const std::vector<Double_t>& par)
|
|||||||
asymFcnValue = fTheory->Func(time, par, fFuncValues);
|
asymFcnValue = fTheory->Func(time, par, fFuncValues);
|
||||||
break;
|
break;
|
||||||
case 2: // alpha != 1, beta == 1
|
case 2: // alpha != 1, beta == 1
|
||||||
a = par[fRunInfo->fAlphaParamNo-1];
|
a = par[fRunInfo->GetAlphaParamNo()-1];
|
||||||
f = fTheory->Func(time, par, fFuncValues);
|
f = fTheory->Func(time, par, fFuncValues);
|
||||||
asymFcnValue = (f*(a+1.0)-(a-1.0))/((a+1.0)-f*(a-1.0));
|
asymFcnValue = (f*(a+1.0)-(a-1.0))/((a+1.0)-f*(a-1.0));
|
||||||
break;
|
break;
|
||||||
case 3: // alpha == 1, beta != 1
|
case 3: // alpha == 1, beta != 1
|
||||||
b = par[fRunInfo->fBetaParamNo-1];
|
b = par[fRunInfo->GetBetaParamNo()-1];
|
||||||
f = fTheory->Func(time, par, fFuncValues);
|
f = fTheory->Func(time, par, fFuncValues);
|
||||||
asymFcnValue = f*(b+1.0)/(2.0-f*(b-1.0));
|
asymFcnValue = f*(b+1.0)/(2.0-f*(b-1.0));
|
||||||
break;
|
break;
|
||||||
case 4: // alpha != 1, beta != 1
|
case 4: // alpha != 1, beta != 1
|
||||||
a = par[fRunInfo->fAlphaParamNo-1];
|
a = par[fRunInfo->GetAlphaParamNo()-1];
|
||||||
b = par[fRunInfo->fBetaParamNo-1];
|
b = par[fRunInfo->GetBetaParamNo()-1];
|
||||||
f = fTheory->Func(time, par, fFuncValues);
|
f = fTheory->Func(time, par, fFuncValues);
|
||||||
asymFcnValue = (f*(a*b+1.0)-(a-1.0))/((a+1.0)-f*(a*b-1.0));
|
asymFcnValue = (f*(a*b+1.0)-(a-1.0))/((a+1.0)-f*(a*b-1.0));
|
||||||
break;
|
break;
|
||||||
@ -226,7 +226,7 @@ void PRunAsymmetry::CalcTheory()
|
|||||||
|
|
||||||
// calculate functions
|
// calculate functions
|
||||||
for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++) {
|
for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++) {
|
||||||
fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), fRunInfo->fMap, par);
|
fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), *fRunInfo->GetMap(), par);
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate asymmetry
|
// calculate asymmetry
|
||||||
@ -240,18 +240,18 @@ void PRunAsymmetry::CalcTheory()
|
|||||||
asymFcnValue = fTheory->Func(time, par, fFuncValues);
|
asymFcnValue = fTheory->Func(time, par, fFuncValues);
|
||||||
break;
|
break;
|
||||||
case 2: // alpha != 1, beta == 1
|
case 2: // alpha != 1, beta == 1
|
||||||
a = par[fRunInfo->fAlphaParamNo-1];
|
a = par[fRunInfo->GetAlphaParamNo()-1];
|
||||||
f = fTheory->Func(time, par, fFuncValues);
|
f = fTheory->Func(time, par, fFuncValues);
|
||||||
asymFcnValue = (f*(a+1.0)-(a-1.0))/((a+1.0)-f*(a-1.0));
|
asymFcnValue = (f*(a+1.0)-(a-1.0))/((a+1.0)-f*(a-1.0));
|
||||||
break;
|
break;
|
||||||
case 3: // alpha == 1, beta != 1
|
case 3: // alpha == 1, beta != 1
|
||||||
b = par[fRunInfo->fBetaParamNo-1];
|
b = par[fRunInfo->GetBetaParamNo()-1];
|
||||||
f = fTheory->Func(time, par, fFuncValues);
|
f = fTheory->Func(time, par, fFuncValues);
|
||||||
asymFcnValue = f*(b+1.0)/(2.0-f*(b-1.0));
|
asymFcnValue = f*(b+1.0)/(2.0-f*(b-1.0));
|
||||||
break;
|
break;
|
||||||
case 4: // alpha != 1, beta != 1
|
case 4: // alpha != 1, beta != 1
|
||||||
a = par[fRunInfo->fAlphaParamNo-1];
|
a = par[fRunInfo->GetAlphaParamNo()-1];
|
||||||
b = par[fRunInfo->fBetaParamNo-1];
|
b = par[fRunInfo->GetBetaParamNo()-1];
|
||||||
f = fTheory->Func(time, par, fFuncValues);
|
f = fTheory->Func(time, par, fFuncValues);
|
||||||
asymFcnValue = (f*(a*b+1.0)-(a-1.0))/((a+1.0)-f*(a*b-1.0));
|
asymFcnValue = (f*(a*b+1.0)-(a-1.0))/((a+1.0)-f*(a*b-1.0));
|
||||||
break;
|
break;
|
||||||
@ -520,11 +520,11 @@ Bool_t PRunAsymmetry::SubtractEstimatedBkg()
|
|||||||
Double_t beamPeriod = 0.0;
|
Double_t beamPeriod = 0.0;
|
||||||
|
|
||||||
// check if data are from PSI, RAL, or TRIUMF
|
// check if data are from PSI, RAL, or TRIUMF
|
||||||
if (fRunInfo->fInstitute[0].Contains("psi"))
|
if (fRunInfo->GetInstitute()->Contains("psi"))
|
||||||
beamPeriod = ACCEL_PERIOD_PSI;
|
beamPeriod = ACCEL_PERIOD_PSI;
|
||||||
else if (fRunInfo->fInstitute[0].Contains("ral"))
|
else if (fRunInfo->GetInstitute()->Contains("ral"))
|
||||||
beamPeriod = ACCEL_PERIOD_RAL;
|
beamPeriod = ACCEL_PERIOD_RAL;
|
||||||
else if (fRunInfo->fInstitute[0].Contains("triumf"))
|
else if (fRunInfo->GetInstitute()->Contains("triumf"))
|
||||||
beamPeriod = ACCEL_PERIOD_TRIUMF;
|
beamPeriod = ACCEL_PERIOD_TRIUMF;
|
||||||
else
|
else
|
||||||
beamPeriod = 0.0;
|
beamPeriod = 0.0;
|
||||||
@ -902,16 +902,16 @@ cout << endl << "--------------------------------" << endl;
|
|||||||
beta = 1.0;
|
beta = 1.0;
|
||||||
break;
|
break;
|
||||||
case 2: // alpha != 1, beta == 1
|
case 2: // alpha != 1, beta == 1
|
||||||
alpha = par[fRunInfo->fAlphaParamNo-1];
|
alpha = par[fRunInfo->GetAlphaParamNo()-1];
|
||||||
beta = 1.0;
|
beta = 1.0;
|
||||||
break;
|
break;
|
||||||
case 3: // alpha == 1, beta != 1
|
case 3: // alpha == 1, beta != 1
|
||||||
alpha = 1.0;
|
alpha = 1.0;
|
||||||
beta = par[fRunInfo->fBetaParamNo-1];
|
beta = par[fRunInfo->GetBetaParamNo()-1];
|
||||||
break;
|
break;
|
||||||
case 4: // alpha != 1, beta != 1
|
case 4: // alpha != 1, beta != 1
|
||||||
alpha = par[fRunInfo->fAlphaParamNo-1];
|
alpha = par[fRunInfo->GetAlphaParamNo()-1];
|
||||||
beta = par[fRunInfo->fBetaParamNo-1];
|
beta = par[fRunInfo->GetBetaParamNo()-1];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -956,7 +956,7 @@ cout << endl << "--------------------------------" << endl;
|
|||||||
// fill theory vector for kView
|
// fill theory vector for kView
|
||||||
// calculate functions
|
// calculate functions
|
||||||
for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++) {
|
for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++) {
|
||||||
fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), fRunInfo->fMap, par);
|
fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), *fRunInfo->GetMap(), par);
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate theory
|
// calculate theory
|
||||||
|
@ -90,7 +90,7 @@ PRunBase::PRunBase(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo,
|
|||||||
fRunInfo = &(*msrInfo->GetMsrRunList())[runNo];
|
fRunInfo = &(*msrInfo->GetMsrRunList())[runNo];
|
||||||
|
|
||||||
// check the parameter and map range of the functions
|
// check the parameter and map range of the functions
|
||||||
if (!fMsrInfo->CheckMapAndParamRange(fRunInfo->fMap.size(), fMsrInfo->GetNoOfParams())) {
|
if (!fMsrInfo->CheckMapAndParamRange(fRunInfo->GetMap()->size(), fMsrInfo->GetNoOfParams())) {
|
||||||
cerr << endl << "**SEVERE ERROR** PRunBase::PRunBase: map and/or parameter out of range in FUNCTIONS." << endl;
|
cerr << endl << "**SEVERE ERROR** PRunBase::PRunBase: map and/or parameter out of range in FUNCTIONS." << endl;
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
@ -153,23 +153,23 @@ Bool_t PRunDataHandler::ReadFile()
|
|||||||
if (!FileExistsCheck(runList->at(i), j))
|
if (!FileExistsCheck(runList->at(i), j))
|
||||||
return false;
|
return false;
|
||||||
// everything looks fine, hence try to read the data file
|
// everything looks fine, hence try to read the data file
|
||||||
if (!runList->at(i).fFileFormat[j].CompareTo("root-npp")) // not post pile up corrected histos
|
if (!runList->at(i).GetFileFormat(j)->CompareTo("root-npp")) // not post pile up corrected histos
|
||||||
success = ReadRootFile(true);
|
success = ReadRootFile(true);
|
||||||
else if (!runList->at(i).fFileFormat[j].CompareTo("root-ppc")) // post pile up corrected histos
|
else if (!runList->at(i).GetFileFormat(j)->CompareTo("root-ppc")) // post pile up corrected histos
|
||||||
success = ReadRootFile(false);
|
success = ReadRootFile(false);
|
||||||
else if (!runList->at(i).fFileFormat[j].CompareTo("nexus"))
|
else if (!runList->at(i).GetFileFormat(j)->CompareTo("nexus"))
|
||||||
success = ReadNexusFile();
|
success = ReadNexusFile();
|
||||||
else if (!runList->at(i).fFileFormat[j].CompareTo("psi-bin"))
|
else if (!runList->at(i).GetFileFormat(j)->CompareTo("psi-bin"))
|
||||||
success = ReadPsiBinFile();
|
success = ReadPsiBinFile();
|
||||||
else if (!runList->at(i).fFileFormat[j].CompareTo("mud"))
|
else if (!runList->at(i).GetFileFormat(j)->CompareTo("mud"))
|
||||||
success = ReadMudFile();
|
success = ReadMudFile();
|
||||||
else if (!runList->at(i).fFileFormat[j].CompareTo("wkm"))
|
else if (!runList->at(i).GetFileFormat(j)->CompareTo("wkm"))
|
||||||
success = ReadWkmFile();
|
success = ReadWkmFile();
|
||||||
else if (!runList->at(i).fFileFormat[j].CompareTo("mdu-ascii"))
|
else if (!runList->at(i).GetFileFormat(j)->CompareTo("mdu-ascii"))
|
||||||
success = ReadMduAsciiFile();
|
success = ReadMduAsciiFile();
|
||||||
else if (!runList->at(i).fFileFormat[j].CompareTo("ascii"))
|
else if (!runList->at(i).GetFileFormat(j)->CompareTo("ascii"))
|
||||||
success = ReadAsciiFile();
|
success = ReadAsciiFile();
|
||||||
else if (!runList->at(i).fFileFormat[j].CompareTo("db"))
|
else if (!runList->at(i).GetFileFormat(j)->CompareTo("db"))
|
||||||
success = ReadDBFile();
|
success = ReadDBFile();
|
||||||
else
|
else
|
||||||
success = false;
|
success = false;
|
||||||
@ -217,44 +217,66 @@ Bool_t PRunDataHandler::FileExistsCheck(PMsrRunBlock &runInfo, const UInt_t idx)
|
|||||||
// local init
|
// local init
|
||||||
TROOT root("PRunBase", "PRunBase", 0);
|
TROOT root("PRunBase", "PRunBase", 0);
|
||||||
TString pathName = "???";
|
TString pathName = "???";
|
||||||
TString str;
|
TString str, *pstr;
|
||||||
TString ext;
|
TString ext;
|
||||||
|
|
||||||
runInfo.fBeamline[idx].ToLower();
|
pstr = runInfo.GetBeamline(idx);
|
||||||
runInfo.fInstitute[idx].ToLower();
|
if (pstr == 0) {
|
||||||
runInfo.fFileFormat[idx].ToLower();
|
cerr << endl << ">> PRunDataHandler::FileExistsCheck: **ERROR** Couldn't obtain beamline data." << endl;
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
pstr->ToLower();
|
||||||
|
runInfo.SetBeamline(*pstr, idx);
|
||||||
|
pstr = runInfo.GetInstitute(idx);
|
||||||
|
if (pstr == 0) {
|
||||||
|
cerr << endl << ">> PRunDataHandler::FileExistsCheck: **ERROR** Couldn't obtain institute data." << endl;
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
pstr->ToLower();
|
||||||
|
runInfo.SetInstitute(*pstr, idx);
|
||||||
|
pstr = runInfo.GetFileFormat(idx);
|
||||||
|
if (pstr == 0) {
|
||||||
|
cerr << endl << ">> PRunDataHandler::FileExistsCheck: **ERROR** Couldn't obtain file format data." << endl;
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
pstr->ToLower();
|
||||||
|
runInfo.SetFileFormat(*pstr, idx);
|
||||||
|
|
||||||
// file extensions for the various formats
|
// file extensions for the various formats
|
||||||
if (!runInfo.fFileFormat[idx].CompareTo("root-npp")) // not post pile up corrected histos
|
if (!runInfo.GetFileFormat(idx)->CompareTo("root-npp")) // not post pile up corrected histos
|
||||||
ext = TString("root");
|
ext = TString("root");
|
||||||
else if (!runInfo.fFileFormat[idx].CompareTo("root-ppc")) // post pile up corrected histos
|
else if (!runInfo.GetFileFormat(idx)->CompareTo("root-ppc")) // post pile up corrected histos
|
||||||
ext = TString("root");
|
ext = TString("root");
|
||||||
else if (!runInfo.fFileFormat[idx].CompareTo("nexus"))
|
else if (!runInfo.GetFileFormat(idx)->CompareTo("nexus"))
|
||||||
ext = TString("nexus");
|
ext = TString("nexus");
|
||||||
else if (!runInfo.fFileFormat[idx].CompareTo("psi-bin"))
|
else if (!runInfo.GetFileFormat(idx)->CompareTo("psi-bin"))
|
||||||
ext = TString("bin");
|
ext = TString("bin");
|
||||||
else if (!runInfo.fFileFormat[idx].CompareTo("mud"))
|
else if (!runInfo.GetFileFormat(idx)->CompareTo("mud"))
|
||||||
ext = TString("msr");
|
ext = TString("msr");
|
||||||
else if (!runInfo.fFileFormat[idx].CompareTo("wkm")) {
|
else if (!runInfo.GetFileFormat(idx)->CompareTo("wkm")) {
|
||||||
if (!runInfo.fBeamline[idx].CompareTo("mue4"))
|
if (!runInfo.GetBeamline(idx)->CompareTo("mue4"))
|
||||||
ext = TString("nemu");
|
ext = TString("nemu");
|
||||||
else
|
else
|
||||||
ext = runInfo.fBeamline[idx];
|
ext = *runInfo.GetBeamline(idx);
|
||||||
}
|
}
|
||||||
else if (!runInfo.fFileFormat[idx].CompareTo("mdu-ascii"))
|
else if (!runInfo.GetFileFormat(idx)->CompareTo("mdu-ascii"))
|
||||||
ext = TString("mdua");
|
ext = TString("mdua");
|
||||||
else if (!runInfo.fFileFormat[idx].CompareTo("ascii"))
|
else if (!runInfo.GetFileFormat(idx)->CompareTo("ascii"))
|
||||||
ext = TString("dat");
|
ext = TString("dat");
|
||||||
else if (!runInfo.fFileFormat[idx].CompareTo("db"))
|
else if (!runInfo.GetFileFormat(idx)->CompareTo("db"))
|
||||||
ext = TString("db");
|
ext = TString("db");
|
||||||
else
|
else
|
||||||
success = false;
|
success = false;
|
||||||
|
|
||||||
// unkown file format found
|
// unkown file format found
|
||||||
if (!success) {
|
if (!success) {
|
||||||
str = runInfo.fFileFormat[idx];
|
pstr = runInfo.GetFileFormat(idx);
|
||||||
str.ToUpper();
|
if (pstr == 0) {
|
||||||
cerr << endl << "**ERROR** File Format '" << str.Data() << "' unsupported.";
|
cerr << endl << ">> PRunDataHandler::FileExistsCheck: **ERROR** Couldn't obtain file format data." << endl;
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
pstr->ToUpper();
|
||||||
|
cerr << endl << "**ERROR** File Format '" << pstr->Data() << "' unsupported.";
|
||||||
cerr << endl << " support file formats are:";
|
cerr << endl << " support file formats are:";
|
||||||
cerr << endl << " ROOT-NPP -> root not post pileup corrected for lem";
|
cerr << endl << " ROOT-NPP -> root not post pileup corrected for lem";
|
||||||
cerr << endl << " ROOT-PPC -> root post pileup corrected for lem";
|
cerr << endl << " ROOT-PPC -> root post pileup corrected for lem";
|
||||||
@ -270,7 +292,7 @@ Bool_t PRunDataHandler::FileExistsCheck(PMsrRunBlock &runInfo, const UInt_t idx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check if the file is in the local directory
|
// check if the file is in the local directory
|
||||||
str = *(runInfo.GetRunName(idx)) + TString(".") + ext;
|
str = *runInfo.GetRunName(idx) + TString(".") + ext;
|
||||||
if (gSystem->AccessPathName(str.Data())!=true) { // found in the local dir
|
if (gSystem->AccessPathName(str.Data())!=true) { // found in the local dir
|
||||||
pathName = str;
|
pathName = str;
|
||||||
}
|
}
|
||||||
@ -278,7 +300,7 @@ Bool_t PRunDataHandler::FileExistsCheck(PMsrRunBlock &runInfo, const UInt_t idx)
|
|||||||
// check if the file is found in the <msr-file-directory>
|
// check if the file is found in the <msr-file-directory>
|
||||||
if (pathName.CompareTo("???") == 0) { // not found in local directory search
|
if (pathName.CompareTo("???") == 0) { // not found in local directory search
|
||||||
str = *fMsrInfo->GetMsrFileDirectoryPath();
|
str = *fMsrInfo->GetMsrFileDirectoryPath();
|
||||||
str += *(runInfo.GetRunName(idx)) + TString(".") + ext;
|
str += *runInfo.GetRunName(idx) + TString(".") + ext;
|
||||||
if (gSystem->AccessPathName(str.Data())!=true) { // found
|
if (gSystem->AccessPathName(str.Data())!=true) { // found
|
||||||
pathName = str;
|
pathName = str;
|
||||||
}
|
}
|
||||||
@ -287,7 +309,7 @@ Bool_t PRunDataHandler::FileExistsCheck(PMsrRunBlock &runInfo, const UInt_t idx)
|
|||||||
// check if the file is found in the directory given in the startup file
|
// check if the file is found in the directory given in the startup file
|
||||||
if (pathName.CompareTo("???") == 0) { // not found in local directory search
|
if (pathName.CompareTo("???") == 0) { // not found in local directory search
|
||||||
for (UInt_t i=0; i<fDataPath.size(); i++) {
|
for (UInt_t i=0; i<fDataPath.size(); i++) {
|
||||||
str = fDataPath[i] + TString("/") + *(runInfo.GetRunName(idx)) + TString(".") + ext;
|
str = fDataPath[i] + TString("/") + *runInfo.GetRunName(idx) + TString(".") + ext;
|
||||||
if (gSystem->AccessPathName(str.Data())!=true) { // found
|
if (gSystem->AccessPathName(str.Data())!=true) { // found
|
||||||
pathName = str;
|
pathName = str;
|
||||||
break;
|
break;
|
||||||
@ -304,7 +326,7 @@ Bool_t PRunDataHandler::FileExistsCheck(PMsrRunBlock &runInfo, const UInt_t idx)
|
|||||||
TObjString *ostr;
|
TObjString *ostr;
|
||||||
for (Int_t i=0; i<tokens->GetEntries(); i++) {
|
for (Int_t i=0; i<tokens->GetEntries(); i++) {
|
||||||
ostr = dynamic_cast<TObjString*>(tokens->At(i));
|
ostr = dynamic_cast<TObjString*>(tokens->At(i));
|
||||||
str = ostr->GetString() + TString("/") + *(runInfo.GetRunName(idx)) + TString(".") + ext;
|
str = ostr->GetString() + TString("/") + *runInfo.GetRunName(idx) + TString(".") + ext;
|
||||||
if (gSystem->AccessPathName(str.Data())!=true) { // found
|
if (gSystem->AccessPathName(str.Data())!=true) { // found
|
||||||
pathName = str;
|
pathName = str;
|
||||||
break;
|
break;
|
||||||
@ -318,18 +340,30 @@ Bool_t PRunDataHandler::FileExistsCheck(PMsrRunBlock &runInfo, const UInt_t idx)
|
|||||||
// WKMFULLDATAPATH has the structure: path_1:path_2:...:path_n
|
// WKMFULLDATAPATH has the structure: path_1:path_2:...:path_n
|
||||||
TObjArray *tokens = str.Tokenize(":");
|
TObjArray *tokens = str.Tokenize(":");
|
||||||
TObjString *ostr;
|
TObjString *ostr;
|
||||||
runInfo.fInstitute[idx].ToUpper();
|
pstr = runInfo.GetInstitute(idx);
|
||||||
runInfo.fBeamline[idx].ToUpper();
|
if (pstr == 0) {
|
||||||
|
cerr << endl << ">> PRunDataHandler::FileExistsCheck: **ERROR** Couldn't obtain institute data." << endl;
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
pstr->ToUpper();
|
||||||
|
runInfo.SetInstitute(*pstr, idx);
|
||||||
|
pstr = runInfo.GetBeamline(idx);
|
||||||
|
if (pstr == 0) {
|
||||||
|
cerr << endl << ">> PRunDataHandler::FileExistsCheck: **ERROR** Couldn't obtain beamline data." << endl;
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
pstr->ToUpper();
|
||||||
|
runInfo.SetBeamline(*pstr, idx);
|
||||||
TDatime datetime;
|
TDatime datetime;
|
||||||
TString dt;
|
TString dt;
|
||||||
dt += datetime.GetYear();
|
dt += datetime.GetYear();
|
||||||
for (Int_t i=0; i<tokens->GetEntries(); i++) {
|
for (Int_t i=0; i<tokens->GetEntries(); i++) {
|
||||||
ostr = dynamic_cast<TObjString*>(tokens->At(i));
|
ostr = dynamic_cast<TObjString*>(tokens->At(i));
|
||||||
str = ostr->GetString() + TString("/DATA/") +
|
str = ostr->GetString() + TString("/DATA/") +
|
||||||
runInfo.fInstitute[idx] + TString("/") +
|
*runInfo.GetInstitute(idx) + TString("/") +
|
||||||
runInfo.fBeamline[idx] + TString("/") +
|
*runInfo.GetBeamline(idx) + TString("/") +
|
||||||
dt + TString("/") +
|
dt + TString("/") +
|
||||||
*(runInfo.GetRunName(idx)) + TString(".") + ext;
|
*runInfo.GetRunName(idx) + TString(".") + ext;
|
||||||
if (gSystem->AccessPathName(str.Data())!=true) { // found
|
if (gSystem->AccessPathName(str.Data())!=true) { // found
|
||||||
pathName = str;
|
pathName = str;
|
||||||
break;
|
break;
|
||||||
|
@ -105,7 +105,7 @@ Bool_t PRunListCollection::Add(Int_t runNo, EPMusrHandleTag tag)
|
|||||||
// cout << ", name = " << runList->fRunName.Data();
|
// cout << ", name = " << runList->fRunName.Data();
|
||||||
// cout << ", type = " << runList->fFitType;
|
// cout << ", type = " << runList->fFitType;
|
||||||
|
|
||||||
Int_t fitType = (*fMsrInfo->GetMsrRunList())[runNo].fFitType;
|
Int_t fitType = (*fMsrInfo->GetMsrRunList())[runNo].GetFitType();
|
||||||
|
|
||||||
switch (fitType) {
|
switch (fitType) {
|
||||||
case PRUN_SINGLE_HISTO:
|
case PRUN_SINGLE_HISTO:
|
||||||
|
@ -101,7 +101,7 @@ Double_t PRunNonMusr::CalcChiSquare(const std::vector<Double_t>& par)
|
|||||||
|
|
||||||
// calculate functions
|
// calculate functions
|
||||||
for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++) {
|
for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++) {
|
||||||
fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), fRunInfo->fMap, par);
|
fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), *fRunInfo->GetMap(), par);
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate chi square
|
// calculate chi square
|
||||||
@ -288,7 +288,7 @@ Bool_t PRunNonMusr::PrepareViewData()
|
|||||||
par.push_back((*paramList)[i].fValue);
|
par.push_back((*paramList)[i].fValue);
|
||||||
// calculate functions
|
// calculate functions
|
||||||
for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++) {
|
for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++) {
|
||||||
fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), fRunInfo->fMap, par);
|
fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), *fRunInfo->GetMap(), par);
|
||||||
}
|
}
|
||||||
|
|
||||||
// cout << endl << ">> after parameter fill" << endl;
|
// cout << endl << ">> after parameter fill" << endl;
|
||||||
|
@ -101,39 +101,39 @@ Double_t PRunSingleHisto::CalcChiSquare(const std::vector<Double_t>& par)
|
|||||||
Double_t N0;
|
Double_t N0;
|
||||||
|
|
||||||
// check if norm is a parameter or a function
|
// check if norm is a parameter or a function
|
||||||
if (fRunInfo->fNormParamNo < MSR_PARAM_FUN_OFFSET) { // norm is a parameter
|
if (fRunInfo->GetNormParamNo() < MSR_PARAM_FUN_OFFSET) { // norm is a parameter
|
||||||
N0 = par[fRunInfo->fNormParamNo-1];
|
N0 = par[fRunInfo->GetNormParamNo()-1];
|
||||||
} else { // norm is a function
|
} else { // norm is a function
|
||||||
// get function number
|
// get function number
|
||||||
UInt_t funNo = fRunInfo->fNormParamNo-MSR_PARAM_FUN_OFFSET;
|
UInt_t funNo = fRunInfo->GetNormParamNo()-MSR_PARAM_FUN_OFFSET;
|
||||||
// evaluate function
|
// evaluate function
|
||||||
N0 = fMsrInfo->EvalFunc(funNo,fRunInfo->fMap,par);
|
N0 = fMsrInfo->EvalFunc(funNo, *fRunInfo->GetMap(), par);
|
||||||
}
|
}
|
||||||
|
|
||||||
// get tau
|
// get tau
|
||||||
Double_t tau;
|
Double_t tau;
|
||||||
if (fRunInfo->fLifetimeParamNo != -1)
|
if (fRunInfo->GetLifetimeParamNo() != -1)
|
||||||
tau = par[fRunInfo->fLifetimeParamNo-1];
|
tau = par[fRunInfo->GetLifetimeParamNo()-1];
|
||||||
else
|
else
|
||||||
tau = PMUON_LIFETIME;
|
tau = PMUON_LIFETIME;
|
||||||
|
|
||||||
// get background
|
// get background
|
||||||
Double_t bkg;
|
Double_t bkg;
|
||||||
if (fRunInfo->fBkgFitParamNo == -1) { // bkg not fitted
|
if (fRunInfo->GetBkgFitParamNo() == -1) { // bkg not fitted
|
||||||
if (fRunInfo->fBkgFix.size() == 0) { // no fixed background given (background interval)
|
if (fRunInfo->fBkgFix.size() == 0) { // no fixed background given (background interval)
|
||||||
bkg = fBackground;
|
bkg = fBackground;
|
||||||
} else { // fixed bkg given
|
} else { // fixed bkg given
|
||||||
bkg = fRunInfo->fBkgFix[0];
|
bkg = fRunInfo->fBkgFix[0];
|
||||||
}
|
}
|
||||||
} else { // bkg fitted
|
} else { // bkg fitted
|
||||||
bkg = par[fRunInfo->fBkgFitParamNo-1];
|
bkg = par[fRunInfo->GetBkgFitParamNo()-1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate functions
|
// calculate functions
|
||||||
for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++) {
|
for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++) {
|
||||||
Int_t funcNo = fMsrInfo->GetFuncNo(i);
|
Int_t funcNo = fMsrInfo->GetFuncNo(i);
|
||||||
//cout << ">> i = " << i << ", funcNo = " << funcNo << endl;
|
//cout << ">> i = " << i << ", funcNo = " << funcNo << endl;
|
||||||
fFuncValues[i] = fMsrInfo->EvalFunc(funcNo, fRunInfo->fMap, par);
|
fFuncValues[i] = fMsrInfo->EvalFunc(funcNo, *fRunInfo->GetMap(), par);
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate chi square
|
// calculate chi square
|
||||||
@ -165,38 +165,38 @@ Double_t PRunSingleHisto::CalcMaxLikelihood(const std::vector<Double_t>& par)
|
|||||||
Double_t N0;
|
Double_t N0;
|
||||||
|
|
||||||
// check if norm is a parameter or a function
|
// check if norm is a parameter or a function
|
||||||
if (fRunInfo->fNormParamNo < MSR_PARAM_FUN_OFFSET) { // norm is a parameter
|
if (fRunInfo->GetNormParamNo() < MSR_PARAM_FUN_OFFSET) { // norm is a parameter
|
||||||
N0 = par[fRunInfo->fNormParamNo-1];
|
N0 = par[fRunInfo->GetNormParamNo()-1];
|
||||||
} else { // norm is a function
|
} else { // norm is a function
|
||||||
// get function number
|
// get function number
|
||||||
UInt_t funNo = fRunInfo->fNormParamNo-MSR_PARAM_FUN_OFFSET;
|
UInt_t funNo = fRunInfo->GetNormParamNo()-MSR_PARAM_FUN_OFFSET;
|
||||||
// evaluate function
|
// evaluate function
|
||||||
N0 = fMsrInfo->EvalFunc(funNo,fRunInfo->fMap,par);
|
N0 = fMsrInfo->EvalFunc(funNo, *fRunInfo->GetMap(), par);
|
||||||
}
|
}
|
||||||
|
|
||||||
// get tau
|
// get tau
|
||||||
Double_t tau;
|
Double_t tau;
|
||||||
if (fRunInfo->fLifetimeParamNo != -1)
|
if (fRunInfo->GetLifetimeParamNo() != -1)
|
||||||
tau = par[fRunInfo->fLifetimeParamNo-1];
|
tau = par[fRunInfo->GetLifetimeParamNo()-1];
|
||||||
else
|
else
|
||||||
tau = PMUON_LIFETIME;
|
tau = PMUON_LIFETIME;
|
||||||
|
|
||||||
// get background
|
// get background
|
||||||
Double_t bkg;
|
Double_t bkg;
|
||||||
if (fRunInfo->fBkgFitParamNo == -1) { // bkg not fitted
|
if (fRunInfo->GetBkgFitParamNo() == -1) { // bkg not fitted
|
||||||
if (fRunInfo->fBkgFix.size() == 0) { // no fixed background given (background interval)
|
if (fRunInfo->fBkgFix.size() == 0) { // no fixed background given (background interval)
|
||||||
bkg = fBackground;
|
bkg = fBackground;
|
||||||
} else { // fixed bkg given
|
} else { // fixed bkg given
|
||||||
bkg = fRunInfo->fBkgFix[0];
|
bkg = fRunInfo->fBkgFix[0];
|
||||||
}
|
}
|
||||||
} else { // bkg fitted
|
} else { // bkg fitted
|
||||||
bkg = par[fRunInfo->fBkgFitParamNo-1];
|
bkg = par[fRunInfo->GetBkgFitParamNo()-1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate functions
|
// calculate functions
|
||||||
for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++) {
|
for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++) {
|
||||||
Int_t funcNo = fMsrInfo->GetFuncNo(i);
|
Int_t funcNo = fMsrInfo->GetFuncNo(i);
|
||||||
fFuncValues[i] = fMsrInfo->EvalFunc(funcNo, fRunInfo->fMap, par);
|
fFuncValues[i] = fMsrInfo->EvalFunc(funcNo, *fRunInfo->GetMap(), par);
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate maximum log likelihood
|
// calculate maximum log likelihood
|
||||||
@ -239,37 +239,37 @@ void PRunSingleHisto::CalcTheory()
|
|||||||
// calculate asymmetry
|
// calculate asymmetry
|
||||||
Double_t N0;
|
Double_t N0;
|
||||||
// check if norm is a parameter or a function
|
// check if norm is a parameter or a function
|
||||||
if (fRunInfo->fNormParamNo < MSR_PARAM_FUN_OFFSET) { // norm is a parameter
|
if (fRunInfo->GetNormParamNo() < MSR_PARAM_FUN_OFFSET) { // norm is a parameter
|
||||||
N0 = par[fRunInfo->fNormParamNo-1];
|
N0 = par[fRunInfo->GetNormParamNo()-1];
|
||||||
} else { // norm is a function
|
} else { // norm is a function
|
||||||
// get function number
|
// get function number
|
||||||
UInt_t funNo = fRunInfo->fNormParamNo-MSR_PARAM_FUN_OFFSET;
|
UInt_t funNo = fRunInfo->GetNormParamNo()-MSR_PARAM_FUN_OFFSET;
|
||||||
// evaluate function
|
// evaluate function
|
||||||
N0 = fMsrInfo->EvalFunc(funNo,fRunInfo->fMap,par);
|
N0 = fMsrInfo->EvalFunc(funNo, *fRunInfo->GetMap(), par);
|
||||||
}
|
}
|
||||||
|
|
||||||
// get tau
|
// get tau
|
||||||
Double_t tau;
|
Double_t tau;
|
||||||
if (fRunInfo->fLifetimeParamNo != -1)
|
if (fRunInfo->GetLifetimeParamNo() != -1)
|
||||||
tau = par[fRunInfo->fLifetimeParamNo-1];
|
tau = par[fRunInfo->GetLifetimeParamNo()-1];
|
||||||
else
|
else
|
||||||
tau = PMUON_LIFETIME;
|
tau = PMUON_LIFETIME;
|
||||||
|
|
||||||
// get background
|
// get background
|
||||||
Double_t bkg;
|
Double_t bkg;
|
||||||
if (fRunInfo->fBkgFitParamNo == -1) { // bkg not fitted
|
if (fRunInfo->GetBkgFitParamNo() == -1) { // bkg not fitted
|
||||||
if (fRunInfo->fBkgFix.size() == 0) { // no fixed background given (background interval)
|
if (fRunInfo->fBkgFix.size() == 0) { // no fixed background given (background interval)
|
||||||
bkg = fBackground;
|
bkg = fBackground;
|
||||||
} else { // fixed bkg given
|
} else { // fixed bkg given
|
||||||
bkg = fRunInfo->fBkgFix[0];
|
bkg = fRunInfo->fBkgFix[0];
|
||||||
}
|
}
|
||||||
} else { // bkg fitted
|
} else { // bkg fitted
|
||||||
bkg = par[fRunInfo->fBkgFitParamNo-1];
|
bkg = par[fRunInfo->GetBkgFitParamNo()-1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate functions
|
// calculate functions
|
||||||
for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++) {
|
for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++) {
|
||||||
fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), fRunInfo->fMap, par);
|
fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), *fRunInfo->GetMap(), par);
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate theory
|
// calculate theory
|
||||||
@ -299,7 +299,7 @@ Bool_t PRunSingleHisto::PrepareData()
|
|||||||
Bool_t success = true;
|
Bool_t success = true;
|
||||||
|
|
||||||
// get the proper run
|
// get the proper run
|
||||||
PRawRunData* runData = fRawData->GetRunData(*(fRunInfo->GetRunName()));
|
PRawRunData* runData = fRawData->GetRunData(*fRunInfo->GetRunName());
|
||||||
if (!runData) { // couldn't get run
|
if (!runData) { // couldn't get run
|
||||||
cerr << endl << "PRunSingleHisto::PrepareData(): **ERROR** Couldn't get run " << fRunInfo->GetRunName()->Data() << "!";
|
cerr << endl << "PRunSingleHisto::PrepareData(): **ERROR** Couldn't get run " << fRunInfo->GetRunName()->Data() << "!";
|
||||||
cerr << endl;
|
cerr << endl;
|
||||||
@ -360,7 +360,7 @@ Bool_t PRunSingleHisto::PrepareData()
|
|||||||
for (UInt_t i=1; i<fRunInfo->GetRunNames().size(); i++) {
|
for (UInt_t i=1; i<fRunInfo->GetRunNames().size(); i++) {
|
||||||
|
|
||||||
// get run to be added to the main one
|
// get run to be added to the main one
|
||||||
addRunData = fRawData->GetRunData(*(fRunInfo->GetRunName(i)));
|
addRunData = fRawData->GetRunData(*fRunInfo->GetRunName(i));
|
||||||
if (addRunData == 0) { // couldn't get run
|
if (addRunData == 0) { // couldn't get run
|
||||||
cerr << endl << "PRunSingleHisto::PrepareData(): **ERROR** Couldn't get addrun " << fRunInfo->GetRunName(i)->Data() << "!";
|
cerr << endl << "PRunSingleHisto::PrepareData(): **ERROR** Couldn't get addrun " << fRunInfo->GetRunName(i)->Data() << "!";
|
||||||
cerr << endl;
|
cerr << endl;
|
||||||
@ -423,9 +423,9 @@ Bool_t PRunSingleHisto::PrepareData()
|
|||||||
|
|
||||||
if (fHandleTag == kFit)
|
if (fHandleTag == kFit)
|
||||||
success = PrepareFitData(runData, histoNo);
|
success = PrepareFitData(runData, histoNo);
|
||||||
else if ((fHandleTag == kView) && !fRunInfo->fLifetimeCorrection)
|
else if ((fHandleTag == kView) && !fRunInfo->IsLifetimeCorrected())
|
||||||
success = PrepareRawViewData(runData, histoNo);
|
success = PrepareRawViewData(runData, histoNo);
|
||||||
else if ((fHandleTag == kView) && fRunInfo->fLifetimeCorrection)
|
else if ((fHandleTag == kView) && fRunInfo->IsLifetimeCorrected())
|
||||||
success = PrepareViewData(runData, histoNo);
|
success = PrepareViewData(runData, histoNo);
|
||||||
else
|
else
|
||||||
success = false;
|
success = false;
|
||||||
@ -476,7 +476,7 @@ Bool_t PRunSingleHisto::PrepareFitData(PRawRunData* runData, const UInt_t histoN
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check how the background shall be handled
|
// check how the background shall be handled
|
||||||
if (fRunInfo->fBkgFitParamNo == -1) { // bkg shall **NOT** be fitted
|
if (fRunInfo->GetBkgFitParamNo() == -1) { // bkg shall **NOT** be fitted
|
||||||
// subtract background from histogramms ------------------------------------------
|
// subtract background from histogramms ------------------------------------------
|
||||||
if (fRunInfo->fBkgFix.size() == 0) { // no fixed background given
|
if (fRunInfo->fBkgFix.size() == 0) { // no fixed background given
|
||||||
if (fRunInfo->fBkgRange.size() != 0) {
|
if (fRunInfo->fBkgRange.size() != 0) {
|
||||||
@ -632,25 +632,25 @@ cout << endl << ">> data start time = " << fData.GetDataTimeStart();
|
|||||||
// calculate asymmetry
|
// calculate asymmetry
|
||||||
Double_t N0;
|
Double_t N0;
|
||||||
// check if norm is a parameter or a function
|
// check if norm is a parameter or a function
|
||||||
if (fRunInfo->fNormParamNo < MSR_PARAM_FUN_OFFSET) { // norm is a parameter
|
if (fRunInfo->GetNormParamNo() < MSR_PARAM_FUN_OFFSET) { // norm is a parameter
|
||||||
N0 = par[fRunInfo->fNormParamNo-1];
|
N0 = par[fRunInfo->GetNormParamNo()-1];
|
||||||
} else { // norm is a function
|
} else { // norm is a function
|
||||||
// get function number
|
// get function number
|
||||||
UInt_t funNo = fRunInfo->fNormParamNo-MSR_PARAM_FUN_OFFSET;
|
UInt_t funNo = fRunInfo->GetNormParamNo()-MSR_PARAM_FUN_OFFSET;
|
||||||
// evaluate function
|
// evaluate function
|
||||||
N0 = fMsrInfo->EvalFunc(funNo,fRunInfo->fMap,par);
|
N0 = fMsrInfo->EvalFunc(funNo, *fRunInfo->GetMap(), par);
|
||||||
}
|
}
|
||||||
|
|
||||||
// get tau
|
// get tau
|
||||||
Double_t tau;
|
Double_t tau;
|
||||||
if (fRunInfo->fLifetimeParamNo != -1)
|
if (fRunInfo->GetLifetimeParamNo() != -1)
|
||||||
tau = par[fRunInfo->fLifetimeParamNo-1];
|
tau = par[fRunInfo->GetLifetimeParamNo()-1];
|
||||||
else
|
else
|
||||||
tau = PMUON_LIFETIME;
|
tau = PMUON_LIFETIME;
|
||||||
|
|
||||||
// get background
|
// get background
|
||||||
Double_t bkg;
|
Double_t bkg;
|
||||||
if (fRunInfo->fBkgFitParamNo == -1) { // bkg not fitted
|
if (fRunInfo->GetBkgFitParamNo() == -1) { // bkg not fitted
|
||||||
if (fRunInfo->fBkgFix.size() == 0) { // no fixed background given (background interval)
|
if (fRunInfo->fBkgFix.size() == 0) { // no fixed background given (background interval)
|
||||||
if (!EstimateBkg(histoNo))
|
if (!EstimateBkg(histoNo))
|
||||||
return false;
|
return false;
|
||||||
@ -659,12 +659,12 @@ cout << endl << ">> data start time = " << fData.GetDataTimeStart();
|
|||||||
bkg = fRunInfo->fBkgFix[0];
|
bkg = fRunInfo->fBkgFix[0];
|
||||||
}
|
}
|
||||||
} else { // bkg fitted
|
} else { // bkg fitted
|
||||||
bkg = par[fRunInfo->fBkgFitParamNo-1];
|
bkg = par[fRunInfo->GetBkgFitParamNo()-1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate functions
|
// calculate functions
|
||||||
for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++) {
|
for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++) {
|
||||||
fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), fRunInfo->fMap, par);
|
fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), *fRunInfo->GetMap(), par);
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate theory
|
// calculate theory
|
||||||
@ -756,26 +756,26 @@ Bool_t PRunSingleHisto::PrepareViewData(PRawRunData* runData, const UInt_t histo
|
|||||||
// calculate asymmetry
|
// calculate asymmetry
|
||||||
Double_t N0;
|
Double_t N0;
|
||||||
// check if norm is a parameter or a function
|
// check if norm is a parameter or a function
|
||||||
if (fRunInfo->fNormParamNo < MSR_PARAM_FUN_OFFSET) { // norm is a parameter
|
if (fRunInfo->GetNormParamNo() < MSR_PARAM_FUN_OFFSET) { // norm is a parameter
|
||||||
N0 = par[fRunInfo->fNormParamNo-1];
|
N0 = par[fRunInfo->GetNormParamNo()-1];
|
||||||
} else { // norm is a function
|
} else { // norm is a function
|
||||||
// get function number
|
// get function number
|
||||||
UInt_t funNo = fRunInfo->fNormParamNo-MSR_PARAM_FUN_OFFSET;
|
UInt_t funNo = fRunInfo->GetNormParamNo()-MSR_PARAM_FUN_OFFSET;
|
||||||
// evaluate function
|
// evaluate function
|
||||||
N0 = fMsrInfo->EvalFunc(funNo,fRunInfo->fMap,par);
|
N0 = fMsrInfo->EvalFunc(funNo, *fRunInfo->GetMap(), par);
|
||||||
}
|
}
|
||||||
|
|
||||||
// get tau
|
// get tau
|
||||||
Double_t tau;
|
Double_t tau;
|
||||||
if (fRunInfo->fLifetimeParamNo != -1)
|
if (fRunInfo->GetLifetimeParamNo() != -1)
|
||||||
tau = par[fRunInfo->fLifetimeParamNo-1];
|
tau = par[fRunInfo->GetLifetimeParamNo()-1];
|
||||||
else
|
else
|
||||||
tau = PMUON_LIFETIME;
|
tau = PMUON_LIFETIME;
|
||||||
//cout << endl << ">> tau = " << tau;
|
//cout << endl << ">> tau = " << tau;
|
||||||
|
|
||||||
// get background
|
// get background
|
||||||
Double_t bkg;
|
Double_t bkg;
|
||||||
if (fRunInfo->fBkgFitParamNo == -1) { // bkg not fitted
|
if (fRunInfo->GetBkgFitParamNo() == -1) { // bkg not fitted
|
||||||
if (fRunInfo->fBkgFix.size() == 0) { // no fixed background given (background interval)
|
if (fRunInfo->fBkgFix.size() == 0) { // no fixed background given (background interval)
|
||||||
if (!EstimateBkg(histoNo))
|
if (!EstimateBkg(histoNo))
|
||||||
return false;
|
return false;
|
||||||
@ -784,7 +784,7 @@ Bool_t PRunSingleHisto::PrepareViewData(PRawRunData* runData, const UInt_t histo
|
|||||||
bkg = fRunInfo->fBkgFix[0];
|
bkg = fRunInfo->fBkgFix[0];
|
||||||
}
|
}
|
||||||
} else { // bkg fitted
|
} else { // bkg fitted
|
||||||
bkg = par[fRunInfo->fBkgFitParamNo-1];
|
bkg = par[fRunInfo->GetBkgFitParamNo()-1];
|
||||||
}
|
}
|
||||||
|
|
||||||
Double_t value = 0.0;
|
Double_t value = 0.0;
|
||||||
@ -829,7 +829,7 @@ cout << endl << "--------------------------------" << endl;
|
|||||||
|
|
||||||
// calculate functions
|
// calculate functions
|
||||||
for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++) {
|
for (Int_t i=0; i<fMsrInfo->GetNoOfFuncs(); i++) {
|
||||||
fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), fRunInfo->fMap, par);
|
fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), *fRunInfo->GetMap(), par);
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate theory
|
// calculate theory
|
||||||
@ -870,11 +870,11 @@ Bool_t PRunSingleHisto::EstimateBkg(UInt_t histoNo)
|
|||||||
Double_t beamPeriod = 0.0;
|
Double_t beamPeriod = 0.0;
|
||||||
|
|
||||||
// check if data are from PSI, RAL, or TRIUMF
|
// check if data are from PSI, RAL, or TRIUMF
|
||||||
if (fRunInfo->fInstitute[0].Contains("psi"))
|
if (fRunInfo->GetInstitute()->Contains("psi"))
|
||||||
beamPeriod = ACCEL_PERIOD_PSI;
|
beamPeriod = ACCEL_PERIOD_PSI;
|
||||||
else if (fRunInfo->fInstitute[0].Contains("ral"))
|
else if (fRunInfo->GetInstitute()->Contains("ral"))
|
||||||
beamPeriod = ACCEL_PERIOD_RAL;
|
beamPeriod = ACCEL_PERIOD_RAL;
|
||||||
else if (fRunInfo->fInstitute[0].Contains("triumf"))
|
else if (fRunInfo->GetInstitute()->Contains("triumf"))
|
||||||
beamPeriod = ACCEL_PERIOD_TRIUMF;
|
beamPeriod = ACCEL_PERIOD_TRIUMF;
|
||||||
else
|
else
|
||||||
beamPeriod = 0.0;
|
beamPeriod = 0.0;
|
||||||
@ -900,7 +900,7 @@ Bool_t PRunSingleHisto::EstimateBkg(UInt_t histoNo)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get the proper run
|
// get the proper run
|
||||||
PRawRunData* runData = fRawData->GetRunData(*(fRunInfo->GetRunName()));
|
PRawRunData* runData = fRawData->GetRunData(*fRunInfo->GetRunName());
|
||||||
|
|
||||||
// check if start is within histogram bounds
|
// check if start is within histogram bounds
|
||||||
if ((start < 0) || (start >= runData->GetDataBin(histoNo)->size())) {
|
if ((start < 0) || (start >= runData->GetDataBin(histoNo)->size())) {
|
||||||
|
@ -190,7 +190,7 @@ PTheory::PTheory(PMsrHandler *msrInfo, UInt_t runNo, const Bool_t hasParent)
|
|||||||
if (status == 1) { // everthing ok
|
if (status == 1) { // everthing ok
|
||||||
ok = true;
|
ok = true;
|
||||||
// get parameter from map
|
// get parameter from map
|
||||||
PIntVector maps = (*msrInfo->GetMsrRunList())[runNo].fMap;
|
PIntVector maps = *(*msrInfo->GetMsrRunList())[runNo].GetMap();
|
||||||
if ((value <= maps.size()) && (value > 0)) { // everything fine
|
if ((value <= maps.size()) && (value > 0)) { // everything fine
|
||||||
fParamNo.push_back(maps[value-1]-1);
|
fParamNo.push_back(maps[value-1]-1);
|
||||||
} else { // map index out of range
|
} else { // map index out of range
|
||||||
|
@ -364,23 +364,43 @@ class PMsrRunBlock {
|
|||||||
virtual void CleanUp();
|
virtual void CleanUp();
|
||||||
|
|
||||||
virtual PStringVector GetRunNames() { return fRunName; }
|
virtual PStringVector GetRunNames() { return fRunName; }
|
||||||
virtual TString* GetRunName(UInt_t i=0);
|
virtual TString *GetRunName(UInt_t i=0);
|
||||||
|
virtual PStringVector GetBeamlines() { return fBeamline; }
|
||||||
|
virtual TString *GetBeamline(UInt_t i=0);
|
||||||
|
virtual PStringVector GetInstitutes() { return fInstitute; }
|
||||||
|
virtual TString *GetInstitute(UInt_t i=0);
|
||||||
|
virtual PStringVector GetFileFormats() { return fFileFormat; }
|
||||||
|
virtual TString *GetFileFormat(UInt_t i=0);
|
||||||
|
virtual Int_t GetFitType() { return fFitType; }
|
||||||
|
virtual Int_t GetAlphaParamNo() { return fAlphaParamNo; }
|
||||||
|
virtual Int_t GetBetaParamNo() { return fBetaParamNo; }
|
||||||
|
virtual Int_t GetNormParamNo() { return fNormParamNo; }
|
||||||
|
virtual Int_t GetBkgFitParamNo() { return fBkgFitParamNo; }
|
||||||
|
virtual Int_t GetPhaseParamNo() { return fPhaseParamNo; }
|
||||||
|
virtual Int_t GetLifetimeParamNo() { return fLifetimeParamNo; }
|
||||||
|
virtual Bool_t IsLifetimeCorrected() { return fLifetimeCorrection; }
|
||||||
|
virtual PIntVector* GetMap() { return &fMap; }
|
||||||
|
virtual Int_t GetMap(UInt_t idx);
|
||||||
|
|
||||||
virtual void AppendRunName(TString str) { fRunName.push_back(str); }
|
virtual void AppendRunName(TString str) { fRunName.push_back(str); }
|
||||||
virtual void SetRunName(TString &str, UInt_t i);
|
virtual void SetRunName(TString &str, UInt_t i);
|
||||||
|
virtual void AppendBeamline(TString str) { fBeamline.push_back(str); }
|
||||||
|
virtual void SetBeamline(TString &str, UInt_t i);
|
||||||
|
virtual void AppendInstitute(TString str) { fInstitute.push_back(str); }
|
||||||
|
virtual void SetInstitute(TString &str, UInt_t i);
|
||||||
|
virtual void AppendFileFormat(TString str) { fFileFormat.push_back(str); }
|
||||||
|
virtual void SetFileFormat(TString &str, UInt_t i);
|
||||||
|
virtual void SetFitType(Int_t ival) { fFitType = ival; }
|
||||||
|
virtual void SetAlphaParamNo(Int_t ival) { fAlphaParamNo = ival; }
|
||||||
|
virtual void SetBetaParamNo(Int_t ival) { fBetaParamNo = ival; }
|
||||||
|
virtual void SetNormParamNo(Int_t ival) { fNormParamNo = ival; }
|
||||||
|
virtual void SetBkgFitParamNo(Int_t ival) { fBkgFitParamNo = ival; }
|
||||||
|
virtual void SetPhaseParamNo(Int_t ival) { fPhaseParamNo = ival; }
|
||||||
|
virtual void SetLifetimeParamNo(Int_t ival) { fLifetimeParamNo = ival; }
|
||||||
|
virtual void SetLifetimeCorrection(Bool_t bval) { fLifetimeCorrection = bval; }
|
||||||
|
virtual void AppendMap(Int_t ival) { fMap.push_back(ival); }
|
||||||
|
virtual void SetMap(Int_t mapVal, UInt_t idx);
|
||||||
|
|
||||||
PStringVector fBeamline; ///< e.g. mue4, mue1, pim3, emu, m15, ... (former: run type)
|
|
||||||
PStringVector fInstitute; ///< e.g. psi, ral, triumf (former: run format)
|
|
||||||
PStringVector fFileFormat; ///< e.g. root, nexus, psi-bin, mud, ascii, db
|
|
||||||
Int_t fFitType; ///< fit type: 0=single histo fit, 2=asymmetry fit, 4=asymmetry in RRF, 8=non muSR
|
|
||||||
Int_t fAlphaParamNo; ///< alpha parameter number (fit type 2, 4)
|
|
||||||
Int_t fBetaParamNo; ///< beta parameter number (fit type 2, 4)
|
|
||||||
Int_t fNormParamNo; ///< N0 parameter number (fit type 0)
|
|
||||||
Int_t fBkgFitParamNo; ///< background fit parameter number (fit type 0)
|
|
||||||
Int_t fPhaseParamNo; ///< ??? NEEDED ??? NEEDS TO BE CHECKED !!!
|
|
||||||
Int_t fLifetimeParamNo; ///< muon lifetime parameter number (fit type 0)
|
|
||||||
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
|
|
||||||
Int_t fForwardHistoNo; ///< forward histogram number (fit type 0, 2, 4)
|
Int_t fForwardHistoNo; ///< forward histogram number (fit type 0, 2, 4)
|
||||||
Int_t fBackwardHistoNo; ///< backward histogram number (fit type 2, 4)
|
Int_t fBackwardHistoNo; ///< backward histogram number (fit type 2, 4)
|
||||||
PDoubleVector fBkgFix; ///< fixed background in (1/ns) (fit type 0, 2, 4)
|
PDoubleVector fBkgFix; ///< fixed background in (1/ns) (fit type 0, 2, 4)
|
||||||
@ -400,6 +420,18 @@ class PMsrRunBlock {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
PStringVector fRunName; ///< name of the run file
|
PStringVector fRunName; ///< name of the run file
|
||||||
|
PStringVector fBeamline; ///< e.g. mue4, mue1, pim3, emu, m15, ... (former: run type)
|
||||||
|
PStringVector fInstitute; ///< e.g. psi, ral, triumf (former: run format)
|
||||||
|
PStringVector fFileFormat; ///< e.g. root, nexus, psi-bin, mud, ascii, db
|
||||||
|
Int_t fFitType; ///< fit type: 0=single histo fit, 2=asymmetry fit, 4=asymmetry in RRF, 8=non muSR
|
||||||
|
Int_t fAlphaParamNo; ///< alpha parameter number (fit type 2, 4)
|
||||||
|
Int_t fBetaParamNo; ///< beta parameter number (fit type 2, 4)
|
||||||
|
Int_t fNormParamNo; ///< N0 parameter number (fit type 0)
|
||||||
|
Int_t fBkgFitParamNo; ///< background fit parameter number (fit type 0)
|
||||||
|
Int_t fPhaseParamNo; ///< ??? NEEDED ??? NEEDS TO BE CHECKED !!!
|
||||||
|
Int_t fLifetimeParamNo; ///< muon lifetime parameter number (fit type 0)
|
||||||
|
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
|
||||||
};
|
};
|
||||||
|
|
||||||
//-------------------------------------------------------------
|
//-------------------------------------------------------------
|
||||||
|
@ -215,7 +215,7 @@ int main(int argc, char *argv[])
|
|||||||
// check if the fittype is not NonMusr
|
// check if the fittype is not NonMusr
|
||||||
PMsrRunList *runList = msrHandler->GetMsrRunList();
|
PMsrRunList *runList = msrHandler->GetMsrRunList();
|
||||||
for (unsigned int i=0; i<runList->size(); i++) {
|
for (unsigned int i=0; i<runList->size(); i++) {
|
||||||
if (runList->at(i).fFitType == MSR_FITTYPE_NON_MUSR) {
|
if (runList->at(i).GetFitType() == MSR_FITTYPE_NON_MUSR) {
|
||||||
cout << endl << "**ERROR** t0 setting for NonMusr fittype doesn't make any sense, will quit ..." << endl;
|
cout << endl << "**ERROR** t0 setting for NonMusr fittype doesn't make any sense, will quit ..." << endl;
|
||||||
success = false;
|
success = false;
|
||||||
break;
|
break;
|
||||||
@ -243,7 +243,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// generate vector of all necessary PMusrT0 objects
|
// generate vector of all necessary PMusrT0 objects
|
||||||
for (unsigned int i=0; i<runList->size(); i++) {
|
for (unsigned int i=0; i<runList->size(); i++) {
|
||||||
switch (runList->at(i).fFitType) {
|
switch (runList->at(i).GetFitType()) {
|
||||||
case MSR_FITTYPE_SINGLE_HISTO:
|
case MSR_FITTYPE_SINGLE_HISTO:
|
||||||
for (unsigned int j=0; j<runList->at(i).GetRunNames().size(); j++) { // necessary in case of ADDRUN
|
for (unsigned int j=0; j<runList->at(i).GetRunNames().size(); j++) { // necessary in case of ADDRUN
|
||||||
if (!musrt0_item(app, msrHandler, dataHandler->GetRunData(*(runList->at(i).GetRunName(j))), i, runList->at(i).fForwardHistoNo, 0, j)) {
|
if (!musrt0_item(app, msrHandler, dataHandler->GetRunData(*(runList->at(i).GetRunName(j))), i, runList->at(i).fForwardHistoNo, 0, j)) {
|
||||||
|
Reference in New Issue
Block a user