39#include <TGFileDialog.h>
45#include "icons/musrview_icon.xpm"
47#include "PMacDockIcon.h"
48#include "icons/musrview_icon_png.h"
51static const char *
gFiletypes[] = {
"Data files",
"*.dat",
92 std::cerr << std::endl <<
">> PMusrCanvasPlotRange::SetXRange(): **WARNING** xmin > xmax, will swap them." << std::endl;
117 std::cerr << std::endl <<
">> PMusrCanvasPlotRange::SetYRange(): **WARNING** ymin > ymax, will swap them." << std::endl;
181 gStyle->SetHistMinimumZero(kTRUE);
214 Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh,
215 const Bool_t batch,
const Bool_t fourier,
const Bool_t avg,
216 const Bool_t theoAsData) :
240 gStyle->SetHistMinimumZero(kTRUE);
280 Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh,
283 const Bool_t batch,
const Bool_t fourier,
const Bool_t avg,
284 const Bool_t theoAsData) :
307 gStyle->SetHistMinimumZero(kTRUE);
319 if (
fData.size() > 0) {
320 for (UInt_t i=0; i<
fData.size(); i++)
354 if (
fMsrHandler->GetMsrFourierList()->fFourierBlockPresent) {
355 fFourier.fFourierBlockPresent =
true;
359 if (
fMsrHandler->GetMsrFourierList()->fFourierPower != -1) {
371 if ((
fMsrHandler->GetMsrFourierList()->fRangeForPhaseCorrection[0] != -1.0) &&
372 (
fMsrHandler->GetMsrFourierList()->fRangeForPhaseCorrection[1] != -1.0)) {
373 fFourier.fRangeForPhaseCorrection[0] =
fMsrHandler->GetMsrFourierList()->fRangeForPhaseCorrection[0];
374 fFourier.fRangeForPhaseCorrection[1] =
fMsrHandler->GetMsrFourierList()->fRangeForPhaseCorrection[1];
376 if ((
fMsrHandler->GetMsrFourierList()->fPlotRange[0] != -1.0) &&
377 (
fMsrHandler->GetMsrFourierList()->fPlotRange[1] != -1.0)) {
384 if (((
fMsrHandler->GetMsrPlotList()->at(0).fRRFPacking > 0) &&
385 (
fMsrHandler->GetMsrPlotList()->at(0).fRRFFreq != 0.0)) ||
386 (
fMsrHandler->GetMsrGlobal()->GetRRFPacking() > 0 &&
387 fMsrHandler->GetMsrGlobal()->GetRRFUnit().CompareTo(
"??"))) {
393 Int_t rrfUnitTag = -1;
394 Double_t rrfFreq = 0.0;
395 if (
fMsrHandler->GetMsrPlotList()->at(0).fRRFPacking > 0) {
396 fRRFText = std::make_unique<TString>(
"RRF: ");
397 rrfUnitTag =
fMsrHandler->GetMsrPlotList()->at(0).fRRFUnit;
398 rrfFreq =
fMsrHandler->GetMsrPlotList()->at(0).fRRFFreq;
399 TString rrfFreqStr(
"");
400 rrfFreqStr.Form(
"%.5g", rrfFreq);
402 *
fRRFText += TString(
"#nu_{RRF} = ");
406 *
fRRFText += TString(
"#nu_{RRF} = ");
410 *
fRRFText += TString(
"#omega_{RRF} = ");
422 *
fRRFText += TString(
", RRF packing = ");
425 fRRFText = std::make_unique<TString>(
"RRF: ");
426 rrfUnitTag =
fMsrHandler->GetMsrGlobal()->GetRRFUnitTag();
428 TString rrfFreqStr(
"");
429 rrfFreqStr.Form(
"%.5g", rrfFreq);
431 *
fRRFText += TString(
"#nu_{RRF} = ");
435 *
fRRFText += TString(
"#nu_{RRF} = ");
439 *
fRRFText += TString(
"#omega_{RRF} = ");
451 *
fRRFText += TString(
", RRF packing = ");
474 fTimeoutTimer->Connect(
"Timeout()",
"PMusrCanvas",
this,
"Done()");
493 Double_t ypos = 0.0, yoffset = 0.0;
500 for (UInt_t i=0; i<param.size(); i++) {
501 if (param[i].fName.Length() > maxLength)
502 maxLength = param[i].fName.Length();
507 if (param.size() > 20)
508 yoffset = 1.0 / (param.size()+1);
515 for (UInt_t i=0; i<param.size(); i++) {
518 snprintf(accStr,
sizeof(accStr),
"%%.%dlf", accuracy);
526 str += param[i].fName;
527 for (Int_t j=0; j<maxLength-param[i].fName.Length(); j++)
530 if (round(param[i].fValue)-param[i].fValue==0)
531 snprintf(cnum,
sizeof(cnum),
"%.1lf", param[i].fValue);
533 snprintf(cnum,
sizeof(cnum), accStr, param[i].fValue);
535 for (Int_t j=0; j<9-(Int_t)strlen(cnum); j++)
539 if (param[i].fPosErrorPresent) {
542 err = (param[i].fPosError - param[i].fStep) / 2.0;
544 if ((fabs(fabs(param[i].fStep) - param[i].fPosError) < 0.1*fabs(param[i].fStep)) &&
545 (fabs(fabs(param[i].fStep) - param[i].fPosError) < 0.1*param[i].fPosError)) {
546 if (round(err)-err==0)
547 snprintf(cnum,
sizeof(cnum),
"%.1lf", err);
549 snprintf(cnum,
sizeof(cnum), accStr, err);
551 snprintf(accStr,
sizeof(accStr),
"%%.%dlf!!", accuracy);
552 if (round(err)-err==0)
553 snprintf(cnum,
sizeof(cnum),
"%.1lf!!", err);
555 snprintf(cnum,
sizeof(cnum), accStr, err);
559 if (round(param[i].fStep)-param[i].fStep==0)
560 snprintf(cnum,
sizeof(cnum),
"%.1lf", param[i].fStep);
562 snprintf(cnum,
sizeof(cnum), accStr, param[i].fStep);
565 ypos = 0.98-i*yoffset;
571 if (theory.size() > 20)
572 yoffset = 1.0/(theory.size()+1);
575 for (UInt_t i=1; i<theory.size(); i++) {
577 str = theory[i].fLine;
578 idx = str.Index(
"(");
581 str.Resize(str.Strip().Length());
583 ypos = 0.98 - i*yoffset;
590 for (UInt_t i=1; i<functions.size(); i++) {
592 fTheoryPad->AddText(0.03, ypos, functions[i].fLine.Data());
619 for (UInt_t i=0; i<plotInfo.
fRuns.size(); i++) {
621 if ((Int_t)plotInfo.
fRuns[i] > (Int_t)runs.size()) {
623 std::cerr << std::endl <<
">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** run plot number " << (Int_t)plotInfo.
fRuns[i] <<
" is larger than the number of runs " << runs.size();
624 std::cerr << std::endl;
628 runNo = (UInt_t)plotInfo.
fRuns[i]-1;
629 if (runs[runNo].GetFitType() != -1) {
630 fitType = runs[runNo].GetFitType();
634 std::cerr << std::endl <<
">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** plottype = " <<
fPlotType;
635 std::cerr <<
", fittype = " << runs[runNo].GetFitType() <<
"(RUN block)/";
636 std::cerr <<
"fittype = " << globalBlock->
GetFitType() <<
"(GLOBAL block). However, they have to correspond!";
637 std::cerr << std::endl;
643 for (UInt_t i=0; i<plotInfo.
fRuns.size(); i++) {
646 runNo = (UInt_t)plotInfo.
fRuns[i]-1;
648 if (runs[runNo].GetFitType() != -1) {
649 fitType = runs[runNo].GetFitType();
657 std::cerr << std::endl <<
">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo <<
" for a single histogram plot";
658 std::cerr << std::endl;
669 std::cerr << std::endl <<
">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo <<
" for a single histogram RRF plot";
670 std::cerr << std::endl;
681 std::cerr << std::endl <<
">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo <<
" for a asymmetry plot";
682 std::cerr << std::endl;
693 std::cerr << std::endl <<
">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo <<
" for a beta-NMR asymmetry plot";
694 std::cerr << std::endl;
705 std::cerr << std::endl <<
">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo <<
" for a asymmetry RRF plot";
706 std::cerr << std::endl;
717 std::cerr << std::endl <<
">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo <<
" for a mu minus single histogram plot";
718 std::cerr << std::endl;
729 std::cerr << std::endl <<
">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo <<
" for a none musr data plot";
730 std::cerr << std::endl;
749 std::cerr << std::endl <<
">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** wrong plottype tag?!";
750 std::cerr << std::endl;
839 TString tstr, tsubstr;
844 tstr += statistic.
fDate;
845 tstr += TString(
", ");
849 tstr += TString(
"chisq = ");
851 tstr += TString(
"maxLH = ");
853 tstr += statistic.
fMin;
854 tstr += TString(
" , NDF = ");
855 tstr += statistic.
fNdf;
857 tstr += TString(
" , chisq/NDF = ");
859 tstr += TString(
" , maxLH/NDF = ");
861 if (statistic.
fNdf != 0) {
862 tstr += statistic.
fMin/statistic.
fNdf;
864 tstr += TString(
"undefined");
876 for (UInt_t i=0; i<
fData.size(); i++) {
878 runNo = (UInt_t)plotInfo.
fRuns[i]-1;
879 if (runs[runNo].GetRunNameSize() > 1)
880 tstr =
"++" + *runs[runNo].GetRunName() + TString(
",");
882 tstr = *runs[runNo].GetRunName() + TString(
",");
886 tstr += TString(
"h:");
888 fMsrHandler->GetGroupingString(runNo,
"forward", grouping);
890 tstr += TString(
",");
894 tstr += TString(
"h:");
896 fMsrHandler->GetGroupingString(runNo,
"forward", grouping);
898 tstr += TString(
"/");
900 fMsrHandler->GetGroupingString(runNo,
"backward", grouping);
902 tstr += TString(
",");
905 ddvec =
fRunList->GetTemp(*runs[runNo].GetRunName());
906 if (ddvec->empty()) {
907 tstr += TString(
"T=");
908 tstr += TString(
"??,");
909 }
else if (ddvec->size() == 1){
910 tstr += TString(
"T=");
911 snprintf(sval,
sizeof(sval),
"%0.2lf", ddvec->at(0).first);
912 tstr += TString(sval) + TString(
"K,");
914 for(UInt_t i(0); i<ddvec->size(); ++i){
915 snprintf(sval,
sizeof(sval),
"T%u=", i);
916 tstr += TString(sval);
917 snprintf(sval,
sizeof(sval),
"%0.2lf", ddvec->at(i).first);
918 tstr += TString(sval) + TString(
"K,");
922 tstr += TString(
"B=");
923 dval =
fRunList->GetField(*runs[runNo].GetRunName());
925 tstr += TString(
"??,");
928 snprintf(sval,
sizeof(sval),
"%0.2lf", dval);
929 tstr += TString(sval) + TString(
"G,");
931 snprintf(sval,
sizeof(sval),
"%0.2lf", dval/1.0e4);
932 tstr += TString(sval) + TString(
"T,");
936 tstr += TString(
"E=");
937 dval =
fRunList->GetEnergy(*runs[runNo].GetRunName());
939 tstr += TString(
"??,");
942 snprintf(sval,
sizeof(sval),
"%0.2lf", dval);
943 tstr += TString(sval) + TString(
"keV,");
945 snprintf(sval,
sizeof(sval),
"%0.2lf", dval/1.0e3);
946 tstr += TString(sval) + TString(
"MeV,");
950 tstr +=
fRunList->GetSetup(*runs[runNo].GetRunName());
970 Emit(
"Done(Int_t)",
status);
994 if (event != kKeyPress)
1000 if (!strcmp(selected->GetTitle(),
"dataTheoryPad"))
1014 enum eKeySwitch {kNotRelevant, kData, kDiffData, kFourier, kDiffFourier, kFourierDiff};
1015 eKeySwitch relevantKeySwitch = kNotRelevant;
1016 static eKeySwitch lastKeySwitch = kNotRelevant;
1018 if ((lastKeySwitch == kFourierDiff) && (x ==
'f')) {
1019 std::cout <<
"**INFO** f-d-f doesn't make any sense, will ignore 'f' ..." << std::endl;
1023 if ((lastKeySwitch == kDiffFourier) && (x ==
'd')) {
1024 std::cout <<
"**INFO** d-f-d doesn't make any sense, will ignore 'd' ..." << std::endl;
1030 }
else if (x ==
'd') {
1043 relevantKeySwitch = kDiffData;
1045 relevantKeySwitch = kData;
1047 relevantKeySwitch = kFourierDiff;
1049 relevantKeySwitch = kFourier;
1050 }
else if (x ==
'u') {
1068 }
else if (x ==
'f') {
1071 relevantKeySwitch = kDiffFourier;
1073 relevantKeySwitch = kFourier;
1075 relevantKeySwitch = kDiffData;
1077 relevantKeySwitch = kData;
1126 }
else if (x ==
'+') {
1129 }
else if (x ==
'-') {
1132 }
else if (x ==
'a') {
1133 if (
fData.size() > 1) {
1147 relevantKeySwitch = kDiffData;
1149 relevantKeySwitch = kData;
1151 relevantKeySwitch = kFourierDiff;
1153 relevantKeySwitch = kFourier;
1155 std::cout <<
"**INFO** averaging of a single data set doesn't make any sense, will ignore 'a' ..." << std::endl;
1158 }
else if (x ==
'c') {
1168 }
else if (x ==
't') {
1169 if (
fData.size() == 1) {
1172 fData[0].theory->SetLineColor(kRed);
1173 fData[0].theory->SetLineWidth(2);
1176 fData[0].theory->SetLineWidth(1);
1185 lastKeySwitch = relevantKeySwitch;
1188 switch (relevantKeySwitch) {
1238 static Int_t previousPlotView =
PV_DATA;
1274 if (previousPlotView ==
PV_DATA)
1297 if (previousPlotView ==
PV_DATA)
1320 if (previousPlotView ==
PV_DATA)
1343 if (previousPlotView ==
PV_DATA)
1366 if (previousPlotView ==
PV_DATA)
1377 if (
fData[0].dataFourierPhaseOptReal ==
nullptr) {
1378 if (
fData[0].dataFourierRe ==
nullptr)
1396 if (previousPlotView ==
PV_DATA)
1461 if (
fData.size() > 1) {
1473 std::cout <<
"**INFO** averaging of a single data set doesn't make any sense, will ignore 'a' ..." << std::endl;
1477 static TString dir(
".");
1480 fi.fIniDir = StrDup(dir);
1481 fi.fOverwrite =
true;
1482 new TGFileDialog(0,
fImp, kFDSave, &fi);
1483 if (fi.fFilename && strlen(fi.fFilename)) {
1511 if (gROOT->GetListOfCanvases()->IsEmpty()) {
1525 gROOT->GetListOfCanvases()->Remove(
fMainCanvas.get());
1540 std::cout << std::endl <<
">> SaveGraphicsAndQuit: will dump the canvas into a graphics output file (" << graphicsFormat <<
") ..."<< std::endl;
1542 TString str(fileName);
1547 if (str.Contains(
".msr")) {
1548 idx = str.Index(
".msr");
1551 if (str.Contains(
".mlog")) {
1552 idx = str.Index(
".mlog");
1557 std::cerr << std::endl <<
">> PMusrCanvas::SaveGraphicsAndQuit(): **ERROR** fileName (" << fileName <<
") is invalid." << std::endl;
1565 str.Replace(idx, size, ext, strlen(ext));
1568 snprintf(ext,
sizeof(ext),
".%s", graphicsFormat);
1569 str.Replace(idx, size, ext, strlen(ext));
1571 std::cout << std::endl <<
">> SaveGraphicsAndQuit: " << str.Data() << std::endl;
1589 if (fileName ==
nullptr) {
1590 std::cerr << std::endl <<
">> PMusrCanvas::ExportData(): **ERROR** NO path file name provided. Will do nothing." << std::endl;
1602 Double_t xval, yval;
1617 xmin =
fHistoFrame->GetXaxis()->GetBinCenter(xminBin);
1618 xmax =
fHistoFrame->GetXaxis()->GetBinCenter(xmaxBin);
1624 for (UInt_t i=0; i<
fData.size(); i++) {
1631 xminBin =
fData[0].diffFourierRe->GetXaxis()->GetFirst();
1632 xmaxBin =
fData[0].diffFourierRe->GetXaxis()->GetLast();
1633 xmin =
fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xminBin);
1634 xmax =
fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xmaxBin);
1640 for (UInt_t i=0; i<
fData.size(); i++) {
1647 xminBin =
fData[0].diffFourierIm->GetXaxis()->GetFirst();
1648 xmaxBin =
fData[0].diffFourierIm->GetXaxis()->GetLast();
1649 xmin =
fData[0].diffFourierIm->GetXaxis()->GetBinCenter(xminBin);
1650 xmax =
fData[0].diffFourierIm->GetXaxis()->GetBinCenter(xmaxBin);
1656 for (UInt_t i=0; i<
fData.size(); i++) {
1663 xminBin =
fData[0].diffFourierRe->GetXaxis()->GetFirst();
1664 xmaxBin =
fData[0].diffFourierRe->GetXaxis()->GetLast();
1665 xmin =
fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xminBin);
1666 xmax =
fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xmaxBin);
1673 for (UInt_t i=0; i<
fData.size(); i++) {
1681 xminBin =
fData[0].diffFourierPwr->GetXaxis()->GetFirst();
1682 xmaxBin =
fData[0].diffFourierPwr->GetXaxis()->GetLast();
1683 xmin =
fData[0].diffFourierPwr->GetXaxis()->GetBinCenter(xminBin);
1684 xmax =
fData[0].diffFourierPwr->GetXaxis()->GetBinCenter(xmaxBin);
1690 for (UInt_t i=0; i<
fData.size(); i++) {
1697 xminBin =
fData[0].diffFourierPhase->GetXaxis()->GetFirst();
1698 xmaxBin =
fData[0].diffFourierPhase->GetXaxis()->GetLast();
1699 xmin =
fData[0].diffFourierPhase->GetXaxis()->GetBinCenter(xminBin);
1700 xmax =
fData[0].diffFourierPhase->GetXaxis()->GetBinCenter(xmaxBin);
1706 for (UInt_t i=0; i<
fData.size(); i++) {
1720 xmin =
fHistoFrame->GetXaxis()->GetBinCenter(xminBin);
1721 xmax =
fHistoFrame->GetXaxis()->GetBinCenter(xmaxBin);
1728 for (UInt_t i=0; i<
fData.size(); i++) {
1737 xminBin =
fData[0].dataFourierRe->GetXaxis()->GetFirst();
1738 xmaxBin =
fData[0].dataFourierRe->GetXaxis()->GetLast();
1739 xmin =
fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xminBin);
1740 xmax =
fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xmaxBin);
1747 for (UInt_t i=0; i<
fData.size(); i++) {
1755 xminBin =
fData[0].dataFourierIm->GetXaxis()->GetFirst();
1756 xmaxBin =
fData[0].dataFourierIm->GetXaxis()->GetLast();
1757 xmin =
fData[0].dataFourierIm->GetXaxis()->GetBinCenter(xminBin);
1758 xmax =
fData[0].dataFourierIm->GetXaxis()->GetBinCenter(xmaxBin);
1765 for (UInt_t i=0; i<
fData.size(); i++) {
1773 xminBin =
fData[0].dataFourierRe->GetXaxis()->GetFirst();
1774 xmaxBin =
fData[0].dataFourierRe->GetXaxis()->GetLast();
1775 xmin =
fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xminBin);
1776 xmax =
fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xmaxBin);
1784 for (UInt_t i=0; i<
fData.size(); i++) {
1794 xminBin =
fData[0].dataFourierPwr->GetXaxis()->GetFirst();
1795 xmaxBin =
fData[0].dataFourierPwr->GetXaxis()->GetLast();
1796 xmin =
fData[0].dataFourierPwr->GetXaxis()->GetBinCenter(xminBin);
1797 xmax =
fData[0].dataFourierPwr->GetXaxis()->GetBinCenter(xmaxBin);
1804 for (UInt_t i=0; i<
fData.size(); i++) {
1812 xminBin =
fData[0].dataFourierPhase->GetXaxis()->GetFirst();
1813 xmaxBin =
fData[0].dataFourierPhase->GetXaxis()->GetLast();
1814 xmin =
fData[0].dataFourierPhase->GetXaxis()->GetBinCenter(xminBin);
1815 xmax =
fData[0].dataFourierPhase->GetXaxis()->GetBinCenter(xmaxBin);
1822 for (UInt_t i=0; i<
fData.size(); i++) {
1830 xminBin =
fData[0].dataFourierPhaseOptReal->GetXaxis()->GetFirst();
1831 xmaxBin =
fData[0].dataFourierPhaseOptReal->GetXaxis()->GetLast();
1832 xmin =
fData[0].dataFourierPhaseOptReal->GetXaxis()->GetBinCenter(xminBin);
1833 xmax =
fData[0].dataFourierPhaseOptReal->GetXaxis()->GetBinCenter(xmaxBin);
1840 for (UInt_t i=0; i<
fData.size(); i++) {
1873 if ((xval >= xmin) && (xval <= xmax)) {
1874 dump.
dataX.push_back(xval);
1875 dump.
data.push_back(yval);
1881 if (dump.
dataX.size() > 0)
1882 dumpVector.push_back(dump);
1920 if ((xval >= xmin) && (xval <= xmax)) {
1921 dump.
dataX.push_back(xval);
1922 dump.
data.push_back(yval);
1928 if (dump.
dataX.size() > 0)
1929 dumpVector.push_back(dump);
1937 for (Int_t j=0; j<
fNonMusrData[i].theory->GetN(); j++) {
1941 if ((xval >= xmin) && (xval <= xmax)) {
1942 dump.
dataX.push_back(xval);
1943 dump.
data.push_back(yval);
1948 if (dump.
dataX.size() > 0)
1949 dumpVector.push_back(dump);
1976 fout.open(fileName, std::iostream::out);
1977 if (!fout.is_open()) {
1978 std::cerr << std::endl <<
">> PMusrCanvas::ExportData(): **ERROR** couldn't open file " << fileName <<
" for writing." << std::endl;
1983 UInt_t maxLength = 0;
1984 for (UInt_t i=0; i<dumpVector.size(); i++) {
1985 if (maxLength < dumpVector[i].dataX.size())
1986 maxLength = dumpVector[i].dataX.size();
1995 fout <<
"% from averaged view" << std::endl;
1996 fout <<
"x, diff, errDiff" << std::endl;
1998 for (UInt_t i=0; i<dumpVector.size()-1; i++) {
1999 fout <<
"x" << i <<
" , diff" << i <<
", errDiff" << i <<
", ";
2001 fout <<
"x" << dumpVector.size()-1 <<
" , diff" << dumpVector.size()-1 <<
", errDiff" << dumpVector.size()-1 << std::endl;
2006 fout <<
"% from averaged view" << std::endl;
2007 fout <<
"x, F_diffRe" << std::endl;
2009 for (UInt_t i=0; i<dumpVector.size()-1; i++) {
2010 fout <<
"freq" << i <<
", F_diffRe" << i <<
", ";
2012 fout <<
"freq" << dumpVector.size()-1 <<
", F_diffRe" << dumpVector.size()-1 << std::endl;
2017 fout <<
"% from averaged view" << std::endl;
2018 fout <<
"x, F_diffIm" << std::endl;
2020 for (UInt_t i=0; i<dumpVector.size()-1; i++) {
2021 fout <<
"freq" << i <<
", F_diffIm" << i <<
", ";
2023 fout <<
"freq" << dumpVector.size()-1 <<
", F_diffIm" << dumpVector.size()-1 << std::endl;
2028 fout <<
"% from averaged view" << std::endl;
2029 fout <<
"x, F_diffRe, F_diffIm" << std::endl;
2031 for (UInt_t i=0; i<dumpVector.size()/2; i++) {
2032 fout <<
"freq" << i <<
", F_diffRe" << i <<
", ";
2034 for (UInt_t i=0; i<dumpVector.size()/2-1; i++) {
2035 fout <<
"freq" << i <<
", F_diffIm" << i <<
", ";
2037 fout <<
"freq" << dumpVector.size()/2-1 <<
", F_diffIm" << dumpVector.size()/2-1 << std::endl;
2042 fout <<
"% from averaged view" << std::endl;
2043 fout <<
"x, F_diffPwr" << std::endl;
2045 for (UInt_t i=0; i<dumpVector.size()-1; i++) {
2046 fout <<
"freq" << i <<
", F_diffPwr" << i <<
", ";
2048 fout <<
"freq" << dumpVector.size()-1 <<
", F_diffPwr" << dumpVector.size()-1 << std::endl;
2053 fout <<
"% from averaged view" << std::endl;
2054 fout <<
"x, F_diffPhase" << std::endl;
2056 for (UInt_t i=0; i<dumpVector.size()-1; i++) {
2057 fout <<
"freq" << i <<
", F_diffPhase" << i <<
", ";
2059 fout <<
"freq" << dumpVector.size()-1 <<
", F_diffPhase" << dumpVector.size()-1 << std::endl;
2067 for (UInt_t i=0; i<maxLength; i++) {
2069 for (UInt_t j=0; j<dumpVector.size()-1; j++) {
2070 if (i<dumpVector[j].dataX.size()) {
2071 fout << dumpVector[j].dataX[i] <<
", ";
2072 fout << dumpVector[j].data[i] <<
", ";
2073 if (dumpVector[j].dataErr.size() > 0)
2074 fout << dumpVector[j].dataErr[i] <<
", ";
2076 if (dumpVector[j].dataErr.size() > 0)
2083 if (i<dumpVector[dumpVector.size()-1].dataX.size()) {
2084 fout << dumpVector[dumpVector.size()-1].dataX[i] <<
", ";
2085 fout << dumpVector[dumpVector.size()-1].data[i] <<
", ";
2086 if (dumpVector[dumpVector.size()-1].dataErr.size() > 0)
2087 fout << dumpVector[dumpVector.size()-1].dataErr[i];
2089 if (dumpVector[dumpVector.size()-1].dataErr.size() > 0)
2101 fout <<
"% from averaged view" << std::endl;
2102 fout <<
"% xData, data, errData, xTheory, theory" << std::endl;
2104 for (UInt_t i=0; i<dumpVector.size(); i++) {
2106 fout <<
"xData" << i/2 <<
", data" << i/2 <<
", errData" << i/2 <<
", ";
2108 if (i == dumpVector.size()-1)
2109 fout <<
"xTheory" << (i-1)/2 <<
", theory" << (i-1)/2 << std::endl;
2111 fout <<
"xTheory" << (i-1)/2 <<
", theory" << (i-1)/2 <<
", ";
2117 fout <<
"% from averaged view" << std::endl;
2118 fout <<
"freq, F_Re, freqTheo, F_theoRe" << std::endl;
2120 for (UInt_t i=0; i<dumpVector.size(); i++) {
2122 fout <<
"freq" << i/2 <<
", F_Re" << i/2 <<
", ";
2124 if (i == dumpVector.size()-1)
2125 fout <<
"freqTheo" << (i-1)/2 <<
", F_theoRe" << (i-1)/2 << std::endl;
2127 fout <<
"freqTheo" << (i-1)/2 <<
", F_theoRe" << (i-1)/2 <<
", ";
2133 fout <<
"% from averaged view" << std::endl;
2134 fout <<
"freq, F_Im, freqTheo, F_theoIm" << std::endl;
2137 for (UInt_t i=0; i<dumpVector.size(); i++) {
2139 fout <<
"freq" << i/2 <<
", F_Im" << i/2 <<
", ";
2141 if (i == dumpVector.size()-1)
2142 fout <<
"freqTheo" << (i-1)/2 <<
", F_theoIm" << (i-1)/2 << std::endl;
2144 fout <<
"freqTheo" << (i-1)/2 <<
", F_theoIm" << (i-1)/2 <<
", ";
2150 fout <<
"% from averaged view" << std::endl;
2151 fout <<
"freq, F_Re, freqTheo, F_theoRe, freq, F_Im, freqTheo, F_theoIm" << std::endl;
2153 for (UInt_t i=0; i<dumpVector.size(); i++) {
2155 fout <<
"freq" << i/4 <<
", F_Re" << i/4 <<
", ";
2156 else if (i % 4 == 1)
2157 fout <<
"freqTheo" << (i-1)/4 <<
", F_theoRe" << (i-1)/4 <<
", ";
2158 else if (i % 4 == 2)
2159 fout <<
"freq" << (i-2)/4 <<
", F_Im" << (i-2)/4 <<
", ";
2161 if (i == dumpVector.size()-1)
2162 fout <<
"freqTheo" << (i-3)/4 <<
", F_theoIm" << (i-3)/4 << std::endl;
2164 fout <<
"freqTheo" << (i-3)/4 <<
", F_theoIm" << (i-3)/4 <<
", ";
2170 fout <<
"% from averaged view" << std::endl;
2171 fout <<
"freq, F_Pwr, freqTheo, F_theoPwr" << std::endl;
2173 for (UInt_t i=0; i<dumpVector.size(); i++) {
2175 fout <<
"freq" << i/2 <<
", F_Pwr" << i/2 <<
", ";
2177 if (i == dumpVector.size()-1)
2178 fout <<
"freqTheo" << (i-1)/2 <<
", F_theoPwr" << (i-1)/2 << std::endl;
2180 fout <<
"freqTheo" << (i-1)/2 <<
", F_theoPwr" << (i-1)/2 <<
", ";
2186 fout <<
"% from averaged view" << std::endl;
2187 fout <<
"freq, F_Phase, freqTheo, F_theoPhase" << std::endl;
2189 for (UInt_t i=0; i<dumpVector.size(); i++) {
2191 fout <<
"freq" << i/2 <<
", F_Phase" << i/2 <<
", ";
2193 if (i == dumpVector.size()-1)
2194 fout <<
"freqTheo" << (i-1)/2 <<
", F_theoPhase" << (i-1)/2 << std::endl;
2196 fout <<
"freqTheo" << (i-1)/2 <<
", F_theoPhase" << (i-1)/2 <<
", ";
2205 for (UInt_t i=0; i<maxLength; i++) {
2207 for (UInt_t j=0; j<dumpVector.size()-1; j++) {
2208 if (i<dumpVector[j].dataX.size()) {
2209 fout << std::setprecision(9) << dumpVector[j].dataX[i] <<
", ";
2210 fout << std::setprecision(9) << dumpVector[j].data[i] <<
", ";
2211 if (dumpVector[j].dataErr.size() > 0)
2212 fout << std::setprecision(9) << dumpVector[j].dataErr[i] <<
", ";
2214 if (dumpVector[j].dataErr.size() > 0)
2221 if (i<dumpVector[dumpVector.size()-1].dataX.size()) {
2222 fout << std::setprecision(9) << dumpVector[dumpVector.size()-1].dataX[i] <<
", ";
2223 fout << std::setprecision(9) << dumpVector[dumpVector.size()-1].data[i];
2235 for (UInt_t i=0; i<dumpVector.size(); i++) {
2236 dumpVector[i].dataX.clear();
2237 dumpVector[i].data.clear();
2238 dumpVector[i].dataErr.clear();
2242 std::cout << std::endl <<
">> Data windows saved in ascii format ..." << std::endl;
2268 for (Int_t j=1; j<data->GetNbinsX(); j++) {
2270 x = data->GetBinCenter(j);
2272 if ((x >= xmin) && (x <= xmax)) {
2273 dump.
dataX.push_back(x);
2274 dump.
data.push_back(data->GetBinContent(j));
2276 dump.
dataErr.push_back(data->GetBinError(j));
2281 if (dump.
dataX.size() > 0)
2282 dumpData.push_back(dump);
2293 TString musrStyle(
"musrStyle");
2295 fStyle = std::make_unique<TStyle>(musrStyle, musrStyle);
2309 fFourier.fFourierBlockPresent =
false;
2316 for (UInt_t i=0; i<2; i++) {
2317 fFourier.fRangeForPhaseCorrection[i] = -1.0;
2335 fDataAvg.dataFourierPhase =
nullptr;
2336 fDataAvg.dataFourierPhaseOptReal =
nullptr;
2338 fDataAvg.theoryFourierRe =
nullptr;
2339 fDataAvg.theoryFourierIm =
nullptr;
2340 fDataAvg.theoryFourierPwr =
nullptr;
2341 fDataAvg.theoryFourierPhase =
nullptr;
2342 fDataAvg.theoryFourierPhaseOptReal =
nullptr;
2347 fDataAvg.diffFourierPhase =
nullptr;
2348 fDataAvg.diffFourierPhaseOptReal =
nullptr;
2381 TString canvasName = TString(
"fMainCanvas");
2383 fMainCanvas = std::make_unique<TCanvas>(canvasName.Data(), title, wtopx, wtopy, ww, wh);
2385 fMainCanvas->Connect(
"Closed()",
"PMusrCanvas",
this,
"LastCanvasClosed()");
2391 fImp->SetIconPixmap(
const_cast<char**
>(musrview_icon_xpm));
2392 fImp->SetClassHints(
"musrview",
"musrview");
2396 SetMacDockIcon(musrview_icon_png, musrview_icon_png_len);
2398 fImp->Connect(
"CloseWindow()",
"PMusrCanvas",
this,
"WindowClosed()");
2426 fBar->MapSubwindows();
2429 fPopupMain->Connect(
"TGPopupMenu",
"Activated(Int_t)",
"PMusrCanvas",
this,
"HandleMenuPopup(Int_t)");
2436 fTitlePad = std::make_unique<TPaveText>(0.0,
YTITLE, 1.0, 1.0,
"NDC");
2437 fTitlePad->SetFillColor(TColor::GetColor(255,255,255));
2454 fTheoryPad = std::make_unique<TPaveText>(
XTHEO, 0.1, 1.0, 0.5,
"NDC");
2455 fTheoryPad->SetFillColor(TColor::GetColor(255,255,255));
2461 fInfoPad = std::make_unique<TLegend>(0.0, 0.0, 1.0,
YINFO,
"NDC");
2462 fInfoPad->SetFillColor(TColor::GetColor(255,255,255));
2471 fMainCanvas->Connect(
"ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",
"PMusrCanvas",
2472 this,
"HandleCmdKey(Int_t,Int_t,Int_t,TObject*)");
2485 dataSet.
data =
nullptr;
2491 dataSet.
theory =
nullptr;
2497 dataSet.
diff =
nullptr;
2516 dataSet.
data =
nullptr;
2521 dataSet.
theory =
nullptr;
2526 dataSet.
diff =
nullptr;
2545 delete dataSet.
data;
2546 dataSet.
data =
nullptr;
2570 dataSet.
theory =
nullptr;
2593 delete dataSet.
diff;
2594 dataSet.
diff =
nullptr;
2633 delete dataSet.
data;
2634 dataSet.
data =
nullptr;
2654 dataSet.
theory =
nullptr;
2673 delete dataSet.
diff;
2674 dataSet.
diff =
nullptr;
2717 Double_t xmin, xmax, ymin, ymax;
2727 name = *
fMsrHandler->GetMsrRunList()->at(runNo).GetRunName() +
"_DataRunNo";
2728 name +=
static_cast<Int_t
>(runNo);
2753 (
fMsrHandler->GetMsrRunList()->at(runNo).IsLifetimeCorrected())) {
2784 start =
fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(0);
2786 start =
fMsrHandler->GetMsrGlobal()->GetFitRange(0);
2788 end =
fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(1);
2790 end =
fMsrHandler->GetMsrGlobal()->GetFitRange(1);
2802 (
fMsrHandler->GetMsrRunList()->at(runNo).IsLifetimeCorrected())) {
2864 dataHisto =
new TH1F(name, name, size, start, end);
2868 UInt_t startBin = 0;
2869 UInt_t endBin = data->
GetValue()->size();
2873 Double_t startFitRange =
fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(0);
2875 startFitRange =
fMsrHandler->GetMsrGlobal()->GetFitRange(0);
2880 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin data < 0 for 'use_fit_range', will set it to 0" << std::endl << std::endl;
2881 }
else if (dval >= (Double_t)data->
GetValue()->size()) {
2882 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin data=" << (UInt_t)dval <<
" >= data vector size=" << data->
GetValue()->size() <<
" for 'use_fit_range',";
2883 std::cerr << std::endl <<
">> will set it to data vector size" << std::endl << std::endl;
2884 startBin = data->
GetValue()->size();
2886 startBin = (UInt_t)dval;
2889 Double_t endFitRange =
fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(1);
2891 endFitRange =
fMsrHandler->GetMsrGlobal()->GetFitRange(1);
2896 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin data < 0 for 'use_fit_range', will set it to 0" << std::endl << std::endl;
2897 }
else if (dval >= (Double_t)data->
GetValue()->size()) {
2898 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin data=" << (UInt_t)dval <<
" >= data vector size=" << data->
GetValue()->size() <<
" for 'use_fit_range',";
2899 std::cerr << std::endl <<
">> will set it to data vector size" << std::endl << std::endl;
2902 endBin = (UInt_t)dval;
2911 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin data < 0 for 'sub_ranges', will set it to 0" << std::endl << std::endl;
2912 }
else if (dval >= (Double_t)data->
GetValue()->size()) {
2913 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin data=" << (UInt_t)dval <<
" >= data vector size=" << data->
GetValue()->size() <<
" for 'sub_ranges',";
2914 std::cerr << std::endl <<
">> will set it to data vector size" << std::endl << std::endl;
2915 startBin = data->
GetValue()->size();
2917 startBin = (UInt_t)dval;
2923 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin data < 0 for 'sub_ranges', will set it to 0" << std::endl << std::endl;
2924 }
else if (dval >= (Double_t)data->
GetValue()->size()) {
2925 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin data=" << (UInt_t)dval <<
" >= data vector size=" << data->
GetValue()->size() <<
" for 'sub_ranges',";
2926 std::cerr << std::endl <<
">> will set it to data vector size" << std::endl << std::endl;
2929 endBin = (UInt_t)dval;
2933 for (UInt_t i=startBin; i<endBin; i++) {
2934 dataHisto->SetBinContent(i-startBin+1, data->
GetValue()->at(i));
2935 dataHisto->SetBinError(i-startBin+1, data->
GetError()->at(i));
2940 dataHisto->SetMarkerColor(
fColorList[plotNo]);
2943 TRandom rand(plotNo);
2947 Int_t r = (Int_t)rand.Integer(255);
2948 Int_t g = (Int_t)rand.Integer(255);
2949 Int_t b = (Int_t)rand.Integer(255);
2950 Int_t color = TColor::GetColor(r, g, b);
2951 dataHisto->SetMarkerColor(color);
2952 dataHisto->SetLineColor(color);
2955 dataHisto->SetMarkerSize(1);
2960 TRandom rand(plotNo);
2961 dataHisto->SetMarkerStyle(20+(Int_t)rand.Integer(10));
2966 name = *
fMsrHandler->GetMsrRunList()->at(runNo).GetRunName() +
"_TheoRunNo";
2967 name += (Int_t)runNo;
2976 start =
fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(0);
2978 start =
fMsrHandler->GetMsrGlobal()->GetFitRange(0);
2980 end =
fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(1);
2982 end =
fMsrHandler->GetMsrGlobal()->GetFitRange(1);
3003 theoHisto =
new TH1F(name, name, size, start, end);
3011 Double_t startFitRange =
fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(0);
3013 startFitRange =
fMsrHandler->GetMsrGlobal()->GetFitRange(0);
3018 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin theory < 0 for 'use_fit_range', will set it to 0" << std::endl << std::endl;
3019 }
else if (dval >= (Double_t)data->
GetTheory()->size()) {
3020 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin theory=" << (UInt_t)dval <<
" >= theory vector size=" << data->
GetTheory()->size() <<
" for 'use_fit_range',";
3021 std::cerr << std::endl <<
">> will set it to theory vector size" << std::endl << std::endl;
3024 startBin = (UInt_t)dval;
3027 Double_t endFitRange =
fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(1);
3029 endFitRange =
fMsrHandler->GetMsrGlobal()->GetFitRange(1);
3034 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin theory < 0 for 'use_fit_range', will set it to 0" << std::endl << std::endl;
3035 }
else if (dval >= (Double_t)data->
GetTheory()->size()) {
3036 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin theory=" << (UInt_t)dval <<
" >= theory vector size=" << data->
GetTheory()->size() <<
" for 'use_fit_range',";
3037 std::cerr << std::endl <<
">> will set it to theory vector size" << std::endl << std::endl;
3040 endBin = (UInt_t)dval;
3052 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin theory < 0 for 'sub_ranges', will set it to 0" << std::endl << std::endl;
3053 }
else if (dval >= (Double_t)data->
GetTheory()->size()) {
3054 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin theory=" << (UInt_t)dval <<
" >= theory vector size=" << data->
GetTheory()->size() <<
" for 'sub_ranges',";
3055 std::cerr << std::endl <<
">> will set it to theory vector size" << std::endl << std::endl;
3058 startBin = (UInt_t)dval;
3064 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin theory < 0 for 'sub_ranges', will set it to 0" << std::endl << std::endl;
3065 }
else if (dval >= (Double_t)data->
GetTheory()->size()) {
3066 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin theory=" << (UInt_t)dval <<
" >= theory vector size=" << data->
GetTheory()->size() <<
" for 'sub_ranges',";
3067 std::cerr << std::endl <<
">> will set it to theory vector size" << std::endl << std::endl;
3070 endBin = (UInt_t)dval;
3074 for (UInt_t i=startBin; i<endBin; i++) {
3075 theoHisto->SetBinContent(i-startBin+1, data->
GetTheory()->at(i));
3082 TRandom rand(plotNo);
3086 Int_t r = (Int_t)rand.Integer(255);
3087 Int_t g = (Int_t)rand.Integer(255);
3088 Int_t b = (Int_t)rand.Integer(255);
3089 Int_t color = TColor::GetColor(r, g, b);
3090 theoHisto->SetLineColor(color);
3094 dataSet.
data = dataHisto;
3095 dataSet.
theory = theoHisto;
3098 fData.push_back(dataSet);
3114 TGraphErrors *dataHisto;
3115 TGraphErrors *theoHisto;
3125 dataHisto =
new TGraphErrors(data->
GetX()->size());
3128 for (UInt_t i=0; i<data->
GetX()->size(); i++) {
3129 dataHisto->SetPoint(i, data->
GetX()->at(i), data->
GetValue()->at(i));
3130 dataHisto->SetPointError(i, 0.0, data->
GetError()->at(i));
3135 dataHisto->SetMarkerColor(
fColorList[plotNo]);
3138 TRandom rand(plotNo);
3142 Int_t r = (Int_t)rand.Integer(255);
3143 Int_t g = (Int_t)rand.Integer(255);
3144 Int_t b = (Int_t)rand.Integer(255);
3145 Int_t color = TColor::GetColor(r, g, b);
3146 dataHisto->SetMarkerColor(color);
3147 dataHisto->SetLineColor(color);
3150 dataHisto->SetMarkerSize(1);
3155 TRandom rand(plotNo);
3156 dataHisto->SetMarkerStyle(20+(Int_t)rand.Integer(10));
3162 theoHisto =
new TGraphErrors(data->
GetXTheory()->size());
3165 for (UInt_t i=0; i<data->
GetXTheory()->size(); i++) {
3167 theoHisto->SetPointError(i, 0.0, 0.0);
3174 TRandom rand(plotNo);
3178 Int_t r = (Int_t)rand.Integer(255);
3179 Int_t g = (Int_t)rand.Integer(255);
3180 Int_t b = (Int_t)rand.Integer(255);
3181 Int_t color = TColor::GetColor(r, g, b);
3182 theoHisto->SetLineColor(color);
3186 dataSet.
data = dataHisto;
3187 dataSet.
theory = theoHisto;
3191 Double_t xmin=0.0, xmax=0.0, ymin=0.0, ymax=0.0, x=0.0, y=0.0;
3195 dataSet.
data->GetPoint(0, xmin, y);
3196 dataSet.
data->GetPoint(dataSet.
data->GetN()-1, xmax, y);
3197 dataSet.
data->GetPoint(0, x, y);
3200 for (Int_t i=1; i<dataSet.
data->GetN(); i++) {
3201 dataSet.
data->GetPoint(i, x, y);
3207 Double_t dx = 0.025*(xmax-xmin);
3208 Double_t dy = 0.025*(ymax-ymin);
3230 xmin =
fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(0);
3231 xmax =
fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(1);
3293 for (UInt_t i=0; i<
fData.size(); i++) {
3295 name = TString(
fData[i].data->GetTitle()) +
"_diff";
3296 diffHisto =
new TH1F(name, name,
fData[i].data->GetNbinsX(),
3297 fData[i].data->GetXaxis()->GetXmin(),
3298 fData[i].data->GetXaxis()->GetXmax());
3301 diffHisto->SetMarkerColor(
fData[i].data->GetMarkerColor());
3302 diffHisto->SetLineColor(
fData[i].data->GetLineColor());
3304 diffHisto->SetMarkerSize(
fData[i].data->GetMarkerSize());
3306 diffHisto->SetMarkerStyle(
fData[i].data->GetMarkerStyle());
3309 fData[i].diff = diffHisto;
3312 for (Int_t j=1; j<
fData[i].data->GetNbinsX()-1; j++) {
3315 fData[i].data->GetBinContent(j),
3317 fData[i].diff->SetBinContent(j, value);
3319 value =
fData[i].data->GetBinError(j);
3320 fData[i].diff->SetBinError(j, value);
3324 TGraphErrors *diffHisto;
3332 diffHisto =
new TGraphErrors(
fNonMusrData[i].data->GetN());
3335 name = TString(
fNonMusrData[i].data->GetTitle()) +
"_diff";
3336 diffHisto->SetNameTitle(name.Data(), name.Data());
3339 diffHisto->SetMarkerColor(
fNonMusrData[i].data->GetMarkerColor());
3340 diffHisto->SetLineColor(
fNonMusrData[i].data->GetLineColor());
3342 diffHisto->SetMarkerSize(
fNonMusrData[i].data->GetMarkerSize());
3344 diffHisto->SetMarkerStyle(
fNonMusrData[i].data->GetMarkerStyle());
3381 if (
fData[0].dataFourierRe ==
nullptr) {
3383 double startTime =
fXmin;
3384 double endTime =
fXmax;
3393 std::vector<PFourier*> fourierData(
fData.size(),
nullptr);
3394 std::vector<PFourier*> fourierTheory(
fData.size(),
nullptr);
3395 for (UInt_t i=0; i<
fData.size(); i++) {
3397 if (!fourierData[i]->
IsValid()) {
3398 std::cerr << std::endl <<
">> PMusrCanvas::HandleFourier(): **SEVERE ERROR** couldn't invoke PFourier to calculate the Fourier data ..." << std::endl;
3399 for (
auto *ft : fourierData)
delete ft;
3400 for (
auto *ft : fourierTheory)
delete ft;
3407 Int_t powerPad =
fFourier.fFourierPower+5;
3410 if (!fourierTheory[i]->
IsValid()) {
3411 std::cerr << std::endl <<
">> PMusrCanvas::HandleFourier(): **SEVERE ERROR** couldn't invoke PFourier to calculate the Fourier theory ..." << std::endl;
3412 for (
auto *ft : fourierData)
delete ft;
3413 for (
auto *ft : fourierTheory)
delete ft;
3420 Int_t noOfFT =
static_cast<Int_t
>(
fData.size());
3422 Int_t chunk = noOfFT/omp_get_num_procs();
3425 #pragma omp parallel for default(shared) schedule(dynamic,chunk)
3427 for (Int_t i=0; i<noOfFT; i++) {
3428 fourierData[i]->Transform(
fFourier.fApodization);
3429 fourierTheory[i]->Transform(
fFourier.fApodization);
3434 for (UInt_t i=0; i<
fData.size(); i++) {
3436 scale = sqrt(
fData[0].data->GetBinWidth(1)/(endTime-startTime));
3438 fData[i].dataFourierRe = fourierData[i]->GetRealFourier(scale);
3440 fData[i].dataFourierIm = fourierData[i]->GetImaginaryFourier(scale);
3442 fData[i].dataFourierPwr = fourierData[i]->GetPowerFourier(scale);
3444 fData[i].dataFourierPhase = fourierData[i]->GetPhaseFourier();
3447 fData[i].dataFourierRe->SetMarkerColor(
fData[i].data->GetMarkerColor());
3448 fData[i].dataFourierRe->SetLineColor(
fData[i].data->GetLineColor());
3449 fData[i].dataFourierIm->SetMarkerColor(
fData[i].data->GetMarkerColor());
3450 fData[i].dataFourierIm->SetLineColor(
fData[i].data->GetLineColor());
3451 fData[i].dataFourierPwr->SetMarkerColor(
fData[i].data->GetMarkerColor());
3452 fData[i].dataFourierPwr->SetLineColor(
fData[i].data->GetLineColor());
3453 fData[i].dataFourierPhase->SetMarkerColor(
fData[i].data->GetMarkerColor());
3454 fData[i].dataFourierPhase->SetLineColor(
fData[i].data->GetLineColor());
3457 fData[i].dataFourierRe->SetMarkerSize(1);
3458 fData[i].dataFourierIm->SetMarkerSize(1);
3459 fData[i].dataFourierPwr->SetMarkerSize(1);
3460 fData[i].dataFourierPhase->SetMarkerSize(1);
3463 fData[i].dataFourierRe->SetMarkerStyle(
fData[i].data->GetMarkerStyle());
3464 fData[i].dataFourierIm->SetMarkerStyle(
fData[i].data->GetMarkerStyle());
3465 fData[i].dataFourierPwr->SetMarkerStyle(
fData[i].data->GetMarkerStyle());
3466 fData[i].dataFourierPhase->SetMarkerStyle(
fData[i].data->GetMarkerStyle());
3468 scale = sqrt(
fData[0].theory->GetBinWidth(1)/(endTime-startTime)*
fData[0].theory->GetBinWidth(1)/
fData[0].data->GetBinWidth(1));
3470 fData[i].theoryFourierRe = fourierTheory[i]->GetRealFourier(scale);
3472 fData[i].theoryFourierIm = fourierTheory[i]->GetImaginaryFourier(scale);
3474 fData[i].theoryFourierPwr = fourierTheory[i]->GetPowerFourier(scale);
3476 fData[i].theoryFourierPhase = fourierTheory[i]->GetPhaseFourier();
3479 fData[i].theoryFourierRe->SetLineColor(
fData[i].theory->GetLineColor());
3480 fData[i].theoryFourierIm->SetLineColor(
fData[i].theory->GetLineColor());
3481 fData[i].theoryFourierPwr->SetLineColor(
fData[i].theory->GetLineColor());
3482 fData[i].theoryFourierPhase->SetLineColor(
fData[i].theory->GetLineColor());
3485 delete fourierData[i];
3486 delete fourierTheory[i];
3495 if (
fFourier.fPhase.size() != 0.0) {
3501 for (UInt_t i=0; i<
fData.size(); i++) {
3503 cp = TMath::Cos(
fFourier.fPhase[0]/180.0*TMath::Pi());
3504 sp = TMath::Sin(
fFourier.fPhase[0]/180.0*TMath::Pi());
3506 cp = TMath::Cos(
fFourier.fPhase[i]/180.0*TMath::Pi());
3507 sp = TMath::Sin(
fFourier.fPhase[i]/180.0*TMath::Pi());
3509 if ((
fData[i].dataFourierRe !=
nullptr) && (
fData[i].dataFourierIm !=
nullptr)) {
3510 for (Int_t j=0; j<
fData[i].dataFourierRe->GetNbinsX(); j++) {
3512 re =
fData[i].dataFourierRe->GetBinContent(j) * cp +
fData[i].dataFourierIm->GetBinContent(j) * sp;
3513 im =
fData[i].dataFourierIm->GetBinContent(j) * cp -
fData[i].dataFourierRe->GetBinContent(j) * sp;
3515 fData[i].dataFourierRe->SetBinContent(j, re);
3516 fData[i].dataFourierIm->SetBinContent(j, im);
3519 if ((
fData[i].theoryFourierRe !=
nullptr) && (
fData[i].theoryFourierIm !=
nullptr)) {
3520 for (Int_t j=0; j<
fData[i].theoryFourierRe->GetNbinsX(); j++) {
3522 re =
fData[i].theoryFourierRe->GetBinContent(j) * cp +
fData[i].theoryFourierIm->GetBinContent(j) * sp;
3523 im =
fData[i].theoryFourierIm->GetBinContent(j) * cp -
fData[i].theoryFourierRe->GetBinContent(j) * sp;
3525 fData[i].theoryFourierRe->SetBinContent(j, re);
3526 fData[i].theoryFourierIm->SetBinContent(j, im);
3549 if (
fData[0].diffFourierRe ==
nullptr) {
3551 if (
fData[0].diff ==
nullptr)
3557 double startTime =
fHistoFrame->GetBinCenter(bin);
3563 std::vector<PFourier*> fourierData(
fData.size(),
nullptr);
3564 for (UInt_t i=0; i<
fData.size(); i++) {
3566 if (!fourierData[i]->
IsValid()) {
3567 std::cerr << std::endl <<
">> PMusrCanvas::HandleFourier(): **SEVERE ERROR** couldn't invoke PFourier to calculate the Fourier diff ..." << std::endl;
3568 for (
auto *ft : fourierData)
delete ft;
3575 Int_t noOfFT =
static_cast<Int_t
>(
fData.size());
3577 Int_t chunk = noOfFT/omp_get_num_procs();
3580 #pragma omp parallel for default(shared) schedule(dynamic,chunk)
3582 for (Int_t i=0; i<noOfFT; i++) {
3583 fourierData[i]->Transform(
fFourier.fApodization);
3588 for (UInt_t i=0; i<
fData.size(); i++) {
3590 scale = sqrt(
fData[0].diff->GetBinWidth(1)/(endTime-startTime));
3592 fData[i].diffFourierRe = fourierData[i]->GetRealFourier(scale);
3594 fData[i].diffFourierIm = fourierData[i]->GetImaginaryFourier(scale);
3596 fData[i].diffFourierPwr = fourierData[i]->GetPowerFourier(scale);
3598 fData[i].diffFourierPhase = fourierData[i]->GetPhaseFourier();
3601 fData[i].diffFourierRe->SetMarkerColor(
fData[i].diff->GetMarkerColor());
3602 fData[i].diffFourierRe->SetLineColor(
fData[i].diff->GetLineColor());
3603 fData[i].diffFourierIm->SetMarkerColor(
fData[i].diff->GetMarkerColor());
3604 fData[i].diffFourierIm->SetLineColor(
fData[i].diff->GetLineColor());
3605 fData[i].diffFourierPwr->SetMarkerColor(
fData[i].diff->GetMarkerColor());
3606 fData[i].diffFourierPwr->SetLineColor(
fData[i].diff->GetLineColor());
3607 fData[i].diffFourierPhase->SetMarkerColor(
fData[i].diff->GetMarkerColor());
3608 fData[i].diffFourierPhase->SetLineColor(
fData[i].diff->GetLineColor());
3611 fData[i].diffFourierRe->SetMarkerSize(1);
3612 fData[i].diffFourierIm->SetMarkerSize(1);
3613 fData[i].diffFourierPwr->SetMarkerSize(1);
3614 fData[i].diffFourierPhase->SetMarkerSize(1);
3616 fData[i].diffFourierRe->SetMarkerStyle(
fData[i].diff->GetMarkerStyle());
3617 fData[i].diffFourierIm->SetMarkerStyle(
fData[i].diff->GetMarkerStyle());
3618 fData[i].diffFourierPwr->SetMarkerStyle(
fData[i].diff->GetMarkerStyle());
3619 fData[i].diffFourierPhase->SetMarkerStyle(
fData[i].diff->GetMarkerStyle());
3622 fData[i].diffFourierTag = 1;
3625 delete fourierData[i];
3629 if (
fFourier.fPhase.size() != 0.0) {
3636 for (UInt_t i=0; i<
fData.size(); i++) {
3637 if ((
fData[i].diffFourierRe !=
nullptr) && (
fData[i].diffFourierIm !=
nullptr)) {
3639 cp = TMath::Cos(
fFourier.fPhase[0]/180.0*TMath::Pi());
3640 sp = TMath::Sin(
fFourier.fPhase[0]/180.0*TMath::Pi());
3642 cp = TMath::Cos(
fFourier.fPhase[i]/180.0*TMath::Pi());
3643 sp = TMath::Sin(
fFourier.fPhase[i]/180.0*TMath::Pi());
3645 for (Int_t j=0; j<
fData[i].diffFourierRe->GetNbinsX(); j++) {
3647 re =
fData[i].diffFourierRe->GetBinContent(j) * cp +
fData[i].diffFourierIm->GetBinContent(j) * sp;
3648 im =
fData[i].diffFourierIm->GetBinContent(j) * cp -
fData[i].diffFourierRe->GetBinContent(j) * sp;
3650 fData[i].diffFourierRe->SetBinContent(j, re);
3651 fData[i].diffFourierIm->SetBinContent(j, im);
3674 if (
fData[0].diffFourierRe ==
nullptr) {
3676 Double_t dval, dvalx;
3679 for (UInt_t i=0; i<
fData.size(); i++) {
3682 name = TString(
fData[i].dataFourierRe->GetTitle()) +
"_diff";
3683 fData[i].diffFourierRe =
new TH1F(name, name,
fData[i].dataFourierRe->GetNbinsX(),
3684 fData[i].dataFourierRe->GetXaxis()->GetXmin(),
3685 fData[i].dataFourierRe->GetXaxis()->GetXmax());
3688 name = TString(
fData[i].dataFourierIm->GetTitle()) +
"_diff";
3689 fData[i].diffFourierIm =
new TH1F(name, name,
fData[i].dataFourierIm->GetNbinsX(),
3690 fData[i].dataFourierIm->GetXaxis()->GetXmin(),
3691 fData[i].dataFourierIm->GetXaxis()->GetXmax());
3693 name = TString(
fData[i].dataFourierPwr->GetTitle()) +
"_diff";
3694 fData[i].diffFourierPwr =
new TH1F(name, name,
fData[i].dataFourierPwr->GetNbinsX(),
3695 fData[i].dataFourierPwr->GetXaxis()->GetXmin(),
3696 fData[i].dataFourierPwr->GetXaxis()->GetXmax());
3698 name = TString(
fData[i].dataFourierPhase->GetTitle()) +
"_diff";
3699 fData[i].diffFourierPhase =
new TH1F(name, name,
fData[i].dataFourierPhase->GetNbinsX(),
3700 fData[i].dataFourierPhase->GetXaxis()->GetXmin(),
3701 fData[i].dataFourierPhase->GetXaxis()->GetXmax());
3704 if (
fData[i].dataFourierPhaseOptReal !=
nullptr) {
3705 name = TString(
fData[i].dataFourierPhaseOptReal->GetTitle()) +
"_diff";
3706 fData[i].diffFourierPhaseOptReal =
new TH1F(name, name,
fData[i].dataFourierPhaseOptReal->GetNbinsX(),
3707 fData[i].dataFourierPhaseOptReal->GetXaxis()->GetXmin(),
3708 fData[i].dataFourierPhaseOptReal->GetXaxis()->GetXmax());
3712 for (UInt_t j=1; j<
fData[i].dataFourierRe->GetEntries(); j++) {
3713 dvalx =
fData[i].dataFourierRe->GetXaxis()->GetBinCenter(j);
3714 theoBin =
fData[i].theoryFourierRe->FindBin(dvalx);
3715 dval =
fData[i].dataFourierRe->GetBinContent(j) -
fData[i].theoryFourierRe->GetBinContent(theoBin);
3716 fData[i].diffFourierRe->SetBinContent(j, dval);
3717 dvalx =
fData[i].dataFourierIm->GetXaxis()->GetBinCenter(j);
3718 theoBin =
fData[i].theoryFourierIm->FindBin(dvalx);
3719 dval =
fData[i].dataFourierIm->GetBinContent(j) -
fData[i].theoryFourierIm->GetBinContent(theoBin);
3720 fData[i].diffFourierIm->SetBinContent(j, dval);
3721 dvalx =
fData[i].dataFourierPwr->GetXaxis()->GetBinCenter(j);
3722 theoBin =
fData[i].theoryFourierPwr->FindBin(dvalx);
3723 dval =
fData[i].dataFourierPwr->GetBinContent(j) -
fData[i].theoryFourierPwr->GetBinContent(theoBin);
3724 fData[i].diffFourierPwr->SetBinContent(j, dval);
3725 dvalx =
fData[i].dataFourierPhase->GetXaxis()->GetBinCenter(j);
3726 theoBin =
fData[i].theoryFourierPhase->FindBin(dvalx);
3727 dval =
fData[i].dataFourierPhase->GetBinContent(j) -
fData[i].theoryFourierPhase->GetBinContent(theoBin);
3728 fData[i].diffFourierPhase->SetBinContent(j, dval);
3729 if (
fData[i].dataFourierPhaseOptReal !=
nullptr) {
3730 dvalx =
fData[i].dataFourierPhaseOptReal->GetXaxis()->GetBinCenter(j);
3731 theoBin =
fData[i].theoryFourierPhaseOptReal->FindBin(dvalx);
3732 dval =
fData[i].dataFourierPhaseOptReal->GetBinContent(j) -
fData[i].theoryFourierPhaseOptReal->GetBinContent(theoBin);
3733 fData[i].diffFourierPhaseOptReal->SetBinContent(j, dval);
3738 for (UInt_t i=0; i<
fData.size(); i++) {
3740 fData[i].diffFourierRe->SetMarkerColor(
fData[i].dataFourierRe->GetMarkerColor());
3741 fData[i].diffFourierRe->SetLineColor(
fData[i].dataFourierRe->GetLineColor());
3742 fData[i].diffFourierIm->SetMarkerColor(
fData[i].dataFourierIm->GetMarkerColor());
3743 fData[i].diffFourierIm->SetLineColor(
fData[i].dataFourierIm->GetLineColor());
3744 fData[i].diffFourierPwr->SetMarkerColor(
fData[i].dataFourierPwr->GetMarkerColor());
3745 fData[i].diffFourierPwr->SetLineColor(
fData[i].dataFourierPwr->GetLineColor());
3746 fData[i].diffFourierPhase->SetMarkerColor(
fData[i].dataFourierPhase->GetMarkerColor());
3747 fData[i].diffFourierPhase->SetLineColor(
fData[i].dataFourierPhase->GetLineColor());
3748 if (
fData[i].dataFourierPhaseOptReal !=
nullptr) {
3749 fData[i].diffFourierPhaseOptReal->SetMarkerColor(
fData[i].dataFourierPhaseOptReal->GetMarkerColor());
3750 fData[i].diffFourierPhaseOptReal->SetLineColor(
fData[i].dataFourierPhaseOptReal->GetLineColor());
3754 fData[i].diffFourierRe->SetMarkerSize(1);
3755 fData[i].diffFourierIm->SetMarkerSize(1);
3756 fData[i].diffFourierPwr->SetMarkerSize(1);
3757 fData[i].diffFourierPhase->SetMarkerSize(1);
3758 if (
fData[i].dataFourierPhaseOptReal !=
nullptr) {
3759 fData[i].diffFourierPhaseOptReal->SetMarkerSize(1);
3762 fData[i].diffFourierRe->SetMarkerStyle(
fData[i].dataFourierRe->GetMarkerStyle());
3763 fData[i].diffFourierIm->SetMarkerStyle(
fData[i].dataFourierIm->GetMarkerStyle());
3764 fData[i].diffFourierPwr->SetMarkerStyle(
fData[i].dataFourierPwr->GetMarkerStyle());
3765 fData[i].diffFourierPhase->SetMarkerStyle(
fData[i].dataFourierPhase->GetMarkerStyle());
3766 if (
fData[i].dataFourierPhaseOptReal !=
nullptr) {
3767 fData[i].diffFourierPhaseOptReal->SetMarkerStyle(
fData[i].dataFourierPhaseOptReal->GetMarkerStyle());
3771 fData[i].diffFourierTag = 2;
3797 if (
fData[0].data !=
nullptr) {
3798 name = TString(
fData[0].data->GetTitle()) +
"_avg";
3799 fDataAvg.data =
new TH1F(name, name,
fData[0].data->GetNbinsX(),
3800 fData[0].data->GetXaxis()->GetXmin(),
3801 fData[0].data->GetXaxis()->GetXmax());
3803 if (
fData[0].dataFourierRe !=
nullptr) {
3804 name = TString(
fData[0].dataFourierRe->GetTitle()) +
"_avg";
3805 fDataAvg.dataFourierRe =
new TH1F(name, name,
fData[0].dataFourierRe->GetNbinsX(),
3806 fData[0].dataFourierRe->GetXaxis()->GetXmin(),
3807 fData[0].dataFourierRe->GetXaxis()->GetXmax());
3809 if (
fData[0].dataFourierIm !=
nullptr) {
3810 name = TString(
fData[0].dataFourierIm->GetTitle()) +
"_avg";
3811 fDataAvg.dataFourierIm =
new TH1F(name, name,
fData[0].dataFourierIm->GetNbinsX(),
3812 fData[0].dataFourierIm->GetXaxis()->GetXmin(),
3813 fData[0].dataFourierIm->GetXaxis()->GetXmax());
3815 if (
fData[0].dataFourierPwr !=
nullptr) {
3816 name = TString(
fData[0].dataFourierPwr->GetTitle()) +
"_avg";
3817 fDataAvg.dataFourierPwr =
new TH1F(name, name,
fData[0].dataFourierPwr->GetNbinsX(),
3818 fData[0].dataFourierPwr->GetXaxis()->GetXmin(),
3819 fData[0].dataFourierPwr->GetXaxis()->GetXmax());
3821 if (
fData[0].dataFourierPhase !=
nullptr) {
3822 name = TString(
fData[0].dataFourierPhase->GetTitle()) +
"_avg";
3823 fDataAvg.dataFourierPhase =
new TH1F(name, name,
fData[0].dataFourierPhase->GetNbinsX(),
3824 fData[0].dataFourierPhase->GetXaxis()->GetXmin(),
3825 fData[0].dataFourierPhase->GetXaxis()->GetXmax());
3827 if (
fData[0].dataFourierPhaseOptReal !=
nullptr) {
3828 name = TString(
fData[0].dataFourierPhaseOptReal->GetTitle()) +
"_avg";
3829 fDataAvg.dataFourierPhaseOptReal =
new TH1F(name, name,
fData[0].dataFourierPhaseOptReal->GetNbinsX(),
3830 fData[0].dataFourierPhaseOptReal->GetXaxis()->GetXmin(),
3831 fData[0].dataFourierPhaseOptReal->GetXaxis()->GetXmax());
3833 if (
fData[0].theory !=
nullptr) {
3834 name = TString(
fData[0].theory->GetTitle()) +
"_avg";
3835 fDataAvg.theory =
new TH1F(name, name,
fData[0].theory->GetNbinsX(),
3836 fData[0].theory->GetXaxis()->GetXmin(),
3837 fData[0].theory->GetXaxis()->GetXmax());
3839 if (
fData[0].theoryFourierRe !=
nullptr) {
3840 name = TString(
fData[0].theoryFourierRe->GetTitle()) +
"_avg";
3841 fDataAvg.theoryFourierRe =
new TH1F(name, name,
fData[0].theoryFourierRe->GetNbinsX(),
3842 fData[0].theoryFourierRe->GetXaxis()->GetXmin(),
3843 fData[0].theoryFourierRe->GetXaxis()->GetXmax());
3845 if (
fData[0].theoryFourierIm !=
nullptr) {
3846 name = TString(
fData[0].theoryFourierIm->GetTitle()) +
"_avg";
3847 fDataAvg.theoryFourierIm =
new TH1F(name, name,
fData[0].theoryFourierIm->GetNbinsX(),
3848 fData[0].theoryFourierIm->GetXaxis()->GetXmin(),
3849 fData[0].theoryFourierIm->GetXaxis()->GetXmax());
3851 if (
fData[0].theoryFourierPwr !=
nullptr) {
3852 name = TString(
fData[0].theoryFourierPwr->GetTitle()) +
"_avg";
3853 fDataAvg.theoryFourierPwr =
new TH1F(name, name,
fData[0].theoryFourierPwr->GetNbinsX(),
3854 fData[0].theoryFourierPwr->GetXaxis()->GetXmin(),
3855 fData[0].theoryFourierPwr->GetXaxis()->GetXmax());
3857 if (
fData[0].theoryFourierPhase !=
nullptr) {
3858 name = TString(
fData[0].theoryFourierPhase->GetTitle()) +
"_avg";
3859 fDataAvg.theoryFourierPhase =
new TH1F(name, name,
fData[0].theoryFourierPhase->GetNbinsX(),
3860 fData[0].theoryFourierPhase->GetXaxis()->GetXmin(),
3861 fData[0].theoryFourierPhase->GetXaxis()->GetXmax());
3863 if (
fData[0].theoryFourierPhaseOptReal !=
nullptr) {
3864 name = TString(
fData[0].theoryFourierPhaseOptReal->GetTitle()) +
"_avg";
3865 fDataAvg.theoryFourierPhaseOptReal =
new TH1F(name, name,
fData[0].theoryFourierPhaseOptReal->GetNbinsX(),
3866 fData[0].theoryFourierPhaseOptReal->GetXaxis()->GetXmin(),
3867 fData[0].theoryFourierPhaseOptReal->GetXaxis()->GetXmax());
3869 if (
fData[0].diff !=
nullptr) {
3870 name = TString(
fData[0].diff->GetTitle()) +
"_avg";
3871 fDataAvg.diff =
new TH1F(name, name,
fData[0].diff->GetNbinsX(),
3872 fData[0].diff->GetXaxis()->GetXmin(),
3873 fData[0].diff->GetXaxis()->GetXmax());
3875 if (
fData[0].diffFourierRe !=
nullptr) {
3876 name = TString(
fData[0].diffFourierRe->GetTitle()) +
"_avg";
3877 fDataAvg.diffFourierRe =
new TH1F(name, name,
fData[0].diffFourierRe->GetNbinsX(),
3878 fData[0].diffFourierRe->GetXaxis()->GetXmin(),
3879 fData[0].diffFourierRe->GetXaxis()->GetXmax());
3881 if (
fData[0].diffFourierIm !=
nullptr) {
3882 name = TString(
fData[0].diffFourierIm->GetTitle()) +
"_avg";
3883 fDataAvg.diffFourierIm =
new TH1F(name, name,
fData[0].diffFourierIm->GetNbinsX(),
3884 fData[0].diffFourierIm->GetXaxis()->GetXmin(),
3885 fData[0].diffFourierIm->GetXaxis()->GetXmax());
3887 if (
fData[0].diffFourierPwr !=
nullptr) {
3888 name = TString(
fData[0].diffFourierPwr->GetTitle()) +
"_avg";
3889 fDataAvg.diffFourierPwr =
new TH1F(name, name,
fData[0].diffFourierPwr->GetNbinsX(),
3890 fData[0].diffFourierPwr->GetXaxis()->GetXmin(),
3891 fData[0].diffFourierPwr->GetXaxis()->GetXmax());
3893 if (
fData[0].diffFourierPhase !=
nullptr) {
3894 name = TString(
fData[0].diffFourierPhase->GetTitle()) +
"_avg";
3895 fDataAvg.diffFourierPhase =
new TH1F(name, name,
fData[0].diffFourierPhase->GetNbinsX(),
3896 fData[0].diffFourierPhase->GetXaxis()->GetXmin(),
3897 fData[0].diffFourierPhase->GetXaxis()->GetXmax());
3899 if (
fData[0].diffFourierPhaseOptReal !=
nullptr) {
3900 name = TString(
fData[0].diffFourierPhaseOptReal->GetTitle()) +
"_avg";
3901 fDataAvg.diffFourierPhaseOptReal =
new TH1F(name, name,
fData[0].diffFourierPhaseOptReal->GetNbinsX(),
3902 fData[0].diffFourierPhaseOptReal->GetXaxis()->GetXmin(),
3903 fData[0].diffFourierPhaseOptReal->GetXaxis()->GetXmax());
3909 for (Int_t i=0; i<
fData[0].data->GetNbinsX(); i++) {
3911 for (UInt_t j=0; j<
fData.size(); j++) {
3917 fDataAvg.data->SetMarkerColor(
fData[0].data->GetMarkerColor());
3919 fDataAvg.data->SetMarkerSize(
fData[0].data->GetMarkerSize());
3920 fDataAvg.data->SetMarkerStyle(
fData[0].data->GetMarkerStyle());
3922 if (
fDataAvg.dataFourierRe !=
nullptr) {
3923 for (Int_t i=0; i<
fData[0].dataFourierRe->GetNbinsX(); i++) {
3925 for (UInt_t j=0; j<
fData.size(); j++) {
3928 fDataAvg.dataFourierRe->SetBinContent(i, dval/
fData.size());
3931 fDataAvg.dataFourierRe->SetMarkerColor(
fData[0].dataFourierRe->GetMarkerColor());
3932 fDataAvg.dataFourierRe->SetLineColor(
fData[0].dataFourierRe->GetLineColor());
3933 fDataAvg.dataFourierRe->SetMarkerSize(
fData[0].dataFourierRe->GetMarkerSize());
3934 fDataAvg.dataFourierRe->SetMarkerStyle(
fData[0].dataFourierRe->GetMarkerStyle());
3936 if (
fDataAvg.dataFourierIm !=
nullptr) {
3937 for (Int_t i=0; i<
fData[0].dataFourierIm->GetNbinsX(); i++) {
3939 for (UInt_t j=0; j<
fData.size(); j++) {
3942 fDataAvg.dataFourierIm->SetBinContent(i, dval/
fData.size());
3945 fDataAvg.dataFourierIm->SetMarkerColor(
fData[0].dataFourierIm->GetMarkerColor());
3946 fDataAvg.dataFourierIm->SetLineColor(
fData[0].dataFourierIm->GetLineColor());
3947 fDataAvg.dataFourierIm->SetMarkerSize(
fData[0].dataFourierIm->GetMarkerSize());
3948 fDataAvg.dataFourierIm->SetMarkerStyle(
fData[0].dataFourierIm->GetMarkerStyle());
3950 if (
fDataAvg.dataFourierPwr !=
nullptr) {
3951 for (Int_t i=0; i<
fData[0].dataFourierPwr->GetNbinsX(); i++) {
3953 for (UInt_t j=0; j<
fData.size(); j++) {
3956 fDataAvg.dataFourierPwr->SetBinContent(i, dval/
fData.size());
3959 fDataAvg.dataFourierPwr->SetMarkerColor(
fData[0].dataFourierPwr->GetMarkerColor());
3960 fDataAvg.dataFourierPwr->SetLineColor(
fData[0].dataFourierPwr->GetLineColor());
3961 fDataAvg.dataFourierPwr->SetMarkerSize(
fData[0].dataFourierPwr->GetMarkerSize());
3962 fDataAvg.dataFourierPwr->SetMarkerStyle(
fData[0].dataFourierPwr->GetMarkerStyle());
3964 if (
fDataAvg.dataFourierPhase !=
nullptr) {
3965 for (Int_t i=0; i<
fData[0].dataFourierPhase->GetNbinsX(); i++) {
3967 for (UInt_t j=0; j<
fData.size(); j++) {
3970 fDataAvg.dataFourierPhase->SetBinContent(i, dval/
fData.size());
3973 fDataAvg.dataFourierPhase->SetMarkerColor(
fData[0].dataFourierPhase->GetMarkerColor());
3974 fDataAvg.dataFourierPhase->SetLineColor(
fData[0].dataFourierPhase->GetLineColor());
3975 fDataAvg.dataFourierPhase->SetMarkerSize(
fData[0].dataFourierPhase->GetMarkerSize());
3976 fDataAvg.dataFourierPhase->SetMarkerStyle(
fData[0].dataFourierPhase->GetMarkerStyle());
3978 if (
fDataAvg.dataFourierPhaseOptReal !=
nullptr) {
3979 for (Int_t i=0; i<
fData[0].dataFourierPhaseOptReal->GetNbinsX(); i++) {
3981 for (UInt_t j=0; j<
fData.size(); j++) {
3984 fDataAvg.dataFourierPhaseOptReal->SetBinContent(i, dval/
fData.size());
3987 fDataAvg.dataFourierPhaseOptReal->SetMarkerColor(
fData[0].dataFourierPhaseOptReal->GetMarkerColor());
3988 fDataAvg.dataFourierPhaseOptReal->SetLineColor(
fData[0].dataFourierPhaseOptReal->GetLineColor());
3989 fDataAvg.dataFourierPhaseOptReal->SetMarkerSize(
fData[0].dataFourierPhaseOptReal->GetMarkerSize());
3990 fDataAvg.dataFourierPhaseOptReal->SetMarkerStyle(
fData[0].dataFourierPhaseOptReal->GetMarkerStyle());
3993 for (Int_t i=0; i<
fData[0].theory->GetNbinsX(); i++) {
3995 for (UInt_t j=0; j<
fData.size(); j++) {
4000 fDataAvg.theory->SetLineColor(
fData[0].theory->GetLineColor());
4002 if (
fDataAvg.theoryFourierRe !=
nullptr) {
4003 for (Int_t i=0; i<
fData[0].theoryFourierRe->GetNbinsX(); i++) {
4005 for (UInt_t j=0; j<
fData.size(); j++) {
4008 fDataAvg.theoryFourierRe->SetBinContent(i, dval/
fData.size());
4011 fDataAvg.theoryFourierRe->SetMarkerColor(
fData[0].theoryFourierRe->GetMarkerColor());
4012 fDataAvg.theoryFourierRe->SetLineColor(
fData[0].theoryFourierRe->GetLineColor());
4013 fDataAvg.theoryFourierRe->SetMarkerSize(
fData[0].theoryFourierRe->GetMarkerSize());
4014 fDataAvg.theoryFourierRe->SetMarkerStyle(
fData[0].theoryFourierRe->GetMarkerStyle());
4016 if (
fDataAvg.theoryFourierIm !=
nullptr) {
4017 for (Int_t i=0; i<
fData[0].theoryFourierIm->GetNbinsX(); i++) {
4019 for (UInt_t j=0; j<
fData.size(); j++) {
4022 fDataAvg.theoryFourierIm->SetBinContent(i, dval/
fData.size());
4025 fDataAvg.theoryFourierIm->SetMarkerColor(
fData[0].theoryFourierIm->GetMarkerColor());
4026 fDataAvg.theoryFourierIm->SetLineColor(
fData[0].theoryFourierIm->GetLineColor());
4027 fDataAvg.theoryFourierIm->SetMarkerSize(
fData[0].theoryFourierIm->GetMarkerSize());
4028 fDataAvg.theoryFourierIm->SetMarkerStyle(
fData[0].theoryFourierIm->GetMarkerStyle());
4030 if (
fDataAvg.theoryFourierPwr !=
nullptr) {
4031 for (Int_t i=0; i<
fData[0].theoryFourierPwr->GetNbinsX(); i++) {
4033 for (UInt_t j=0; j<
fData.size(); j++) {
4036 fDataAvg.theoryFourierPwr->SetBinContent(i, dval/
fData.size());
4039 fDataAvg.theoryFourierPwr->SetMarkerColor(
fData[0].theoryFourierPwr->GetMarkerColor());
4040 fDataAvg.theoryFourierPwr->SetLineColor(
fData[0].theoryFourierPwr->GetLineColor());
4041 fDataAvg.theoryFourierPwr->SetMarkerSize(
fData[0].theoryFourierPwr->GetMarkerSize());
4042 fDataAvg.theoryFourierPwr->SetMarkerStyle(
fData[0].theoryFourierPwr->GetMarkerStyle());
4044 if (
fDataAvg.theoryFourierPhase !=
nullptr) {
4045 for (Int_t i=0; i<
fData[0].theoryFourierPhase->GetNbinsX(); i++) {
4047 for (UInt_t j=0; j<
fData.size(); j++) {
4050 fDataAvg.theoryFourierPhase->SetBinContent(i, dval/
fData.size());
4053 fDataAvg.theoryFourierPhase->SetMarkerColor(
fData[0].theoryFourierPhase->GetMarkerColor());
4054 fDataAvg.theoryFourierPhase->SetLineColor(
fData[0].theoryFourierPhase->GetLineColor());
4055 fDataAvg.theoryFourierPhase->SetMarkerSize(
fData[0].theoryFourierPhase->GetMarkerSize());
4056 fDataAvg.theoryFourierPhase->SetMarkerStyle(
fData[0].theoryFourierPhase->GetMarkerStyle());
4058 if (
fDataAvg.theoryFourierPhaseOptReal !=
nullptr) {
4059 for (Int_t i=0; i<
fData[0].theoryFourierPhaseOptReal->GetNbinsX(); i++) {
4061 for (UInt_t j=0; j<
fData.size(); j++) {
4064 fDataAvg.theoryFourierPhaseOptReal->SetBinContent(i, dval/
fData.size());
4067 fDataAvg.theoryFourierPhaseOptReal->SetMarkerColor(
fData[0].theoryFourierPhaseOptReal->GetMarkerColor());
4068 fDataAvg.theoryFourierPhaseOptReal->SetLineColor(
fData[0].theoryFourierPhaseOptReal->GetLineColor());
4069 fDataAvg.theoryFourierPhaseOptReal->SetMarkerSize(
fData[0].theoryFourierPhaseOptReal->GetMarkerSize());
4070 fDataAvg.theoryFourierPhaseOptReal->SetMarkerStyle(
fData[0].theoryFourierPhaseOptReal->GetMarkerStyle());
4073 for (Int_t i=0; i<
fData[0].diff->GetNbinsX(); i++) {
4075 for (UInt_t j=0; j<
fData.size(); j++) {
4081 fDataAvg.diff->SetMarkerColor(
fData[0].diff->GetMarkerColor());
4083 fDataAvg.diff->SetMarkerSize(
fData[0].diff->GetMarkerSize());
4084 fDataAvg.diff->SetMarkerStyle(
fData[0].diff->GetMarkerStyle());
4086 if (
fDataAvg.diffFourierRe !=
nullptr) {
4087 for (Int_t i=0; i<
fData[0].diffFourierRe->GetNbinsX(); i++) {
4089 for (UInt_t j=0; j<
fData.size(); j++) {
4092 fDataAvg.diffFourierRe->SetBinContent(i, dval/
fData.size());
4095 fDataAvg.diffFourierRe->SetMarkerColor(
fData[0].diffFourierRe->GetMarkerColor());
4096 fDataAvg.diffFourierRe->SetLineColor(
fData[0].diffFourierRe->GetLineColor());
4097 fDataAvg.diffFourierRe->SetMarkerSize(
fData[0].diffFourierRe->GetMarkerSize());
4098 fDataAvg.diffFourierRe->SetMarkerStyle(
fData[0].diffFourierRe->GetMarkerStyle());
4100 if (
fDataAvg.diffFourierIm !=
nullptr) {
4101 for (Int_t i=0; i<
fData[0].diffFourierIm->GetNbinsX(); i++) {
4103 for (UInt_t j=0; j<
fData.size(); j++) {
4106 fDataAvg.diffFourierIm->SetBinContent(i, dval/
fData.size());
4109 fDataAvg.diffFourierIm->SetMarkerColor(
fData[0].diffFourierIm->GetMarkerColor());
4110 fDataAvg.diffFourierIm->SetLineColor(
fData[0].diffFourierIm->GetLineColor());
4111 fDataAvg.diffFourierIm->SetMarkerSize(
fData[0].diffFourierIm->GetMarkerSize());
4112 fDataAvg.diffFourierIm->SetMarkerStyle(
fData[0].diffFourierIm->GetMarkerStyle());
4114 if (
fDataAvg.diffFourierPwr !=
nullptr) {
4115 for (Int_t i=0; i<
fData[0].diffFourierPwr->GetNbinsX(); i++) {
4117 for (UInt_t j=0; j<
fData.size(); j++) {
4120 fDataAvg.diffFourierPwr->SetBinContent(i, dval/
fData.size());
4123 fDataAvg.diffFourierPwr->SetMarkerColor(
fData[0].diffFourierPwr->GetMarkerColor());
4124 fDataAvg.diffFourierPwr->SetLineColor(
fData[0].diffFourierPwr->GetLineColor());
4125 fDataAvg.diffFourierPwr->SetMarkerSize(
fData[0].diffFourierPwr->GetMarkerSize());
4126 fDataAvg.diffFourierPwr->SetMarkerStyle(
fData[0].diffFourierPwr->GetMarkerStyle());
4128 if (
fDataAvg.diffFourierPhase !=
nullptr) {
4129 for (Int_t i=0; i<
fData[0].diffFourierPhase->GetNbinsX(); i++) {
4131 for (UInt_t j=0; j<
fData.size(); j++) {
4134 fDataAvg.diffFourierPhase->SetBinContent(i, dval/
fData.size());
4137 fDataAvg.diffFourierPhase->SetMarkerColor(
fData[0].diffFourierPhase->GetMarkerColor());
4138 fDataAvg.diffFourierPhase->SetLineColor(
fData[0].diffFourierPhase->GetLineColor());
4139 fDataAvg.diffFourierPhase->SetMarkerSize(
fData[0].diffFourierPhase->GetMarkerSize());
4140 fDataAvg.diffFourierPhase->SetMarkerStyle(
fData[0].diffFourierPhase->GetMarkerStyle());
4142 if (
fDataAvg.diffFourierPhaseOptReal !=
nullptr) {
4143 for (Int_t i=0; i<
fData[0].diffFourierPhaseOptReal->GetNbinsX(); i++) {
4145 for (UInt_t j=0; j<
fData.size(); j++) {
4148 fDataAvg.diffFourierPhaseOptReal->SetBinContent(i, dval/
fData.size());
4151 fDataAvg.diffFourierPhaseOptReal->SetMarkerColor(
fData[0].dataFourierPhaseOptReal->GetMarkerColor());
4152 fDataAvg.diffFourierPhaseOptReal->SetLineColor(
fData[0].dataFourierPhaseOptReal->GetLineColor());
4153 fDataAvg.diffFourierPhaseOptReal->SetMarkerSize(
fData[0].dataFourierPhaseOptReal->GetMarkerSize());
4154 fDataAvg.diffFourierPhaseOptReal->SetMarkerStyle(
fData[0].dataFourierPhaseOptReal->GetMarkerStyle());
4166 for (UInt_t i=0; i<
fData.size(); i++) {
4167 if (
fData[i].diff !=
nullptr) {
4168 delete fData[i].diff;
4169 fData[i].diff =
nullptr;
4182 for (UInt_t i=0; i<
fData.size(); i++) {
4183 if (
fData[i].dataFourierRe !=
nullptr) {
4184 delete fData[i].dataFourierRe;
4185 fData[i].dataFourierRe =
nullptr;
4187 if (
fData[i].dataFourierIm !=
nullptr) {
4188 delete fData[i].dataFourierIm;
4189 fData[i].dataFourierIm =
nullptr;
4191 if (
fData[i].dataFourierPwr !=
nullptr) {
4192 delete fData[i].dataFourierPwr;
4193 fData[i].dataFourierPwr =
nullptr;
4195 if (
fData[i].dataFourierPhase !=
nullptr) {
4196 delete fData[i].dataFourierPhase;
4197 fData[i].dataFourierPhase =
nullptr;
4199 if (
fData[i].dataFourierPhaseOptReal !=
nullptr) {
4200 delete fData[i].dataFourierPhaseOptReal;
4201 fData[i].dataFourierPhaseOptReal =
nullptr;
4203 if (
fData[i].theoryFourierRe !=
nullptr) {
4204 delete fData[i].theoryFourierRe;
4205 fData[i].theoryFourierRe =
nullptr;
4207 if (
fData[i].theoryFourierIm !=
nullptr) {
4208 delete fData[i].theoryFourierIm;
4209 fData[i].theoryFourierIm =
nullptr;
4211 if (
fData[i].theoryFourierPwr !=
nullptr) {
4212 delete fData[i].theoryFourierPwr;
4213 fData[i].theoryFourierPwr =
nullptr;
4215 if (
fData[i].theoryFourierPhase !=
nullptr) {
4216 delete fData[i].theoryFourierPhase;
4217 fData[i].theoryFourierPhase =
nullptr;
4219 if (
fData[i].theoryFourierPhaseOptReal !=
nullptr) {
4220 delete fData[i].theoryFourierPhaseOptReal;
4221 fData[i].theoryFourierPhaseOptReal =
nullptr;
4234 for (UInt_t i=0; i<
fData.size(); i++) {
4235 if (
fData[i].diffFourierRe !=
nullptr) {
4236 delete fData[i].diffFourierRe;
4237 fData[i].diffFourierRe =
nullptr;
4239 if (
fData[i].diffFourierIm !=
nullptr) {
4240 delete fData[i].diffFourierIm;
4241 fData[i].diffFourierIm =
nullptr;
4243 if (
fData[i].diffFourierPwr !=
nullptr) {
4244 delete fData[i].diffFourierPwr;
4245 fData[i].diffFourierPwr =
nullptr;
4247 if (
fData[i].diffFourierPhase !=
nullptr) {
4248 delete fData[i].diffFourierPhase;
4249 fData[i].diffFourierPhase =
nullptr;
4251 if (
fData[i].diffFourierPhaseOptReal !=
nullptr) {
4252 delete fData[i].diffFourierPhaseOptReal;
4253 fData[i].diffFourierPhaseOptReal =
nullptr;
4270 if (
fDataAvg.dataFourierRe !=
nullptr) {
4274 if (
fDataAvg.dataFourierIm !=
nullptr) {
4278 if (
fDataAvg.dataFourierPwr !=
nullptr) {
4282 if (
fDataAvg.dataFourierPhase !=
nullptr) {
4284 fDataAvg.dataFourierPhase =
nullptr;
4286 if (
fDataAvg.dataFourierPhaseOptReal !=
nullptr) {
4287 delete fDataAvg.dataFourierPhaseOptReal;
4288 fDataAvg.dataFourierPhaseOptReal =
nullptr;
4294 if (
fDataAvg.theoryFourierRe !=
nullptr) {
4296 fDataAvg.theoryFourierRe =
nullptr;
4298 if (
fDataAvg.theoryFourierIm !=
nullptr) {
4300 fDataAvg.theoryFourierIm =
nullptr;
4302 if (
fDataAvg.theoryFourierPwr !=
nullptr) {
4304 fDataAvg.theoryFourierPwr =
nullptr;
4306 if (
fDataAvg.theoryFourierPhase !=
nullptr) {
4307 delete fDataAvg.theoryFourierPhase;
4308 fDataAvg.theoryFourierPhase =
nullptr;
4310 if (
fDataAvg.theoryFourierPhaseOptReal !=
nullptr) {
4311 delete fDataAvg.theoryFourierPhaseOptReal;
4312 fDataAvg.theoryFourierPhaseOptReal =
nullptr;
4318 if (
fDataAvg.diffFourierRe !=
nullptr) {
4322 if (
fDataAvg.diffFourierIm !=
nullptr) {
4326 if (
fDataAvg.diffFourierPwr !=
nullptr) {
4330 if (
fDataAvg.diffFourierPhase !=
nullptr) {
4332 fDataAvg.diffFourierPhase =
nullptr;
4334 if (
fDataAvg.diffFourierPhaseOptReal !=
nullptr) {
4335 delete fDataAvg.diffFourierPhaseOptReal;
4336 fDataAvg.diffFourierPhaseOptReal =
nullptr;
4348 Double_t min =
fMsrHandler->GetMsrFourierList()->fRangeForPhaseCorrection[0];
4349 Double_t max =
fMsrHandler->GetMsrFourierList()->fRangeForPhaseCorrection[1];
4351 if ((min == -1.0) && (max == -1.0)) {
4356 min =
fData[0].dataFourierRe->GetBinLowEdge(1);
4357 max =
fData[0].dataFourierRe->GetBinLowEdge(
fData[0].dataFourierRe->GetNbinsX())+
fData[0].dataFourierRe->GetBinWidth(1);
4365 for (UInt_t i=0; i<
fData.size(); i++) {
4368 phaseParam, 1.0, min, max);
4370 fData[i].dataFourierPhaseOptReal->SetMarkerColor(
fData[i].data->GetMarkerColor());
4371 fData[i].dataFourierPhaseOptReal->SetLineColor(
fData[i].data->GetLineColor());
4373 fData[i].dataFourierPhaseOptReal->SetMarkerSize(1);
4375 fData[i].dataFourierPhaseOptReal->SetMarkerStyle(
fData[i].data->GetMarkerStyle());
4379 strcpy(hName,
fData[i].theoryFourierPhase->GetName());
4380 strcat(hName,
"_Opt_Real");
4381 fData[i].theoryFourierPhaseOptReal = (TH1F*)
fData[i].theoryFourierRe->Clone(hName);
4385 Int_t minBin =
fData[i].theoryFourierPhaseOptReal->GetXaxis()->FindFixBin(min);
4386 Int_t maxBin =
fData[i].theoryFourierPhaseOptReal->GetXaxis()->FindFixBin(max);
4388 for (Int_t j=1; j<
fData[i].theoryFourierPhaseOptReal->GetNbinsX(); j++) {
4389 ph = phaseParam[0] + phaseParam[1] * (Double_t)(j-minBin+1) / (Double_t)(maxBin-minBin);
4390 re =
fData[i].theoryFourierRe->GetBinContent(j) * cos(ph) -
fData[i].theoryFourierIm->GetBinContent(j) * sin(ph);
4391 fData[i].theoryFourierPhaseOptReal->SetBinContent(j, re);
4394 fData[i].theoryFourierPhaseOptReal->SetLineColor(
fData[i].theory->GetLineColor());
4413 Int_t bin = theo->FindBin(x);
4415 return y - theo->GetBinContent(bin);
4434 Double_t xVal, yVal;
4438 theo->GetPoint(bin, xVal, yVal);
4458 Double_t *xTheo = graph->GetX();
4461 for (i=0; i<graph->GetN(); i++) {
4462 if (*(xTheo+i) >= x) {
4468 if (i == graph->GetN()) {
4491 if (histo ==
nullptr)
4494 Int_t start=0, end=0;
4497 end = histo->GetNbinsX();
4499 start = histo->FindBin(xmin);
4500 if ((start==0) || (start==histo->GetNbinsX()+1))
4502 end = histo->FindBin(xmax);
4503 if ((end==0) || (end==histo->GetNbinsX()+1))
4504 end = histo->GetNbinsX();
4507 Double_t max = histo->GetBinContent(start);
4508 Double_t binContent;
4509 for (Int_t i=start; i<end; i++) {
4510 binContent = histo->GetBinContent(i);
4511 if (max < binContent)
4534 if (histo ==
nullptr)
4537 Int_t start=0, end=0;
4540 end = histo->GetNbinsX();
4542 start = histo->FindBin(xmin);
4543 if ((start==0) || (start==histo->GetNbinsX()+1))
4545 end = histo->FindBin(xmax);
4546 if ((end==0) || (end==histo->GetNbinsX()+1))
4547 end = histo->GetNbinsX();
4550 Double_t min = histo->GetBinContent(start);
4551 Double_t binContent;
4552 for (Int_t i=start; i<end; i++) {
4553 binContent = histo->GetBinContent(i);
4554 if (min > binContent)
4577 if (graph ==
nullptr)
4582 graph->GetPoint(0, x, y);
4584 graph->GetPoint(graph->GetN()-1, x, y);
4588 graph->GetPoint(0, x, y);
4590 for (Int_t i=0; i<graph->GetN(); i++) {
4591 graph->GetPoint(i, x, y);
4592 if ((x >= xmin) && (x <= xmax)) {
4617 if (graph ==
nullptr)
4622 graph->GetPoint(0, x, y);
4624 graph->GetPoint(graph->GetN()-1, x, y);
4628 graph->GetPoint(0, x, y);
4630 for (Int_t i=0; i<graph->GetN(); i++) {
4631 graph->GetPoint(i, x, y);
4632 if ((x >= xmin) && (x <= xmax)) {
4661 Double_t xmin, xmax;
4663 if (
fData.size() > 0) {
4681 Double_t dataXmin=0.0, dataXmax=0.0, dataYmin=0.0, dataYmax=0.0;
4691 for (UInt_t i=1; i<
fData.size(); i++) {
4697 Double_t dd = 0.05*fabs(dataYmax-dataYmin);
4710 for (UInt_t i=1; i<
fData.size(); i++) {
4716 Double_t dd = 0.05*fabs(dataYmax-dataYmin);
4722 dataYmin = 1.0e-4 * dataYmax;
4729 UInt_t noOfPoints = 1000;
4730 for (UInt_t i=0; i<
fData.size(); i++) {
4731 if (
fData[i].data->GetNbinsX() > (Int_t)noOfPoints)
4732 noOfPoints =
fData[i].data->GetNbinsX();
4735 fHistoFrame->SetBins(noOfPoints, dataXmin, dataXmax);
4738 for (UInt_t i=0; i<
fData.size(); i++) {
4739 fData[i].data->GetXaxis()->SetRange(
fData[i].data->FindBin(dataXmin),
fData[i].data->FindBin(dataXmax));
4740 fData[i].data->GetYaxis()->SetRangeUser(dataYmin, dataYmax);
4741 fData[i].theory->GetXaxis()->SetRange(
fData[i].theory->FindBin(dataXmin),
fData[i].theory->FindBin(dataXmax));
4742 fData[i].theory->GetYaxis()->SetRangeUser(dataYmin, dataYmax);
4763 if (runList->at(0).IsLifetimeCorrected()) {
4764 yAxisTitle =
"Asymmetry";
4767 yAxisTitle =
"N(t) per nsec";
4769 yAxisTitle =
"N(t) per bin";
4774 yAxisTitle =
"RRF Asymmetry";
4777 yAxisTitle =
"Asymmetry";
4780 yAxisTitle =
"Asymmetry";
4783 yAxisTitle =
"N(t) per bin";
4790 fHistoFrame->GetYaxis()->SetTitle(yAxisTitle.Data());
4792 for (UInt_t i=0; i<
fData.size(); i++) {
4793 fData[i].data->Draw(
"pesame");
4796 for (UInt_t i=0; i<
fData.size(); i++) {
4797 fData[i].theory->Draw(
"lsame");
4830 UInt_t runNo = (UInt_t)plotInfo.
fRuns[0]-1;
4831 TString xAxisTitle =
fRunList->GetXAxisTitle(*runs[runNo].GetRunName(), runNo);
4832 TString yAxisTitle =
fRunList->GetYAxisTitle(*runs[runNo].GetRunName(), runNo);
4837 Double_t dataXmin=0.0, dataXmax=0.0, dataYmin=0.0, dataYmax=0.0;
4853 Double_t dd = 0.05*fabs(dataYmax-dataYmin);
4872 Double_t dd = 0.05*fabs(dataYmax-dataYmin);
4878 if (dataYmin <= 0.0)
4879 dataYmin = 1.0e-4 * dataYmax;
4891 TGraphErrors *ge =
new TGraphErrors(*(
fNonMusrData[i].data));
4893 ge->SetEditable(
false);
4901 TGraphErrors *ge =
new TGraphErrors(*(
fNonMusrData[i].theory));
4903 ge->SetEditable(
false);
4927 for (UInt_t i=0; i<plotInfo.
fRuns.size(); i++) {
4928 runNo = (UInt_t)plotInfo.
fRuns[i]-1;
4929 xAxisTitle =
fRunList->GetXAxisTitle(*runs[runNo].GetRunName(), runNo);
4930 yAxisTitle =
fRunList->GetYAxisTitle(*runs[runNo].GetRunName(), runNo);
4931 legendLabel.push_back(yAxisTitle +
" vs. " + xAxisTitle);
4936 legendLabel.clear();
4978 Double_t xmin, xmax;
4995 Double_t dataXmin=0.0, dataXmax=0.0, dataYmin=0.0, dataYmax=0.0, dd=0.0;
5001 for (UInt_t i=1; i<
fData.size(); i++) {
5008 dd = 0.05*fabs(dataYmax-dataYmin);
5016 for (UInt_t i=1; i<
fData.size(); i++) {
5023 dd = 0.05*fabs(dataYmax-dataYmin);
5031 UInt_t noOfPoints = 1000;
5032 for (UInt_t i=0; i<
fData.size(); i++) {
5033 if (
fData[i].diff->GetNbinsX() > (Int_t)noOfPoints)
5034 noOfPoints =
fData[i].diff->GetNbinsX();
5037 fHistoFrame->SetBins(noOfPoints, dataXmin, dataXmax);
5051 for (UInt_t i=0; i<
fData.size(); i++) {
5052 fData[i].diff->Draw(
"pesame");
5054 if (
fData[i].dataRange->IsXRangePresent())
5055 fData[i].diff->GetXaxis()->SetRangeUser(
fData[i].dataRange->GetXmin(),
fData[i].dataRange->GetXmax());
5057 fData[i].diff->GetXaxis()->SetRange(
fData[i].diff->FindBin(dataXmin),
fData[i].diff->FindBin(dataXmax));
5059 if (
fData[i].dataRange->IsYRangePresent())
5060 fData[i].diff->GetYaxis()->SetRangeUser(
fData[i].dataRange->GetYmin(),
fData[i].dataRange->GetYmax());
5062 fData[i].diff->GetYaxis()->SetRangeUser(dataYmin, dataYmax);
5095 UInt_t runNo = (UInt_t)plotInfo.
fRuns[0]-1;
5096 TString xAxisTitle =
fRunList->GetXAxisTitle(*runs[runNo].GetRunName(), runNo);
5103 Double_t dataXmin=0.0, dataXmax=0.0, dataYmin=0.0, dataYmax=0.0;
5115 Double_t dd = 0.05*fabs(dataYmax-dataYmin);
5129 Double_t dd = 0.05*fabs(dataYmax-dataYmin);
5139 TGraphErrors *ge =
new TGraphErrors(*(
fNonMusrData[i].diff));
5141 ge->SetEditable(
false);
5189 if (
fData.size() == 0)
5193 TString xAxisTitle(
"");
5195 xAxisTitle = TString(
"Field (G)");
5197 xAxisTitle = TString(
"Field (T)");
5199 xAxisTitle = TString(
"Frequency (MHz)");
5201 xAxisTitle = TString(
"Frequency (Mc/s)");
5203 xAxisTitle = TString(
"??");
5207 Double_t xmin, xmax, ymin, ymax, binContent;
5208 UInt_t noOfPoints = 1000;
5216 xmin =
fData[0].dataFourierRe->GetBinLowEdge(1);
5217 xmax =
fData[0].dataFourierRe->GetBinLowEdge(
fData[0].dataFourierRe->GetNbinsX())+
fData[0].dataFourierRe->GetBinWidth(1);
5225 if (binContent < ymin)
5228 if (binContent > ymax)
5230 for (UInt_t i=1; i<
fData.size(); i++) {
5232 if (binContent < ymin)
5235 if (binContent > ymax)
5238 if (binContent < ymin)
5241 if (binContent > ymax)
5255 for (UInt_t i=0; i<
fData.size(); i++) {
5256 if (
fData[i].dataFourierRe->GetNbinsX() > (Int_t)noOfPoints)
5257 noOfPoints =
fData[i].dataFourierRe->GetNbinsX();
5263 for (UInt_t i=0; i<
fData.size(); i++) {
5264 fData[i].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
5265 fData[i].dataFourierRe->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5266 fData[i].theoryFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
5267 fData[i].theoryFourierRe->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5271 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
5275 fHistoFrame->GetYaxis()->SetTitle(
"Real Fourier");
5278 for (UInt_t i=0; i<
fData.size(); i++) {
5279 fData[i].dataFourierRe->Draw(
"psame");
5283 for (UInt_t i=0; i<
fData.size(); i++) {
5284 fData[i].theoryFourierRe->Draw(
"same");
5296 xmin =
fData[0].dataFourierIm->GetBinLowEdge(1);
5297 xmax =
fData[0].dataFourierIm->GetBinLowEdge(
fData[0].dataFourierIm->GetNbinsX())+
fData[0].dataFourierIm->GetBinWidth(1);
5305 if (binContent < ymin)
5308 if (binContent > ymax)
5310 for (UInt_t i=1; i<
fData.size(); i++) {
5312 if (binContent < ymin)
5315 if (binContent > ymax)
5318 if (binContent < ymin)
5321 if (binContent > ymax)
5335 for (UInt_t i=0; i<
fData.size(); i++) {
5336 if (
fData[i].dataFourierIm->GetNbinsX() > (Int_t)noOfPoints)
5337 noOfPoints =
fData[i].dataFourierIm->GetNbinsX();
5343 for (UInt_t i=0; i<
fData.size(); i++) {
5344 fData[i].dataFourierIm->GetXaxis()->SetRangeUser(xmin, xmax);
5345 fData[i].dataFourierIm->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5346 fData[i].theoryFourierIm->GetXaxis()->SetRangeUser(xmin, xmax);
5347 fData[i].theoryFourierIm->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5351 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
5355 fHistoFrame->GetYaxis()->SetTitle(
"Imaginary Fourier");
5358 for (UInt_t i=0; i<
fData.size(); i++) {
5359 fData[i].dataFourierIm->Draw(
"psame");
5363 for (UInt_t i=0; i<
fData.size(); i++) {
5364 fData[i].theoryFourierIm->Draw(
"same");
5376 xmin =
fData[0].dataFourierRe->GetBinLowEdge(1);
5377 xmax =
fData[0].dataFourierRe->GetBinLowEdge(
fData[0].dataFourierRe->GetNbinsX())+
fData[0].dataFourierRe->GetBinWidth(1);
5385 for (UInt_t i=1; i<
fData.size(); i++) {
5387 if (binContent < ymin)
5390 if (binContent > ymax)
5394 for (UInt_t i=0; i<
fData.size(); i++) {
5396 if (binContent < ymin)
5399 if (binContent > ymax)
5403 for (UInt_t i=0; i<
fData.size(); i++) {
5405 if (binContent < ymin)
5408 if (binContent > ymax)
5411 if (binContent < ymin)
5414 if (binContent > ymax)
5428 for (UInt_t i=0; i<
fData.size(); i++) {
5429 if (
fData[i].dataFourierRe->GetNbinsX() > (Int_t)noOfPoints)
5430 noOfPoints =
fData[i].dataFourierRe->GetNbinsX();
5436 for (UInt_t i=0; i<
fData.size(); i++) {
5437 fData[i].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
5438 fData[i].dataFourierRe->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5439 fData[i].theoryFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
5440 fData[i].theoryFourierRe->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5441 fData[i].dataFourierIm->GetXaxis()->SetRangeUser(xmin, xmax);
5442 fData[i].dataFourierIm->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5443 fData[i].theoryFourierIm->GetXaxis()->SetRangeUser(xmin, xmax);
5444 fData[i].theoryFourierIm->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5448 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
5452 fHistoFrame->GetYaxis()->SetTitle(
"Real/Imag Fourier");
5455 for (UInt_t i=0; i<
fData.size(); i++) {
5456 fData[i].dataFourierRe->Draw(
"psame");
5457 fData[i].dataFourierIm->Draw(
"psame");
5461 for (UInt_t i=0; i<
fData.size(); i++) {
5462 fData[i].theoryFourierRe->Draw(
"same");
5463 fData[i].theoryFourierIm->Draw(
"same");
5475 xmin =
fData[0].dataFourierPwr->GetBinLowEdge(1);
5476 xmax =
fData[0].dataFourierPwr->GetBinLowEdge(
fData[0].dataFourierPwr->GetNbinsX())+
fData[0].dataFourierPwr->GetBinWidth(1);
5484 if (binContent < ymin)
5487 if (binContent > ymax)
5489 for (UInt_t i=1; i<
fData.size(); i++) {
5491 if (binContent < ymin)
5494 if (binContent > ymax)
5497 if (binContent < ymin)
5500 if (binContent > ymax)
5514 for (UInt_t i=0; i<
fData.size(); i++) {
5515 if (
fData[i].dataFourierPwr->GetNbinsX() > (Int_t)noOfPoints)
5516 noOfPoints =
fData[i].dataFourierPwr->GetNbinsX();
5522 for (UInt_t i=0; i<
fData.size(); i++) {
5523 fData[i].dataFourierPwr->GetXaxis()->SetRangeUser(xmin, xmax);
5524 fData[i].dataFourierPwr->GetYaxis()->SetRangeUser(0.95*ymin, 1.05*ymax);
5525 fData[i].theoryFourierPwr->GetXaxis()->SetRangeUser(xmin, xmax);
5526 fData[i].theoryFourierPwr->GetYaxis()->SetRangeUser(0.95*ymin, 1.05*ymax);
5530 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
5534 fHistoFrame->GetYaxis()->SetTitle(
"Ampl. Fourier");
5537 for (UInt_t i=0; i<
fData.size(); i++) {
5538 fData[i].dataFourierPwr->Draw(
"psame");
5542 for (UInt_t i=0; i<
fData.size(); i++) {
5543 fData[i].theoryFourierPwr->Draw(
"same");
5553 xmin =
fData[0].dataFourierPhase->GetBinLowEdge(1);
5554 xmax =
fData[0].dataFourierPhase->GetBinLowEdge(
fData[0].dataFourierPhase->GetNbinsX())+
fData[0].dataFourierPhase->GetBinWidth(1);
5562 if (binContent < ymin)
5565 if (binContent > ymax)
5567 for (UInt_t i=1; i<
fData.size(); i++) {
5569 if (binContent < ymin)
5572 if (binContent > ymax)
5575 if (binContent < ymin)
5578 if (binContent > ymax)
5592 for (UInt_t i=0; i<
fData.size(); i++) {
5593 if (
fData[i].dataFourierPhase->GetNbinsX() > (Int_t)noOfPoints)
5594 noOfPoints =
fData[i].dataFourierPhase->GetNbinsX();
5599 for (UInt_t i=0; i<
fData.size(); i++) {
5600 fData[i].dataFourierPhase->GetXaxis()->SetRangeUser(xmin, xmax);
5601 fData[i].dataFourierPhase->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5602 fData[i].theoryFourierPhase->GetXaxis()->SetRangeUser(xmin, xmax);
5603 fData[i].theoryFourierPhase->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5607 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
5611 fHistoFrame->GetYaxis()->SetTitle(
"Phase Fourier");
5614 for (UInt_t i=0; i<
fData.size(); i++) {
5615 fData[i].dataFourierPhase->Draw(
"psame");
5619 for (UInt_t i=0; i<
fData.size(); i++) {
5620 fData[i].theoryFourierPhase->Draw(
"same");
5630 xmin =
fData[0].dataFourierPhaseOptReal->GetBinLowEdge(1);
5631 xmax =
fData[0].dataFourierPhaseOptReal->GetBinLowEdge(
fData[0].dataFourierPhaseOptReal->GetNbinsX())+
fData[0].dataFourierPhaseOptReal->GetBinWidth(1);
5639 if (binContent < ymin)
5642 if (binContent > ymax)
5644 for (UInt_t i=1; i<
fData.size(); i++) {
5646 if (binContent < ymin)
5649 if (binContent > ymax)
5652 if (binContent < ymin)
5655 if (binContent > ymax)
5669 for (UInt_t i=0; i<
fData.size(); i++) {
5670 if (
fData[i].dataFourierPhaseOptReal->GetNbinsX() > (Int_t)noOfPoints)
5671 noOfPoints =
fData[i].dataFourierPhaseOptReal->GetNbinsX();
5676 for (UInt_t i=0; i<
fData.size(); i++) {
5677 fData[i].dataFourierPhaseOptReal->GetXaxis()->SetRangeUser(xmin, xmax);
5678 fData[i].dataFourierPhaseOptReal->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5679 fData[i].theoryFourierPhaseOptReal->GetXaxis()->SetRangeUser(xmin, xmax);
5680 fData[i].theoryFourierPhaseOptReal->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5684 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
5688 fHistoFrame->GetYaxis()->SetTitle(
"Phase Opt. Real Fourier");
5691 for (UInt_t i=0; i<
fData.size(); i++) {
5692 fData[i].dataFourierPhaseOptReal->Draw(
"psame");
5696 for (UInt_t i=0; i<
fData.size(); i++) {
5697 fData[i].theoryFourierPhaseOptReal->Draw(
"same");
5737 if (
fData.size() == 0)
5741 TString xAxisTitle(
"");
5743 xAxisTitle = TString(
"Field (G)");
5745 xAxisTitle = TString(
"Field (T)");
5747 xAxisTitle = TString(
"Frequency (MHz)");
5749 xAxisTitle = TString(
"Frequency (Mc/s)");
5751 xAxisTitle = TString(
"??");
5755 double xmin, xmax, ymin, ymax, binContent;
5763 xmin =
fData[0].diffFourierRe->GetBinLowEdge(1);
5764 xmax =
fData[0].diffFourierRe->GetBinLowEdge(
fData[0].diffFourierRe->GetNbinsX())+
fData[0].diffFourierRe->GetBinWidth(1);
5771 for (UInt_t i=1; i<
fData.size(); i++) {
5773 if (binContent < ymin)
5776 if (binContent > ymax)
5789 for (UInt_t i=0; i<
fData.size(); i++) {
5790 fData[i].diffFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
5791 fData[i].diffFourierRe->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5795 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
5799 if (
fData[0].diffFourierTag == 1)
5800 fHistoFrame->GetYaxis()->SetTitle(
"Real Fourier (d-f: data-theory)");
5802 fHistoFrame->GetYaxis()->SetTitle(
"Real Fourier (f-d: [(F data)-(F theory)]");
5805 for (UInt_t i=0; i<
fData.size(); i++) {
5806 fData[i].diffFourierRe->Draw(
"plsame");
5818 xmin =
fData[0].diffFourierIm->GetBinLowEdge(1);
5819 xmax =
fData[0].diffFourierIm->GetBinLowEdge(
fData[0].diffFourierIm->GetNbinsX())+
fData[0].diffFourierIm->GetBinWidth(1);
5826 for (UInt_t i=1; i<
fData.size(); i++) {
5828 if (binContent < ymin)
5831 if (binContent > ymax)
5844 for (UInt_t i=0; i<
fData.size(); i++) {
5845 fData[i].diffFourierIm->GetXaxis()->SetRangeUser(xmin, xmax);
5846 fData[i].diffFourierIm->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5850 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
5854 if (
fData[0].diffFourierTag == 1)
5855 fHistoFrame->GetYaxis()->SetTitle(
"Imaginary Fourier (d-f: data-theory)");
5857 fHistoFrame->GetYaxis()->SetTitle(
"Imaginary Fourier (f-d: [(F data)-(F theory)]");
5860 for (UInt_t i=0; i<
fData.size(); i++) {
5861 fData[i].diffFourierIm->Draw(
"plsame");
5873 xmin =
fData[0].diffFourierRe->GetBinLowEdge(1);
5874 xmax =
fData[0].diffFourierRe->GetBinLowEdge(
fData[0].diffFourierRe->GetNbinsX())+
fData[0].diffFourierRe->GetBinWidth(1);
5881 for (UInt_t i=1; i<
fData.size(); i++) {
5883 if (binContent < ymin)
5886 if (binContent > ymax)
5889 for (UInt_t i=0; i<
fData.size(); i++) {
5891 if (binContent < ymin)
5894 if (binContent > ymax)
5907 for (UInt_t i=0; i<
fData.size(); i++) {
5908 fData[i].diffFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
5909 fData[i].diffFourierRe->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5910 fData[i].diffFourierIm->GetXaxis()->SetRangeUser(xmin, xmax);
5911 fData[i].diffFourierIm->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5915 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
5919 if (
fData[0].diffFourierTag == 1)
5920 fHistoFrame->GetYaxis()->SetTitle(
"Real+Imag Fourier (d-f: data-theory)");
5922 fHistoFrame->GetYaxis()->SetTitle(
"Real+Imag Fourier (f-d: [(F data)-(F theory)]");
5925 for (UInt_t i=0; i<
fData.size(); i++) {
5926 fData[i].diffFourierRe->Draw(
"plsame");
5927 fData[i].diffFourierIm->Draw(
"plsame");
5939 xmin =
fData[0].diffFourierPwr->GetBinLowEdge(1);
5940 xmax =
fData[0].diffFourierPwr->GetBinLowEdge(
fData[0].diffFourierPwr->GetNbinsX())+
fData[0].diffFourierPwr->GetBinWidth(1);
5947 for (UInt_t i=1; i<
fData.size(); i++) {
5949 if (binContent < ymin)
5952 if (binContent > ymax)
5965 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
5968 for (UInt_t i=0; i<
fData.size(); i++) {
5969 fData[i].diffFourierPwr->GetXaxis()->SetRangeUser(xmin, xmax);
5970 fData[i].diffFourierPwr->GetYaxis()->SetRangeUser(0.95*ymin, 1.05*ymax);
5975 if (
fData[0].diffFourierTag == 1)
5976 fHistoFrame->GetYaxis()->SetTitle(
"Ampl. Fourier (d-f: data-theory)");
5978 fHistoFrame->GetYaxis()->SetTitle(
"Ampl. Fourier (f-d: [(F data)-(F theory)]");
5981 for (UInt_t i=0; i<
fData.size(); i++) {
5982 fData[i].diffFourierPwr->Draw(
"plsame");
5992 xmin =
fData[0].diffFourierPhase->GetBinLowEdge(1);
5993 xmax =
fData[0].diffFourierPhase->GetBinLowEdge(
fData[0].diffFourierPhase->GetNbinsX())+
fData[0].diffFourierPhase->GetBinWidth(1);
6000 for (UInt_t i=1; i<
fData.size(); i++) {
6002 if (binContent < ymin)
6005 if (binContent > ymax)
6018 for (UInt_t i=0; i<
fData.size(); i++) {
6019 fData[i].diffFourierPhase->GetXaxis()->SetRangeUser(xmin, xmax);
6020 fData[i].diffFourierPhase->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
6024 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
6028 if (
fData[0].diffFourierTag == 1)
6029 fHistoFrame->GetYaxis()->SetTitle(
"Phase Fourier (d-f: data-theory)");
6031 fHistoFrame->GetYaxis()->SetTitle(
"Phase Fourier [f-d: (F data)-(F theory)]");
6034 for (UInt_t i=0; i<
fData.size(); i++) {
6035 fData[i].diffFourierPhase->Draw(
"plsame");
6047 xmin =
fData[0].diffFourierPhaseOptReal->GetBinLowEdge(1);
6048 xmax =
fData[0].diffFourierPhaseOptReal->GetBinLowEdge(
fData[0].diffFourierPhaseOptReal->GetNbinsX())+
fData[0].diffFourierPhaseOptReal->GetBinWidth(1);
6055 for (UInt_t i=1; i<
fData.size(); i++) {
6057 if (binContent < ymin)
6060 if (binContent > ymax)
6073 for (UInt_t i=0; i<
fData.size(); i++) {
6074 fData[i].diffFourierPhaseOptReal->GetXaxis()->SetRangeUser(xmin, xmax);
6075 fData[i].diffFourierPhaseOptReal->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
6079 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
6083 if (
fData[0].diffFourierTag == 1)
6084 fHistoFrame->GetYaxis()->SetTitle(
"Real Fourier (d-f: data-theory)");
6086 fHistoFrame->GetYaxis()->SetTitle(
"Real Fourier (f-d: [(F data)-(F theory)]");
6089 for (UInt_t i=0; i<
fData.size(); i++) {
6090 fData[i].diffFourierPhaseOptReal->Draw(
"plsame");
6122 str = TString(
"phase = ");
6155 TString xAxisTitle(
"");
6159 xAxisTitle = TString(
"time (s)");
6161 xAxisTitle = TString(
"time (#mus)");
6165 xAxisTitle = TString(
"Field (G)");
6167 xAxisTitle = TString(
"Field (T)");
6169 xAxisTitle = TString(
"Frequency (MHz)");
6171 xAxisTitle = TString(
"Frequency (Mc/s)");
6173 xAxisTitle = TString(
"??");
6177 TString yAxisTitle(
"");
6183 if (runList->at(0).IsLifetimeCorrected()) {
6184 yAxisTitle =
"<asymmetry>";
6187 yAxisTitle =
"<N(t)> per nsec";
6189 yAxisTitle =
"<N(t)> per bin";
6193 yAxisTitle =
"<asymmetry>";
6196 yAxisTitle =
"<asymmetry>";
6199 yAxisTitle =
"<N(t)> per bin";
6206 yAxisTitle =
"<data-theory>";
6212 yAxisTitle =
"<Real Fourier>";
6215 yAxisTitle =
"<Imaginary Fourier>";
6218 yAxisTitle =
"<Real/Imag Fourier>";
6221 yAxisTitle =
"<Ampl. Fourier>";
6224 yAxisTitle =
"<Phase Fourier>";
6227 yAxisTitle =
"<Phase Opt. Real Fourier>";
6236 if (
fData[0].diffFourierTag == 1)
6237 yAxisTitle =
"<Real Fourier (d-f: data-theory)>";
6239 yAxisTitle =
"<Real Fourier (f-d: [(F data)-(F theory)]>";
6242 if (
fData[0].diffFourierTag == 1)
6243 yAxisTitle =
"<Imag Fourier (d-f: data-theory)>";
6245 yAxisTitle =
"<Imag Fourier (f-d: [(F data)-(F theory)]>";
6249 if (
fData[0].diffFourierTag == 1)
6250 yAxisTitle =
"<Real/Imag Fourier (d-f: data-theory)>";
6252 yAxisTitle =
"<Real/Imag Fourier (f-d: [(F data)-(F theory)]>";
6256 if (
fData[0].diffFourierTag == 1)
6257 yAxisTitle =
"<Ampl. Fourier (d-f: data-theory)>";
6259 yAxisTitle =
"<Ampl. Fourier (f-d: [(F data)-(F theory)]>";
6263 if (
fData[0].diffFourierTag == 1)
6264 yAxisTitle =
"<Phase Fourier (d-f: data-theory)>";
6266 yAxisTitle =
"<Phase Fourier (f-d: [(F data)-(F theory)]>";
6277 Double_t xmin, xmax, ymin, ymax;
6291 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
6292 fHistoFrame->GetYaxis()->SetTitle(yAxisTitle.Data());
6307 fDataAvg.dataFourierRe->Draw(
"psame");
6308 fDataAvg.theoryFourierRe->Draw(
"same");
6310 fDataAvg.diffFourierRe->Draw(
"psame");
6315 fDataAvg.dataFourierIm->Draw(
"psame");
6316 fDataAvg.theoryFourierIm->Draw(
"same");
6318 fDataAvg.diffFourierIm->Draw(
"psame");
6323 fDataAvg.dataFourierRe->Draw(
"psame");
6324 fDataAvg.theoryFourierRe->Draw(
"same");
6325 fDataAvg.dataFourierIm->Draw(
"psame");
6326 fDataAvg.theoryFourierIm->Draw(
"same");
6328 fDataAvg.diffFourierRe->Draw(
"psame");
6329 fDataAvg.diffFourierIm->Draw(
"psame");
6334 fDataAvg.dataFourierPwr->Draw(
"psame");
6335 fDataAvg.theoryFourierPwr->Draw(
"same");
6337 fDataAvg.diffFourierPwr->Draw(
"psame");
6342 fDataAvg.dataFourierPhase->Draw(
"psame");
6343 fDataAvg.theoryFourierPhase->Draw(
"same");
6345 fDataAvg.diffFourierPhase->Draw(
"psame");
6350 fDataAvg.dataFourierPhaseOptReal->Draw(
"psame");
6351 fDataAvg.theoryFourierPhaseOptReal->Draw(
"same");
6353 fDataAvg.diffFourierPhaseOptReal->Draw(
"psame");
6383 const double cp = TMath::Cos(
fFourier.fPhaseIncrement/180.0*TMath::Pi());
6384 const double sp = TMath::Sin(
fFourier.fPhaseIncrement/180.0*TMath::Pi());
6390 for (UInt_t i=0; i<
fData.size(); i++) {
6391 if ((
fData[i].dataFourierRe !=
nullptr) && (
fData[i].dataFourierIm !=
nullptr)) {
6392 for (Int_t j=0; j<
fData[i].dataFourierRe->GetNbinsX(); j++) {
6394 re =
fData[i].dataFourierRe->GetBinContent(j) * cp +
fData[i].dataFourierIm->GetBinContent(j) * sp;
6395 im =
fData[i].dataFourierIm->GetBinContent(j) * cp -
fData[i].dataFourierRe->GetBinContent(j) * sp;
6397 fData[i].dataFourierRe->SetBinContent(j, re);
6398 fData[i].dataFourierIm->SetBinContent(j, im);
6401 if ((
fData[i].theoryFourierRe !=
nullptr) && (
fData[i].theoryFourierIm !=
nullptr)) {
6402 for (Int_t j=0; j<
fData[i].theoryFourierRe->GetNbinsX(); j++) {
6404 re =
fData[i].theoryFourierRe->GetBinContent(j) * cp +
fData[i].theoryFourierIm->GetBinContent(j) * sp;
6405 im =
fData[i].theoryFourierIm->GetBinContent(j) * cp -
fData[i].theoryFourierRe->GetBinContent(j) * sp;
6407 fData[i].theoryFourierRe->SetBinContent(j, re);
6408 fData[i].theoryFourierIm->SetBinContent(j, im);
6411 if ((
fData[i].diffFourierRe !=
nullptr) && (
fData[i].diffFourierIm !=
nullptr)) {
6412 for (Int_t j=0; j<
fData[i].diffFourierRe->GetNbinsX(); j++) {
6414 re =
fData[i].diffFourierRe->GetBinContent(j) * cp +
fData[i].diffFourierIm->GetBinContent(j) * sp;
6415 im =
fData[i].diffFourierIm->GetBinContent(j) * cp -
fData[i].diffFourierRe->GetBinContent(j) * sp;
6417 fData[i].diffFourierRe->SetBinContent(j, re);
6418 fData[i].diffFourierIm->SetBinContent(j, im);
6436 const double cp = TMath::Cos(
fFourier.fPhaseIncrement/180.0*TMath::Pi());
6437 const double sp = TMath::Sin(
fFourier.fPhaseIncrement/180.0*TMath::Pi());
6443 for (UInt_t i=0; i<
fData.size(); i++) {
6444 if ((
fData[i].dataFourierRe !=
nullptr) && (
fData[i].dataFourierIm !=
nullptr)) {
6445 for (Int_t j=0; j<
fData[i].dataFourierRe->GetNbinsX(); j++) {
6447 re =
fData[i].dataFourierRe->GetBinContent(j) * cp -
fData[i].dataFourierIm->GetBinContent(j) * sp;
6448 im =
fData[i].dataFourierIm->GetBinContent(j) * cp +
fData[i].dataFourierRe->GetBinContent(j) * sp;
6450 fData[i].dataFourierRe->SetBinContent(j, re);
6451 fData[i].dataFourierIm->SetBinContent(j, im);
6454 if ((
fData[i].theoryFourierRe !=
nullptr) && (
fData[i].theoryFourierIm !=
nullptr)) {
6455 for (Int_t j=0; j<
fData[i].theoryFourierRe->GetNbinsX(); j++) {
6457 re =
fData[i].theoryFourierRe->GetBinContent(j) * cp -
fData[i].theoryFourierIm->GetBinContent(j) * sp;
6458 im =
fData[i].theoryFourierIm->GetBinContent(j) * cp +
fData[i].theoryFourierRe->GetBinContent(j) * sp;
6460 fData[i].theoryFourierRe->SetBinContent(j, re);
6461 fData[i].theoryFourierIm->SetBinContent(j, im);
6464 if ((
fData[i].diffFourierRe !=
nullptr) && (
fData[i].diffFourierIm !=
nullptr)) {
6465 for (Int_t j=0; j<
fData[i].diffFourierRe->GetNbinsX(); j++) {
6467 re =
fData[i].diffFourierRe->GetBinContent(j) * cp -
fData[i].diffFourierIm->GetBinContent(j) * sp;
6468 im =
fData[i].diffFourierIm->GetBinContent(j) * cp +
fData[i].diffFourierRe->GetBinContent(j) * sp;
6470 fData[i].diffFourierRe->SetBinContent(j, re);
6471 fData[i].diffFourierIm->SetBinContent(j, im);
6493 Bool_t willScale =
true;
6496 for (UInt_t i=0; i<cmd->size(); i++) {
6497 if (cmd->at(i).fLine.Contains(
"SCALE_N0_BKG", TString::kIgnoreCase)) {
6499 if (tokens.size() != 2) {
6500 std::cerr << std::endl <<
">> PRunSingleHisto::IsScaleN0AndBkg(): **WARNING** Found uncorrect 'SCALE_N0_BKG' command, will ignore it.";
6501 std::cerr << std::endl <<
">> Allowed commands: SCALE_N0_BKG TRUE | FALSE" << std::endl;
6526 const UInt_t precLimit = 6;
6527 UInt_t decimalPoint = 0;
6528 UInt_t accuracy = 6;
6530 if (param.
fStep == 0.0) {
6533 snprintf(str,
sizeof(str),
"%lf", param.
fValue);
6536 for (UInt_t i=0; i<strlen(str); i++) {
6537 if (str[i] ==
'.') {
6544 for (Int_t i=strlen(str)-1; i>=0; i--) {
6545 if (str[i] !=
'0') {
6546 if (((UInt_t)i-decimalPoint) < precLimit)
6547 accuracy = (UInt_t)i-decimalPoint;
6549 accuracy = precLimit;
6556 for (UInt_t i=0; i<precLimit; i++) {
6557 if ((Int_t)(param.
fStep*pow(10.0,(Double_t)i)) != 0) {
6563 if (accuracy+1 <= precLimit)
6568 for (UInt_t i=0; i<precLimit; i++) {
6569 if ((Int_t)(param.
fStep*pow(10.0,(Double_t)i)) != 0) {
6575 UInt_t accuracy2 = 6;
6576 for (UInt_t i=0; i<precLimit; i++) {
6577 if ((Int_t)(param.
fStep*pow(10.0,(Double_t)i)) != 0) {
6583 if (accuracy2 > accuracy)
6584 accuracy = accuracy2;
6586 if (accuracy+1 <= precLimit)
6609 if (histo ==
nullptr)
6612 Int_t idx = histo->FindBin(xVal);
6615 if ((idx < 1) || (idx > histo->GetNbinsX()))
6620 if (histo->GetBinCenter(idx) > xVal)
6623 Double_t x0, x1, y0, y1;
6624 x0 = histo->GetBinCenter(idx);
6625 x1 = histo->GetBinCenter(idx+1);
6626 y0 = histo->GetBinContent(idx);
6627 y1 = histo->GetBinContent(idx+1);
6629 return (y1-y0)*(xVal-x0)/(x1-x0)+y0;
static const Char_t * gFiletypes[]
ClassImp(PMusrCanvasPlotRange) PMusrCanvasPlotRange
Constructor initializing plot range to undefined state.
ClassImpQ(PMusrCanvas) PMusrCanvas
Default constructor initializing canvas to undefined state.
#define PV_FOURIER_REAL_AND_IMAG
Plot view: real and imaginary parts simultaneously.
#define PV_FOURIER_PHASE
Plot view: phase spectrum.
#define PV_FOURIER_PWR
Plot view: power spectrum.
#define P_MENU_ID_FOURIER_PHASE_PLUS
Fourier menu: increment phase.
#define P_MENU_ID_DIFFERENCE
Menu ID for Difference view (data-theory).
#define XTHEO
X-position of theory pad.
#define P_MENU_ID_FOURIER
Menu ID for Fourier submenu.
#define P_MENU_ID_FOURIER_IMAG
Fourier menu: imaginary part.
#define P_MENU_PLOT_OFFSET
Offset for plot-specific menu IDs.
#define P_MENU_ID_AVERAGE
Menu ID for Average view.
#define P_MENU_ID_EXPORT_DATA
Menu ID for Export Data function.
#define P_MENU_ID_DATA
Menu ID for Data view.
#define P_MENU_ID_FOURIER_REAL
Fourier menu: real part.
#define P_MENU_ID_FOURIER_PHASE_MINUS
Fourier menu: decrement phase.
#define P_MENU_ID_FOURIER_REAL_AND_IMAG
Fourier menu: real and imaginary.
#define P_MENU_ID_FOURIER_PWR
Fourier menu: power spectrum.
#define P_MENU_ID_FOURIER_PHASE
Fourier menu: phase spectrum.
std::vector< PMusrCanvasAsciiDump > PMusrCanvasAsciiDumpVector
#define PV_DATA
Plot view: time-domain data.
#define PV_FOURIER_PHASE_OPT_REAL
Plot view: phase-optimized real part.
#define YINFO
Y-position of info/legend pad.
#define PV_FOURIER_REAL
Plot view: real part of Fourier transform.
#define P_MENU_ID_FOURIER_PHASE_OPT_REAL
Fourier menu: phase-optimized real.
#define PV_FOURIER_IMAG
Plot view: imaginary part of Fourier transform.
#define YTITLE
Y-position of title pad.
#define MSR_FITTYPE_ASYM
Fit asymmetry A(t) = (F-αB)/(F+αB).
#define MSR_PLOT_SINGLE_HISTO
Plot single histogram.
#define FOURIER_UNIT_FREQ
Frequency in MHz.
#define FOURIER_PLOT_REAL_AND_IMAG
Plot both real and imaginary components (default).
#define RRF_UNIT_MHz
Frequency in MHz (megahertz).
std::vector< PMsrRunBlock > PMsrRunList
#define FOURIER_UNIT_GAUSS
Magnetic field in Gauss (G).
#define MSR_FITTYPE_SINGLE_HISTO_RRF
Fit single histogram in rotating reference frame.
#define FOURIER_PLOT_NOT_GIVEN
Plot type not specified.
#define FOURIER_PLOT_POWER
Plot power spectrum |F(ω)|²
#define MSR_FITTYPE_SINGLE_HISTO
Fit single histogram (e.g., positron counts vs. time).
#define FOURIER_PLOT_REAL
Plot real component only.
#define FOURIER_PLOT_PHASE_OPT_REAL
Plot phase-optimized real component.
#define MSR_FITTYPE_MU_MINUS
Fit negative muon (μ-) single histogram.
#define MSR_PLOT_ASYM_RRF
Plot asymmetry in rotating reference frame.
std::vector< PMsrLineStructure > PMsrLines
#define MSR_FITTYPE_ASYM_RRF
Fit asymmetry in rotating reference frame.
#define MSR_FITTYPE_NON_MUSR
Fit non-μSR data (general x-y data).
#define MSR_PLOT_SINGLE_HISTO_RRF
Plot single histogram in rotating reference frame.
#define FOURIER_APOD_NONE
No apodization (rectangular window).
#define FOURIER_UNIT_CYCLES
Angular frequency in Mc/s (Mega-cycles per second).
std::vector< PDoublePair > PDoublePairVector
#define MSR_PLOT_ASYM
Plot asymmetry.
std::vector< Int_t > PIntVector
#define MSR_PLOT_MU_MINUS
Plot negative muon (μ-) data.
std::vector< PMsrParamStructure > PMsrParamList
#define MSR_FITTYPE_BNMR
Fit beta-detected NMR asymmetry.
#define RRF_UNIT_Mcs
Angular frequency in Mc/s (Mega-cycles per second).
#define RRF_UNIT_G
Equivalent magnetic field in Gauss (G).
#define FOURIER_PLOT_IMAG
Plot imaginary component only.
#define RRF_UNIT_kHz
Frequency in kHz (kilohertz).
#define MSR_PLOT_BNMR
Plot beta-detected NMR data.
#define RRF_UNIT_T
Equivalent magnetic field in Tesla (T).
#define FOURIER_PLOT_PHASE
Plot phase spectrum arg(F(ω)).
#define FOURIER_UNIT_NOT_GIVEN
Units not specified.
#define FOURIER_UNIT_TESLA
Magnetic field in Tesla (T).
#define FOURIER_APOD_NOT_GIVEN
Apodization not specified.
std::vector< TString > PStringVector
std::vector< Double_t > PDoubleVector
#define MSR_PLOT_NON_MUSR
Plot non-μSR data.
static TH1F * GetPhaseOptRealFourier(const TH1F *re, const TH1F *im, std::vector< Double_t > &phase, const Double_t scale=1.0, const Double_t min=-1.0, const Double_t max=-1.0)
virtual Int_t GetFitType()
MSR file parser and manager for the musrfit framework.
Helper class for managing plot axis ranges.
Bool_t fXRangePresent
Flag: true if X-range explicitly set.
virtual void SetXRange(Double_t xmin, Double_t xmax)
Sets X-axis range and marks it as present.
Double_t fYmin
Minimum Y value.
PMusrCanvasPlotRange()
Default constructor.
virtual Double_t GetXmax()
Returns maximum X value.
Bool_t fYRangePresent
Flag: true if Y-range explicitly set.
Double_t fYmax
Maximum Y value.
virtual Double_t GetYmin()
Returns minimum Y value.
virtual Double_t GetXmin()
Returns minimum X value.
Double_t fXmax
Maximum X value.
virtual Double_t GetYmax()
Returns maximum Y value.
Double_t fXmin
Minimum X value.
virtual void SetYRange(Double_t ymin, Double_t ymax)
Sets Y-axis range and marks it as present.
ROOT-based canvas for interactive visualization of muSR data and fits.
virtual Double_t CalculateDiff(const Double_t x, const Double_t y, TH1F *theo)
virtual Int_t FindBin(const Double_t x, TGraphErrors *graph)
PMsrFourierStructure fFourier
structure holding all the information necessary to perform the Fourier transform
virtual void CleanupFourier()
std::unique_ptr< TTimer > fTimeoutTimer
timeout timer in order to terminate if no action is taking place for too long
Bool_t fValid
if true, everything looks OK
virtual void InitMusrCanvas(const Char_t *title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh)
Int_t fPreviousPlotView
tag showing the previous plot view
std::unique_ptr< TPaveText > fTitlePad
title pad used to display a title
PRunListCollection * fRunList
data handler
virtual void HandleFourier()
PMusrCanvasDataSet fDataAvg
set of all averaged data to be plotted (asymmetry/single histogram)
virtual void Done(Int_t status=0)
ROOT signal emitted when canvas is closed or timeout occurs.
Bool_t fYRangePresent
flag indicating if x-/y-range is present
PIntVector fMarkerList
list of markers
virtual void CleanupAverage()
virtual void InitDataSet(PMusrCanvasDataSet &dataSet)
virtual void CreateStyle()
virtual void PlotFourierDifference(Bool_t unzoom=false)
virtual void HandleAverage()
std::unique_ptr< TGPopupMenu > fPopupFourier
popup menu of the Musrfit/Fourier sub menu
PDoubleVector fCurrentFourierPhase
holds the current Fourier phase(s)
Bool_t fTheoAsData
flag if true, calculate theory points only at the data points
Int_t fPlotType
plot type tag: -1 == undefined, MSR_PLOT_SINGLE_HISTO == single histogram, MSR_PLOT_ASYM == asymmetry...
Int_t fCurrentPlotView
tag showing what the current plot view is: data, fourier, ...
virtual void HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data)
virtual void HandleDifferenceFourier()
virtual void CalcPhaseOptReFT()
PMusrCanvas::CalcPhaseOptReFT.
virtual void SetMsrHandler(PMsrHandler *msrHandler)
Sets the MSR file handler for accessing fit parameters and configuration.
virtual Double_t GetMinimum(TH1F *histo, Double_t xmin=-1.0, Double_t xmax=-1.0)
virtual void SaveGraphicsAndQuit(const Char_t *fileName, const Char_t *graphicsFormat)
Saves canvas to graphics file and emits Done signal.
std::unique_ptr< TPad > fDataTheoryPad
data/theory pad used to display the data/theory
std::unique_ptr< TLatex > fRRFLatexText
used to display RRF info
virtual void LastCanvasClosed()
ROOT slot called when this is the last canvas being closed.
virtual Double_t GetMaximum(TH1F *histo, Double_t xmin=-1.0, Double_t xmax=-1.0)
Bool_t fBatchMode
musrview in ROOT batch mode
virtual void CleanupDifference()
std::unique_ptr< TStyle > fStyle
A collection of all graphics attributes.
virtual void HandleDifference()
std::unique_ptr< TLegend > fInfoPad
info pad used to display a legend of the data plotted
std::unique_ptr< TCanvas > fMainCanvas
main canvas
TMultiGraph * fMultiGraphData
fMultiGraphData is a 'global' graph needed in order to plot error graphs (data) with (potentially) di...
PIntVector fColorList
list of colors
virtual Bool_t IsValid()
Returns true if canvas initialized successfully.
PMsrHandler * fMsrHandler
msr-file handler
PMusrCanvas()
Default constructor.
virtual void HandleFourierDifference()
PMusrCanvasDataList fData
list of all histogram data to be plotted (asymmetry/single histogram)
Bool_t fAveragedView
tag showing that the averaged view or normal view should be presented.
std::unique_ptr< TLatex > fCurrentFourierPhaseText
used in Re/Im Fourier to show the current phase in the pad
Double_t fYmax
data/theory frame range
TGPopupMenu * fPopupMain
popup menu Musrfit in the main menu bar
TH1F * fHistoFrame
fHistoFrame is a 'global' frame needed in order to plot histograms with (potentially) different x-fra...
virtual void InitAverage()
virtual void UpdateInfoPad()
Updates info/legend pad with run information.
Int_t fPlotNumber
plot number
Bool_t fStartWithFourier
flag if true, the Fourier transform will be presented bypassing the time domain representation
virtual void InitFourier()
virtual void CleanupFourierDifference()
virtual void PlotDifference(Bool_t unzoom=false)
virtual void HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected)
ROOT slot handling keyboard commands (e.g., 'f' for Fourier, 'd' for data).
virtual Bool_t IsScaleN0AndBkg()
virtual void SetTimeout(Int_t ival)
Sets timeout in seconds after which Done signal is emitted (0=no timeout).
virtual void IncrementFourierPhase()
virtual Double_t GetInterpolatedValue(TH1F *histo, Double_t xVal)
virtual void PlotData(Bool_t unzoom=false)
std::unique_ptr< TString > fRRFText
RRF information.
TMultiGraph * fMultiGraphDiff
fMultiGraphDiff is a 'global' graph needed in order to plot error graphs (data-theory) with (potentia...
Bool_t fStartWithAvg
flag if true, the averaged data/Fourier will be presented
virtual void CleanupDataSet(PMusrCanvasDataSet &dataSet)
TRootCanvas * fImp
ROOT native GUI version of main window with menubar and drawing area.
virtual void HandleMenuPopup(Int_t id)
ROOT slot handling menu selections.
virtual UInt_t GetNeededAccuracy(PMsrParamStructure param)
virtual void PlotFourier(Bool_t unzoom=false)
std::unique_ptr< TLegend > fMultiGraphLegend
used for non-muSR plots to display a legend
Int_t fTimeout
timeout after which the Done signal should be emited. If timeout <= 0, no timeout is taking place
virtual void ExportData(const Char_t *fileName)
Exports displayed data to ASCII file.
Bool_t fToggleColor
tag showing if a single histo theory is color toggled
virtual void HandleNonMusrDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data)
virtual void PlotFourierPhaseValue(Bool_t unzoom=false)
std::unique_ptr< TPaveText > fTheoryPad
theory pad used to display the theory and functions
virtual void DecrementFourierPhase()
Bool_t fDifferenceView
tag showing that the shown data, fourier, are the difference between data and theory
virtual void UpdateParamTheoryPad()
Updates parameter and theory display pads with current fit results.
virtual void UpdateDataTheoryPad()
Updates main data/theory plotting pad.
virtual ~PMusrCanvas()
Destructor - cleans up all histograms, graphs, and ROOT objects.
std::unique_ptr< TPaveText > fParameterPad
parameter pad used to display the fitting parameters
virtual void PlotAverage(Bool_t unzoom=false)
Bool_t fScaleN0AndBkg
true=N0 and background is scaled to (1/ns), otherwise (1/bin) for the single histogram case
virtual void WindowClosed()
ROOT slot called when canvas window is closed.
virtual void GetExportDataSet(const TH1F *data, const Double_t xmin, const Double_t xmax, PMusrCanvasAsciiDumpVector &dumpData, const Bool_t hasError=true)
PMusrCanvasNonMusrDataList fNonMusrData
list of all error graphs to be plotted (non-muSR)
virtual const PDoubleVector * GetX()
Returns pointer to x-axis vector (used only for non-μSR data).
virtual Double_t GetTheoryTimeStart()
Returns the start time for theory evaluation in microseconds (μs).
virtual const PDoubleVector * GetValue()
Returns pointer to data value vector (asymmetry, counts, or y-data).
virtual const PDoubleVector * GetTheory()
Returns pointer to theory value vector.
virtual Double_t GetDataTimeStep()
Returns the time bin width for data in microseconds (μs).
virtual Double_t GetTheoryTimeStep()
Returns the time step for theory evaluation in microseconds (μs).
virtual const PDoubleVector * GetError()
Returns pointer to data error vector (statistical uncertainties).
virtual Double_t GetDataTimeStart()
Returns the start time of the data set in microseconds (μs).
virtual const PDoubleVector * GetXTheory()
Returns pointer to x-axis vector for theory (non-μSR only).
static bool IsEqualNoCase(const std::string &a, const std::string &b)
static std::vector< std::string > Split(const std::string &str, const std::string &delimiters)
Double_t fStep
Step size / error / negative error (context-dependent).
Bool_t fPosErrorPresent
True if positive error explicitly defined (asymmetric errors).
Double_t fValue
Parameter value (initial or fitted).
PIntVector fRuns
list of runs to be plotted
UInt_t fNdf
number of degrees of freedom
TString fDate
string holding fitting date and time
Double_t fMin
chisq or max. likelihood
Bool_t fChisq
flag telling if min = chi2 or min = max.likelihood
PDoubleVector dataErr
error of the y-axis data set
PDoubleVector dataX
x-axis data set
PDoubleVector data
y-axis data set
TH1F * theoryFourierIm
imaginary part of the Fourier transform of the theory histogram
TH1F * theoryFourierPwr
power spectrum of the Fourier transform of the theory histogram
UInt_t diffFourierTag
0=not relevant, 1=d-f (Fourier of difference time spectra), 2=f-d (difference of Fourier spectra)
TH1F * theory
theory histogram belonging to the data histogram
TH1F * dataFourierRe
real part of the Fourier transform of the data histogram
TH1F * diffFourierPhase
phase spectrum of the Fourier transform of the diff histogram
TH1F * dataFourierPhase
phase spectrum of the Fourier transform of the data histogram
TH1F * theoryFourierPhaseOptReal
phase optimized real part spectrum Fourier transform of the theory histogram
TH1F * diff
difference histogram, i.e. data-theory
TH1F * diffFourierPhaseOptReal
phase optimized real part spectrum Fourier transform of the diff histogram
TH1F * dataFourierIm
imaginary part of the Fourier transform of the data histogram
TH1F * data
data histogram
TH1F * diffFourierIm
imaginary part of the Fourier transform of the diff histogram
TH1F * theoryFourierPhase
phase spectrum of the Fourier transform of the theory histogram
TH1F * dataFourierPhaseOptReal
phase optimized real part spectrum Fourier transform of the data histogram
PMusrCanvasPlotRange * dataRange
keep the msr-file plot data range
TH1F * diffFourierPwr
power spectrum of the Fourier transform of the diff histogram
TH1F * dataFourierPwr
power spectrum of the Fourier transform of the data histogram
TH1F * diffFourierRe
real part of the Fourier transform of the diff histogram
TH1F * theoryFourierRe
real part of the Fourier transform of the theory histogram
TGraphErrors * dataFourierPhase
phase spectrum of the Fourier transform of the data error graph
TGraphErrors * theoryFourierRe
real part of the Fourier transform of the theory error graph
TGraphErrors * theoryFourierIm
imaginary part of the Fourier transform of the theory error graph
TGraphErrors * dataFourierRe
real part of the Fourier transform of the data error graph
TGraphErrors * theoryFourierPwr
power spectrum of the Fourier transform of the theory error graph
TGraphErrors * data
data error graph
TGraphErrors * theoryFourierPhase
phase spectrum of the Fourier transform of the theory error graph
UInt_t diffFourierTag
0=not relevant, 1=d-f (Fourier of difference time spectra), 2=f-d (difference of Fourier spectra)
TGraphErrors * diffFourierPhase
phase spectrum of the Fourier transform of the diff error graph
TGraphErrors * diffFourierPwr
power spectrum of the Fourier transform of the diff error graph
PMusrCanvasPlotRange * dataRange
keep the msr-file plot data range
TGraphErrors * diffFourierRe
real part of the Fourier transform of the diff error graph
TGraphErrors * dataFourierIm
imaginary part of the Fourier transform of the data error graph
TGraphErrors * diffFourierIm
imaginary part of the Fourier transform of the diff error graph
TGraphErrors * theory
theory histogram belonging to the data error graph
TGraphErrors * diff
difference error graph, i.e. data-theory
TGraphErrors * dataFourierPwr
power spectrum of the Fourier transform of the data error graph