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;
165 if ((fRunInfo->GetBetaParamNo()-MSR_PARAM_FUN_OFFSET < 0) ||
166 (fRunInfo->GetBetaParamNo()-MSR_PARAM_FUN_OFFSET > msrInfo->GetNoOfFuncs())) {
167 std::cerr << std::endl <<
">> PRunAsymmetry::PRunAsymmetry(): **ERROR** beta parameter is a function with no = " << fRunInfo->GetBetaParamNo();
168 std::cerr << std::endl <<
">> This is out of bound, since there are only " << msrInfo->GetNoOfFuncs() <<
" functions.";
169 std::cerr << std::endl;
173 }
else if ((fRunInfo->GetBetaParamNo() < 0) || (fRunInfo->GetBetaParamNo() >
static_cast<Int_t
>(param->size()))) {
174 std::cerr << std::endl <<
">> PRunAsymmetry::PRunAsymmetry(): **ERROR** beta parameter no = " << fRunInfo->GetBetaParamNo();
175 std::cerr << std::endl <<
">> This is out of bound, since there are only " << param->size() <<
" parameters.";
176 std::cerr << std::endl;
180 if (((*param)[fRunInfo->GetBetaParamNo()-1].fStep == 0.0) &&
181 ((*param)[fRunInfo->GetBetaParamNo()-1].fValue == 1.0))
182 betaFixedToOne = true;
186 if (alphaFixedToOne && betaFixedToOne)
188 else if (!alphaFixedToOne && betaFixedToOne)
190 else if (alphaFixedToOne && !betaFixedToOne)
239 Double_t chisq = 0.0;
241 Double_t asymFcnValue = 0.0;
245 for (Int_t i=0; i<
fMsrInfo->GetNoOfFuncs(); i++) {
261 a = par[
fRunInfo->GetAlphaParamNo()-1];
273 b = par[
fRunInfo->GetBetaParamNo()-1];
283 a = par[
fRunInfo->GetAlphaParamNo()-1];
291 b = par[
fRunInfo->GetBetaParamNo()-1];
315 #pragma omp parallel for default(shared) private(i,time,diff,asymFcnValue,f) schedule(dynamic,chunk) reduction(+:chisq)
318 time =
fData.GetDataTimeStart() +
static_cast<Double_t
>(i)*
fData.GetDataTimeStep();
320 asymFcnValue = (f*(a*b+1.0)-(a-1.0))/((a+1.0)-f*(a*b-1.0));
321 diff =
fData.GetValue()->at(i) - asymFcnValue;
322 chisq += diff*diff / (
fData.GetError()->at(i)*
fData.GetError()->at(i));
366 std::cout << std::endl <<
"PRunAsymmetry::CalcMaxLikelihood(): not implemented yet ..." << std::endl;
423 if (tok.size() == 3) {
427 idx = str.First(
"+");
429 str.Remove(0, idx+1);
438 idx = str.First(
"-");
440 str.Remove(0, idx+1);
445 }
else if ((tok.size() > 3) && (tok.size() % 2 == 1)) {
446 UInt_t pos = 2*(
fRunNo+1)-1;
448 if (pos + 1 >= tok.size()) {
449 std::cerr << std::endl <<
">> PRunAsymmetry::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange <<
"'";
450 std::cerr << std::endl <<
">> will ignore it. Sorry ..." << std::endl;
455 idx = str.First(
"+");
457 str.Remove(0, idx+1);
466 idx = str.First(
"-");
468 str.Remove(0, idx+1);
475 std::cerr << std::endl <<
">> PRunAsymmetry::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange <<
"'";
476 std::cerr << std::endl <<
">> will ignore it. Sorry ..." << std::endl;
533 std::vector<Double_t> par;
535 for (UInt_t i=0; i<paramList->size(); i++)
536 par.push_back((*paramList)[i].fValue);
539 for (Int_t i=0; i<
fMsrInfo->GetNoOfFuncs(); i++) {
544 Double_t asymFcnValue = 0.0;
547 for (UInt_t i=0; i<
fData.GetValue()->size(); i++) {
548 time =
fData.GetDataTimeStart() +
static_cast<Double_t
>(i)*
fData.GetDataTimeStep();
555 a = par[
fRunInfo->GetAlphaParamNo()-1];
563 asymFcnValue = (f*(a+1.0)-(a-1.0))/((a+1.0)-f*(a-1.0));
567 b = par[
fRunInfo->GetBetaParamNo()-1];
575 asymFcnValue = f*(b+1.0)/(2.0-f*(b-1.0));
579 a = par[
fRunInfo->GetAlphaParamNo()-1];
587 b = par[
fRunInfo->GetBetaParamNo()-1];
595 asymFcnValue = (f*(a*b+1.0)-(a-1.0))/((a+1.0)-f*(a*b-1.0));
601 fData.AppendTheoryValue(asymFcnValue);
650 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareData(): **ERROR** Couldn't get run " <<
fRunInfo->GetRunName()->Data() <<
"!";
651 std::cerr << std::endl;
668 for (UInt_t i=0; i<
fRunInfo->GetForwardHistoNoSize(); i++) {
669 forwardHistoNo.push_back(
fRunInfo->GetForwardHistoNo(i));
671 if (!runData->
IsPresent(forwardHistoNo[i])) {
672 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareData(): **PANIC ERROR**:";
673 std::cerr << std::endl <<
">> forwardHistoNo found = " << forwardHistoNo[i] <<
", which is NOT present in the data file!?!?";
674 std::cerr << std::endl <<
">> Will quit :-(";
675 std::cerr << std::endl;
677 forwardHistoNo.clear();
678 backwardHistoNo.clear();
682 for (UInt_t i=0; i<
fRunInfo->GetBackwardHistoNoSize(); i++) {
683 backwardHistoNo.push_back(
fRunInfo->GetBackwardHistoNo(i));
685 if (!runData->
IsPresent(backwardHistoNo[i])) {
686 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareData(): **PANIC ERROR**:";
687 std::cerr << std::endl <<
">> backwardHistoNo found = " << backwardHistoNo[i] <<
", which is NOT present in the data file!?!?";
688 std::cerr << std::endl <<
">> Will quit :-(";
689 std::cerr << std::endl;
691 forwardHistoNo.clear();
692 backwardHistoNo.clear();
699 std::cout.precision(10);
700 std::cout << std::endl <<
">> PRunAsymmetry::PrepareData(): time resolution=" << std::fixed << runData->
GetTimeResolution() <<
"(ns)" << std::endl;
703 if (!
GetProperT0(runData, globalBlock, forwardHistoNo, backwardHistoNo)) {
708 std::vector<PDoubleVector> forward, backward;
709 forward.resize(forwardHistoNo.size());
710 for (UInt_t i=0; i<forwardHistoNo.size(); i++) {
711 forward[i].resize(runData->
GetDataBin(forwardHistoNo[i])->size());
712 forward[i] = *runData->
GetDataBin(forwardHistoNo[i]);
719 backward.resize(backwardHistoNo.size());
720 for (UInt_t i=0; i<backwardHistoNo.size(); i++) {
721 backward[i].resize(runData->
GetDataBin(backwardHistoNo[i])->size());
722 backward[i] = *runData->
GetDataBin(backwardHistoNo[i]);
731 if (
fRunInfo->GetRunNameSize() > 1) {
733 std::vector<PDoubleVector> addForward, addBackward;
734 for (UInt_t i=1; i<
fRunInfo->GetRunNameSize(); i++) {
737 if (addRunData ==
nullptr) {
738 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareData(): **ERROR** Couldn't get addrun " <<
fRunInfo->GetRunName(i)->Data() <<
"!";
739 std::cerr << std::endl;
745 addForward.resize(forwardHistoNo.size());
746 for (UInt_t j=0; j<forwardHistoNo.size(); j++) {
747 addForward[j].resize(addRunData->
GetDataBin(forwardHistoNo[j])->size());
748 addForward[j] = *addRunData->
GetDataBin(forwardHistoNo[j]);
752 addBackward.resize(backwardHistoNo.size());
753 for (UInt_t j=0; j<backwardHistoNo.size(); j++) {
754 addBackward[j].resize(addRunData->
GetDataBin(backwardHistoNo[j])->size());
755 addBackward[j] = *addRunData->
GetDataBin(backwardHistoNo[j]);
761 for (UInt_t k=0; k<forwardHistoNo.size(); k++) {
762 addRunSize = addRunData->
GetDataBin(forwardHistoNo[k])->size();
763 for (UInt_t j=0; j<addRunData->
GetDataBin(forwardHistoNo[k])->size(); j++) {
765 if ((
static_cast<Int_t
>(j)+
static_cast<Int_t
>(
fAddT0s[i-1][2*k])-
static_cast<Int_t
>(
fT0s[2*k]) >= 0) &&
766 (j+
static_cast<Int_t
>(
fAddT0s[i-1][2*k])-
static_cast<Int_t
>(
fT0s[2*k]) < addRunSize)) {
767 forward[k][j] += addForward[k][j+
static_cast<Int_t
>(
fAddT0s[i-1][2*k])-
static_cast<Int_t
>(
fT0s[2*k])];
773 for (UInt_t k=0; k<backwardHistoNo.size(); k++) {
774 addRunSize = addRunData->
GetDataBin(backwardHistoNo[k])->size();
775 for (UInt_t j=0; j<addRunData->
GetDataBin(backwardHistoNo[k])->size(); j++) {
777 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) &&
778 (j+
static_cast<Int_t
>(
fAddT0s[i-1][2*k+1])-
static_cast<Int_t
>(
fT0s[2*k+1]) < addRunSize)) {
779 backward[k][j] += addBackward[k][j+
static_cast<Int_t
>(
fAddT0s[i-1][2*k+1])-
static_cast<Int_t
>(
fT0s[2*k+1])];
788 for (UInt_t i=0; i<
fForward.size(); i++) {
792 for (UInt_t i=0; i<
fBackward.size(); i++) {
797 for (UInt_t i=1; i<forwardHistoNo.size(); i++) {
798 for (UInt_t j=0; j<runData->
GetDataBin(forwardHistoNo[i])->size(); j++) {
801 fForward[j] += forward[i][j+
static_cast<Int_t
>(
fT0s[2*i])-
static_cast<Int_t
>(
fT0s[0])];
807 for (UInt_t i=1; i<backwardHistoNo.size(); i++) {
808 for (UInt_t j=0; j<runData->
GetDataBin(backwardHistoNo[i])->size(); j++) {
811 fBackward[j] += backward[i][j+
static_cast<Int_t
>(
fT0s[2*i+1])-
static_cast<Int_t
>(
fT0s[1])];
818 if (
fRunInfo->GetBkgRange(0) >= 0) {
822 fRunInfo->SetBkgRange(
static_cast<Int_t
>(
fT0s[0]*0.1), 0);
823 fRunInfo->SetBkgRange(
static_cast<Int_t
>(
fT0s[0]*0.6), 1);
824 fRunInfo->SetBkgRange(
static_cast<Int_t
>(
fT0s[1]*0.1), 2);
825 fRunInfo->SetBkgRange(
static_cast<Int_t
>(
fT0s[1]*0.6), 3);
826 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareData(): **WARNING** Neither fix background nor background bins are given!";
827 std::cerr << std::endl <<
">> Will try the following:";
828 std::cerr << std::endl <<
">> forward: bkg start = " <<
fRunInfo->GetBkgRange(0) <<
", bkg end = " <<
fRunInfo->GetBkgRange(1);
829 std::cerr << std::endl <<
">> backward: bkg start = " <<
fRunInfo->GetBkgRange(2) <<
", bkg end = " <<
fRunInfo->GetBkgRange(3);
830 std::cerr << std::endl <<
">> NO WARRANTY THAT THIS MAKES ANY SENSE! Better check ...";
831 std::cerr << std::endl;
840 UInt_t histoNo[2] = {forwardHistoNo[0], backwardHistoNo[0]};
857 if (
fMsrInfo->GetMsrPlotList()->at(0).fRRFPacking == 0)
868 forwardHistoNo.clear();
869 backwardHistoNo.clear();
896 std::cerr <<
"PRunAsymmetry::SubtractFixBkg(): **ERROR** no fixed bkg for forward set. Will do nothing here." << std::endl;
900 std::cerr <<
"PRunAsymmetry::SubtractFixBkg(): **ERROR** no fixed bkg for backward set. Will do nothing here." << std::endl;
901 std::cerr <<
" you need an entry like:" << std::endl;
902 std::cerr <<
" backgr.fix 2 3" << std::endl;
903 std::cerr <<
" i.e. two entries for forward and backward." << std::endl;
910 for (UInt_t i=0; i<
fForward.size(); i++) {
953 Double_t beamPeriod = 0.0;
956 if (
fRunInfo->GetInstitute()->Contains(
"psi"))
958 else if (
fRunInfo->GetInstitute()->Contains(
"ral"))
960 else if (
fRunInfo->GetInstitute()->Contains(
"triumf"))
968 for (UInt_t i=0; i<2; i++) {
969 if (end[i] < start[i]) {
970 std::cout << std::endl <<
">> PRunAsymmetry::SubtractEstimatedBkg(): end = " << end[i] <<
" > start = " << start[i] <<
"! Will swap them!";
971 UInt_t keep = end[i];
978 for (UInt_t i=0; i<2; i++) {
979 if (beamPeriod != 0.0) {
981 UInt_t fullCycles =
static_cast<UInt_t
>(timeBkg/beamPeriod);
984 std::cout <<
">> PRunAsymmetry::SubtractEstimatedBkg(): Background " << start[i] <<
", " << end[i] << std::endl;
985 if (end[i] == start[i])
986 end[i] =
fRunInfo->GetBkgRange(2*i+1);
991 if ((start[0] < 0) || (start[0] >=
fForward.size()) ||
992 (start[1] < 0) || (start[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 start (f/b) = (" << start[0] <<
"/" << start[1] <<
").";
1000 if ((end[0] < 0) || (end[0] >=
fForward.size()) ||
1001 (end[1] < 0) || (end[1] >=
fBackward.size())) {
1002 std::cerr << std::endl <<
">> PRunAsymmetry::SubtractEstimatedBkg(): **ERROR** background bin values out of bound!";
1003 std::cerr << std::endl <<
">> histo lengths (f/b) = (" <<
fForward.size() <<
"/" <<
fBackward.size() <<
").";
1004 std::cerr << std::endl <<
">> background end (f/b) = (" << end[0] <<
"/" << end[1] <<
").";
1009 Double_t bkg[2] = {0.0, 0.0};
1010 Double_t errBkg[2] = {0.0, 0.0};
1013 for (UInt_t i=start[0]; i<=end[0]; i++)
1015 errBkg[0] = TMath::Sqrt(bkg[0])/(end[0] - start[0] + 1);
1016 bkg[0] /=
static_cast<Double_t
>(end[0] - start[0] + 1);
1017 std::cout << std::endl <<
">> estimated forward histo background: " << bkg[0];
1020 for (UInt_t i=start[1]; i<=end[1]; i++)
1022 errBkg[1] = TMath::Sqrt(bkg[1])/(end[1] - start[1] + 1);
1023 bkg[1] /=
static_cast<Double_t
>(end[1] - start[1] + 1);
1024 std::cout << std::endl <<
">> estimated backward histo background: " << bkg[1] << std::endl;
1027 Double_t errVal = 0.0;
1028 for (UInt_t i=0; i<
fForward.size(); i++) {
1030 errVal = TMath::Sqrt(
fForward[i]+errBkg[0]*errBkg[0]);
1035 errVal = TMath::Sqrt(
fBackward[i]+errBkg[1]*errBkg[1]);
1042 for (UInt_t i=0; i<
fForward.size(); i++) {
1047 fRunInfo->SetBkgEstimated(bkg[0], 0);
1048 fRunInfo->SetBkgEstimated(bkg[1], 1);
1084 Double_t value = 0.0;
1085 Double_t error = 0.0;
1132 UInt_t noOfBins = forwardPacked.
GetValue()->size();
1133 if (forwardPacked.
GetValue()->size() != backwardPacked.
GetValue()->size()) {
1135 noOfBins = backwardPacked.
GetValue()->size();
1140 Double_t f, b, ef, eb;
1145 for (UInt_t i=0; i<noOfBins; i++) {
1147 f = forwardPacked.
GetValue()->at(i);
1148 b = backwardPacked.
GetValue()->at(i);
1149 ef = forwardPacked.
GetError()->at(i);
1150 eb = backwardPacked.
GetError()->at(i);
1153 asym = (f-b) / (f+b);
1156 fData.AppendValue(asym);
1159 error = 2.0/((f+b)*(f+b))*TMath::Sqrt(b*b*ef*ef+eb*eb*f*f);
1162 fData.AppendErrorValue(error);
1204 if (
fMsrInfo->GetMsrPlotList()->at(0).fViewPacking > 0) {
1205 packing =
fMsrInfo->GetMsrPlotList()->at(0).fViewPacking;
1209 std::vector<Double_t> par;
1211 for (UInt_t i=0; i<paramList->size(); i++)
1212 par.push_back((*paramList)[i].fValue);
1220 Int_t t0[2] = {
static_cast<Int_t
>(
fT0s[0]),
static_cast<Int_t
>(
fT0s[1])};
1224 if (start[0]-t0[0] != start[1]-t0[1]) {
1225 if (abs(start[0]-t0[0]) > abs(start[1]-t0[1])) {
1227 fgb[1] = t0[1] + start[0]-t0[0];
1228 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareViewData(): **WARNING** needed to shift backward fgb from ";
1229 std::cerr << start[1] <<
" to " << fgb[1] << std::endl;
1231 fgb[0] = t0[0] + start[1]-t0[1];
1233 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareViewData(): **WARNING** needed to shift forward fgb from ";
1234 std::cerr << start[0] <<
" to " << fgb[0] << std::endl;
1241 Int_t val = fgb[0]-packing*(fgb[0]/packing);
1243 if (fgb[1] - fgb[0] < 0)
1245 }
while (val + fgb[1] - fgb[0] < 0);
1248 start[1] = val + fgb[1] - fgb[0];
1251 UInt_t noOfBins0 = (runData->
GetDataBin(histoNo[0])->size()-start[0])/packing;
1252 UInt_t noOfBins1 = (runData->
GetDataBin(histoNo[1])->size()-start[1])/packing;
1253 if (noOfBins0 > noOfBins1)
1254 noOfBins0 = noOfBins1;
1255 end[0] = start[0] + noOfBins0 * packing;
1256 end[1] = start[1] + noOfBins0 * packing;
1260 for (UInt_t i=0; i<2; i++) {
1261 if (end[i] < start[i]) {
1262 Int_t keep = end[i];
1267 if ((start[i] < 0) || (start[i] >
static_cast<Int_t
>(runData->
GetDataBin(histoNo[i])->size()))) {
1268 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareViewData(): **ERROR** start data bin doesn't make any sense!";
1269 std::cerr << std::endl;
1273 if ((end[i] < 0) || (end[i] >
static_cast<Int_t
>(runData->
GetDataBin(histoNo[i])->size()))) {
1274 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareViewData(): **ERROR** end data bin doesn't make any sense!";
1275 std::cerr << std::endl;
1279 if ((t0[i] < 0) || (t0[i] >
static_cast<Int_t
>(runData->
GetDataBin(histoNo[i])->size()))) {
1280 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareViewData(): **ERROR** t0 data bin doesn't make any sense!";
1281 std::cerr << std::endl;
1289 Double_t value = 0.0;
1290 Double_t error = 0.0;
1293 for (Int_t i=start[0]; i<end[0]; i++) {
1298 if (((i-start[0]) % packing == 0) && (i != start[0])) {
1316 for (Int_t i=start[1]; i<end[1]; i++) {
1321 if (((i-start[1]) % packing == 0) && (i != start[1])) {
1339 UInt_t noOfBins = forwardPacked.
GetValue()->size();
1340 if (forwardPacked.
GetValue()->size() != backwardPacked.
GetValue()->size()) {
1342 noOfBins = backwardPacked.
GetValue()->size();
1347 Double_t f, b, ef, eb, alpha = 1.0, beta = 1.0;
1350 fData.SetDataTimeStart(
fTimeResolution*((
static_cast<Double_t
>(start[0])-0.5) +
static_cast<Double_t
>(packing)/2.0 -
static_cast<Double_t
>(t0[0])));
1361 alpha = par[
fRunInfo->GetAlphaParamNo()-1];
1373 beta = par[
fRunInfo->GetBetaParamNo()-1];
1383 alpha = par[
fRunInfo->GetAlphaParamNo()-1];
1391 beta = par[
fRunInfo->GetBetaParamNo()-1];
1403 for (UInt_t i=0; i<forwardPacked.
GetValue()->size(); i++) {
1405 f = forwardPacked.
GetValue()->at(i);
1406 b = backwardPacked.
GetValue()->at(i);
1407 ef = forwardPacked.
GetError()->at(i);
1408 eb = backwardPacked.
GetError()->at(i);
1411 asym = (alpha*f-b) / (alpha*beta*f+b);
1414 fData.AppendValue(asym);
1417 error = 2.0/((f+b)*(f+b))*TMath::Sqrt(b*b*ef*ef+eb*eb*f*f);
1420 fData.AppendErrorValue(error);
1433 for (Int_t i=0; i<
fMsrInfo->GetNoOfFuncs(); i++) {
1439 UInt_t size = runData->
GetDataBin(histoNo[0])->size()/packing;
1442 fData.SetTheoryTimeStart(
fData.GetDataTimeStart());
1444 fData.SetTheoryTimeStep(
fData.GetDataTimeStep());
1448 fData.SetTheoryTimeStep(
fData.GetDataTimeStep()/(Double_t)factor);
1451 for (UInt_t i=0; i<size; i++) {
1452 time =
fData.GetTheoryTimeStart() +
static_cast<Double_t
>(i)*
fData.GetTheoryTimeStep();
1454 if (fabs(value) > 10.0) {
1457 fData.AppendTheoryValue(value);
1495 std::vector<Double_t> par;
1497 for (UInt_t i=0; i<paramList->size(); i++)
1498 par.push_back((*paramList)[i].fValue);
1507 Int_t t0[2] = {
static_cast<Int_t
>(
fT0s[0]),
static_cast<Int_t
>(
fT0s[1])};
1508 UInt_t packing =
fMsrInfo->GetMsrPlotList()->at(0).fRRFPacking;
1512 if (start[0]-t0[0] != start[1]-t0[1]) {
1513 if (abs(start[0]-t0[0]) > abs(start[1]-t0[1])) {
1515 fgb[1] = t0[1] + start[0]-t0[0];
1516 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareRRFViewData(): **WARNING** needed to shift backward fgb from ";
1517 std::cerr << start[1] <<
" to " << fgb[1] << std::endl;
1519 fgb[0] = t0[0] + start[1]-t0[1];
1521 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareRRFViewData(): **WARNING** needed to shift forward fgb from ";
1522 std::cerr << start[1] <<
" to " << fgb[0] << std::endl;
1529 Int_t val = fgb[0]-packing*(fgb[0]/packing);
1531 if (fgb[1] - fgb[0] < 0)
1533 }
while (val + fgb[1] - fgb[0] < 0);
1536 start[1] = val + fgb[1] - fgb[0];
1539 UInt_t noOfBins0 = runData->
GetDataBin(histoNo[0])->size()-start[0];
1540 UInt_t noOfBins1 = runData->
GetDataBin(histoNo[1])->size()-start[1];
1541 if (noOfBins0 > noOfBins1)
1542 noOfBins0 = noOfBins1;
1543 end[0] = start[0] + noOfBins0;
1544 end[1] = start[1] + noOfBins0;
1548 for (UInt_t i=0; i<2; i++) {
1549 if (end[i] < start[i]) {
1550 Int_t keep = end[i];
1555 if ((start[i] < 0) || (start[i] >
static_cast<Int_t
>(runData->
GetDataBin(histoNo[i])->size()))) {
1556 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareRRFViewData(): **ERROR** start data bin doesn't make any sense!";
1557 std::cerr << std::endl;
1561 if ((end[i] < 0) || (end[i] >
static_cast<Int_t
>(runData->
GetDataBin(histoNo[i])->size()))) {
1562 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareRRFViewData(): **ERROR** end data bin doesn't make any sense!";
1563 std::cerr << std::endl;
1567 if ((t0[i] < 0) || (t0[i] >
static_cast<Int_t
>(runData->
GetDataBin(histoNo[i])->size()))) {
1568 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareRRFViewData(): **ERROR** t0 data bin doesn't make any sense!";
1569 std::cerr << std::endl;
1580 Double_t error = 0.0;
1582 for (Int_t i=start[0]; i<end[0]; i++) {
1587 for (Int_t i=start[1]; i<end[1]; i++) {
1593 UInt_t noOfBins = forward.size();
1594 if (forward.size() != backward.size()) {
1595 if (forward.size() > backward.size())
1596 noOfBins = backward.size();
1602 Double_t f, b, ef, eb, alpha = 1.0, beta = 1.0;
1612 alpha = par[
fRunInfo->GetAlphaParamNo()-1];
1624 beta = par[
fRunInfo->GetBetaParamNo()-1];
1634 alpha = par[
fRunInfo->GetAlphaParamNo()-1];
1642 beta = par[
fRunInfo->GetBetaParamNo()-1];
1654 for (UInt_t i=0; i<noOfBins; i++) {
1659 eb = backwardErr[i];
1662 asym = (alpha*f-b) / (alpha*beta*f+b);
1665 asymmetry.push_back(asym);
1668 error = 2.0/((f+b)*(f+b))*TMath::Sqrt(b*b*ef*ef+eb*eb*f*f);
1671 asymmetryErr.push_back(error);
1686 Double_t gammaRRF = 0.0, wRRF = 0.0, phaseRRF = 0.0;
1689 switch (
fMsrInfo->GetMsrPlotList()->at(0).fRRFUnit) {
1691 gammaRRF = TMath::TwoPi()*1.0e-3;
1694 gammaRRF = TMath::TwoPi();
1706 gammaRRF = TMath::TwoPi();
1709 wRRF = gammaRRF *
fMsrInfo->GetMsrPlotList()->at(0).fRRFFreq;
1710 phaseRRF =
fMsrInfo->GetMsrPlotList()->at(0).fRRFPhase / 180.0 * TMath::Pi();
1712 for (UInt_t i=0; i<asymmetry.size(); i++) {
1713 time =
fTimeResolution*(
static_cast<Double_t
>(start[0])-t0[0]+
static_cast<Double_t
>(i));
1714 asymmetry[i] *= 2.0*TMath::Cos(wRRF*time+phaseRRF);
1720 Double_t value = 0.0;
1722 for (UInt_t i=0; i<asymmetry.size(); i++) {
1723 if ((i % packing == 0) && (i != 0)) {
1725 fData.AppendValue(value);
1726 fData.AppendErrorValue(TMath::Sqrt(error)/packing);
1731 value += asymmetry[i];
1732 error += asymmetryErr[i]*asymmetryErr[i];
1737 fData.SetDataTimeStart(
fTimeResolution*((
static_cast<Double_t
>(start[0])-0.5) +
static_cast<Double_t
>(packing)/2.0 -
static_cast<Double_t
>(t0[0])));
1744 UInt_t rebinRRF =
static_cast<UInt_t
>((TMath::Pi()/2.0/wRRF)/
fTimeResolution);
1745 fData.SetTheoryTimeStart(
fData.GetDataTimeStart());
1746 fData.SetTheoryTimeStep(TMath::Pi()/2.0/wRRF/rebinRRF);
1749 for (Int_t i=0; i<
fMsrInfo->GetNoOfFuncs(); i++) {
1753 Double_t theoryValue;
1754 for (UInt_t i=0; i<asymmetry.size(); i++) {
1755 time =
fData.GetTheoryTimeStart() +
static_cast<Double_t
>(i)*
fData.GetTheoryTimeStep();
1757 theoryValue *= 2.0*TMath::Cos(wRRF * time + phaseRRF);
1759 if (fabs(theoryValue) > 10.0) {
1763 fData.AppendTheoryValue(theoryValue);
1771 Double_t dval = 0.0;
1772 for (UInt_t i=0; i<
fData.GetTheory()->size(); i++) {
1773 if ((i % rebinRRF == 0) && (i != 0)) {
1774 theo.push_back(dval/rebinRRF);
1777 dval +=
fData.GetTheory()->at(i);
1779 fData.ReplaceTheory(theo);
1783 fData.SetTheoryTimeStart(
fData.GetTheoryTimeStart()+
static_cast<Double_t
>(rebinRRF-1)*
fData.GetTheoryTimeStep()/2.0);
1784 fData.SetTheoryTimeStep(rebinRRF*
fData.GetTheoryTimeStep());
1801 backwardErr.clear();
1803 asymmetryErr.clear();
1845 size_t size = 2*forwardHistoNo.size();
1846 if (backwardHistoNo.size() > forwardHistoNo.size())
1847 size = 2*backwardHistoNo.size();
1849 for (UInt_t i=0; i<
fT0s.size(); i++) {
1854 for (UInt_t i=0; i<
fRunInfo->GetT0BinSize(); i++) {
1860 if (
fT0s[i] == -1) {
1866 for (UInt_t i=0; i<forwardHistoNo.size(); i++) {
1867 if (
fT0s[2*i] == -1.0)
1868 if (runData->
GetT0Bin(forwardHistoNo[i]) > 0.0) {
1873 for (UInt_t i=0; i<backwardHistoNo.size(); i++) {
1874 if (
fT0s[2*i+1] == -1.0)
1875 if (runData->
GetT0Bin(backwardHistoNo[i]) > 0.0) {
1882 for (UInt_t i=0; i<forwardHistoNo.size(); i++) {
1883 if (
fT0s[2*i] == -1.0) {
1887 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperT0(): **WARRNING** NO t0's found, neither in the run data nor in the msr-file!";
1888 std::cerr << std::endl <<
">> run: " <<
fRunInfo->GetRunName()->Data();
1889 std::cerr << std::endl <<
">> will try the estimated one: forward t0 = " << runData->
GetT0BinEstimated(forwardHistoNo[i]);
1890 std::cerr << std::endl <<
">> NO WARRANTY THAT THIS OK!! For instance for LEM this is almost for sure rubbish!";
1891 std::cerr << std::endl;
1894 for (UInt_t i=0; i<backwardHistoNo.size(); i++) {
1895 if (
fT0s[2*i+1] == -1.0) {
1899 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperT0(): **WARRNING** NO t0's found, neither in the run data nor in the msr-file!";
1900 std::cerr << std::endl <<
">> run: " <<
fRunInfo->GetRunName()->Data();
1901 std::cerr << std::endl <<
">> will try the estimated one: backward t0 = " << runData->
GetT0BinEstimated(backwardHistoNo[i]);
1902 std::cerr << std::endl <<
">> NO WARRANTY THAT THIS OK!! For instance for LEM this is almost for sure rubbish!";
1903 std::cerr << std::endl;
1908 for (UInt_t i=0; i<forwardHistoNo.size(); i++) {
1909 if ((
fT0s[2*i] < 0) || (
fT0s[2*i] >
static_cast<Int_t
>(runData->
GetDataBin(forwardHistoNo[i])->size()))) {
1910 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperT0(): **ERROR** t0 data bin (" <<
fT0s[2*i] <<
") doesn't make any sense!";
1911 std::cerr << std::endl <<
">> forwardHistoNo " << forwardHistoNo[i];
1912 std::cerr << std::endl;
1916 for (UInt_t i=0; i<backwardHistoNo.size(); i++) {
1917 if ((
fT0s[2*i+1] < 0) || (
fT0s[2*i+1] >
static_cast<Int_t
>(runData->
GetDataBin(backwardHistoNo[i])->size()))) {
1918 std::cerr << std::endl <<
">> PRunAsymmetry::PrepareData(): **ERROR** t0 data bin (" <<
fT0s[2*i+1] <<
") doesn't make any sense!";
1919 std::cerr << std::endl <<
">> backwardHistoNo " << backwardHistoNo[i];
1920 std::cerr << std::endl;
1926 if (
fRunInfo->GetRunNameSize() > 1) {
1929 for (UInt_t i=1; i<
fRunInfo->GetRunNameSize(); i++) {
1932 if (addRunData == 0) {
1933 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperT0(): **ERROR** Couldn't get addrun " <<
fRunInfo->GetRunName(i)->Data() <<
"!";
1934 std::cerr << std::endl;
1941 fAddT0s[i-1].resize(2*forwardHistoNo.size());
1942 for (UInt_t j=0; j<
fAddT0s[i-1].size(); j++) {
1947 for (Int_t j=0; j<
fRunInfo->GetAddT0BinSize(i-1); j++) {
1952 for (UInt_t j=0; j<forwardHistoNo.size(); j++) {
1953 if (
fAddT0s[i-1][2*j] == -1.0)
1954 if (addRunData->
GetT0Bin(forwardHistoNo[j]) > 0.0) {
1959 for (UInt_t j=0; j<backwardHistoNo.size(); j++) {
1960 if (
fAddT0s[i-1][2*j+1] == -1.0)
1961 if (addRunData->
GetT0Bin(backwardHistoNo[j]) > 0.0) {
1968 for (UInt_t j=0; j<forwardHistoNo.size(); j++) {
1969 if (
fAddT0s[i-1][2*j] == -1.0) {
1973 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperT0(): **WARRNING** NO t0's found, neither in the run data nor in the msr-file!";
1974 std::cerr << std::endl <<
">> run: " <<
fRunInfo->GetRunName(i)->Data();
1975 std::cerr << std::endl <<
">> will try the estimated one: forward t0 = " << addRunData->
GetT0BinEstimated(forwardHistoNo[j]);
1976 std::cerr << std::endl <<
">> NO WARRANTY THAT THIS OK!! For instance for LEM this is almost for sure rubbish!";
1977 std::cerr << std::endl;
1980 for (UInt_t j=0; j<backwardHistoNo.size(); j++) {
1981 if (
fAddT0s[i-1][2*j+1] == -1.0) {
1985 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperT0(): **WARRNING** NO t0's found, neither in the run data nor in the msr-file!";
1986 std::cerr << std::endl <<
">> run: " <<
fRunInfo->GetRunName(i)->Data();
1987 std::cerr << std::endl <<
">> will try the estimated one: backward t0 = " << runData->
GetT0BinEstimated(backwardHistoNo[j]);
1988 std::cerr << std::endl <<
">> NO WARRANTY THAT THIS OK!! For instance for LEM this is almost for sure rubbish!";
1989 std::cerr << std::endl;
2033 if (start[0] == -1) {
2034 start[0] =
fMsrInfo->GetMsrGlobal()->GetDataRange(0);
2036 if (start[1] == -1) {
2037 start[1] =
fMsrInfo->GetMsrGlobal()->GetDataRange(2);
2040 end[0] =
fMsrInfo->GetMsrGlobal()->GetDataRange(1);
2043 end[1] =
fMsrInfo->GetMsrGlobal()->GetDataRange(3);
2046 Double_t t0[2] = {
fT0s[0],
fT0s[1]};
2051 start[0] =
static_cast<Int_t
>(t0[0])+offset;
2052 fRunInfo->SetDataRange(start[0], 0);
2053 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange(): **WARNING** data range (forward) was not provided, will try data range start = t0+" << offset <<
"(=10ns) = " << start[0] <<
".";
2054 std::cerr << std::endl <<
">> NO WARRANTY THAT THIS DOES MAKE ANY SENSE.";
2055 std::cerr << std::endl;
2058 start[1] =
static_cast<Int_t
>(t0[1])+offset;
2059 fRunInfo->SetDataRange(start[1], 2);
2060 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange(): **WARNING** data range (backward) was not provided, will try data range start = t0+" << offset <<
"(=10ns) = " << start[1] <<
".";
2061 std::cerr << std::endl <<
">> NO WARRANTY THAT THIS DOES MAKE ANY SENSE.";
2062 std::cerr << std::endl;
2065 end[0] = runData->
GetDataBin(histoNo[0])->size();
2067 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange(): **WARNING** data range (forward) was not provided, will try data range end = " << end[0] <<
".";
2068 std::cerr << std::endl <<
">> NO WARRANTY THAT THIS DOES MAKE ANY SENSE.";
2069 std::cerr << std::endl;
2072 end[1] = runData->
GetDataBin(histoNo[1])->size();
2074 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange(): **WARNING** data range (backward) was not provided, will try data range end = " << end[1] <<
".";
2075 std::cerr << std::endl <<
">> NO WARRANTY THAT THIS DOES MAKE ANY SENSE.";
2076 std::cerr << std::endl;
2081 for (UInt_t i=0; i<2; i++) {
2082 if (end[i] < start[i]) {
2083 Int_t keep = end[i];
2088 if ((start[i] < 0) || (start[i] >
static_cast<Int_t
>(runData->
GetDataBin(histoNo[i])->size()))) {
2089 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange(): **ERROR** start data bin doesn't make any sense!";
2090 std::cerr << std::endl;
2095 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange(): **ERROR** end data bin (" << end[i] <<
") doesn't make any sense!";
2096 std::cerr << std::endl;
2099 if (end[i] >
static_cast<Int_t
>(runData->
GetDataBin(histoNo[i])->size())) {
2100 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange(): **WARNING** end data bin (" << end[i] <<
") > histo length (" <<
static_cast<Int_t
>(runData->
GetDataBin(histoNo[i])->size()) <<
").";
2101 std::cerr << std::endl <<
">> Will set end = (histo length - 1). Consider to change it in the msr-file." << std::endl;
2102 std::cerr << std::endl;
2103 end[i] =
static_cast<Int_t
>(runData->
GetDataBin(histoNo[i])->size())-1;
2106 if ((t0[i] < 0) || (t0[i] >
static_cast<Int_t
>(runData->
GetDataBin(histoNo[i])->size()))) {
2107 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange(): **ERROR** t0 data bin doesn't make any sense!";
2108 std::cerr << std::endl;
2114 if (fabs(
static_cast<Double_t
>(start[0])-t0[0]) > fabs(
static_cast<Double_t
>(start[1])-t0[1])){
2115 start[1] =
static_cast<Int_t
>(t0[1] +
static_cast<Double_t
>(start[0]) - t0[0]);
2116 end[1] =
static_cast<Int_t
>(t0[1] +
static_cast<Double_t
>(end[0]) - t0[0]);
2117 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange **WARNING** needed to shift backward data range.";
2118 std::cerr << std::endl <<
">> given: " <<
fRunInfo->GetDataRange(2) <<
", " <<
fRunInfo->GetDataRange(3);
2119 std::cerr << std::endl <<
">> used : " << start[1] <<
", " << end[1];
2120 std::cerr << std::endl;
2122 if (fabs(
static_cast<Double_t
>(start[0])-t0[0]) < fabs(
static_cast<Double_t
>(start[1])-t0[1])){
2123 start[0] =
static_cast<Int_t
>(t0[0] +
static_cast<Double_t
>(start[1]) - t0[1]);
2124 end[0] =
static_cast<Int_t
>(t0[0] +
static_cast<Double_t
>(end[1]) - t0[1]);
2125 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange **WARNING** needed to shift forward data range.";
2126 std::cerr << std::endl <<
">> given: " <<
fRunInfo->GetDataRange(0) <<
", " <<
fRunInfo->GetDataRange(1);
2127 std::cerr << std::endl <<
">> used : " << start[0] <<
", " << end[0];
2128 std::cerr << std::endl;
2141 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange **WARNING** needed to shift forward lgb,";
2142 std::cerr << std::endl <<
">> from " <<
fGoodBins[1] <<
" to " <<
fForward.size()-1 << std::endl;
2148 std::cerr << std::endl <<
">> PRunAsymmetry::GetProperDataRange **WARNING** needed to shift backward lgb,";
2149 std::cerr << std::endl <<
">> from " <<
fGoodBins[1] <<
" to " <<
fForward.size()-1 << std::endl;
2209 std::cerr <<
">> PRunSingleHisto::GetProperFitRange(): **WARNING** Couldn't get fit start/end time!" << std::endl;
2210 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)
static std::vector< std::string > Split(const std::string &str, const std::string &delimiters)