merge in Bastian M. Wojek's cpp-version of msr2data. This should help to step towards a real platform independent musrfit package.
This commit is contained in:
parent
51c3ded931
commit
9ac709451c
@ -2,12 +2,13 @@
|
||||
|
||||
SUBDIRS = external classes
|
||||
|
||||
bin_PROGRAMS = musrfit musrview musrt0 musrparam msr2msr
|
||||
bin_PROGRAMS = musrfit musrview musrt0 musrparam msr2msr msr2data
|
||||
musrfit_SOURCES = musrfit.cpp
|
||||
musrview_SOURCES = musrview.cpp
|
||||
musrt0_SOURCES = musrt0.cpp
|
||||
musrparam_SOURCES = musrparam.cpp
|
||||
msr2msr_SOURCES = msr2msr.cpp
|
||||
msr2data_SOURCES = msr2data.cpp
|
||||
|
||||
xmldir = $(bindir)
|
||||
xml_DATA = musrfit_startup.xml
|
||||
|
@ -7,6 +7,7 @@ h_sources = \
|
||||
../include/PFunctionGrammar.h \
|
||||
../include/PFunction.h \
|
||||
../include/PFunctionHandler.h \
|
||||
../include/PMsr2Data.h \
|
||||
../include/PMsrHandler.h \
|
||||
../include/PMusrCanvas.h \
|
||||
../include/PMusr.h \
|
||||
@ -40,6 +41,7 @@ cpp_sources = \
|
||||
PFourier.cpp \
|
||||
PFunction.cpp \
|
||||
PFunctionHandler.cpp \
|
||||
PMsr2Data.cpp \
|
||||
PMsrHandler.cpp \
|
||||
PMusrCanvas.cpp \
|
||||
PMusrT0.cpp \
|
||||
|
@ -52,7 +52,7 @@ using namespace std;
|
||||
*
|
||||
* \param fileName
|
||||
*/
|
||||
PMsrHandler::PMsrHandler(char *fileName) : fFileName(fileName)
|
||||
PMsrHandler::PMsrHandler(const char *fileName) : fFileName(fileName)
|
||||
{
|
||||
// init variables
|
||||
fMsrBlockCounter = 0;
|
||||
|
@ -521,6 +521,7 @@ void PMusrCanvas::UpdateInfoPad()
|
||||
|
||||
// get/set run plot info
|
||||
double dval;
|
||||
vector< pair<double, double> > ddvec;
|
||||
char sval[128];
|
||||
unsigned int runNo;
|
||||
PMsrPlotStructure plotInfo = fMsrHandler->GetMsrPlotList()->at(fPlotNumber);
|
||||
@ -545,13 +546,21 @@ void PMusrCanvas::UpdateInfoPad()
|
||||
tstr += TString(",");
|
||||
}
|
||||
// temperature if present
|
||||
ddvec = fRunList->GetTemp(runs[runNo].fRunName[0]);
|
||||
if (ddvec.empty()) {
|
||||
tstr += TString("T=");
|
||||
dval = fRunList->GetTemp(runs[runNo].fRunName[0]);
|
||||
if (dval == -9.9e99) {
|
||||
tstr += TString("??,");
|
||||
} else if (ddvec.size() == 1){
|
||||
tstr += TString("T=");
|
||||
sprintf(sval, "%0.2lf", ddvec[0].first);
|
||||
tstr += TString(sval) + TString("K,");
|
||||
} else {
|
||||
sprintf(sval, "%0.2lf", dval);
|
||||
tstr += TString(sval) + TString("(K),");
|
||||
for(unsigned int i(0); i<ddvec.size(); ++i){
|
||||
sprintf(sval, "T%u=", i);
|
||||
tstr += TString(sval);
|
||||
sprintf(sval, "%0.2lf", ddvec[i].first);
|
||||
tstr += TString(sval) + TString("K,");
|
||||
}
|
||||
}
|
||||
// field if present
|
||||
tstr += TString("B=");
|
||||
@ -560,17 +569,17 @@ void PMusrCanvas::UpdateInfoPad()
|
||||
tstr += TString("??,");
|
||||
} else {
|
||||
sprintf(sval, "%0.2lf", dval);
|
||||
tstr += TString(sval) + TString("(G),");
|
||||
tstr += TString(sval) + TString("G,");
|
||||
}
|
||||
// energy if present
|
||||
tstr += TString("E=");
|
||||
dval = fRunList->GetEnergy(runs[runNo].fRunName[0]);
|
||||
//cout << endl << ">> dval = " << dval << " (Engery)";
|
||||
if (dval == -9.9e99) {
|
||||
if (dval == -999.0) {
|
||||
tstr += TString("??,");
|
||||
} else {
|
||||
sprintf(sval, "%0.2lf", dval);
|
||||
tstr += TString(sval) + TString("(keV),");
|
||||
tstr += TString(sval) + TString("keV,");
|
||||
}
|
||||
// setup if present
|
||||
tstr += fRunList->GetSetup(runs[runNo].fRunName[0]);
|
||||
|
@ -114,7 +114,7 @@ PRunDataHandler::~PRunDataHandler()
|
||||
*
|
||||
* \param runName
|
||||
*/
|
||||
PRawRunData* PRunDataHandler::GetRunData(TString runName)
|
||||
PRawRunData* PRunDataHandler::GetRunData(const TString &runName)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
@ -394,7 +394,9 @@ bool PRunDataHandler::ReadRootFile(bool notPostPileup)
|
||||
runData.fRunTitle = ostr.GetString();
|
||||
|
||||
// get temperature
|
||||
runData.fTemp = runHeader->GetSampleTemperature();
|
||||
runData.fTemp.resize(1);
|
||||
runData.fTemp[0].first = runHeader->GetSampleTemperature();
|
||||
runData.fTemp[0].second = runHeader->GetSampleTemperatureError();
|
||||
|
||||
// get field
|
||||
runData.fField = runHeader->GetSampleBField();
|
||||
@ -403,6 +405,9 @@ bool PRunDataHandler::ReadRootFile(bool notPostPileup)
|
||||
runData.fEnergy = runHeader->GetImpEnergy();
|
||||
//cout << endl << ">> runData.fEnergy = " << runData.fEnergy;
|
||||
|
||||
// get moderator HV
|
||||
runData.fTransport = runHeader->GetModeratorHV();
|
||||
|
||||
// get setup
|
||||
runData.fSetup = runHeader->GetLemSetup().GetString();
|
||||
|
||||
@ -422,6 +427,107 @@ bool PRunDataHandler::ReadRootFile(bool notPostPileup)
|
||||
}
|
||||
}
|
||||
|
||||
// read run summary to obtain ring anode HV values
|
||||
TObjArray *runSummary = dynamic_cast<TObjArray*>(folder->FindObjectAny("RunSummary"));
|
||||
|
||||
// check if run summary is valid
|
||||
if (!runSummary) {
|
||||
cout << endl << "Couldn't obtain run summary info from ROOT file " << fRunPathName.Data() << endl;
|
||||
// this is not fatal... only RA-HV values are not available
|
||||
} else { // it follows a (at least) little bit strange extraction of the RA values from Thomas' TObjArray...
|
||||
//streaming of a ASCII-file would be more easy
|
||||
TString s, tok;
|
||||
TObjArrayIter summIter(runSummary);
|
||||
TObjString *os(dynamic_cast<TObjString*>(summIter.Next()));
|
||||
TObjArray *oa(0);
|
||||
TObjString *objTok(0);
|
||||
while(os != 0){
|
||||
s = os->GetString();
|
||||
// will put four parallel if's since it may be that more than one RA-values are on one line
|
||||
if(s.Contains("RA-L")){
|
||||
if(runData.fRingAnode.empty() || runData.fRingAnode.size() == 2)
|
||||
runData.fRingAnode.resize(2);
|
||||
oa = s.Tokenize(" ");
|
||||
TObjArrayIter lineIter(oa);
|
||||
objTok = dynamic_cast<TObjString*>(lineIter.Next());
|
||||
while (objTok != 0){
|
||||
if(!objTok->GetString().CompareTo("RA-L")){
|
||||
objTok = dynamic_cast<TObjString*>(lineIter.Next()); // "="
|
||||
if(objTok != 0 && !objTok->GetString().CompareTo("=")){
|
||||
objTok = dynamic_cast<TObjString*>(lineIter.Next()); // HV value
|
||||
runData.fRingAnode[0] = objTok->GetString().Atof(); // fill RA-R value into the runData structure
|
||||
break;
|
||||
}
|
||||
}
|
||||
objTok = dynamic_cast<TObjString*>(lineIter.Next()); // next token...
|
||||
}
|
||||
}
|
||||
|
||||
if(s.Contains("RA-R")){
|
||||
if(runData.fRingAnode.empty() || runData.fRingAnode.size() == 2)
|
||||
runData.fRingAnode.resize(2);
|
||||
oa = s.Tokenize(" ");
|
||||
TObjArrayIter lineIter(oa);
|
||||
objTok = dynamic_cast<TObjString*>(lineIter.Next());
|
||||
while (objTok != 0){
|
||||
if(!objTok->GetString().CompareTo("RA-R")){
|
||||
objTok = dynamic_cast<TObjString*>(lineIter.Next()); // "="
|
||||
if(objTok != 0 && !objTok->GetString().CompareTo("=")){
|
||||
objTok = dynamic_cast<TObjString*>(lineIter.Next()); // HV value
|
||||
runData.fRingAnode[1] = objTok->GetString().Atof(); // fill RA-R value into the runData structure
|
||||
break;
|
||||
}
|
||||
}
|
||||
objTok = dynamic_cast<TObjString*>(lineIter.Next()); // next token...
|
||||
}
|
||||
}
|
||||
|
||||
if(s.Contains("RA-T")){
|
||||
if(runData.fRingAnode.empty() || runData.fRingAnode.size() == 2)
|
||||
runData.fRingAnode.resize(4);
|
||||
oa = s.Tokenize(" ");
|
||||
TObjArrayIter lineIter(oa);
|
||||
objTok = dynamic_cast<TObjString*>(lineIter.Next());
|
||||
while (objTok != 0){
|
||||
if(!objTok->GetString().CompareTo("RA-T")){
|
||||
objTok = dynamic_cast<TObjString*>(lineIter.Next()); // "="
|
||||
if(objTok != 0 && !objTok->GetString().CompareTo("=")){
|
||||
objTok = dynamic_cast<TObjString*>(lineIter.Next()); // HV value
|
||||
runData.fRingAnode[2] = objTok->GetString().Atof(); // fill RA-T value into the runData structure
|
||||
break;
|
||||
}
|
||||
}
|
||||
objTok = dynamic_cast<TObjString*>(lineIter.Next()); // next token...
|
||||
}
|
||||
}
|
||||
|
||||
if(s.Contains("RA-B")){
|
||||
if(runData.fRingAnode.empty() || runData.fRingAnode.size() == 2)
|
||||
runData.fRingAnode.resize(4);
|
||||
oa = s.Tokenize(" ");
|
||||
TObjArrayIter lineIter(oa);
|
||||
objTok = dynamic_cast<TObjString*>(lineIter.Next());
|
||||
while (objTok != 0){
|
||||
if(!objTok->GetString().CompareTo("RA-B")){
|
||||
objTok = dynamic_cast<TObjString*>(lineIter.Next()); // "="
|
||||
if(objTok != 0 && !objTok->GetString().CompareTo("=")){
|
||||
objTok = dynamic_cast<TObjString*>(lineIter.Next()); // HV value
|
||||
runData.fRingAnode[3] = objTok->GetString().Atof(); // fill RA-B value into the runData structure
|
||||
break;
|
||||
}
|
||||
}
|
||||
objTok = dynamic_cast<TObjString*>(lineIter.Next()); // next token...
|
||||
}
|
||||
}
|
||||
|
||||
os = dynamic_cast<TObjString*>(summIter.Next()); // next summary line...
|
||||
}
|
||||
}
|
||||
// for (unsigned int i(0); i<runData.fRingAnode.size(); i++){
|
||||
// cout << endl << runData.fRingAnode[i];
|
||||
// }
|
||||
// cout << endl;
|
||||
|
||||
// read data ---------------------------------------------------------
|
||||
// check if histos folder is found
|
||||
f.GetObject("histos", folder);
|
||||
@ -482,6 +588,8 @@ bool PRunDataHandler::ReadRootFile(bool notPostPileup)
|
||||
runData.fDataBin[i].clear();
|
||||
runData.fDataBin.clear();
|
||||
|
||||
runData.fRingAnode.clear();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -515,8 +623,10 @@ bool PRunDataHandler::ReadWkmFile()
|
||||
runData.fRunTitle = TString("");
|
||||
runData.fSetup = TString("");
|
||||
runData.fField = -9.9e99;
|
||||
runData.fTemp = -9.9e99;
|
||||
runData.fEnergy = -9.9e99;
|
||||
runData.fTemp.clear();
|
||||
runData.fEnergy = -999.0; // standard LEM values...
|
||||
runData.fTransport = -999.0; // standard LEM values...
|
||||
runData.fRingAnode.clear();
|
||||
runData.fTimeResolution = 0.0;
|
||||
|
||||
// open file
|
||||
@ -533,7 +643,7 @@ bool PRunDataHandler::ReadWkmFile()
|
||||
// read header
|
||||
bool headerInfo = true;
|
||||
char instr[512];
|
||||
TString line;
|
||||
TString line, linecp;
|
||||
double dval;
|
||||
int ival;
|
||||
bool ok;
|
||||
@ -574,19 +684,54 @@ bool PRunDataHandler::ReadWkmFile()
|
||||
line.Replace(0, idx+1, 0, 0); // remove 'Setup:'
|
||||
StripWhitespace(line);
|
||||
runData.fSetup = line;
|
||||
} else if (line.Contains("Temp")) {
|
||||
} else if (line.Contains("Temp:") || line.Contains("Temp(meas1):")) {
|
||||
linecp = line;
|
||||
idx = line.Index(":");
|
||||
line.Replace(0, idx+1, 0, 0); // remove 'Temp:'
|
||||
StripWhitespace(line);
|
||||
idx = line.Index("+-"); // remove "+- ..." part
|
||||
idx = line.Index("+/-"); // remove "+/- ..." part
|
||||
if (idx > 0)
|
||||
line.Resize(idx);
|
||||
idx = line.Index("K"); // remove "K ..." part
|
||||
if (idx > 0)
|
||||
line.Resize(idx);
|
||||
dval = ToDouble(line, ok);
|
||||
if (ok)
|
||||
runData.fTemp = dval;
|
||||
if (ok){
|
||||
runData.fTemp.resize(1);
|
||||
runData.fTemp[0].first = dval;
|
||||
runData.fTemp[0].second = 0.0;
|
||||
}
|
||||
idx = linecp.Index("+/-"); // get the error
|
||||
linecp.Replace(0, idx+3, 0, 0);
|
||||
StripWhitespace(linecp);
|
||||
dval = ToDouble(linecp, ok);
|
||||
if (ok && !runData.fTemp.empty()){
|
||||
runData.fTemp[0].second = dval;
|
||||
}
|
||||
} else if (line.Contains("Temp(meas2):")) {
|
||||
linecp = line;
|
||||
idx = line.Index(":");
|
||||
line.Replace(0, idx+1, 0, 0); // remove 'Temp(meas2):'
|
||||
StripWhitespace(line);
|
||||
idx = line.Index("+/-"); // remove "+/- ..." part
|
||||
if (idx > 0)
|
||||
line.Resize(idx);
|
||||
idx = line.Index("K"); // remove "K ..." part
|
||||
if (idx > 0)
|
||||
line.Resize(idx);
|
||||
dval = ToDouble(line, ok);
|
||||
if (ok){
|
||||
runData.fTemp.resize(2);
|
||||
runData.fTemp[1].first = dval;
|
||||
runData.fTemp[1].second = 0.0;
|
||||
}
|
||||
idx = linecp.Index("+/-"); // get the error
|
||||
linecp.Replace(0, idx+3, 0, 0);
|
||||
StripWhitespace(linecp);
|
||||
dval = ToDouble(linecp, ok);
|
||||
if (ok && runData.fTemp.size() > 1){
|
||||
runData.fTemp[1].second = dval;
|
||||
}
|
||||
} else if (line.Contains("Groups")) {
|
||||
idx = line.Index(":");
|
||||
line.Replace(0, idx+1, 0, 0); // remove 'Groups:'
|
||||
@ -840,15 +985,36 @@ cout << endl;
|
||||
// get run title
|
||||
runData.fRunTitle = TString(psiBin.get_comment().c_str()); // run title
|
||||
// get setup
|
||||
runData.fSetup = TString("");
|
||||
runData.fSetup = TString(psiBin.get_orient().c_str());
|
||||
// set LEM specific information to default value since it is not in the file and not used...
|
||||
runData.fEnergy = -999.0;
|
||||
runData.fTransport = -999.0;
|
||||
runData.fRingAnode.clear();
|
||||
// get field
|
||||
status = sscanf(psiBin.get_field().c_str(), "%lfG", &dval);
|
||||
if (status == 1)
|
||||
runData.fField = dval;
|
||||
// get temperature
|
||||
PDoubleVector tempVec(psiBin.get_temperatures_vector());
|
||||
PDoubleVector tempDevVec(psiBin.get_devTemperatures_vector());
|
||||
if(tempVec.size() > 1 && tempDevVec.size() > 1 && tempVec[0] && tempVec[1]) {
|
||||
runData.fTemp.resize(2);
|
||||
// take only the first two values for now...
|
||||
//maybe that's not enough - e.g. in older GPD data I saw the "correct values in the second and third entry..."
|
||||
for (unsigned int i(0); i<2; i++){
|
||||
runData.fTemp[i].first = tempVec[i];
|
||||
runData.fTemp[i].second = tempDevVec[i];
|
||||
}
|
||||
tempVec.clear();
|
||||
tempDevVec.clear();
|
||||
} else {
|
||||
status = sscanf(psiBin.get_temp().c_str(), "%lfK", &dval);
|
||||
if (status == 1)
|
||||
runData.fTemp = dval;
|
||||
runData.fTemp.resize(1);
|
||||
runData.fTemp[0].first = dval;
|
||||
runData.fTemp[0].second = 0.0;
|
||||
}
|
||||
|
||||
// get time resolution (ns)
|
||||
runData.fTimeResolution = psiBin.get_binWidth_ns();
|
||||
// get t0's
|
||||
@ -1022,7 +1188,9 @@ bool PRunDataHandler::ReadAsciiFile()
|
||||
success = false;
|
||||
break;
|
||||
}
|
||||
runData.fTemp = workStr.Atof();
|
||||
runData.fTemp.resize(1);
|
||||
runData.fTemp[0].first = workStr.Atof();
|
||||
runData.fTemp[0].second = 0.0;
|
||||
} else if (workStr.BeginsWith("energy:", TString::kIgnoreCase)) {
|
||||
workStr = TString(workStr.Data()+workStr.First(":")+2);
|
||||
if (!workStr.IsFloat()) {
|
||||
@ -1032,6 +1200,8 @@ bool PRunDataHandler::ReadAsciiFile()
|
||||
break;
|
||||
}
|
||||
runData.fEnergy = workStr.Atof();
|
||||
runData.fTransport = -999.0; // just to initialize the variables to some "meaningful" value
|
||||
runData.fRingAnode.clear();
|
||||
} else { // error
|
||||
cout << endl << "PRunDataHandler::ReadAsciiFile **ERROR** line no " << lineNo << ", illegal header line.";
|
||||
cout << endl;
|
||||
|
@ -42,10 +42,9 @@
|
||||
* \param msrInfo pointer to the msr info structure
|
||||
* \param data
|
||||
*/
|
||||
PRunListCollection::PRunListCollection(PMsrHandler *msrInfo, PRunDataHandler *data)
|
||||
PRunListCollection::PRunListCollection(PMsrHandler *msrInfo, PRunDataHandler *data) \
|
||||
: fMsrInfo(msrInfo), fData(data)
|
||||
{
|
||||
fMsrInfo = msrInfo;
|
||||
fData = data;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -135,7 +134,7 @@ bool PRunListCollection::Add(int runNo, EPMusrHandleTag tag)
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
double PRunListCollection::GetSingleHistoChisq(const std::vector<double>& par)
|
||||
double PRunListCollection::GetSingleHistoChisq(const std::vector<double>& par) const
|
||||
{
|
||||
double chisq = 0.0;
|
||||
|
||||
@ -151,7 +150,7 @@ double PRunListCollection::GetSingleHistoChisq(const std::vector<double>& par)
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
double PRunListCollection::GetAsymmetryChisq(const std::vector<double>& par)
|
||||
double PRunListCollection::GetAsymmetryChisq(const std::vector<double>& par) const
|
||||
{
|
||||
double chisq = 0.0;
|
||||
|
||||
@ -167,7 +166,7 @@ double PRunListCollection::GetAsymmetryChisq(const std::vector<double>& par)
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
double PRunListCollection::GetRRFChisq(const std::vector<double>& par)
|
||||
double PRunListCollection::GetRRFChisq(const std::vector<double>& par) const
|
||||
{
|
||||
double chisq = 0.0;
|
||||
|
||||
@ -183,7 +182,7 @@ double PRunListCollection::GetRRFChisq(const std::vector<double>& par)
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
double PRunListCollection::GetNonMusrChisq(const std::vector<double>& par)
|
||||
double PRunListCollection::GetNonMusrChisq(const std::vector<double>& par) const
|
||||
{
|
||||
double chisq = 0.0;
|
||||
|
||||
@ -199,7 +198,7 @@ double PRunListCollection::GetNonMusrChisq(const std::vector<double>& par)
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
double PRunListCollection::GetSingleHistoMaximumLikelihood(const std::vector<double>& par)
|
||||
double PRunListCollection::GetSingleHistoMaximumLikelihood(const std::vector<double>& par) const
|
||||
{
|
||||
double mlh = 0.0;
|
||||
|
||||
@ -216,7 +215,7 @@ double PRunListCollection::GetSingleHistoMaximumLikelihood(const std::vector<dou
|
||||
* <p> Since it is not clear yet how to handle asymmetry fits with max likelihood
|
||||
* the chi square will be used!
|
||||
*/
|
||||
double PRunListCollection::GetAsymmetryMaximumLikelihood(const std::vector<double>& par)
|
||||
double PRunListCollection::GetAsymmetryMaximumLikelihood(const std::vector<double>& par) const
|
||||
{
|
||||
double mlh = 0.0;
|
||||
|
||||
@ -233,7 +232,7 @@ double PRunListCollection::GetAsymmetryMaximumLikelihood(const std::vector<doubl
|
||||
* <p> Since it is not clear yet how to handle RRF fits with max likelihood
|
||||
* the chi square will be used!
|
||||
*/
|
||||
double PRunListCollection::GetRRFMaximumLikelihood(const std::vector<double>& par)
|
||||
double PRunListCollection::GetRRFMaximumLikelihood(const std::vector<double>& par) const
|
||||
{
|
||||
double mlh = 0.0;
|
||||
|
||||
@ -250,7 +249,7 @@ double PRunListCollection::GetRRFMaximumLikelihood(const std::vector<double>& pa
|
||||
* <p> Since it is not clear yet how to handle non musr fits with max likelihood
|
||||
* the chi square will be used!
|
||||
*/
|
||||
double PRunListCollection::GetNonMusrMaximumLikelihood(const std::vector<double>& par)
|
||||
double PRunListCollection::GetNonMusrMaximumLikelihood(const std::vector<double>& par) const
|
||||
{
|
||||
double mlh = 0.0;
|
||||
|
||||
@ -266,7 +265,7 @@ double PRunListCollection::GetNonMusrMaximumLikelihood(const std::vector<double>
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
unsigned int PRunListCollection::GetTotalNoOfBinsFitted()
|
||||
unsigned int PRunListCollection::GetTotalNoOfBinsFitted() const
|
||||
{
|
||||
unsigned int counts = 0;
|
||||
|
||||
@ -434,7 +433,7 @@ PRunData* PRunListCollection::GetNonMusr(unsigned int index, EDataSwitch tag)
|
||||
*
|
||||
* \param runName
|
||||
*/
|
||||
double PRunListCollection::GetTemp(TString &runName)
|
||||
vector< pair<double, double> > PRunListCollection::GetTemp(const TString &runName) const
|
||||
{
|
||||
return fData->GetRunData(runName)->fTemp;
|
||||
}
|
||||
@ -447,7 +446,7 @@ double PRunListCollection::GetTemp(TString &runName)
|
||||
*
|
||||
* \param runName
|
||||
*/
|
||||
double PRunListCollection::GetField(TString &runName)
|
||||
double PRunListCollection::GetField(const TString &runName) const
|
||||
{
|
||||
return fData->GetRunData(runName)->fField;
|
||||
}
|
||||
@ -460,7 +459,7 @@ double PRunListCollection::GetField(TString &runName)
|
||||
*
|
||||
* \param runName
|
||||
*/
|
||||
double PRunListCollection::GetEnergy(TString &runName)
|
||||
double PRunListCollection::GetEnergy(const TString &runName) const
|
||||
{
|
||||
return fData->GetRunData(runName)->fEnergy;
|
||||
}
|
||||
@ -473,7 +472,7 @@ double PRunListCollection::GetEnergy(TString &runName)
|
||||
*
|
||||
* \param runName
|
||||
*/
|
||||
const char* PRunListCollection::GetSetup(TString &runName)
|
||||
const char* PRunListCollection::GetSetup(const TString &runName) const
|
||||
{
|
||||
return fData->GetRunData(runName)->fSetup.Data();
|
||||
}
|
||||
@ -487,7 +486,7 @@ const char* PRunListCollection::GetSetup(TString &runName)
|
||||
* \param runName name of the run file
|
||||
* \param idx msr-file run index
|
||||
*/
|
||||
const char* PRunListCollection::GetXAxisTitle(TString &runName, const unsigned int idx)
|
||||
const char* PRunListCollection::GetXAxisTitle(const TString &runName, const unsigned int idx) const
|
||||
{
|
||||
//cout << endl << ">> PRunListCollection::GetXAxisTitle: runName = " << runName.Data() << ", idx = " << idx;
|
||||
//cout << endl << ">> PRunListCollection::GetXAxisTitle: fRunNonMusrList.size() = " << fRunNonMusrList.size();
|
||||
@ -521,7 +520,7 @@ const char* PRunListCollection::GetXAxisTitle(TString &runName, const unsigned i
|
||||
* \param runName name of the run file
|
||||
* \param idx msr-file run index
|
||||
*/
|
||||
const char* PRunListCollection::GetYAxisTitle(TString &runName, const unsigned int idx)
|
||||
const char* PRunListCollection::GetYAxisTitle(const TString &runName, const unsigned int idx) const
|
||||
{
|
||||
//cout << endl << ">> PRunListCollection::GetYAxisTitle: runName = " << runName.Data() << ", idx = " << idx;
|
||||
//cout << endl;
|
||||
|
@ -47,7 +47,7 @@
|
||||
class PMsrHandler
|
||||
{
|
||||
public:
|
||||
PMsrHandler(char *fileName);
|
||||
PMsrHandler(const char *fileName);
|
||||
virtual ~PMsrHandler();
|
||||
|
||||
virtual int ReadMsrFile();
|
||||
|
@ -182,8 +182,11 @@ typedef struct {
|
||||
TString fRunTitle; ///< run title
|
||||
TString fSetup; ///< description of the setup of this run
|
||||
double fField; ///< magnetic field value
|
||||
double fTemp; ///< temperature during the run
|
||||
// double fTemp; ///< temperature during the run
|
||||
vector< pair<double, double> > fTemp; ///< measured temperatures and standard deviations during the run
|
||||
double fEnergy; ///< implantation energy of the muon
|
||||
double fTransport; ///< LEM transport settings (Moderator HV)
|
||||
PDoubleVector fRingAnode; ///< LEM ring anode HVs (L,R[,T,B])
|
||||
double fTimeResolution; ///< time resolution of the run
|
||||
PIntVector fT0s; ///< vector of t0's of a run
|
||||
vector<PDoubleVector> fDataBin; ///< vector of all histos of a run
|
||||
|
@ -47,8 +47,8 @@ class PRunDataHandler
|
||||
PRunDataHandler(PMsrHandler *msrInfo, const PStringVector dataPath);
|
||||
virtual ~PRunDataHandler();
|
||||
|
||||
virtual bool IsAllDataAvailable() { return fAllDataAvailable; }
|
||||
virtual PRawRunData* GetRunData(TString runName);
|
||||
virtual bool IsAllDataAvailable() const { return fAllDataAvailable; }
|
||||
virtual PRawRunData* GetRunData(const TString &runName);
|
||||
|
||||
private:
|
||||
PMsrHandler *fMsrInfo;
|
||||
|
@ -53,34 +53,34 @@ class PRunListCollection
|
||||
|
||||
virtual bool Add(int runNo, EPMusrHandleTag tag);
|
||||
|
||||
virtual double GetSingleHistoChisq(const std::vector<double>& par);
|
||||
virtual double GetAsymmetryChisq(const std::vector<double>& par);
|
||||
virtual double GetRRFChisq(const std::vector<double>& par);
|
||||
virtual double GetNonMusrChisq(const std::vector<double>& par);
|
||||
virtual double GetSingleHistoChisq(const std::vector<double>& par) const;
|
||||
virtual double GetAsymmetryChisq(const std::vector<double>& par) const;
|
||||
virtual double GetRRFChisq(const std::vector<double>& par) const;
|
||||
virtual double GetNonMusrChisq(const std::vector<double>& par) const;
|
||||
|
||||
virtual double GetSingleHistoMaximumLikelihood(const std::vector<double>& par);
|
||||
virtual double GetAsymmetryMaximumLikelihood(const std::vector<double>& par);
|
||||
virtual double GetRRFMaximumLikelihood(const std::vector<double>& par);
|
||||
virtual double GetNonMusrMaximumLikelihood(const std::vector<double>& par);
|
||||
virtual double GetSingleHistoMaximumLikelihood(const std::vector<double>& par) const;
|
||||
virtual double GetAsymmetryMaximumLikelihood(const std::vector<double>& par) const;
|
||||
virtual double GetRRFMaximumLikelihood(const std::vector<double>& par) const;
|
||||
virtual double GetNonMusrMaximumLikelihood(const std::vector<double>& par) const;
|
||||
|
||||
virtual unsigned int GetTotalNoOfBinsFitted();
|
||||
virtual unsigned int GetTotalNoOfBinsFitted() const;
|
||||
|
||||
virtual unsigned int GetNoOfSingleHisto() { return fRunSingleHistoList.size(); }
|
||||
virtual unsigned int GetNoOfAsymmetry() { return fRunAsymmetryList.size(); }
|
||||
virtual unsigned int GetNoOfRRF() { return fRunRRFList.size(); }
|
||||
virtual unsigned int GetNoOfNonMusr() { return fRunNonMusrList.size(); }
|
||||
virtual unsigned int GetNoOfSingleHisto() const { return fRunSingleHistoList.size(); }
|
||||
virtual unsigned int GetNoOfAsymmetry() const { return fRunAsymmetryList.size(); }
|
||||
virtual unsigned int GetNoOfRRF() const { return fRunRRFList.size(); }
|
||||
virtual unsigned int GetNoOfNonMusr() const { return fRunNonMusrList.size(); }
|
||||
|
||||
virtual PRunData* GetSingleHisto(unsigned int index, EDataSwitch tag=kIndex);
|
||||
virtual PRunData* GetAsymmetry(unsigned int index, EDataSwitch tag=kIndex);
|
||||
virtual PRunData* GetRRF(unsigned int index, EDataSwitch tag=kIndex);
|
||||
virtual PRunData* GetNonMusr(unsigned int index, EDataSwitch tag=kIndex);
|
||||
|
||||
virtual double GetTemp(TString &runName);
|
||||
virtual double GetField(TString &runName);
|
||||
virtual double GetEnergy(TString &runName);
|
||||
virtual const char* GetSetup(TString &runName);
|
||||
virtual const char* GetXAxisTitle(TString &runName, const unsigned int idx);
|
||||
virtual const char* GetYAxisTitle(TString &runName, const unsigned int idx);
|
||||
virtual vector< pair<double, double> > GetTemp(const TString &runName) const;
|
||||
virtual double GetField(const TString &runName) const;
|
||||
virtual double GetEnergy(const TString &runName) const;
|
||||
virtual const char* GetSetup(const TString &runName) const;
|
||||
virtual const char* GetXAxisTitle(const TString &runName, const unsigned int idx) const;
|
||||
virtual const char* GetYAxisTitle(const TString &runName, const unsigned int idx) const;
|
||||
|
||||
private:
|
||||
PMsrHandler *fMsrInfo; ///< keeps all msr file info
|
||||
|
Loading…
x
Reference in New Issue
Block a user