47#include "PStringUtils.h"
118 std::cerr << std::endl <<
">> PRunAsymmetry::PRunAsymmetry(): **SEVERE ERROR**: Couldn't find any packing information!";
119 std::cerr << std::endl <<
">> This is very bad :-(, will quit ...";
120 std::cerr << std::endl;
130 if (
fRunInfo->GetAlphaParamNo() == -1) {
131 std::cerr << std::endl <<
">> PRunAsymmetry::PRunAsymmetry(): **ERROR** no alpha parameter given! This is needed for an asymmetry fit!";
132 std::cerr << std::endl;
138 if ((fRunInfo->GetAlphaParamNo()-MSR_PARAM_FUN_OFFSET < 0) ||
139 (fRunInfo->GetAlphaParamNo()-MSR_PARAM_FUN_OFFSET > msrInfo->GetNoOfFuncs())) {
140 std::cerr << std::endl <<
">> PRunAsymmetry::PRunAsymmetry(): **ERROR** alpha parameter is a function with no = " << fRunInfo->GetAlphaParamNo();
141 std::cerr << std::endl <<
">> This is out of bound, since there are only " << msrInfo->GetNoOfFuncs() <<
" functions.";
142 std::cerr << std::endl;
146 }
else if ((fRunInfo->GetAlphaParamNo() < 0) || (fRunInfo->GetAlphaParamNo() >
static_cast<Int_t
>(param->size()))) {
147 std::cerr << std::endl <<
">> PRunAsymmetry::PRunAsymmetry(): **ERROR** alpha parameter no = " << fRunInfo->GetAlphaParamNo();
148 std::cerr << std::endl <<
">> This is out of bound, since there are only " << param->size() <<
" parameters.";
149 std::cerr << std::endl;
154 Bool_t alphaFixedToOne =
false;
156 if (((*param)[fRunInfo->GetAlphaParamNo()-1].fStep == 0.0) &&
157 ((*param)[fRunInfo->GetAlphaParamNo()-1].fValue == 1.0))
158 alphaFixedToOne = true;
161 Bool_t betaFixedToOne =
false;
162 if (fRunInfo->GetBetaParamNo() == -1) {
163 betaFixedToOne = true;
164 }
else if ((fRunInfo->GetBetaParamNo() < 0) || (fRunInfo->GetBetaParamNo() >
static_cast<Int_t
>(param->size()))) {
165 std::cerr << std::endl <<
">> PRunAsymmetry::PRunAsymmetry(): **ERROR** beta parameter no = " << fRunInfo->GetBetaParamNo();
166 std::cerr << std::endl <<
">> This is out of bound, since there are only " << param->size() <<
" parameters.";
167 std::cerr << std::endl;
171 if (((*param)[fRunInfo->GetBetaParamNo()-1].fStep == 0.0) &&
172 ((*param)[fRunInfo->GetBetaParamNo()-1].fValue == 1.0))
173 betaFixedToOne = true;
177 if (alphaFixedToOne && betaFixedToOne)
179 else if (!alphaFixedToOne && betaFixedToOne)
181 else if (alphaFixedToOne && !betaFixedToOne)
230 Double_t chisq = 0.0;
232 Double_t asymFcnValue = 0.0;
236 for (Int_t i=0; i<
fMsrInfo->GetNoOfFuncs(); i++) {
252 a = par[
fRunInfo->GetAlphaParamNo()-1];
264 b = par[
fRunInfo->GetBetaParamNo()-1];
274 a = par[
fRunInfo->GetAlphaParamNo()-1];
282 b = par[
fRunInfo->GetBetaParamNo()-1];
306 #pragma omp parallel for default(shared) private(i,time,diff,asymFcnValue,f) schedule(dynamic,chunk) reduction(+:chisq)
309 time =
fData.GetDataTimeStart() +
static_cast<Double_t
>(i)*
fData.GetDataTimeStep();
311 asymFcnValue = (f*(a*b+1.0)-(a-1.0))/((a+1.0)-f*(a*b-1.0));
312 diff =
fData.GetValue()->at(i) - asymFcnValue;
313 chisq += diff*diff / (
fData.GetError()->at(i)*
fData.GetError()->at(i));
357 std::cout << std::endl <<
"PRunAsymmetry::CalcMaxLikelihood(): not implemented yet ..." << std::endl;
412 std::vector<std::string> tok = PStringUtils::Split(fitRange.Data(),
" \t");
414 if (tok.size() == 3) {
418 idx = str.First(
"+");
420 str.Remove(0, idx+1);
429 idx = str.First(
"-");
431 str.Remove(0, idx+1);
436 }
else if ((tok.size() > 3) && (tok.size() % 2 == 1)) {
437 UInt_t pos = 2*(
fRunNo+1)-1;
439 if (pos + 1 >= tok.size()) {
440 std::cerr << std::endl <<
">> PRunAsymmetry::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange <<
"'";
441 std::cerr << std::endl <<
">> will ignore it. Sorry ..." << std::endl;
446 idx = str.First(
"+");
448 str.Remove(0, idx+1);
457 idx = str.First(
"-");
459 str.Remove(0, idx+1);
466 std::cerr << std::endl <<
">> PRunAsymmetry::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange <<
"'";
467 std::cerr << std::endl <<
">> will ignore it. Sorry ..." << std::endl;
524 std::vector<Double_t> par;
526 for (UInt_t i=0; i<paramList->size(); i++)
527 par.push_back((*paramList)[i].fValue);
530 for (Int_t i=0; i<
fMsrInfo->GetNoOfFuncs(); i++) {
535 Double_t asymFcnValue = 0.0;
538 for (UInt_t i=0; i<
fData.GetValue()->size(); i++) {
539 time =
fData.GetDataTimeStart() +
static_cast<Double_t
>(i)*
fData.GetDataTimeStep();
546 a = par[
fRunInfo->GetAlphaParamNo()-1];
554 asymFcnValue = (f*(a+1.0)-(a-1.0))/((a+1.0)-f*(a-1.0));
558 b = par[
fRunInfo->GetBetaParamNo()-1];
566 asymFcnValue = f*(b+1.0)/(2.0-f*(b-1.0));
570 a = par[
fRunInfo->GetAlphaParamNo()-1];
578 b = par[
fRunInfo->GetBetaParamNo()-1];
586 asymFcnValue = (f*(a*b+1.0)-(a-1.0))/((a+1.0)-f*(a*b-1.0));
592 fData.AppendTheoryValue(asymFcnValue);
641 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareData(): **ERROR** Couldn't get run " <<
fRunInfo->GetRunName()->Data() <<
"!";
642 std::cerr << std::endl;
659 for (UInt_t i=0; i<
fRunInfo->GetForwardHistoNoSize(); i++) {
660 forwardHistoNo.push_back(
fRunInfo->GetForwardHistoNo(i));
662 if (!runData->
IsPresent(forwardHistoNo[i])) {
663 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareData(): **PANIC ERROR**:";
664 std::cerr << std::endl <<
">> forwardHistoNo found = " << forwardHistoNo[i] <<
", which is NOT present in the data file!?!?";
665 std::cerr << std::endl <<
">> Will quit :-(";
666 std::cerr << std::endl;
668 forwardHistoNo.clear();
669 backwardHistoNo.clear();
673 for (UInt_t i=0; i<
fRunInfo->GetBackwardHistoNoSize(); i++) {
674 backwardHistoNo.push_back(
fRunInfo->GetBackwardHistoNo(i));
676 if (!runData->
IsPresent(backwardHistoNo[i])) {
677 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareData(): **PANIC ERROR**:";
678 std::cerr << std::endl <<
">> backwardHistoNo found = " << backwardHistoNo[i] <<
", which is NOT present in the data file!?!?";
679 std::cerr << std::endl <<
">> Will quit :-(";
680 std::cerr << std::endl;
682 forwardHistoNo.clear();
683 backwardHistoNo.clear();
690 std::cout.precision(10);
691 std::cout << std::endl <<
">> PRunAsymmetry::PrepareData(): time resolution=" << std::fixed << runData->
GetTimeResolution() <<
"(ns)" << std::endl;
694 if (!
GetProperT0(runData, globalBlock, forwardHistoNo, backwardHistoNo)) {
699 std::vector<PDoubleVector> forward, backward;
700 forward.resize(forwardHistoNo.size());
701 for (UInt_t i=0; i<forwardHistoNo.size(); i++) {
702 forward[i].resize(runData->
GetDataBin(forwardHistoNo[i])->size());
703 forward[i] = *runData->
GetDataBin(forwardHistoNo[i]);
710 backward.resize(backwardHistoNo.size());
711 for (UInt_t i=0; i<backwardHistoNo.size(); i++) {
712 backward[i].resize(runData->
GetDataBin(backwardHistoNo[i])->size());
713 backward[i] = *runData->
GetDataBin(backwardHistoNo[i]);
722 if (
fRunInfo->GetRunNameSize() > 1) {
724 std::vector<PDoubleVector> addForward, addBackward;
725 for (UInt_t i=1; i<
fRunInfo->GetRunNameSize(); i++) {
728 if (addRunData ==
nullptr) {
729 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareData(): **ERROR** Couldn't get addrun " <<
fRunInfo->GetRunName(i)->Data() <<
"!";
730 std::cerr << std::endl;
736 addForward.resize(forwardHistoNo.size());
737 for (UInt_t j=0; j<forwardHistoNo.size(); j++) {
738 addForward[j].resize(addRunData->
GetDataBin(forwardHistoNo[j])->size());
739 addForward[j] = *addRunData->
GetDataBin(forwardHistoNo[j]);
743 addBackward.resize(backwardHistoNo.size());
744 for (UInt_t j=0; j<backwardHistoNo.size(); j++) {
745 addBackward[j].resize(addRunData->
GetDataBin(backwardHistoNo[j])->size());
746 addBackward[j] = *addRunData->
GetDataBin(backwardHistoNo[j]);
752 for (UInt_t k=0; k<forwardHistoNo.size(); k++) {
753 addRunSize = addRunData->
GetDataBin(forwardHistoNo[k])->size();
754 for (UInt_t j=0; j<addRunData->
GetDataBin(forwardHistoNo[k])->size(); j++) {
756 if ((
static_cast<Int_t
>(j)+
static_cast<Int_t
>(
fAddT0s[i-1][2*k])-
static_cast<Int_t
>(
fT0s[2*k]) >= 0) &&
757 (j+
static_cast<Int_t
>(
fAddT0s[i-1][2*k])-
static_cast<Int_t
>(
fT0s[2*k]) < addRunSize)) {
758 forward[k][j] += addForward[k][j+
static_cast<Int_t
>(
fAddT0s[i-1][2*k])-
static_cast<Int_t
>(
fT0s[2*k])];
764 for (UInt_t k=0; k<backwardHistoNo.size(); k++) {
765 addRunSize = addRunData->
GetDataBin(backwardHistoNo[k])->size();
766 for (UInt_t j=0; j<addRunData->
GetDataBin(backwardHistoNo[k])->size(); j++) {
768 if ((
static_cast<Int_t
>(j)+
static_cast<Int_t
>(
fAddT0s[i-1][2*k+1])-
static_cast<Int_t
>(
fT0s[2*k+1]) >= 0) &&
769 (j+
static_cast<Int_t
>(
fAddT0s[i-1][2*k+1])-
static_cast<Int_t
>(
fT0s[2*k+1]) < addRunSize)) {
770 backward[k][j] += addBackward[k][j+
static_cast<Int_t
>(
fAddT0s[i-1][2*k+1])-
static_cast<Int_t
>(
fT0s[2*k+1])];
779 for (UInt_t i=0; i<
fForward.size(); i++) {
783 for (UInt_t i=0; i<
fBackward.size(); i++) {
788 for (UInt_t i=1; i<forwardHistoNo.size(); i++) {
789 for (UInt_t j=0; j<runData->
GetDataBin(forwardHistoNo[i])->size(); j++) {
792 fForward[j] += forward[i][j+
static_cast<Int_t
>(
fT0s[2*i])-
static_cast<Int_t
>(
fT0s[0])];
798 for (UInt_t i=1; i<backwardHistoNo.size(); i++) {
799 for (UInt_t j=0; j<runData->
GetDataBin(backwardHistoNo[i])->size(); j++) {
802 fBackward[j] += backward[i][j+
static_cast<Int_t
>(
fT0s[2*i+1])-
static_cast<Int_t
>(
fT0s[1])];
809 if (
fRunInfo->GetBkgRange(0) >= 0) {
813 fRunInfo->SetBkgRange(
static_cast<Int_t
>(
fT0s[0]*0.1), 0);
814 fRunInfo->SetBkgRange(
static_cast<Int_t
>(
fT0s[0]*0.6), 1);
815 fRunInfo->SetBkgRange(
static_cast<Int_t
>(
fT0s[1]*0.1), 2);
816 fRunInfo->SetBkgRange(
static_cast<Int_t
>(
fT0s[1]*0.6), 3);
817 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareData(): **WARNING** Neither fix background nor background bins are given!";
818 std::cerr << std::endl <<
">> Will try the following:";
819 std::cerr << std::endl <<
">> forward: bkg start = " <<
fRunInfo->GetBkgRange(0) <<
", bkg end = " <<
fRunInfo->GetBkgRange(1);
820 std::cerr << std::endl <<
">> backward: bkg start = " <<
fRunInfo->GetBkgRange(2) <<
", bkg end = " <<
fRunInfo->GetBkgRange(3);
821 std::cerr << std::endl <<
">> NO WARRANTY THAT THIS MAKES ANY SENSE! Better check ...";
822 std::cerr << std::endl;
831 UInt_t histoNo[2] = {forwardHistoNo[0], backwardHistoNo[0]};
848 if (
fMsrInfo->GetMsrPlotList()->at(0).fRRFPacking == 0)
859 forwardHistoNo.clear();
860 backwardHistoNo.clear();
887 std::cerr <<
"PRunAsymmetry::SubtractFixBkg(): **ERROR** no fixed bkg for forward set. Will do nothing here." << std::endl;
891 std::cerr <<
"PRunAsymmetry::SubtractFixBkg(): **ERROR** no fixed bkg for backward set. Will do nothing here." << std::endl;
892 std::cerr <<
" you need an entry like:" << std::endl;
893 std::cerr <<
" backgr.fix 2 3" << std::endl;
894 std::cerr <<
" i.e. two entries for forward and backward." << std::endl;
901 for (UInt_t i=0; i<
fForward.size(); i++) {
944 Double_t beamPeriod = 0.0;
947 if (
fRunInfo->GetInstitute()->Contains(
"psi"))
949 else if (
fRunInfo->GetInstitute()->Contains(
"ral"))
951 else if (
fRunInfo->GetInstitute()->Contains(
"triumf"))
959 for (UInt_t i=0; i<2; i++) {
960 if (end[i] < start[i]) {
961 std::cout << std::endl <<
">> PRunAsymmetry::SubtractEstimatedBkg(): end = " << end[i] <<
" > start = " << start[i] <<
"! Will swap them!";
962 UInt_t keep = end[i];
969 for (UInt_t i=0; i<2; i++) {
970 if (beamPeriod != 0.0) {
972 UInt_t fullCycles =
static_cast<UInt_t
>(timeBkg/beamPeriod);
975 std::cout <<
">> PRunAsymmetry::SubtractEstimatedBkg(): Background " << start[i] <<
", " << end[i] << std::endl;
976 if (end[i] == start[i])
977 end[i] =
fRunInfo->GetBkgRange(2*i+1);
982 if ((start[0] < 0) || (start[0] >=
fForward.size()) ||
983 (start[1] < 0) || (start[1] >=
fBackward.size())) {
984 std::cerr << std::endl <<
">> PRunAsymmetry::SubtractEstimatedBkg(): **ERROR** background bin values out of bound!";
985 std::cerr << std::endl <<
">> histo lengths (f/b) = (" <<
fForward.size() <<
"/" <<
fBackward.size() <<
").";
986 std::cerr << std::endl <<
">> background start (f/b) = (" << start[0] <<
"/" << start[1] <<
").";
991 if ((end[0] < 0) || (end[0] >=
fForward.size()) ||
992 (end[1] < 0) || (end[1] >=
fBackward.size())) {
993 std::cerr << std::endl <<
">> PRunAsymmetry::SubtractEstimatedBkg(): **ERROR** background bin values out of bound!";
994 std::cerr << std::endl <<
">> histo lengths (f/b) = (" <<
fForward.size() <<
"/" <<
fBackward.size() <<
").";
995 std::cerr << std::endl <<
">> background end (f/b) = (" << end[0] <<
"/" << end[1] <<
").";
1000 Double_t bkg[2] = {0.0, 0.0};
1001 Double_t errBkg[2] = {0.0, 0.0};
1004 for (UInt_t i=start[0]; i<=end[0]; i++)
1006 errBkg[0] = TMath::Sqrt(bkg[0])/(end[0] - start[0] + 1);
1007 bkg[0] /=
static_cast<Double_t
>(end[0] - start[0] + 1);
1008 std::cout << std::endl <<
">> estimated forward histo background: " << bkg[0];
1011 for (UInt_t i=start[1]; i<=end[1]; i++)
1013 errBkg[1] = TMath::Sqrt(bkg[1])/(end[1] - start[1] + 1);
1014 bkg[1] /=
static_cast<Double_t
>(end[1] - start[1] + 1);
1015 std::cout << std::endl <<
">> estimated backward histo background: " << bkg[1] << std::endl;
1018 Double_t errVal = 0.0;
1019 for (UInt_t i=0; i<
fForward.size(); i++) {
1021 errVal = TMath::Sqrt(
fForward[i]+errBkg[0]*errBkg[0]);
1026 errVal = TMath::Sqrt(
fBackward[i]+errBkg[1]*errBkg[1]);
1033 for (UInt_t i=0; i<
fForward.size(); i++) {
1038 fRunInfo->SetBkgEstimated(bkg[0], 0);
1039 fRunInfo->SetBkgEstimated(bkg[1], 1);
1075 Double_t value = 0.0;
1076 Double_t error = 0.0;
1123 UInt_t noOfBins = forwardPacked.
GetValue()->size();
1124 if (forwardPacked.
GetValue()->size() != backwardPacked.
GetValue()->size()) {
1126 noOfBins = backwardPacked.
GetValue()->size();
1131 Double_t f, b, ef, eb;
1136 for (UInt_t i=0; i<noOfBins; i++) {
1138 f = forwardPacked.
GetValue()->at(i);
1139 b = backwardPacked.
GetValue()->at(i);
1140 ef = forwardPacked.
GetError()->at(i);
1141 eb = backwardPacked.
GetError()->at(i);
1144 asym = (f-b) / (f+b);
1147 fData.AppendValue(asym);
1150 error = 2.0/((f+b)*(f+b))*TMath::Sqrt(b*b*ef*ef+eb*eb*f*f);
1153 fData.AppendErrorValue(error);
1195 if (
fMsrInfo->GetMsrPlotList()->at(0).fViewPacking > 0) {
1196 packing =
fMsrInfo->GetMsrPlotList()->at(0).fViewPacking;
1200 std::vector<Double_t> par;
1202 for (UInt_t i=0; i<paramList->size(); i++)
1203 par.push_back((*paramList)[i].fValue);
1211 Int_t t0[2] = {
static_cast<Int_t
>(
fT0s[0]),
static_cast<Int_t
>(
fT0s[1])};
1215 if (start[0]-t0[0] != start[1]-t0[1]) {
1216 if (abs(start[0]-t0[0]) > abs(start[1]-t0[1])) {
1218 fgb[1] = t0[1] + start[0]-t0[0];
1219 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareViewData(): **WARNING** needed to shift backward fgb from ";
1220 std::cerr << start[1] <<
" to " << fgb[1] << std::endl;
1222 fgb[0] = t0[0] + start[1]-t0[1];
1224 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareViewData(): **WARNING** needed to shift forward fgb from ";
1225 std::cerr << start[0] <<
" to " << fgb[0] << std::endl;
1232 Int_t val = fgb[0]-packing*(fgb[0]/packing);
1234 if (fgb[1] - fgb[0] < 0)
1236 }
while (val + fgb[1] - fgb[0] < 0);
1239 start[1] = val + fgb[1] - fgb[0];
1242 UInt_t noOfBins0 = (runData->
GetDataBin(histoNo[0])->size()-start[0])/packing;
1243 UInt_t noOfBins1 = (runData->
GetDataBin(histoNo[1])->size()-start[1])/packing;
1244 if (noOfBins0 > noOfBins1)
1245 noOfBins0 = noOfBins1;
1246 end[0] = start[0] + noOfBins0 * packing;
1247 end[1] = start[1] + noOfBins0 * packing;
1251 for (UInt_t i=0; i<2; i++) {
1252 if (end[i] < start[i]) {
1253 Int_t keep = end[i];
1258 if ((start[i] < 0) || (start[i] >
static_cast<Int_t
>(runData->
GetDataBin(histoNo[i])->size()))) {
1259 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareViewData(): **ERROR** start data bin doesn't make any sense!";
1260 std::cerr << std::endl;
1264 if ((end[i] < 0) || (end[i] >
static_cast<Int_t
>(runData->
GetDataBin(histoNo[i])->size()))) {
1265 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareViewData(): **ERROR** end data bin doesn't make any sense!";
1266 std::cerr << std::endl;
1270 if ((t0[i] < 0) || (t0[i] >
static_cast<Int_t
>(runData->
GetDataBin(histoNo[i])->size()))) {
1271 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareViewData(): **ERROR** t0 data bin doesn't make any sense!";
1272 std::cerr << std::endl;
1280 Double_t value = 0.0;
1281 Double_t error = 0.0;
1284 for (Int_t i=start[0]; i<end[0]; i++) {
1289 if (((i-start[0]) % packing == 0) && (i != start[0])) {
1307 for (Int_t i=start[1]; i<end[1]; i++) {
1312 if (((i-start[1]) % packing == 0) && (i != start[1])) {
1330 UInt_t noOfBins = forwardPacked.
GetValue()->size();
1331 if (forwardPacked.
GetValue()->size() != backwardPacked.
GetValue()->size()) {
1333 noOfBins = backwardPacked.
GetValue()->size();
1338 Double_t f, b, ef, eb, alpha = 1.0, beta = 1.0;
1341 fData.SetDataTimeStart(
fTimeResolution*((
static_cast<Double_t
>(start[0])-0.5) +
static_cast<Double_t
>(packing)/2.0 -
static_cast<Double_t
>(t0[0])));
1352 alpha = par[
fRunInfo->GetAlphaParamNo()-1];
1364 beta = par[
fRunInfo->GetBetaParamNo()-1];
1374 alpha = par[
fRunInfo->GetAlphaParamNo()-1];
1382 beta = par[
fRunInfo->GetBetaParamNo()-1];
1394 for (UInt_t i=0; i<forwardPacked.
GetValue()->size(); i++) {
1396 f = forwardPacked.
GetValue()->at(i);
1397 b = backwardPacked.
GetValue()->at(i);
1398 ef = forwardPacked.
GetError()->at(i);
1399 eb = backwardPacked.
GetError()->at(i);
1402 asym = (alpha*f-b) / (alpha*beta*f+b);
1405 fData.AppendValue(asym);
1408 error = 2.0/((f+b)*(f+b))*TMath::Sqrt(b*b*ef*ef+eb*eb*f*f);
1411 fData.AppendErrorValue(error);
1424 for (Int_t i=0; i<
fMsrInfo->GetNoOfFuncs(); i++) {
1430 UInt_t size = runData->
GetDataBin(histoNo[0])->size()/packing;
1433 fData.SetTheoryTimeStart(
fData.GetDataTimeStart());
1435 fData.SetTheoryTimeStep(
fData.GetDataTimeStep());
1439 fData.SetTheoryTimeStep(
fData.GetDataTimeStep()/(Double_t)factor);
1442 for (UInt_t i=0; i<size; i++) {
1443 time =
fData.GetTheoryTimeStart() +
static_cast<Double_t
>(i)*
fData.GetTheoryTimeStep();
1445 if (fabs(value) > 10.0) {
1448 fData.AppendTheoryValue(value);
1486 std::vector<Double_t> par;
1488 for (UInt_t i=0; i<paramList->size(); i++)
1489 par.push_back((*paramList)[i].fValue);
1498 Int_t t0[2] = {
static_cast<Int_t
>(
fT0s[0]),
static_cast<Int_t
>(
fT0s[1])};
1499 UInt_t packing =
fMsrInfo->GetMsrPlotList()->at(0).fRRFPacking;
1503 if (start[0]-t0[0] != start[1]-t0[1]) {
1504 if (abs(start[0]-t0[0]) > abs(start[1]-t0[1])) {
1506 fgb[1] = t0[1] + start[0]-t0[0];
1507 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareRRFViewData(): **WARNING** needed to shift backward fgb from ";
1508 std::cerr << start[1] <<
" to " << fgb[1] << std::endl;
1510 fgb[0] = t0[0] + start[1]-t0[1];
1512 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareRRFViewData(): **WARNING** needed to shift forward fgb from ";
1513 std::cerr << start[1] <<
" to " << fgb[0] << std::endl;
1520 Int_t val = fgb[0]-packing*(fgb[0]/packing);
1522 if (fgb[1] - fgb[0] < 0)
1524 }
while (val + fgb[1] - fgb[0] < 0);
1527 start[1] = val + fgb[1] - fgb[0];
1530 UInt_t noOfBins0 = runData->
GetDataBin(histoNo[0])->size()-start[0];
1531 UInt_t noOfBins1 = runData->
GetDataBin(histoNo[1])->size()-start[1];
1532 if (noOfBins0 > noOfBins1)
1533 noOfBins0 = noOfBins1;
1534 end[0] = start[0] + noOfBins0;
1535 end[1] = start[1] + noOfBins0;
1539 for (UInt_t i=0; i<2; i++) {
1540 if (end[i] < start[i]) {
1541 Int_t keep = end[i];
1546 if ((start[i] < 0) || (start[i] >
static_cast<Int_t
>(runData->
GetDataBin(histoNo[i])->size()))) {
1547 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareRRFViewData(): **ERROR** start data bin doesn't make any sense!";
1548 std::cerr << std::endl;
1552 if ((end[i] < 0) || (end[i] >
static_cast<Int_t
>(runData->
GetDataBin(histoNo[i])->size()))) {
1553 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareRRFViewData(): **ERROR** end data bin doesn't make any sense!";
1554 std::cerr << std::endl;
1558 if ((t0[i] < 0) || (t0[i] >
static_cast<Int_t
>(runData->
GetDataBin(histoNo[i])->size()))) {
1559 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareRRFViewData(): **ERROR** t0 data bin doesn't make any sense!";
1560 std::cerr << std::endl;
1571 Double_t error = 0.0;
1573 for (Int_t i=start[0]; i<end[0]; i++) {
1578 for (Int_t i=start[1]; i<end[1]; i++) {
1584 UInt_t noOfBins = forward.size();
1585 if (forward.size() != backward.size()) {
1586 if (forward.size() > backward.size())
1587 noOfBins = backward.size();
1593 Double_t f, b, ef, eb, alpha = 1.0, beta = 1.0;
1603 alpha = par[
fRunInfo->GetAlphaParamNo()-1];
1615 beta = par[
fRunInfo->GetBetaParamNo()-1];
1625 alpha = par[
fRunInfo->GetAlphaParamNo()-1];
1633 beta = par[
fRunInfo->GetBetaParamNo()-1];
1645 for (UInt_t i=0; i<noOfBins; i++) {
1650 eb = backwardErr[i];
1653 asym = (alpha*f-b) / (alpha*beta*f+b);
1656 asymmetry.push_back(asym);
1659 error = 2.0/((f+b)*(f+b))*TMath::Sqrt(b*b*ef*ef+eb*eb*f*f);
1662 asymmetryErr.push_back(error);
1677 Double_t gammaRRF = 0.0, wRRF = 0.0, phaseRRF = 0.0;
1680 switch (
fMsrInfo->GetMsrPlotList()->at(0).fRRFUnit) {
1682 gammaRRF = TMath::TwoPi()*1.0e-3;
1685 gammaRRF = TMath::TwoPi();
1697 gammaRRF = TMath::TwoPi();
1700 wRRF = gammaRRF *
fMsrInfo->GetMsrPlotList()->at(0).fRRFFreq;
1701 phaseRRF =
fMsrInfo->GetMsrPlotList()->at(0).fRRFPhase / 180.0 * TMath::Pi();
1703 for (UInt_t i=0; i<asymmetry.size(); i++) {
1704 time =
fTimeResolution*(
static_cast<Double_t
>(start[0])-t0[0]+
static_cast<Double_t
>(i));
1705 asymmetry[i] *= 2.0*TMath::Cos(wRRF*time+phaseRRF);
1711 Double_t value = 0.0;
1713 for (UInt_t i=0; i<asymmetry.size(); i++) {
1714 if ((i % packing == 0) && (i != 0)) {
1716 fData.AppendValue(value);
1717 fData.AppendErrorValue(TMath::Sqrt(error)/packing);
1722 value += asymmetry[i];
1723 error += asymmetryErr[i]*asymmetryErr[i];
1728 fData.SetDataTimeStart(
fTimeResolution*((
static_cast<Double_t
>(start[0])-0.5) +
static_cast<Double_t
>(packing)/2.0 -
static_cast<Double_t
>(t0[0])));
1735 UInt_t rebinRRF =
static_cast<UInt_t
>((TMath::Pi()/2.0/wRRF)/
fTimeResolution);
1736 fData.SetTheoryTimeStart(
fData.GetDataTimeStart());
1737 fData.SetTheoryTimeStep(TMath::Pi()/2.0/wRRF/rebinRRF);
1740 for (Int_t i=0; i<
fMsrInfo->GetNoOfFuncs(); i++) {
1744 Double_t theoryValue;
1745 for (UInt_t i=0; i<asymmetry.size(); i++) {
1746 time =
fData.GetTheoryTimeStart() +
static_cast<Double_t
>(i)*
fData.GetTheoryTimeStep();
1748 theoryValue *= 2.0*TMath::Cos(wRRF * time + phaseRRF);
1750 if (fabs(theoryValue) > 10.0) {
1754 fData.AppendTheoryValue(theoryValue);
1762 Double_t dval = 0.0;
1763 for (UInt_t i=0; i<
fData.GetTheory()->size(); i++) {
1764 if ((i % rebinRRF == 0) && (i != 0)) {
1765 theo.push_back(dval/rebinRRF);
1768 dval +=
fData.GetTheory()->at(i);
1770 fData.ReplaceTheory(theo);
1774 fData.SetTheoryTimeStart(
fData.GetTheoryTimeStart()+
static_cast<Double_t
>(rebinRRF-1)*
fData.GetTheoryTimeStep()/2.0);
1775 fData.SetTheoryTimeStep(rebinRRF*
fData.GetTheoryTimeStep());
1792 backwardErr.clear();
1794 asymmetryErr.clear();
1836 size_t size = 2*forwardHistoNo.size();
1837 if (backwardHistoNo.size() > forwardHistoNo.size())
1838 size = 2*backwardHistoNo.size();
1840 for (UInt_t i=0; i<
fT0s.size(); i++) {
1845 for (UInt_t i=0; i<
fRunInfo->GetT0BinSize(); i++) {
1851 if (
fT0s[i] == -1) {
1857 for (UInt_t i=0; i<forwardHistoNo.size(); i++) {
1858 if (
fT0s[2*i] == -1.0)
1859 if (runData->
GetT0Bin(forwardHistoNo[i]) > 0.0) {
1864 for (UInt_t i=0; i<backwardHistoNo.size(); i++) {
1865 if (
fT0s[2*i+1] == -1.0)
1866 if (runData->
GetT0Bin(backwardHistoNo[i]) > 0.0) {
1873 for (UInt_t i=0; i<forwardHistoNo.size(); i++) {
1874 if (
fT0s[2*i] == -1.0) {
1878 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperT0(): **WARRNING** NO t0's found, neither in the run data nor in the msr-file!";
1879 std::cerr << std::endl <<
">> run: " <<
fRunInfo->GetRunName()->Data();
1880 std::cerr << std::endl <<
">> will try the estimated one: forward t0 = " << runData->
GetT0BinEstimated(forwardHistoNo[i]);
1881 std::cerr << std::endl <<
">> NO WARRANTY THAT THIS OK!! For instance for LEM this is almost for sure rubbish!";
1882 std::cerr << std::endl;
1885 for (UInt_t i=0; i<backwardHistoNo.size(); i++) {
1886 if (
fT0s[2*i+1] == -1.0) {
1890 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperT0(): **WARRNING** NO t0's found, neither in the run data nor in the msr-file!";
1891 std::cerr << std::endl <<
">> run: " <<
fRunInfo->GetRunName()->Data();
1892 std::cerr << std::endl <<
">> will try the estimated one: backward t0 = " << runData->
GetT0BinEstimated(backwardHistoNo[i]);
1893 std::cerr << std::endl <<
">> NO WARRANTY THAT THIS OK!! For instance for LEM this is almost for sure rubbish!";
1894 std::cerr << std::endl;
1899 for (UInt_t i=0; i<forwardHistoNo.size(); i++) {
1900 if ((
fT0s[2*i] < 0) || (
fT0s[2*i] >
static_cast<Int_t
>(runData->
GetDataBin(forwardHistoNo[i])->size()))) {
1901 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperT0(): **ERROR** t0 data bin (" <<
fT0s[2*i] <<
") doesn't make any sense!";
1902 std::cerr << std::endl <<
">> forwardHistoNo " << forwardHistoNo[i];
1903 std::cerr << std::endl;
1907 for (UInt_t i=0; i<backwardHistoNo.size(); i++) {
1908 if ((
fT0s[2*i+1] < 0) || (
fT0s[2*i+1] >
static_cast<Int_t
>(runData->
GetDataBin(backwardHistoNo[i])->size()))) {
1909 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareData(): **ERROR** t0 data bin (" <<
fT0s[2*i+1] <<
") doesn't make any sense!";
1910 std::cerr << std::endl <<
">> backwardHistoNo " << backwardHistoNo[i];
1911 std::cerr << std::endl;
1917 if (
fRunInfo->GetRunNameSize() > 1) {
1920 for (UInt_t i=1; i<
fRunInfo->GetRunNameSize(); i++) {
1923 if (addRunData == 0) {
1924 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperT0(): **ERROR** Couldn't get addrun " <<
fRunInfo->GetRunName(i)->Data() <<
"!";
1925 std::cerr << std::endl;
1932 fAddT0s[i-1].resize(2*forwardHistoNo.size());
1933 for (UInt_t j=0; j<
fAddT0s[i-1].size(); j++) {
1938 for (Int_t j=0; j<
fRunInfo->GetAddT0BinSize(i-1); j++) {
1943 for (UInt_t j=0; j<forwardHistoNo.size(); j++) {
1944 if (
fAddT0s[i-1][2*j] == -1.0)
1945 if (addRunData->
GetT0Bin(forwardHistoNo[j]) > 0.0) {
1950 for (UInt_t j=0; j<backwardHistoNo.size(); j++) {
1951 if (
fAddT0s[i-1][2*j+1] == -1.0)
1952 if (addRunData->
GetT0Bin(backwardHistoNo[j]) > 0.0) {
1959 for (UInt_t j=0; j<forwardHistoNo.size(); j++) {
1960 if (
fAddT0s[i-1][2*j] == -1.0) {
1964 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperT0(): **WARRNING** NO t0's found, neither in the run data nor in the msr-file!";
1965 std::cerr << std::endl <<
">> run: " <<
fRunInfo->GetRunName(i)->Data();
1966 std::cerr << std::endl <<
">> will try the estimated one: forward t0 = " << addRunData->
GetT0BinEstimated(forwardHistoNo[j]);
1967 std::cerr << std::endl <<
">> NO WARRANTY THAT THIS OK!! For instance for LEM this is almost for sure rubbish!";
1968 std::cerr << std::endl;
1971 for (UInt_t j=0; j<backwardHistoNo.size(); j++) {
1972 if (
fAddT0s[i-1][2*j+1] == -1.0) {
1976 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperT0(): **WARRNING** NO t0's found, neither in the run data nor in the msr-file!";
1977 std::cerr << std::endl <<
">> run: " <<
fRunInfo->GetRunName(i)->Data();
1978 std::cerr << std::endl <<
">> will try the estimated one: backward t0 = " << runData->
GetT0BinEstimated(backwardHistoNo[j]);
1979 std::cerr << std::endl <<
">> NO WARRANTY THAT THIS OK!! For instance for LEM this is almost for sure rubbish!";
1980 std::cerr << std::endl;
2024 if (start[0] == -1) {
2025 start[0] =
fMsrInfo->GetMsrGlobal()->GetDataRange(0);
2027 if (start[1] == -1) {
2028 start[1] =
fMsrInfo->GetMsrGlobal()->GetDataRange(2);
2031 end[0] =
fMsrInfo->GetMsrGlobal()->GetDataRange(1);
2034 end[1] =
fMsrInfo->GetMsrGlobal()->GetDataRange(3);
2037 Double_t t0[2] = {
fT0s[0],
fT0s[1]};
2042 start[0] =
static_cast<Int_t
>(t0[0])+offset;
2043 fRunInfo->SetDataRange(start[0], 0);
2044 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange(): **WARNING** data range (forward) was not provided, will try data range start = t0+" << offset <<
"(=10ns) = " << start[0] <<
".";
2045 std::cerr << std::endl <<
">> NO WARRANTY THAT THIS DOES MAKE ANY SENSE.";
2046 std::cerr << std::endl;
2049 start[1] =
static_cast<Int_t
>(t0[1])+offset;
2050 fRunInfo->SetDataRange(start[1], 2);
2051 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange(): **WARNING** data range (backward) was not provided, will try data range start = t0+" << offset <<
"(=10ns) = " << start[1] <<
".";
2052 std::cerr << std::endl <<
">> NO WARRANTY THAT THIS DOES MAKE ANY SENSE.";
2053 std::cerr << std::endl;
2056 end[0] = runData->
GetDataBin(histoNo[0])->size();
2058 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange(): **WARNING** data range (forward) was not provided, will try data range end = " << end[0] <<
".";
2059 std::cerr << std::endl <<
">> NO WARRANTY THAT THIS DOES MAKE ANY SENSE.";
2060 std::cerr << std::endl;
2063 end[1] = runData->
GetDataBin(histoNo[1])->size();
2065 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange(): **WARNING** data range (backward) was not provided, will try data range end = " << end[1] <<
".";
2066 std::cerr << std::endl <<
">> NO WARRANTY THAT THIS DOES MAKE ANY SENSE.";
2067 std::cerr << std::endl;
2072 for (UInt_t i=0; i<2; i++) {
2073 if (end[i] < start[i]) {
2074 Int_t keep = end[i];
2079 if ((start[i] < 0) || (start[i] >
static_cast<Int_t
>(runData->
GetDataBin(histoNo[i])->size()))) {
2080 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange(): **ERROR** start data bin doesn't make any sense!";
2081 std::cerr << std::endl;
2086 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange(): **ERROR** end data bin (" << end[i] <<
") doesn't make any sense!";
2087 std::cerr << std::endl;
2090 if (end[i] >
static_cast<Int_t
>(runData->
GetDataBin(histoNo[i])->size())) {
2091 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange(): **WARNING** end data bin (" << end[i] <<
") > histo length (" <<
static_cast<Int_t
>(runData->
GetDataBin(histoNo[i])->size()) <<
").";
2092 std::cerr << std::endl <<
">> Will set end = (histo length - 1). Consider to change it in the msr-file." << std::endl;
2093 std::cerr << std::endl;
2094 end[i] =
static_cast<Int_t
>(runData->
GetDataBin(histoNo[i])->size())-1;
2097 if ((t0[i] < 0) || (t0[i] >
static_cast<Int_t
>(runData->
GetDataBin(histoNo[i])->size()))) {
2098 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange(): **ERROR** t0 data bin doesn't make any sense!";
2099 std::cerr << std::endl;
2105 if (fabs(
static_cast<Double_t
>(start[0])-t0[0]) > fabs(
static_cast<Double_t
>(start[1])-t0[1])){
2106 start[1] =
static_cast<Int_t
>(t0[1] +
static_cast<Double_t
>(start[0]) - t0[0]);
2107 end[1] =
static_cast<Int_t
>(t0[1] +
static_cast<Double_t
>(end[0]) - t0[0]);
2108 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange **WARNING** needed to shift backward data range.";
2109 std::cerr << std::endl <<
">> given: " <<
fRunInfo->GetDataRange(2) <<
", " <<
fRunInfo->GetDataRange(3);
2110 std::cerr << std::endl <<
">> used : " << start[1] <<
", " << end[1];
2111 std::cerr << std::endl;
2113 if (fabs(
static_cast<Double_t
>(start[0])-t0[0]) < fabs(
static_cast<Double_t
>(start[1])-t0[1])){
2114 start[0] =
static_cast<Int_t
>(t0[0] +
static_cast<Double_t
>(start[1]) - t0[1]);
2115 end[0] =
static_cast<Int_t
>(t0[0] +
static_cast<Double_t
>(end[1]) - t0[1]);
2116 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange **WARNING** needed to shift forward data range.";
2117 std::cerr << std::endl <<
">> given: " <<
fRunInfo->GetDataRange(0) <<
", " <<
fRunInfo->GetDataRange(1);
2118 std::cerr << std::endl <<
">> used : " << start[0] <<
", " << end[0];
2119 std::cerr << std::endl;
2132 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange **WARNING** needed to shift forward lgb,";
2133 std::cerr << std::endl <<
">> from " <<
fGoodBins[1] <<
" to " <<
fForward.size()-1 << std::endl;
2139 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange **WARNING** needed to shift backward lgb,";
2140 std::cerr << std::endl <<
">> from " <<
fGoodBins[1] <<
" to " <<
fForward.size()-1 << std::endl;
2200 std::cerr <<
">> PRunSingleHisto::GetProperFitRange(): **WARNING** Couldn't get fit start/end time!" << std::endl;
2201 std::cerr <<
">> Will set it to fgb/lgb which given in time is: " <<
fFitStartTime <<
"..." <<
fFitEndTime <<
" (usec)" << std::endl;
std::vector< UInt_t > PUIntVector
#define ACCEL_PERIOD_TRIUMF
TRIUMF accelerator cycle: 43.37 ns.
@ kFit
Fitting mode - perform least-squares fit to data.
@ kView
Viewing mode - display data and theory without fitting.
#define RRF_UNIT_MHz
Frequency in MHz (megahertz)
#define MSR_PARAM_FUN_OFFSET
Offset added to function indices for parameter parsing.
std::vector< PMsrParamStructure > PMsrParamList
#define RRF_UNIT_Mcs
Angular frequency in Mc/s (Mega-cycles per second)
#define RRF_UNIT_G
Equivalent magnetic field in Gauss (G)
#define RRF_UNIT_kHz
Frequency in kHz (kilohertz)
#define ACCEL_PERIOD_PSI
PSI (Paul Scherrer Institute) accelerator cycle: 19.75 ns.
#define RRF_UNIT_T
Equivalent magnetic field in Tesla (T)
std::vector< Double_t > PDoubleVector
#define ACCEL_PERIOD_RAL
RAL (Rutherford Appleton Lab) - pulsed beam.
virtual void SetFitRange(Double_t dval, UInt_t idx)
virtual Double_t GetFitRange(UInt_t idx)
virtual UInt_t GetT0BinSize()
virtual Bool_t IsFitRangeInBin()
virtual Int_t GetFitRangeOffset(UInt_t idx)
virtual Double_t GetT0Bin(UInt_t idx=0)
MSR file parser and manager for the musrfit framework.
virtual PMsrParamList * GetMsrParamList()
Returns pointer to fit parameter list.
virtual const PDoubleVector * GetDataBin(const UInt_t histoNo)
virtual const Double_t GetT0Bin(const UInt_t histoNo)
virtual const Double_t GetTimeResolution()
virtual const Bool_t IsPresent(UInt_t histoNo)
virtual const UInt_t GetNoOfTemperatures()
virtual const Double_t GetField()
virtual const Double_t GetEnergy()
virtual const Double_t GetT0BinEstimated(const UInt_t histoNo)
virtual const PDoublePairVector * GetTemperature() const
UInt_t fNoOfFitBins
Number of bins included in the fit.
PRunAsymmetry()
Default constructor.
Int_t fPacking
Bin packing factor from RUN or GLOBAL block.
PDoubleVector fForwardErr
Forward detector histogram errors.
virtual void GetProperFitRange(PMsrGlobalBlock *globalBlock)
Determines the proper fit range from global block.
virtual Bool_t GetProperT0(PRawRunData *runData, PMsrGlobalBlock *globalBlock, PUIntVector &forwardHisto, PUIntVector &backwardHistoNo)
Retrieves proper t0 values for all histograms.
Bool_t SubtractFixBkg()
Subtracts fixed background from histograms.
PDoubleVector fBackwardErr
Backward detector histogram errors.
virtual void CalcNoOfFitBins()
Calculates the number of bins to be fitted.
virtual Double_t CalcChiSquareExpected(const std::vector< Double_t > &par)
Calculates expected chi-square (for statistical analysis).
virtual void CalcTheory()
Calculates theoretical asymmetry function.
virtual Bool_t PrepareViewData(PRawRunData *runData, UInt_t histoNo[2])
Prepares data for viewing/plotting.
UInt_t fAlphaBetaTag
Tag indicating α/β configuration: 1=both unity, 2=α free/β unity, 3=α unity/β free,...
virtual Bool_t PrepareFitData()
Prepares data specifically for fitting.
Int_t fGoodBins[4]
Good bin boundaries: [0]=forward first, [1]=forward last, [2]=backward first, [3]=backward last.
Int_t fEndTimeBin
Last bin index for fitting.
virtual Double_t CalcChiSquare(const std::vector< Double_t > &par)
Calculates chi-square for the current parameter set.
virtual ~PRunAsymmetry()
Destructor.
virtual Double_t CalcMaxLikelihood(const std::vector< Double_t > &par)
Calculates maximum likelihood estimator.
virtual Bool_t PrepareRRFViewData(PRawRunData *runData, UInt_t histoNo[2])
Prepares rotating reference frame (RRF) data for viewing.
virtual UInt_t GetNoOfFitBins()
Returns the number of bins used in the fit.
virtual Bool_t GetProperDataRange(PRawRunData *runData, UInt_t histoNo[2])
Retrieves proper data range for histograms.
virtual Bool_t PrepareData()
Prepares all data for fitting or viewing.
PDoubleVector fForward
Forward detector histogram data.
Bool_t SubtractEstimatedBkg()
Estimates and subtracts background from histograms.
PDoubleVector fBackward
Backward detector histogram data.
Int_t fStartTimeBin
First bin index for fitting.
Bool_t fTheoAsData
If true, theory calculated only at data points; if false, extra points for nicer Fourier transforms.
virtual void SetFitRangeBin(const TString fitRange)
Sets the fit range in bins.
Double_t fTimeResolution
Time resolution of raw histogram data in microseconds (μs), e.g., 0.01953125 μs for PSI GPS.
Bool_t fValid
Flag indicating if run object initialized successfully; false if any error occurred.
Double_t fFitEndTime
Fit range end time in microseconds (μs) relative to t0.
PDoubleVector fFuncValues
Cached values of user-defined functions from FUNCTIONS block, evaluated at current parameters.
PMsrHandler * fMsrInfo
Pointer to MSR file handler (owned externally, not deleted here)
virtual void DeadTimeCorrection(std::vector< PDoubleVector > &histos, PUIntVector &histoNo)
carry out dead time correction
PMetaData fMetaData
Experimental metadata extracted from data file header (magnetic field, temperature,...
std::unique_ptr< PTheory > fTheory
Theory function evaluator (smart pointer, automatically deleted)
std::vector< PDoubleVector > fAddT0s
Time-zero bin values for additional runs to be added to main run.
EPMusrHandleTag fHandleTag
Operation mode: kFit (fitting), kView (display only), kEmpty (uninitialized)
virtual void CalculateKaiserFilterCoeff(Double_t wc, Double_t A, Double_t dw)
Calculates Kaiser window FIR filter coefficients for RRF smoothing.
PRunData fData
Processed data container: background-corrected, packed, with theory values.
PRunDataHandler * fRawData
Pointer to raw data handler (owned externally, not deleted here)
PDoubleVector fT0s
Time-zero bin values for all histograms in this run (forward, backward, etc.)
PRunBase()
Default constructor.
Int_t fRunNo
Run number (0-based index in MSR file RUN blocks)
PMsrRunBlock * fRunInfo
Pointer to this run's RUN block settings within fMsrInfo.
Double_t fFitStartTime
Fit range start time in microseconds (μs) relative to t0.
virtual void FilterTheo()
Applies Kaiser FIR filter to theory values for RRF fits.
Raw data file reader and format converter for μSR data.
virtual void AppendErrorValue(Double_t dval)
virtual void AppendValue(Double_t dval)
virtual const PDoubleVector * GetValue()
Returns pointer to data value vector (asymmetry, counts, or y-data)
virtual const PDoubleVector * GetError()
Returns pointer to data error vector (statistical uncertainties)