37 #include <TObjString.h> 38 #include <TGFileDialog.h> 43 static const char *
gFiletypes[] = {
"Data files",
"*.dat",
78 std::cerr << std::endl <<
">> PMusrCanvasPlotRange::SetXRange(): **WARNING** xmin > xmax, will swap them." << std::endl;
100 std::cerr << std::endl <<
">> PMusrCanvasPlotRange::SetYRange(): **WARNING** ymin > ymax, will swap them." << std::endl;
152 gStyle->SetHistMinimumZero(kTRUE);
173 Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh,
174 const Bool_t batch,
const Bool_t fourier,
const Bool_t avg,
175 const Bool_t theoAsData) :
176 fTheoAsData(theoAsData), fStartWithFourier(fourier), fStartWithAvg(avg),
177 fBatchMode(batch), fPlotNumber(number)
199 gStyle->SetHistMinimumZero(kTRUE);
223 Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh,
226 const Bool_t batch,
const Bool_t fourier,
const Bool_t avg,
227 const Bool_t theoAsData) :
228 fTheoAsData(theoAsData), fStartWithFourier(fourier), fStartWithAvg(avg), fBatchMode(batch),
229 fPlotNumber(number), fFourier(fourierDefault),
230 fMarkerList(markerList), fColorList(colorList)
250 gStyle->SetHistMinimumZero(kTRUE);
262 if (
fData.size() > 0) {
263 for (UInt_t i=0; i<
fData.size(); i++)
336 Int_t rrfUnitTag = -1;
337 Double_t rrfFreq = 0.0;
339 fRRFText = std::make_unique<TString>(
"RRF: ");
342 TString rrfFreqStr(
"");
343 rrfFreqStr.Form(
"%.5g", rrfFreq);
345 *
fRRFText += TString(
"#nu_{RRF} = ");
349 *
fRRFText += TString(
"#nu_{RRF} = ");
353 *
fRRFText += TString(
"#omega_{RRF} = ");
365 *
fRRFText += TString(
", RRF packing = ");
368 fRRFText = std::make_unique<TString>(
"RRF: ");
371 TString rrfFreqStr(
"");
372 rrfFreqStr.Form(
"%.5g", rrfFreq);
374 *
fRRFText += TString(
"#nu_{RRF} = ");
378 *
fRRFText += TString(
"#nu_{RRF} = ");
382 *
fRRFText += TString(
"#omega_{RRF} = ");
394 *
fRRFText += TString(
", RRF packing = ");
417 fTimeoutTimer->Connect(
"Timeout()",
"PMusrCanvas",
this,
"Done()");
436 Double_t ypos = 0.0, yoffset = 0.0;
443 for (UInt_t i=0; i<param.size(); i++) {
444 if (param[i].fName.Length() > maxLength)
445 maxLength = param[i].fName.Length();
450 if (param.size() > 20)
451 yoffset = 1.0 / (param.size()+1);
458 for (UInt_t i=0; i<param.size(); i++) {
461 snprintf(accStr,
sizeof(accStr),
"%%.%dlf", accuracy);
469 str += param[i].fName;
470 for (Int_t j=0; j<maxLength-param[i].fName.Length(); j++)
473 if (round(param[i].fValue)-param[i].fValue==0)
474 snprintf(cnum,
sizeof(cnum),
"%.1lf", param[i].fValue);
476 snprintf(cnum,
sizeof(cnum), accStr, param[i].fValue);
478 for (Int_t j=0; j<9-(Int_t)strlen(cnum); j++)
482 if (param[i].fPosErrorPresent) {
485 err = (param[i].fPosError - param[i].fStep) / 2.0;
487 if ((fabs(fabs(param[i].fStep) - param[i].fPosError) < 0.1*fabs(param[i].fStep)) &&
488 (fabs(fabs(param[i].fStep) - param[i].fPosError) < 0.1*param[i].fPosError)) {
489 if (round(err)-err==0)
490 snprintf(cnum,
sizeof(cnum),
"%.1lf", err);
492 snprintf(cnum,
sizeof(cnum), accStr, err);
494 snprintf(accStr,
sizeof(accStr),
"%%.%dlf!!", accuracy);
495 if (round(err)-err==0)
496 snprintf(cnum,
sizeof(cnum),
"%.1lf!!", err);
498 snprintf(cnum,
sizeof(cnum), accStr, err);
502 if (round(param[i].fStep)-param[i].fStep==0)
503 snprintf(cnum,
sizeof(cnum),
"%.1lf", param[i].fStep);
505 snprintf(cnum,
sizeof(cnum), accStr, param[i].fStep);
508 ypos = 0.98-i*yoffset;
514 if (theory.size() > 20)
515 yoffset = 1.0/(theory.size()+1);
518 for (UInt_t i=1; i<theory.size(); i++) {
520 str = theory[i].fLine;
521 idx = str.Index(
"(");
524 str.Resize(str.Strip().Length());
526 ypos = 0.98 - i*yoffset;
533 for (UInt_t i=1; i<functions.size(); i++) {
535 fTheoryPad->AddText(0.03, ypos, functions[i].fLine.Data());
562 for (UInt_t i=0; i<plotInfo.
fRuns.size(); i++) {
564 if ((Int_t)plotInfo.
fRuns[i] > (Int_t)runs.size()) {
566 std::cerr << std::endl <<
">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** run plot number " << (Int_t)plotInfo.
fRuns[i] <<
" is larger than the number of runs " << runs.size();
567 std::cerr << std::endl;
571 runNo = (UInt_t)plotInfo.
fRuns[i]-1;
572 if (runs[runNo].GetFitType() != -1) {
573 fitType = runs[runNo].GetFitType();
577 std::cerr << std::endl <<
">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** plottype = " <<
fPlotType;
578 std::cerr <<
", fittype = " << runs[runNo].GetFitType() <<
"(RUN block)/";
579 std::cerr <<
"fittype = " << globalBlock->
GetFitType() <<
"(GLOBAL block). However, they have to correspond!";
580 std::cerr << std::endl;
586 for (UInt_t i=0; i<plotInfo.
fRuns.size(); i++) {
589 runNo = (UInt_t)plotInfo.
fRuns[i]-1;
591 if (runs[runNo].GetFitType() != -1) {
592 fitType = runs[runNo].GetFitType();
600 std::cerr << std::endl <<
">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo <<
" for a single histogram plot";
601 std::cerr << std::endl;
612 std::cerr << std::endl <<
">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo <<
" for a single histogram RRF plot";
613 std::cerr << std::endl;
624 std::cerr << std::endl <<
">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo <<
" for a asymmetry plot";
625 std::cerr << std::endl;
636 std::cerr << std::endl <<
">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo <<
" for a beta-NMR asymmetry plot";
637 std::cerr << std::endl;
648 std::cerr << std::endl <<
">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo <<
" for a asymmetry RRF plot";
649 std::cerr << std::endl;
660 std::cerr << std::endl <<
">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo <<
" for a mu minus single histogram plot";
661 std::cerr << std::endl;
672 std::cerr << std::endl <<
">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo <<
" for a none musr data plot";
673 std::cerr << std::endl;
692 std::cerr << std::endl <<
">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** wrong plottype tag?!";
693 std::cerr << std::endl;
782 TString tstr, tsubstr;
787 tstr += statistic.
fDate;
788 tstr += TString(
", ");
792 tstr += TString(
"chisq = ");
794 tstr += TString(
"maxLH = ");
796 tstr += statistic.
fMin;
797 tstr += TString(
" , NDF = ");
798 tstr += statistic.
fNdf;
800 tstr += TString(
" , chisq/NDF = ");
802 tstr += TString(
" , maxLH/NDF = ");
804 if (statistic.
fNdf != 0) {
805 tstr += statistic.
fMin/statistic.
fNdf;
807 tstr += TString(
"undefined");
819 for (UInt_t i=0; i<
fData.size(); i++) {
821 runNo = (UInt_t)plotInfo.
fRuns[i]-1;
822 if (runs[runNo].GetRunNameSize() > 1)
823 tstr =
"++" + *runs[runNo].GetRunName() + TString(
",");
825 tstr = *runs[runNo].GetRunName() + TString(
",");
829 tstr += TString(
"h:");
833 tstr += TString(
",");
837 tstr += TString(
"h:");
841 tstr += TString(
"/");
845 tstr += TString(
",");
849 if (ddvec->empty()) {
850 tstr += TString(
"T=");
851 tstr += TString(
"??,");
852 }
else if (ddvec->size() == 1){
853 tstr += TString(
"T=");
854 snprintf(sval,
sizeof(sval),
"%0.2lf", ddvec->at(0).first);
855 tstr += TString(sval) + TString(
"K,");
857 for(UInt_t i(0); i<ddvec->size(); ++i){
858 snprintf(sval,
sizeof(sval),
"T%u=", i);
859 tstr += TString(sval);
860 snprintf(sval,
sizeof(sval),
"%0.2lf", ddvec->at(i).first);
861 tstr += TString(sval) + TString(
"K,");
865 tstr += TString(
"B=");
868 tstr += TString(
"??,");
871 snprintf(sval,
sizeof(sval),
"%0.2lf", dval);
872 tstr += TString(sval) + TString(
"G,");
874 snprintf(sval,
sizeof(sval),
"%0.2lf", dval/1.0e4);
875 tstr += TString(sval) + TString(
"T,");
879 tstr += TString(
"E=");
882 tstr += TString(
"??,");
885 snprintf(sval,
sizeof(sval),
"%0.2lf", dval);
886 tstr += TString(sval) + TString(
"keV,");
888 snprintf(sval,
sizeof(sval),
"%0.2lf", dval/1.0e3);
889 tstr += TString(sval) + TString(
"MeV,");
913 Emit(
"Done(Int_t)",
status);
937 if (event != kKeyPress)
949 enum eKeySwitch {kNotRelevant, kData, kDiffData, kFourier, kDiffFourier, kFourierDiff};
950 eKeySwitch relevantKeySwitch = kNotRelevant;
951 static eKeySwitch lastKeySwitch = kNotRelevant;
953 if ((lastKeySwitch == kFourierDiff) && (x ==
'f')) {
954 std::cout <<
"**INFO** f-d-f doesn't make any sense, will ignore 'f' ..." << std::endl;
958 if ((lastKeySwitch == kDiffFourier) && (x ==
'd')) {
959 std::cout <<
"**INFO** d-f-d doesn't make any sense, will ignore 'd' ..." << std::endl;
965 }
else if (x ==
'd') {
978 relevantKeySwitch = kDiffData;
980 relevantKeySwitch = kData;
982 relevantKeySwitch = kFourierDiff;
984 relevantKeySwitch = kFourier;
985 }
else if (x ==
'u') {
1003 }
else if (x ==
'f') {
1006 relevantKeySwitch = kDiffFourier;
1008 relevantKeySwitch = kFourier;
1010 relevantKeySwitch = kDiffData;
1012 relevantKeySwitch = kData;
1061 }
else if (x ==
'+') {
1064 }
else if (x ==
'-') {
1067 }
else if (x ==
'a') {
1068 if (
fData.size() > 1) {
1082 relevantKeySwitch = kDiffData;
1084 relevantKeySwitch = kData;
1086 relevantKeySwitch = kFourierDiff;
1088 relevantKeySwitch = kFourier;
1090 std::cout <<
"**INFO** averaging of a single data set doesn't make any sense, will ignore 'a' ..." << std::endl;
1093 }
else if (x ==
'c') {
1103 }
else if (x ==
't') {
1104 if (
fData.size() == 1) {
1107 fData[0].theory->SetLineColor(kRed);
1108 fData[0].theory->SetLineWidth(2);
1111 fData[0].theory->SetLineWidth(1);
1120 lastKeySwitch = relevantKeySwitch;
1123 switch (relevantKeySwitch) {
1173 static Int_t previousPlotView =
PV_DATA;
1209 if (previousPlotView ==
PV_DATA)
1232 if (previousPlotView ==
PV_DATA)
1255 if (previousPlotView ==
PV_DATA)
1278 if (previousPlotView ==
PV_DATA)
1301 if (previousPlotView ==
PV_DATA)
1312 if (
fData[0].dataFourierPhaseOptReal ==
nullptr) {
1313 if (
fData[0].dataFourierRe ==
nullptr)
1331 if (previousPlotView ==
PV_DATA)
1396 if (
fData.size() > 1) {
1408 std::cout <<
"**INFO** averaging of a single data set doesn't make any sense, will ignore 'a' ..." << std::endl;
1412 static TString dir(
".");
1415 fi.fIniDir = StrDup(dir);
1416 fi.fOverwrite =
true;
1417 new TGFileDialog(0,
fImp, kFDSave, &fi);
1418 if (fi.fFilename && strlen(fi.fFilename)) {
1446 if (gROOT->GetListOfCanvases()->IsEmpty()) {
1460 gROOT->GetListOfCanvases()->Remove(
fMainCanvas.get());
1475 std::cout << std::endl <<
">> SaveGraphicsAndQuit: will dump the canvas into a graphics output file (" << graphicsFormat <<
") ..."<< std::endl;
1477 TString str(fileName);
1482 if (str.Contains(
".msr")) {
1483 idx = str.Index(
".msr");
1486 if (str.Contains(
".mlog")) {
1487 idx = str.Index(
".mlog");
1492 std::cerr << std::endl <<
">> PMusrCanvas::SaveGraphicsAndQuit(): **ERROR** fileName (" << fileName <<
") is invalid." << std::endl;
1500 str.Replace(idx, size, ext, strlen(ext));
1503 snprintf(ext,
sizeof(ext),
".%s", graphicsFormat);
1504 str.Replace(idx, size, ext, strlen(ext));
1506 std::cout << std::endl <<
">> SaveGraphicsAndQuit: " << str.Data() << std::endl;
1524 if (fileName ==
nullptr) {
1525 std::cerr << std::endl <<
">> PMusrCanvas::ExportData(): **ERROR** NO path file name provided. Will do nothing." << std::endl;
1537 Double_t xval, yval;
1552 xmin =
fHistoFrame->GetXaxis()->GetBinCenter(xminBin);
1553 xmax =
fHistoFrame->GetXaxis()->GetBinCenter(xmaxBin);
1559 for (UInt_t i=0; i<
fData.size(); i++) {
1566 xminBin =
fData[0].diffFourierRe->GetXaxis()->GetFirst();
1567 xmaxBin =
fData[0].diffFourierRe->GetXaxis()->GetLast();
1568 xmin =
fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xminBin);
1569 xmax =
fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xmaxBin);
1575 for (UInt_t i=0; i<
fData.size(); i++) {
1582 xminBin =
fData[0].diffFourierIm->GetXaxis()->GetFirst();
1583 xmaxBin =
fData[0].diffFourierIm->GetXaxis()->GetLast();
1584 xmin =
fData[0].diffFourierIm->GetXaxis()->GetBinCenter(xminBin);
1585 xmax =
fData[0].diffFourierIm->GetXaxis()->GetBinCenter(xmaxBin);
1591 for (UInt_t i=0; i<
fData.size(); i++) {
1598 xminBin =
fData[0].diffFourierRe->GetXaxis()->GetFirst();
1599 xmaxBin =
fData[0].diffFourierRe->GetXaxis()->GetLast();
1600 xmin =
fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xminBin);
1601 xmax =
fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xmaxBin);
1608 for (UInt_t i=0; i<
fData.size(); i++) {
1616 xminBin =
fData[0].diffFourierPwr->GetXaxis()->GetFirst();
1617 xmaxBin =
fData[0].diffFourierPwr->GetXaxis()->GetLast();
1618 xmin =
fData[0].diffFourierPwr->GetXaxis()->GetBinCenter(xminBin);
1619 xmax =
fData[0].diffFourierPwr->GetXaxis()->GetBinCenter(xmaxBin);
1625 for (UInt_t i=0; i<
fData.size(); i++) {
1632 xminBin =
fData[0].diffFourierPhase->GetXaxis()->GetFirst();
1633 xmaxBin =
fData[0].diffFourierPhase->GetXaxis()->GetLast();
1634 xmin =
fData[0].diffFourierPhase->GetXaxis()->GetBinCenter(xminBin);
1635 xmax =
fData[0].diffFourierPhase->GetXaxis()->GetBinCenter(xmaxBin);
1641 for (UInt_t i=0; i<
fData.size(); i++) {
1655 xmin =
fHistoFrame->GetXaxis()->GetBinCenter(xminBin);
1656 xmax =
fHistoFrame->GetXaxis()->GetBinCenter(xmaxBin);
1663 for (UInt_t i=0; i<
fData.size(); i++) {
1672 xminBin =
fData[0].dataFourierRe->GetXaxis()->GetFirst();
1673 xmaxBin =
fData[0].dataFourierRe->GetXaxis()->GetLast();
1674 xmin =
fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xminBin);
1675 xmax =
fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xmaxBin);
1682 for (UInt_t i=0; i<
fData.size(); i++) {
1690 xminBin =
fData[0].dataFourierIm->GetXaxis()->GetFirst();
1691 xmaxBin =
fData[0].dataFourierIm->GetXaxis()->GetLast();
1692 xmin =
fData[0].dataFourierIm->GetXaxis()->GetBinCenter(xminBin);
1693 xmax =
fData[0].dataFourierIm->GetXaxis()->GetBinCenter(xmaxBin);
1700 for (UInt_t i=0; i<
fData.size(); i++) {
1708 xminBin =
fData[0].dataFourierRe->GetXaxis()->GetFirst();
1709 xmaxBin =
fData[0].dataFourierRe->GetXaxis()->GetLast();
1710 xmin =
fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xminBin);
1711 xmax =
fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xmaxBin);
1719 for (UInt_t i=0; i<
fData.size(); i++) {
1729 xminBin =
fData[0].dataFourierPwr->GetXaxis()->GetFirst();
1730 xmaxBin =
fData[0].dataFourierPwr->GetXaxis()->GetLast();
1731 xmin =
fData[0].dataFourierPwr->GetXaxis()->GetBinCenter(xminBin);
1732 xmax =
fData[0].dataFourierPwr->GetXaxis()->GetBinCenter(xmaxBin);
1739 for (UInt_t i=0; i<
fData.size(); i++) {
1747 xminBin =
fData[0].dataFourierPhase->GetXaxis()->GetFirst();
1748 xmaxBin =
fData[0].dataFourierPhase->GetXaxis()->GetLast();
1749 xmin =
fData[0].dataFourierPhase->GetXaxis()->GetBinCenter(xminBin);
1750 xmax =
fData[0].dataFourierPhase->GetXaxis()->GetBinCenter(xmaxBin);
1757 for (UInt_t i=0; i<
fData.size(); i++) {
1765 xminBin =
fData[0].dataFourierPhaseOptReal->GetXaxis()->GetFirst();
1766 xmaxBin =
fData[0].dataFourierPhaseOptReal->GetXaxis()->GetLast();
1767 xmin =
fData[0].dataFourierPhaseOptReal->GetXaxis()->GetBinCenter(xminBin);
1768 xmax =
fData[0].dataFourierPhaseOptReal->GetXaxis()->GetBinCenter(xmaxBin);
1775 for (UInt_t i=0; i<
fData.size(); i++) {
1808 if ((xval >= xmin) && (xval <= xmax)) {
1809 dump.
dataX.push_back(xval);
1810 dump.
data.push_back(yval);
1816 if (dump.
dataX.size() > 0)
1817 dumpVector.push_back(dump);
1855 if ((xval >= xmin) && (xval <= xmax)) {
1856 dump.
dataX.push_back(xval);
1857 dump.
data.push_back(yval);
1863 if (dump.
dataX.size() > 0)
1864 dumpVector.push_back(dump);
1872 for (Int_t j=0; j<
fNonMusrData[i].theory->GetN(); j++) {
1876 if ((xval >= xmin) && (xval <= xmax)) {
1877 dump.
dataX.push_back(xval);
1878 dump.
data.push_back(yval);
1883 if (dump.
dataX.size() > 0)
1884 dumpVector.push_back(dump);
1911 fout.open(fileName, std::iostream::out);
1912 if (!fout.is_open()) {
1913 std::cerr << std::endl <<
">> PMusrCanvas::ExportData(): **ERROR** couldn't open file " << fileName <<
" for writing." << std::endl;
1918 UInt_t maxLength = 0;
1919 for (UInt_t i=0; i<dumpVector.size(); i++) {
1920 if (maxLength < dumpVector[i].dataX.size())
1921 maxLength = dumpVector[i].dataX.size();
1930 fout <<
"% from averaged view" << std::endl;
1931 fout <<
"% x, diff, errDiff" << std::endl;
1934 for (UInt_t i=0; i<dumpVector.size()-1; i++) {
1935 fout <<
"x" << i <<
" , diff" << i <<
", errDiff" << i <<
", ";
1937 fout <<
"x" << dumpVector.size()-1 <<
" , diff" << dumpVector.size()-1 <<
", errDiff" << dumpVector.size()-1 << std::endl;
1942 fout <<
"% from averaged view" << std::endl;
1943 fout <<
"% x, F_diffRe" << std::endl;
1946 for (UInt_t i=0; i<dumpVector.size()-1; i++) {
1947 fout <<
"freq" << i <<
", F_diffRe" << i <<
", ";
1949 fout <<
"freq" << dumpVector.size()-1 <<
", F_diffRe" << dumpVector.size()-1 << std::endl;
1954 fout <<
"% from averaged view" << std::endl;
1955 fout <<
"% x, F_diffIm" << std::endl;
1958 for (UInt_t i=0; i<dumpVector.size()-1; i++) {
1959 fout <<
"freq" << i <<
", F_diffIm" << i <<
", ";
1961 fout <<
"freq" << dumpVector.size()-1 <<
", F_diffIm" << dumpVector.size()-1 << std::endl;
1966 fout <<
"% from averaged view" << std::endl;
1967 fout <<
"% x, F_diffRe, F_diffIm" << std::endl;
1970 for (UInt_t i=0; i<dumpVector.size()/2; i++) {
1971 fout <<
"freq" << i <<
", F_diffRe" << i <<
", ";
1973 for (UInt_t i=0; i<dumpVector.size()/2-1; i++) {
1974 fout <<
"freq" << i <<
", F_diffIm" << i <<
", ";
1976 fout <<
"freq" << dumpVector.size()/2-1 <<
", F_diffIm" << dumpVector.size()/2-1 << std::endl;
1981 fout <<
"% from averaged view" << std::endl;
1982 fout <<
"% x, F_diffPwr" << std::endl;
1985 for (UInt_t i=0; i<dumpVector.size()-1; i++) {
1986 fout <<
"freq" << i <<
", F_diffPwr" << i <<
", ";
1988 fout <<
"freq" << dumpVector.size()-1 <<
", F_diffPwr" << dumpVector.size()-1 << std::endl;
1993 fout <<
"% from averaged view" << std::endl;
1994 fout <<
"% x, F_diffPhase" << std::endl;
1997 for (UInt_t i=0; i<dumpVector.size()-1; i++) {
1998 fout <<
"freq" << i <<
", F_diffPhase" << i <<
", ";
2000 fout <<
"freq" << dumpVector.size()-1 <<
", F_diffPhase" << dumpVector.size()-1 << std::endl;
2008 for (UInt_t i=0; i<maxLength; i++) {
2010 for (UInt_t j=0; j<dumpVector.size()-1; j++) {
2011 if (i<dumpVector[j].dataX.size()) {
2012 fout << dumpVector[j].dataX[i] <<
", ";
2013 fout << dumpVector[j].data[i] <<
", ";
2014 if (dumpVector[j].dataErr.size() > 0)
2015 fout << dumpVector[j].dataErr[i] <<
", ";
2017 if (dumpVector[j].dataErr.size() > 0)
2024 if (i<dumpVector[dumpVector.size()-1].dataX.size()) {
2025 fout << dumpVector[dumpVector.size()-1].dataX[i] <<
", ";
2026 fout << dumpVector[dumpVector.size()-1].data[i] <<
", ";
2027 if (dumpVector[dumpVector.size()-1].dataErr.size() > 0)
2028 fout << dumpVector[dumpVector.size()-1].dataErr[i];
2030 if (dumpVector[dumpVector.size()-1].dataErr.size() > 0)
2042 fout <<
"% from averaged view" << std::endl;
2043 fout <<
"% xData, data, errData, xTheory, theory" << std::endl;
2046 for (UInt_t i=0; i<dumpVector.size(); i++) {
2048 fout <<
"xData" << i/2 <<
" , data" << i/2 <<
", errData" << i/2 <<
", ";
2050 if (i == dumpVector.size()-1)
2051 fout <<
"xTheory" << (i-1)/2 <<
" , theory" << (i-1)/2 << std::endl;
2053 fout <<
"xTheory" << (i-1)/2 <<
" , theory" << (i-1)/2 <<
", ";
2059 fout <<
"% from averaged view" << std::endl;
2060 fout <<
"% freq, F_Re, freqTheo, F_theoRe" << std::endl;
2063 for (UInt_t i=0; i<dumpVector.size(); i++) {
2065 fout <<
"freq" << i/2 <<
", F_Re" << i/2 <<
", ";
2067 if (i == dumpVector.size()-1)
2068 fout <<
"freqTheo" << (i-1)/2 <<
", F_theoRe" << (i-1)/2 << std::endl;
2070 fout <<
"freqTheo" << (i-1)/2 <<
", F_theoRe" << (i-1)/2 <<
", ";
2076 fout <<
"% from averaged view" << std::endl;
2077 fout <<
"% freq, F_Im, freqTheo, F_theoIm" << std::endl;
2080 for (UInt_t i=0; i<dumpVector.size(); i++) {
2082 fout <<
"freq" << i/2 <<
", F_Im" << i/2 <<
", ";
2084 if (i == dumpVector.size()-1)
2085 fout <<
"freqTheo" << (i-1)/2 <<
", F_theoIm" << (i-1)/2 << std::endl;
2087 fout <<
"freqTheo" << (i-1)/2 <<
", F_theoIm" << (i-1)/2 <<
", ";
2093 fout <<
"% from averaged view" << std::endl;
2094 fout <<
"% freq, F_Re, freqTheo, F_theoRe, freq, F_Im, freqTheo, F_theoIm" << std::endl;
2097 for (UInt_t i=0; i<dumpVector.size(); i++) {
2099 fout <<
"freq" << i/4 <<
", F_Re" << i/4 <<
", ";
2100 else if (i % 4 == 1)
2101 fout <<
"freqTheo" << (i-1)/4 <<
", F_theoRe" << (i-1)/4 <<
", ";
2102 else if (i % 4 == 2)
2103 fout <<
"freq" << (i-2)/4 <<
", F_Im" << (i-2)/4 <<
", ";
2105 if (i == dumpVector.size()-1)
2106 fout <<
"freqTheo" << (i-3)/4 <<
", F_theoIm" << (i-3)/4 << std::endl;
2108 fout <<
"freqTheo" << (i-3)/4 <<
", F_theoIm" << (i-3)/4 <<
", ";
2114 fout <<
"% from averaged view" << std::endl;
2115 fout <<
"% freq, F_Pwr, freqTheo, F_theoPwr" << std::endl;
2118 for (UInt_t i=0; i<dumpVector.size(); i++) {
2120 fout <<
"freq" << i/2 <<
", F_Pwr" << i/2 <<
", ";
2122 if (i == dumpVector.size()-1)
2123 fout <<
"freqTheo" << (i-1)/2 <<
", F_theoPwr" << (i-1)/2 << std::endl;
2125 fout <<
"freqTheo" << (i-1)/2 <<
", F_theoPwr" << (i-1)/2 <<
", ";
2131 fout <<
"% from averaged view" << std::endl;
2132 fout <<
"% freq, F_Phase, freqTheo, F_theoPhase" << std::endl;
2135 for (UInt_t i=0; i<dumpVector.size(); i++) {
2137 fout <<
"freq" << i/2 <<
", F_Phase" << i/2 <<
", ";
2139 if (i == dumpVector.size()-1)
2140 fout <<
"freqTheo" << (i-1)/2 <<
", F_theoPhase" << (i-1)/2 << std::endl;
2142 fout <<
"freqTheo" << (i-1)/2 <<
", F_theoPhase" << (i-1)/2 <<
", ";
2151 for (UInt_t i=0; i<maxLength; i++) {
2153 for (UInt_t j=0; j<dumpVector.size()-1; j++) {
2154 if (i<dumpVector[j].dataX.size()) {
2155 fout << std::setprecision(9) << dumpVector[j].dataX[i] <<
", ";
2156 fout << std::setprecision(9) << dumpVector[j].data[i] <<
", ";
2157 if (dumpVector[j].dataErr.size() > 0)
2158 fout << std::setprecision(9) << dumpVector[j].dataErr[i] <<
", ";
2160 if (dumpVector[j].dataErr.size() > 0)
2167 if (i<dumpVector[dumpVector.size()-1].dataX.size()) {
2168 fout << std::setprecision(9) << dumpVector[dumpVector.size()-1].dataX[i] <<
", ";
2169 fout << std::setprecision(9) << dumpVector[dumpVector.size()-1].data[i];
2181 for (UInt_t i=0; i<dumpVector.size(); i++) {
2182 dumpVector[i].dataX.clear();
2183 dumpVector[i].data.clear();
2184 dumpVector[i].dataErr.clear();
2188 std::cout << std::endl <<
">> Data windows saved in ascii format ..." << std::endl;
2214 for (Int_t j=1; j<data->GetNbinsX(); j++) {
2216 x = data->GetBinCenter(j);
2218 if ((x >= xmin) && (x <= xmax)) {
2219 dump.
dataX.push_back(x);
2220 dump.
data.push_back(data->GetBinContent(j));
2222 dump.
dataErr.push_back(data->GetBinError(j));
2227 if (dump.
dataX.size() > 0)
2228 dumpData.push_back(dump);
2239 TString musrStyle(
"musrStyle");
2241 fStyle = std::make_unique<TStyle>(musrStyle, musrStyle);
2262 for (UInt_t i=0; i<2; i++) {
2327 TString canvasName = TString(
"fMainCanvas");
2329 fMainCanvas = std::make_unique<TCanvas>(canvasName.Data(), title, wtopx, wtopy, ww, wh);
2331 fMainCanvas->Connect(
"Closed()",
"PMusrCanvas",
this,
"LastCanvasClosed()");
2336 fImp->Connect(
"CloseWindow()",
"PMusrCanvas",
this,
"WindowClosed()");
2364 fBar->MapSubwindows();
2367 fPopupMain->Connect(
"TGPopupMenu",
"Activated(Int_t)",
"PMusrCanvas",
this,
"HandleMenuPopup(Int_t)");
2374 fTitlePad = std::make_unique<TPaveText>(0.0,
YTITLE, 1.0, 1.0,
"NDC");
2375 fTitlePad->SetFillColor(TColor::GetColor(255,255,255));
2392 fTheoryPad = std::make_unique<TPaveText>(
XTHEO, 0.1, 1.0, 0.5,
"NDC");
2393 fTheoryPad->SetFillColor(TColor::GetColor(255,255,255));
2399 fInfoPad = std::make_unique<TLegend>(0.0, 0.0, 1.0,
YINFO,
"NDC");
2400 fInfoPad->SetFillColor(TColor::GetColor(255,255,255));
2409 fMainCanvas->Connect(
"ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",
"PMusrCanvas",
2410 this,
"HandleCmdKey(Int_t,Int_t,Int_t,TObject*)");
2423 dataSet.
data =
nullptr;
2429 dataSet.
theory =
nullptr;
2435 dataSet.
diff =
nullptr;
2454 dataSet.
data =
nullptr;
2459 dataSet.
theory =
nullptr;
2464 dataSet.
diff =
nullptr;
2483 delete dataSet.
data;
2484 dataSet.
data =
nullptr;
2508 dataSet.
theory =
nullptr;
2531 delete dataSet.
diff;
2532 dataSet.
diff =
nullptr;
2571 delete dataSet.
data;
2572 dataSet.
data =
nullptr;
2592 dataSet.
theory =
nullptr;
2611 delete dataSet.
diff;
2612 dataSet.
diff =
nullptr;
2655 Double_t xmin, xmax, ymin, ymax;
2666 name +=
static_cast<Int_t
>(runNo);
2802 dataHisto =
new TH1F(name, name, size, start, end);
2806 UInt_t startBin = 0;
2807 UInt_t endBin = data->
GetValue()->size();
2818 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin data < 0 for 'use_fit_range', will set it to 0" << std::endl << std::endl;
2819 }
else if (dval >= (Double_t)data->
GetValue()->size()) {
2820 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin data=" << (UInt_t)dval <<
" >= data vector size=" << data->
GetValue()->size() <<
" for 'use_fit_range',";
2821 std::cerr << std::endl <<
">> will set it to data vector size" << std::endl << std::endl;
2822 startBin = data->
GetValue()->size();
2824 startBin = (UInt_t)dval;
2834 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin data < 0 for 'use_fit_range', will set it to 0" << std::endl << std::endl;
2835 }
else if (dval >= (Double_t)data->
GetValue()->size()) {
2836 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin data=" << (UInt_t)dval <<
" >= data vector size=" << data->
GetValue()->size() <<
" for 'use_fit_range',";
2837 std::cerr << std::endl <<
">> will set it to data vector size" << std::endl << std::endl;
2840 endBin = (UInt_t)dval;
2849 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin data < 0 for 'sub_ranges', will set it to 0" << std::endl << std::endl;
2850 }
else if (dval >= (Double_t)data->
GetValue()->size()) {
2851 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin data=" << (UInt_t)dval <<
" >= data vector size=" << data->
GetValue()->size() <<
" for 'sub_ranges',";
2852 std::cerr << std::endl <<
">> will set it to data vector size" << std::endl << std::endl;
2853 startBin = data->
GetValue()->size();
2855 startBin = (UInt_t)dval;
2861 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin data < 0 for 'sub_ranges', will set it to 0" << std::endl << std::endl;
2862 }
else if (dval >= (Double_t)data->
GetValue()->size()) {
2863 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin data=" << (UInt_t)dval <<
" >= data vector size=" << data->
GetValue()->size() <<
" for 'sub_ranges',";
2864 std::cerr << std::endl <<
">> will set it to data vector size" << std::endl << std::endl;
2867 endBin = (UInt_t)dval;
2871 for (UInt_t i=startBin; i<endBin; i++) {
2872 dataHisto->SetBinContent(i-startBin+1, data->
GetValue()->at(i));
2873 dataHisto->SetBinError(i-startBin+1, data->
GetError()->at(i));
2878 dataHisto->SetMarkerColor(
fColorList[plotNo]);
2881 TRandom rand(plotNo);
2882 Int_t color = TColor::GetColor((Int_t)rand.Integer(255), (Int_t)rand.Integer(255), (Int_t)rand.Integer(255));
2883 dataHisto->SetMarkerColor(color);
2884 dataHisto->SetLineColor(color);
2887 dataHisto->SetMarkerSize(1);
2892 TRandom rand(plotNo);
2893 dataHisto->SetMarkerStyle(20+(Int_t)rand.Integer(10));
2899 name += (Int_t)runNo;
2935 theoHisto =
new TH1F(name, name, size, start, end);
2950 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin theory < 0 for 'use_fit_range', will set it to 0" << std::endl << std::endl;
2951 }
else if (dval >= (Double_t)data->
GetTheory()->size()) {
2952 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin theory=" << (UInt_t)dval <<
" >= theory vector size=" << data->
GetTheory()->size() <<
" for 'use_fit_range',";
2953 std::cerr << std::endl <<
">> will set it to theory vector size" << std::endl << std::endl;
2956 startBin = (UInt_t)dval;
2966 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin theory < 0 for 'use_fit_range', will set it to 0" << std::endl << std::endl;
2967 }
else if (dval >= (Double_t)data->
GetTheory()->size()) {
2968 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin theory=" << (UInt_t)dval <<
" >= theory vector size=" << data->
GetTheory()->size() <<
" for 'use_fit_range',";
2969 std::cerr << std::endl <<
">> will set it to theory vector size" << std::endl << std::endl;
2972 endBin = (UInt_t)dval;
2984 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin theory < 0 for 'sub_ranges', will set it to 0" << std::endl << std::endl;
2985 }
else if (dval >= (Double_t)data->
GetTheory()->size()) {
2986 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin theory=" << (UInt_t)dval <<
" >= theory vector size=" << data->
GetTheory()->size() <<
" for 'sub_ranges',";
2987 std::cerr << std::endl <<
">> will set it to theory vector size" << std::endl << std::endl;
2990 startBin = (UInt_t)dval;
2996 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin theory < 0 for 'sub_ranges', will set it to 0" << std::endl << std::endl;
2997 }
else if (dval >= (Double_t)data->
GetTheory()->size()) {
2998 std::cerr << std::endl <<
">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin theory=" << (UInt_t)dval <<
" >= theory vector size=" << data->
GetTheory()->size() <<
" for 'sub_ranges',";
2999 std::cerr << std::endl <<
">> will set it to theory vector size" << std::endl << std::endl;
3002 endBin = (UInt_t)dval;
3006 for (UInt_t i=startBin; i<endBin; i++) {
3007 theoHisto->SetBinContent(i-startBin+1, data->
GetTheory()->at(i));
3014 TRandom rand(plotNo);
3015 Int_t color = TColor::GetColor((Int_t)rand.Integer(255), (Int_t)rand.Integer(255), (Int_t)rand.Integer(255));
3016 theoHisto->SetLineColor(color);
3020 dataSet.
data = dataHisto;
3021 dataSet.
theory = theoHisto;
3024 fData.push_back(dataSet);
3040 TGraphErrors *dataHisto;
3041 TGraphErrors *theoHisto;
3051 dataHisto =
new TGraphErrors(data->
GetX()->size());
3054 for (UInt_t i=0; i<data->
GetX()->size(); i++) {
3055 dataHisto->SetPoint(i, data->
GetX()->at(i), data->
GetValue()->at(i));
3056 dataHisto->SetPointError(i, 0.0, data->
GetError()->at(i));
3061 dataHisto->SetMarkerColor(
fColorList[plotNo]);
3064 TRandom rand(plotNo);
3065 Int_t color = TColor::GetColor((Int_t)rand.Integer(255), (Int_t)rand.Integer(255), (Int_t)rand.Integer(255));
3066 dataHisto->SetMarkerColor(color);
3067 dataHisto->SetLineColor(color);
3070 dataHisto->SetMarkerSize(1);
3075 TRandom rand(plotNo);
3076 dataHisto->SetMarkerStyle(20+(Int_t)rand.Integer(10));
3082 theoHisto =
new TGraphErrors(data->
GetXTheory()->size());
3085 for (UInt_t i=0; i<data->
GetXTheory()->size(); i++) {
3087 theoHisto->SetPointError(i, 0.0, 0.0);
3094 TRandom rand(plotNo);
3095 Int_t color = TColor::GetColor((Int_t)rand.Integer(255), (Int_t)rand.Integer(255), (Int_t)rand.Integer(255));
3096 theoHisto->SetLineColor(color);
3100 dataSet.
data = dataHisto;
3101 dataSet.
theory = theoHisto;
3105 Double_t xmin=0.0, xmax=0.0, ymin=0.0, ymax=0.0, x=0.0, y=0.0;
3109 dataSet.
data->GetPoint(0, xmin, y);
3110 dataSet.
data->GetPoint(dataSet.
data->GetN()-1, xmax, y);
3111 dataSet.
data->GetPoint(0, x, y);
3114 for (Int_t i=1; i<dataSet.
data->GetN(); i++) {
3115 dataSet.
data->GetPoint(i, x, y);
3121 Double_t dx = 0.025*(xmax-xmin);
3122 Double_t dy = 0.025*(ymax-ymin);
3181 if (fXmax < dataSet.dataRange->GetXmax())
3185 if (fYmax < dataSet.dataRange->GetYmax())
3207 for (UInt_t i=0; i<
fData.size(); i++) {
3209 name = TString(
fData[i].data->GetTitle()) +
"_diff";
3210 diffHisto =
new TH1F(name, name,
fData[i].data->GetNbinsX(),
3211 fData[i].data->GetXaxis()->GetXmin(),
3212 fData[i].data->GetXaxis()->GetXmax());
3215 diffHisto->SetMarkerColor(
fData[i].data->GetMarkerColor());
3216 diffHisto->SetLineColor(
fData[i].data->GetLineColor());
3218 diffHisto->SetMarkerSize(
fData[i].data->GetMarkerSize());
3220 diffHisto->SetMarkerStyle(
fData[i].data->GetMarkerStyle());
3223 fData[i].diff = diffHisto;
3226 for (Int_t j=1; j<
fData[i].data->GetNbinsX()-1; j++) {
3229 fData[i].data->GetBinContent(j),
3231 fData[i].diff->SetBinContent(j, value);
3233 value =
fData[i].data->GetBinError(j);
3234 fData[i].diff->SetBinError(j, value);
3238 TGraphErrors *diffHisto;
3246 diffHisto =
new TGraphErrors(
fNonMusrData[i].data->GetN());
3249 name = TString(
fNonMusrData[i].data->GetTitle()) +
"_diff";
3250 diffHisto->SetNameTitle(name.Data(), name.Data());
3253 diffHisto->SetMarkerColor(
fNonMusrData[i].data->GetMarkerColor());
3254 diffHisto->SetLineColor(
fNonMusrData[i].data->GetLineColor());
3256 diffHisto->SetMarkerSize(
fNonMusrData[i].data->GetMarkerSize());
3258 diffHisto->SetMarkerStyle(
fNonMusrData[i].data->GetMarkerStyle());
3295 if (
fData[0].dataFourierRe ==
nullptr) {
3297 double startTime =
fXmin;
3298 double endTime =
fXmax;
3305 for (UInt_t i=0; i<
fData.size(); i++) {
3309 std::cerr << std::endl <<
">> PMusrCanvas::HandleFourier(): **SEVERE ERROR** couldn't invoke PFourier to calculate the Fourier data ..." << std::endl;
3314 scale = sqrt(
fData[0].data->GetBinWidth(1)/(endTime-startTime));
3325 fData[i].dataFourierRe->SetMarkerColor(
fData[i].data->GetMarkerColor());
3326 fData[i].dataFourierRe->SetLineColor(
fData[i].data->GetLineColor());
3327 fData[i].dataFourierIm->SetMarkerColor(
fData[i].data->GetMarkerColor());
3328 fData[i].dataFourierIm->SetLineColor(
fData[i].data->GetLineColor());
3329 fData[i].dataFourierPwr->SetMarkerColor(
fData[i].data->GetMarkerColor());
3330 fData[i].dataFourierPwr->SetLineColor(
fData[i].data->GetLineColor());
3331 fData[i].dataFourierPhase->SetMarkerColor(
fData[i].data->GetMarkerColor());
3332 fData[i].dataFourierPhase->SetLineColor(
fData[i].data->GetLineColor());
3335 fData[i].dataFourierRe->SetMarkerSize(1);
3336 fData[i].dataFourierIm->SetMarkerSize(1);
3337 fData[i].dataFourierPwr->SetMarkerSize(1);
3338 fData[i].dataFourierPhase->SetMarkerSize(1);
3341 fData[i].dataFourierRe->SetMarkerStyle(
fData[i].data->GetMarkerStyle());
3342 fData[i].dataFourierIm->SetMarkerStyle(
fData[i].data->GetMarkerStyle());
3343 fData[i].dataFourierPwr->SetMarkerStyle(
fData[i].data->GetMarkerStyle());
3344 fData[i].dataFourierPhase->SetMarkerStyle(
fData[i].data->GetMarkerStyle());
3354 if (!fourierTheory->
IsValid()) {
3355 std::cerr << std::endl <<
">> PMusrCanvas::HandleFourier(): **SEVERE ERROR** couldn't invoke PFourier to calculate the Fourier theory ..." << std::endl;
3359 scale = sqrt(
fData[0].theory->GetBinWidth(1)/(endTime-startTime)*
fData[0].theory->GetBinWidth(1)/
fData[0].data->GetBinWidth(1));
3370 delete fourierTheory;
3373 fData[i].theoryFourierRe->SetLineColor(
fData[i].theory->GetLineColor());
3374 fData[i].theoryFourierIm->SetLineColor(
fData[i].theory->GetLineColor());
3375 fData[i].theoryFourierPwr->SetLineColor(
fData[i].theory->GetLineColor());
3376 fData[i].theoryFourierPhase->SetLineColor(
fData[i].theory->GetLineColor());
3391 for (UInt_t i=0; i<
fData.size(); i++) {
3399 if ((
fData[i].dataFourierRe !=
nullptr) && (
fData[i].dataFourierIm !=
nullptr)) {
3400 for (Int_t j=0; j<
fData[i].dataFourierRe->GetNbinsX(); j++) {
3402 re =
fData[i].dataFourierRe->GetBinContent(j) * cp +
fData[i].dataFourierIm->GetBinContent(j) * sp;
3403 im =
fData[i].dataFourierIm->GetBinContent(j) * cp -
fData[i].dataFourierRe->GetBinContent(j) * sp;
3405 fData[i].dataFourierRe->SetBinContent(j, re);
3406 fData[i].dataFourierIm->SetBinContent(j, im);
3409 if ((
fData[i].theoryFourierRe !=
nullptr) && (
fData[i].theoryFourierIm !=
nullptr)) {
3410 for (Int_t j=0; j<
fData[i].theoryFourierRe->GetNbinsX(); j++) {
3412 re =
fData[i].theoryFourierRe->GetBinContent(j) * cp +
fData[i].theoryFourierIm->GetBinContent(j) * sp;
3413 im =
fData[i].theoryFourierIm->GetBinContent(j) * cp -
fData[i].theoryFourierRe->GetBinContent(j) * sp;
3415 fData[i].theoryFourierRe->SetBinContent(j, re);
3416 fData[i].theoryFourierIm->SetBinContent(j, im);
3439 if (
fData[0].diffFourierRe ==
nullptr) {
3441 if (
fData[0].diff ==
nullptr)
3447 double startTime =
fHistoFrame->GetBinCenter(bin);
3451 for (UInt_t i=0; i<
fData.size(); i++) {
3455 std::cerr << std::endl <<
">> PMusrCanvas::HandleFourier(): **SEVERE ERROR** couldn't invoke PFourier to calculate the Fourier diff ..." << std::endl;
3460 scale = sqrt(
fData[0].diff->GetBinWidth(1)/(endTime-startTime));
3471 fData[i].diffFourierRe->SetMarkerColor(
fData[i].diff->GetMarkerColor());
3472 fData[i].diffFourierRe->SetLineColor(
fData[i].diff->GetLineColor());
3473 fData[i].diffFourierIm->SetMarkerColor(
fData[i].diff->GetMarkerColor());
3474 fData[i].diffFourierIm->SetLineColor(
fData[i].diff->GetLineColor());
3475 fData[i].diffFourierPwr->SetMarkerColor(
fData[i].diff->GetMarkerColor());
3476 fData[i].diffFourierPwr->SetLineColor(
fData[i].diff->GetLineColor());
3477 fData[i].diffFourierPhase->SetMarkerColor(
fData[i].diff->GetMarkerColor());
3478 fData[i].diffFourierPhase->SetLineColor(
fData[i].diff->GetLineColor());
3481 fData[i].diffFourierRe->SetMarkerSize(1);
3482 fData[i].diffFourierIm->SetMarkerSize(1);
3483 fData[i].diffFourierPwr->SetMarkerSize(1);
3484 fData[i].diffFourierPhase->SetMarkerSize(1);
3486 fData[i].diffFourierRe->SetMarkerStyle(
fData[i].diff->GetMarkerStyle());
3487 fData[i].diffFourierIm->SetMarkerStyle(
fData[i].diff->GetMarkerStyle());
3488 fData[i].diffFourierPwr->SetMarkerStyle(
fData[i].diff->GetMarkerStyle());
3489 fData[i].diffFourierPhase->SetMarkerStyle(
fData[i].diff->GetMarkerStyle());
3492 fData[i].diffFourierTag = 1;
3503 for (UInt_t i=0; i<
fData.size(); i++) {
3504 if ((
fData[i].diffFourierRe !=
nullptr) && (
fData[i].diffFourierIm !=
nullptr)) {
3512 for (Int_t j=0; j<
fData[i].diffFourierRe->GetNbinsX(); j++) {
3514 re =
fData[i].diffFourierRe->GetBinContent(j) * cp +
fData[i].diffFourierIm->GetBinContent(j) * sp;
3515 im =
fData[i].diffFourierIm->GetBinContent(j) * cp -
fData[i].diffFourierRe->GetBinContent(j) * sp;
3517 fData[i].diffFourierRe->SetBinContent(j, re);
3518 fData[i].diffFourierIm->SetBinContent(j, im);
3541 if (
fData[0].diffFourierRe ==
nullptr) {
3543 Double_t dval, dvalx;
3546 for (UInt_t i=0; i<
fData.size(); i++) {
3549 name = TString(
fData[i].dataFourierRe->GetTitle()) +
"_diff";
3550 fData[i].diffFourierRe =
new TH1F(name, name,
fData[i].dataFourierRe->GetNbinsX(),
3551 fData[i].dataFourierRe->GetXaxis()->GetXmin(),
3552 fData[i].dataFourierRe->GetXaxis()->GetXmax());
3555 name = TString(
fData[i].dataFourierIm->GetTitle()) +
"_diff";
3556 fData[i].diffFourierIm =
new TH1F(name, name,
fData[i].dataFourierIm->GetNbinsX(),
3557 fData[i].dataFourierIm->GetXaxis()->GetXmin(),
3558 fData[i].dataFourierIm->GetXaxis()->GetXmax());
3560 name = TString(
fData[i].dataFourierPwr->GetTitle()) +
"_diff";
3561 fData[i].diffFourierPwr =
new TH1F(name, name,
fData[i].dataFourierPwr->GetNbinsX(),
3562 fData[i].dataFourierPwr->GetXaxis()->GetXmin(),
3563 fData[i].dataFourierPwr->GetXaxis()->GetXmax());
3565 name = TString(
fData[i].dataFourierPhase->GetTitle()) +
"_diff";
3566 fData[i].diffFourierPhase =
new TH1F(name, name,
fData[i].dataFourierPhase->GetNbinsX(),
3567 fData[i].dataFourierPhase->GetXaxis()->GetXmin(),
3568 fData[i].dataFourierPhase->GetXaxis()->GetXmax());
3571 if (
fData[i].dataFourierPhaseOptReal !=
nullptr) {
3572 name = TString(
fData[i].dataFourierPhaseOptReal->GetTitle()) +
"_diff";
3573 fData[i].diffFourierPhaseOptReal =
new TH1F(name, name,
fData[i].dataFourierPhaseOptReal->GetNbinsX(),
3574 fData[i].dataFourierPhaseOptReal->GetXaxis()->GetXmin(),
3575 fData[i].dataFourierPhaseOptReal->GetXaxis()->GetXmax());
3579 for (UInt_t j=1; j<
fData[i].dataFourierRe->GetEntries(); j++) {
3580 dvalx =
fData[i].dataFourierRe->GetXaxis()->GetBinCenter(j);
3581 theoBin =
fData[i].theoryFourierRe->FindBin(dvalx);
3582 dval =
fData[i].dataFourierRe->GetBinContent(j) -
fData[i].theoryFourierRe->GetBinContent(theoBin);
3583 fData[i].diffFourierRe->SetBinContent(j, dval);
3584 dvalx =
fData[i].dataFourierIm->GetXaxis()->GetBinCenter(j);
3585 theoBin =
fData[i].theoryFourierIm->FindBin(dvalx);
3586 dval =
fData[i].dataFourierIm->GetBinContent(j) -
fData[i].theoryFourierIm->GetBinContent(theoBin);
3587 fData[i].diffFourierIm->SetBinContent(j, dval);
3588 dvalx =
fData[i].dataFourierPwr->GetXaxis()->GetBinCenter(j);
3589 theoBin =
fData[i].theoryFourierPwr->FindBin(dvalx);
3590 dval =
fData[i].dataFourierPwr->GetBinContent(j) -
fData[i].theoryFourierPwr->GetBinContent(theoBin);
3591 fData[i].diffFourierPwr->SetBinContent(j, dval);
3592 dvalx =
fData[i].dataFourierPhase->GetXaxis()->GetBinCenter(j);
3593 theoBin =
fData[i].theoryFourierPhase->FindBin(dvalx);
3594 dval =
fData[i].dataFourierPhase->GetBinContent(j) -
fData[i].theoryFourierPhase->GetBinContent(theoBin);
3595 fData[i].diffFourierPhase->SetBinContent(j, dval);
3596 if (
fData[i].dataFourierPhaseOptReal !=
nullptr) {
3597 dvalx =
fData[i].dataFourierPhaseOptReal->GetXaxis()->GetBinCenter(j);
3598 theoBin =
fData[i].theoryFourierPhaseOptReal->FindBin(dvalx);
3599 dval =
fData[i].dataFourierPhaseOptReal->GetBinContent(j) -
fData[i].theoryFourierPhaseOptReal->GetBinContent(theoBin);
3600 fData[i].diffFourierPhaseOptReal->SetBinContent(j, dval);
3605 for (UInt_t i=0; i<
fData.size(); i++) {
3607 fData[i].diffFourierRe->SetMarkerColor(
fData[i].dataFourierRe->GetMarkerColor());
3608 fData[i].diffFourierRe->SetLineColor(
fData[i].dataFourierRe->GetLineColor());
3609 fData[i].diffFourierIm->SetMarkerColor(
fData[i].dataFourierIm->GetMarkerColor());
3610 fData[i].diffFourierIm->SetLineColor(
fData[i].dataFourierIm->GetLineColor());
3611 fData[i].diffFourierPwr->SetMarkerColor(
fData[i].dataFourierPwr->GetMarkerColor());
3612 fData[i].diffFourierPwr->SetLineColor(
fData[i].dataFourierPwr->GetLineColor());
3613 fData[i].diffFourierPhase->SetMarkerColor(
fData[i].dataFourierPhase->GetMarkerColor());
3614 fData[i].diffFourierPhase->SetLineColor(
fData[i].dataFourierPhase->GetLineColor());
3615 if (
fData[i].dataFourierPhaseOptReal !=
nullptr) {
3616 fData[i].diffFourierPhaseOptReal->SetMarkerColor(
fData[i].dataFourierPhaseOptReal->GetMarkerColor());
3617 fData[i].diffFourierPhaseOptReal->SetLineColor(
fData[i].dataFourierPhaseOptReal->GetLineColor());
3621 fData[i].diffFourierRe->SetMarkerSize(1);
3622 fData[i].diffFourierIm->SetMarkerSize(1);
3623 fData[i].diffFourierPwr->SetMarkerSize(1);
3624 fData[i].diffFourierPhase->SetMarkerSize(1);
3625 if (
fData[i].dataFourierPhaseOptReal !=
nullptr) {
3626 fData[i].diffFourierPhaseOptReal->SetMarkerSize(1);
3629 fData[i].diffFourierRe->SetMarkerStyle(
fData[i].dataFourierRe->GetMarkerStyle());
3630 fData[i].diffFourierIm->SetMarkerStyle(
fData[i].dataFourierIm->GetMarkerStyle());
3631 fData[i].diffFourierPwr->SetMarkerStyle(
fData[i].dataFourierPwr->GetMarkerStyle());
3632 fData[i].diffFourierPhase->SetMarkerStyle(
fData[i].dataFourierPhase->GetMarkerStyle());
3633 if (
fData[i].dataFourierPhaseOptReal !=
nullptr) {
3634 fData[i].diffFourierPhaseOptReal->SetMarkerStyle(
fData[i].dataFourierPhaseOptReal->GetMarkerStyle());
3638 fData[i].diffFourierTag = 2;
3664 if (
fData[0].data !=
nullptr) {
3665 name = TString(
fData[0].data->GetTitle()) +
"_avg";
3667 fData[0].data->GetXaxis()->GetXmin(),
3668 fData[0].data->GetXaxis()->GetXmax());
3670 if (
fData[0].dataFourierRe !=
nullptr) {
3671 name = TString(
fData[0].dataFourierRe->GetTitle()) +
"_avg";
3673 fData[0].dataFourierRe->GetXaxis()->GetXmin(),
3674 fData[0].dataFourierRe->GetXaxis()->GetXmax());
3676 if (
fData[0].dataFourierIm !=
nullptr) {
3677 name = TString(
fData[0].dataFourierIm->GetTitle()) +
"_avg";
3679 fData[0].dataFourierIm->GetXaxis()->GetXmin(),
3680 fData[0].dataFourierIm->GetXaxis()->GetXmax());
3682 if (
fData[0].dataFourierPwr !=
nullptr) {
3683 name = TString(
fData[0].dataFourierPwr->GetTitle()) +
"_avg";
3685 fData[0].dataFourierPwr->GetXaxis()->GetXmin(),
3686 fData[0].dataFourierPwr->GetXaxis()->GetXmax());
3688 if (
fData[0].dataFourierPhase !=
nullptr) {
3689 name = TString(
fData[0].dataFourierPhase->GetTitle()) +
"_avg";
3691 fData[0].dataFourierPhase->GetXaxis()->GetXmin(),
3692 fData[0].dataFourierPhase->GetXaxis()->GetXmax());
3694 if (
fData[0].dataFourierPhaseOptReal !=
nullptr) {
3695 name = TString(
fData[0].dataFourierPhaseOptReal->GetTitle()) +
"_avg";
3697 fData[0].dataFourierPhaseOptReal->GetXaxis()->GetXmin(),
3698 fData[0].dataFourierPhaseOptReal->GetXaxis()->GetXmax());
3700 if (
fData[0].theory !=
nullptr) {
3701 name = TString(
fData[0].theory->GetTitle()) +
"_avg";
3703 fData[0].theory->GetXaxis()->GetXmin(),
3704 fData[0].theory->GetXaxis()->GetXmax());
3706 if (
fData[0].theoryFourierRe !=
nullptr) {
3707 name = TString(
fData[0].theoryFourierRe->GetTitle()) +
"_avg";
3709 fData[0].theoryFourierRe->GetXaxis()->GetXmin(),
3710 fData[0].theoryFourierRe->GetXaxis()->GetXmax());
3712 if (
fData[0].theoryFourierIm !=
nullptr) {
3713 name = TString(
fData[0].theoryFourierIm->GetTitle()) +
"_avg";
3715 fData[0].theoryFourierIm->GetXaxis()->GetXmin(),
3716 fData[0].theoryFourierIm->GetXaxis()->GetXmax());
3718 if (
fData[0].theoryFourierPwr !=
nullptr) {
3719 name = TString(
fData[0].theoryFourierPwr->GetTitle()) +
"_avg";
3721 fData[0].theoryFourierPwr->GetXaxis()->GetXmin(),
3722 fData[0].theoryFourierPwr->GetXaxis()->GetXmax());
3724 if (
fData[0].theoryFourierPhase !=
nullptr) {
3725 name = TString(
fData[0].theoryFourierPhase->GetTitle()) +
"_avg";
3727 fData[0].theoryFourierPhase->GetXaxis()->GetXmin(),
3728 fData[0].theoryFourierPhase->GetXaxis()->GetXmax());
3730 if (
fData[0].theoryFourierPhaseOptReal !=
nullptr) {
3731 name = TString(
fData[0].theoryFourierPhaseOptReal->GetTitle()) +
"_avg";
3733 fData[0].theoryFourierPhaseOptReal->GetXaxis()->GetXmin(),
3734 fData[0].theoryFourierPhaseOptReal->GetXaxis()->GetXmax());
3736 if (
fData[0].diff !=
nullptr) {
3737 name = TString(
fData[0].diff->GetTitle()) +
"_avg";
3739 fData[0].diff->GetXaxis()->GetXmin(),
3740 fData[0].diff->GetXaxis()->GetXmax());
3742 if (
fData[0].diffFourierRe !=
nullptr) {
3743 name = TString(
fData[0].diffFourierRe->GetTitle()) +
"_avg";
3745 fData[0].diffFourierRe->GetXaxis()->GetXmin(),
3746 fData[0].diffFourierRe->GetXaxis()->GetXmax());
3748 if (
fData[0].diffFourierIm !=
nullptr) {
3749 name = TString(
fData[0].diffFourierIm->GetTitle()) +
"_avg";
3751 fData[0].diffFourierIm->GetXaxis()->GetXmin(),
3752 fData[0].diffFourierIm->GetXaxis()->GetXmax());
3754 if (
fData[0].diffFourierPwr !=
nullptr) {
3755 name = TString(
fData[0].diffFourierPwr->GetTitle()) +
"_avg";
3757 fData[0].diffFourierPwr->GetXaxis()->GetXmin(),
3758 fData[0].diffFourierPwr->GetXaxis()->GetXmax());
3760 if (
fData[0].diffFourierPhase !=
nullptr) {
3761 name = TString(
fData[0].diffFourierPhase->GetTitle()) +
"_avg";
3763 fData[0].diffFourierPhase->GetXaxis()->GetXmin(),
3764 fData[0].diffFourierPhase->GetXaxis()->GetXmax());
3766 if (
fData[0].diffFourierPhaseOptReal !=
nullptr) {
3767 name = TString(
fData[0].diffFourierPhaseOptReal->GetTitle()) +
"_avg";
3769 fData[0].diffFourierPhaseOptReal->GetXaxis()->GetXmin(),
3770 fData[0].diffFourierPhaseOptReal->GetXaxis()->GetXmax());
3776 for (Int_t i=0; i<
fData[0].data->GetNbinsX(); i++) {
3778 for (UInt_t j=0; j<
fData.size(); j++) {
3790 for (Int_t i=0; i<
fData[0].dataFourierRe->GetNbinsX(); i++) {
3792 for (UInt_t j=0; j<
fData.size(); j++) {
3804 for (Int_t i=0; i<
fData[0].dataFourierIm->GetNbinsX(); i++) {
3806 for (UInt_t j=0; j<
fData.size(); j++) {
3818 for (Int_t i=0; i<
fData[0].dataFourierPwr->GetNbinsX(); i++) {
3820 for (UInt_t j=0; j<
fData.size(); j++) {
3832 for (Int_t i=0; i<
fData[0].dataFourierPhase->GetNbinsX(); i++) {
3834 for (UInt_t j=0; j<
fData.size(); j++) {
3846 for (Int_t i=0; i<
fData[0].dataFourierPhaseOptReal->GetNbinsX(); i++) {
3848 for (UInt_t j=0; j<
fData.size(); j++) {
3860 for (Int_t i=0; i<
fData[0].theory->GetNbinsX(); i++) {
3862 for (UInt_t j=0; j<
fData.size(); j++) {
3870 for (Int_t i=0; i<
fData[0].theoryFourierRe->GetNbinsX(); i++) {
3872 for (UInt_t j=0; j<
fData.size(); j++) {
3884 for (Int_t i=0; i<
fData[0].theoryFourierIm->GetNbinsX(); i++) {
3886 for (UInt_t j=0; j<
fData.size(); j++) {
3898 for (Int_t i=0; i<
fData[0].theoryFourierPwr->GetNbinsX(); i++) {
3900 for (UInt_t j=0; j<
fData.size(); j++) {
3912 for (Int_t i=0; i<
fData[0].theoryFourierPhase->GetNbinsX(); i++) {
3914 for (UInt_t j=0; j<
fData.size(); j++) {
3926 for (Int_t i=0; i<
fData[0].theoryFourierPhaseOptReal->GetNbinsX(); i++) {
3928 for (UInt_t j=0; j<
fData.size(); j++) {
3940 for (Int_t i=0; i<
fData[0].diff->GetNbinsX(); i++) {
3942 for (UInt_t j=0; j<
fData.size(); j++) {
3954 for (Int_t i=0; i<
fData[0].diffFourierRe->GetNbinsX(); i++) {
3956 for (UInt_t j=0; j<
fData.size(); j++) {
3968 for (Int_t i=0; i<
fData[0].diffFourierIm->GetNbinsX(); i++) {
3970 for (UInt_t j=0; j<
fData.size(); j++) {
3982 for (Int_t i=0; i<
fData[0].diffFourierPwr->GetNbinsX(); i++) {
3984 for (UInt_t j=0; j<
fData.size(); j++) {
3996 for (Int_t i=0; i<
fData[0].diffFourierPhase->GetNbinsX(); i++) {
3998 for (UInt_t j=0; j<
fData.size(); j++) {
4010 for (Int_t i=0; i<
fData[0].diffFourierPhaseOptReal->GetNbinsX(); i++) {
4012 for (UInt_t j=0; j<
fData.size(); j++) {
4033 for (UInt_t i=0; i<
fData.size(); i++) {
4034 if (
fData[i].diff !=
nullptr) {
4035 delete fData[i].diff;
4036 fData[i].diff =
nullptr;
4049 for (UInt_t i=0; i<
fData.size(); i++) {
4050 if (
fData[i].dataFourierRe !=
nullptr) {
4051 delete fData[i].dataFourierRe;
4052 fData[i].dataFourierRe =
nullptr;
4054 if (
fData[i].dataFourierIm !=
nullptr) {
4055 delete fData[i].dataFourierIm;
4056 fData[i].dataFourierIm =
nullptr;
4058 if (
fData[i].dataFourierPwr !=
nullptr) {
4059 delete fData[i].dataFourierPwr;
4060 fData[i].dataFourierPwr =
nullptr;
4062 if (
fData[i].dataFourierPhase !=
nullptr) {
4063 delete fData[i].dataFourierPhase;
4064 fData[i].dataFourierPhase =
nullptr;
4066 if (
fData[i].dataFourierPhaseOptReal !=
nullptr) {
4067 delete fData[i].dataFourierPhaseOptReal;
4068 fData[i].dataFourierPhaseOptReal =
nullptr;
4070 if (
fData[i].theoryFourierRe !=
nullptr) {
4071 delete fData[i].theoryFourierRe;
4072 fData[i].theoryFourierRe =
nullptr;
4074 if (
fData[i].theoryFourierIm !=
nullptr) {
4075 delete fData[i].theoryFourierIm;
4076 fData[i].theoryFourierIm =
nullptr;
4078 if (
fData[i].theoryFourierPwr !=
nullptr) {
4079 delete fData[i].theoryFourierPwr;
4080 fData[i].theoryFourierPwr =
nullptr;
4082 if (
fData[i].theoryFourierPhase !=
nullptr) {
4083 delete fData[i].theoryFourierPhase;
4084 fData[i].theoryFourierPhase =
nullptr;
4086 if (
fData[i].theoryFourierPhaseOptReal !=
nullptr) {
4087 delete fData[i].theoryFourierPhaseOptReal;
4088 fData[i].theoryFourierPhaseOptReal =
nullptr;
4101 for (UInt_t i=0; i<
fData.size(); i++) {
4102 if (
fData[i].diffFourierRe !=
nullptr) {
4103 delete fData[i].diffFourierRe;
4104 fData[i].diffFourierRe =
nullptr;
4106 if (
fData[i].diffFourierIm !=
nullptr) {
4107 delete fData[i].diffFourierIm;
4108 fData[i].diffFourierIm =
nullptr;
4110 if (
fData[i].diffFourierPwr !=
nullptr) {
4111 delete fData[i].diffFourierPwr;
4112 fData[i].diffFourierPwr =
nullptr;
4114 if (
fData[i].diffFourierPhase !=
nullptr) {
4115 delete fData[i].diffFourierPhase;
4116 fData[i].diffFourierPhase =
nullptr;
4118 if (
fData[i].diffFourierPhaseOptReal !=
nullptr) {
4119 delete fData[i].diffFourierPhaseOptReal;
4120 fData[i].diffFourierPhaseOptReal =
nullptr;
4218 if ((min == -1.0) && (max == -1.0)) {
4223 min =
fData[0].dataFourierRe->GetBinLowEdge(1);
4224 max =
fData[0].dataFourierRe->GetBinLowEdge(
fData[0].dataFourierRe->GetNbinsX())+
fData[0].dataFourierRe->GetBinWidth(1);
4232 for (UInt_t i=0; i<
fData.size(); i++) {
4235 phaseParam, 1.0, min, max);
4237 fData[i].dataFourierPhaseOptReal->SetMarkerColor(
fData[i].data->GetMarkerColor());
4238 fData[i].dataFourierPhaseOptReal->SetLineColor(
fData[i].data->GetLineColor());
4240 fData[i].dataFourierPhaseOptReal->SetMarkerSize(1);
4242 fData[i].dataFourierPhaseOptReal->SetMarkerStyle(
fData[i].data->GetMarkerStyle());
4246 strcpy(hName,
fData[i].theoryFourierPhase->GetName());
4247 strcat(hName,
"_Opt_Real");
4248 fData[i].theoryFourierPhaseOptReal = (TH1F*)
fData[i].theoryFourierRe->Clone(hName);
4252 Int_t minBin =
fData[i].theoryFourierPhaseOptReal->GetXaxis()->FindFixBin(min);
4253 Int_t maxBin =
fData[i].theoryFourierPhaseOptReal->GetXaxis()->FindFixBin(max);
4255 for (Int_t j=1; j<
fData[i].theoryFourierPhaseOptReal->GetNbinsX(); j++) {
4256 ph = phaseParam[0] + phaseParam[1] * (Double_t)(j-minBin+1) / (Double_t)(maxBin-minBin);
4257 re =
fData[i].theoryFourierRe->GetBinContent(j) * cos(ph) -
fData[i].theoryFourierIm->GetBinContent(j) * sin(ph);
4258 fData[i].theoryFourierPhaseOptReal->SetBinContent(j, re);
4261 fData[i].theoryFourierPhaseOptReal->SetLineColor(
fData[i].theory->GetLineColor());
4280 Int_t bin = theo->FindBin(x);
4282 return y - theo->GetBinContent(bin);
4301 Double_t xVal, yVal;
4305 theo->GetPoint(bin, xVal, yVal);
4325 Double_t *xTheo = graph->GetX();
4328 for (i=0; i<graph->GetN(); i++) {
4329 if (*(xTheo+i) >= x) {
4335 if (i == graph->GetN()) {
4358 if (histo ==
nullptr)
4361 Int_t start=0, end=0;
4364 end = histo->GetNbinsX();
4366 start = histo->FindBin(xmin);
4367 if ((start==0) || (start==histo->GetNbinsX()+1))
4369 end = histo->FindBin(xmax);
4370 if ((end==0) || (end==histo->GetNbinsX()+1))
4371 end = histo->GetNbinsX();
4374 Double_t max = histo->GetBinContent(start);
4375 Double_t binContent;
4376 for (Int_t i=start; i<end; i++) {
4377 binContent = histo->GetBinContent(i);
4378 if (max < binContent)
4401 if (histo ==
nullptr)
4404 Int_t start=0, end=0;
4407 end = histo->GetNbinsX();
4409 start = histo->FindBin(xmin);
4410 if ((start==0) || (start==histo->GetNbinsX()+1))
4412 end = histo->FindBin(xmax);
4413 if ((end==0) || (end==histo->GetNbinsX()+1))
4414 end = histo->GetNbinsX();
4417 Double_t min = histo->GetBinContent(start);
4418 Double_t binContent;
4419 for (Int_t i=start; i<end; i++) {
4420 binContent = histo->GetBinContent(i);
4421 if (min > binContent)
4444 if (graph ==
nullptr)
4449 graph->GetPoint(0, x, y);
4451 graph->GetPoint(graph->GetN()-1, x, y);
4455 graph->GetPoint(0, x, y);
4457 for (Int_t i=0; i<graph->GetN(); i++) {
4458 graph->GetPoint(i, x, y);
4459 if ((x >= xmin) && (x <= xmax)) {
4484 if (graph ==
nullptr)
4489 graph->GetPoint(0, x, y);
4491 graph->GetPoint(graph->GetN()-1, x, y);
4495 graph->GetPoint(0, x, y);
4497 for (Int_t i=0; i<graph->GetN(); i++) {
4498 graph->GetPoint(i, x, y);
4499 if ((x >= xmin) && (x <= xmax)) {
4528 Double_t xmin, xmax;
4530 if (
fData.size() > 0) {
4548 Double_t dataXmin=0.0, dataXmax=0.0, dataYmin=0.0, dataYmax=0.0;
4558 for (UInt_t i=1; i<
fData.size(); i++) {
4564 Double_t dd = 0.05*fabs(dataYmax-dataYmin);
4577 for (UInt_t i=1; i<
fData.size(); i++) {
4583 Double_t dd = 0.05*fabs(dataYmax-dataYmin);
4589 dataYmin = 1.0e-4 * dataYmax;
4596 UInt_t noOfPoints = 1000;
4597 for (UInt_t i=0; i<
fData.size(); i++) {
4598 if (
fData[i].data->GetNbinsX() > (Int_t)noOfPoints)
4599 noOfPoints =
fData[i].data->GetNbinsX();
4602 fHistoFrame->SetBins(noOfPoints, dataXmin, dataXmax);
4605 for (UInt_t i=0; i<
fData.size(); i++) {
4606 fData[i].data->GetXaxis()->SetRange(
fData[i].data->FindBin(dataXmin),
fData[i].data->FindBin(dataXmax));
4607 fData[i].data->GetYaxis()->SetRangeUser(dataYmin, dataYmax);
4608 fData[i].theory->GetXaxis()->SetRange(
fData[i].theory->FindBin(dataXmin),
fData[i].theory->FindBin(dataXmax));
4609 fData[i].theory->GetYaxis()->SetRangeUser(dataYmin, dataYmax);
4630 if (runList->at(0).IsLifetimeCorrected()) {
4631 yAxisTitle =
"Asymmetry";
4634 yAxisTitle =
"N(t) per nsec";
4636 yAxisTitle =
"N(t) per bin";
4641 yAxisTitle =
"RRF Asymmetry";
4644 yAxisTitle =
"Asymmetry";
4647 yAxisTitle =
"Asymmetry";
4650 yAxisTitle =
"N(t) per bin";
4657 fHistoFrame->GetYaxis()->SetTitle(yAxisTitle.Data());
4659 for (UInt_t i=0; i<
fData.size(); i++) {
4660 fData[i].data->Draw(
"pesame");
4663 for (UInt_t i=0; i<
fData.size(); i++) {
4664 fData[i].theory->Draw(
"lsame");
4697 UInt_t runNo = (UInt_t)plotInfo.
fRuns[0]-1;
4704 Double_t dataXmin=0.0, dataXmax=0.0, dataYmin=0.0, dataYmax=0.0;
4720 Double_t dd = 0.05*fabs(dataYmax-dataYmin);
4739 Double_t dd = 0.05*fabs(dataYmax-dataYmin);
4745 if (dataYmin <= 0.0)
4746 dataYmin = 1.0e-4 * dataYmax;
4758 TGraphErrors *ge =
new TGraphErrors(*(
fNonMusrData[i].data));
4760 ge->SetEditable(
false);
4768 TGraphErrors *ge =
new TGraphErrors(*(
fNonMusrData[i].theory));
4770 ge->SetEditable(
false);
4794 for (UInt_t i=0; i<plotInfo.
fRuns.size(); i++) {
4795 runNo = (UInt_t)plotInfo.
fRuns[i]-1;
4798 legendLabel.push_back(yAxisTitle +
" vs. " + xAxisTitle);
4803 legendLabel.clear();
4845 Double_t xmin, xmax;
4862 Double_t dataXmin=0.0, dataXmax=0.0, dataYmin=0.0, dataYmax=0.0, dd=0.0;
4868 for (UInt_t i=1; i<
fData.size(); i++) {
4875 dd = 0.05*fabs(dataYmax-dataYmin);
4883 for (UInt_t i=1; i<
fData.size(); i++) {
4890 dd = 0.05*fabs(dataYmax-dataYmin);
4898 UInt_t noOfPoints = 1000;
4899 for (UInt_t i=0; i<
fData.size(); i++) {
4900 if (
fData[i].diff->GetNbinsX() > (Int_t)noOfPoints)
4901 noOfPoints =
fData[i].diff->GetNbinsX();
4904 fHistoFrame->SetBins(noOfPoints, dataXmin, dataXmax);
4918 for (UInt_t i=0; i<
fData.size(); i++) {
4919 fData[i].diff->Draw(
"pesame");
4921 if (
fData[i].dataRange->IsXRangePresent())
4922 fData[i].diff->GetXaxis()->SetRangeUser(
fData[i].dataRange->GetXmin(),
fData[i].dataRange->GetXmax());
4924 fData[i].diff->GetXaxis()->SetRange(
fData[i].diff->FindBin(dataXmin),
fData[i].diff->FindBin(dataXmax));
4926 if (
fData[i].dataRange->IsYRangePresent())
4927 fData[i].diff->GetYaxis()->SetRangeUser(
fData[i].dataRange->GetYmin(),
fData[i].dataRange->GetYmax());
4929 fData[i].diff->GetYaxis()->SetRangeUser(dataYmin, dataYmax);
4962 UInt_t runNo = (UInt_t)plotInfo.
fRuns[0]-1;
4970 Double_t dataXmin=0.0, dataXmax=0.0, dataYmin=0.0, dataYmax=0.0;
4982 Double_t dd = 0.05*fabs(dataYmax-dataYmin);
4996 Double_t dd = 0.05*fabs(dataYmax-dataYmin);
5006 TGraphErrors *ge =
new TGraphErrors(*(
fNonMusrData[i].diff));
5008 ge->SetEditable(
false);
5056 if (
fData.size() == 0)
5060 TString xAxisTitle(
"");
5062 xAxisTitle = TString(
"Field (G)");
5064 xAxisTitle = TString(
"Field (T)");
5066 xAxisTitle = TString(
"Frequency (MHz)");
5068 xAxisTitle = TString(
"Frequency (Mc/s)");
5070 xAxisTitle = TString(
"??");
5074 Double_t xmin, xmax, ymin, ymax, binContent;
5075 UInt_t noOfPoints = 1000;
5083 xmin =
fData[0].dataFourierRe->GetBinLowEdge(1);
5084 xmax =
fData[0].dataFourierRe->GetBinLowEdge(
fData[0].dataFourierRe->GetNbinsX())+
fData[0].dataFourierRe->GetBinWidth(1);
5092 if (binContent < ymin)
5095 if (binContent > ymax)
5097 for (UInt_t i=1; i<
fData.size(); i++) {
5099 if (binContent < ymin)
5102 if (binContent > ymax)
5105 if (binContent < ymin)
5108 if (binContent > ymax)
5122 for (UInt_t i=0; i<
fData.size(); i++) {
5123 if (
fData[i].dataFourierRe->GetNbinsX() > (Int_t)noOfPoints)
5124 noOfPoints =
fData[i].dataFourierRe->GetNbinsX();
5130 for (UInt_t i=0; i<
fData.size(); i++) {
5131 fData[i].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
5132 fData[i].dataFourierRe->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5133 fData[i].theoryFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
5134 fData[i].theoryFourierRe->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5138 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
5142 fHistoFrame->GetYaxis()->SetTitle(
"Real Fourier");
5145 for (UInt_t i=0; i<
fData.size(); i++) {
5146 fData[i].dataFourierRe->Draw(
"psame");
5150 for (UInt_t i=0; i<
fData.size(); i++) {
5151 fData[i].theoryFourierRe->Draw(
"same");
5163 xmin =
fData[0].dataFourierIm->GetBinLowEdge(1);
5164 xmax =
fData[0].dataFourierIm->GetBinLowEdge(
fData[0].dataFourierIm->GetNbinsX())+
fData[0].dataFourierIm->GetBinWidth(1);
5172 if (binContent < ymin)
5175 if (binContent > ymax)
5177 for (UInt_t i=1; i<
fData.size(); i++) {
5179 if (binContent < ymin)
5182 if (binContent > ymax)
5185 if (binContent < ymin)
5188 if (binContent > ymax)
5202 for (UInt_t i=0; i<
fData.size(); i++) {
5203 if (
fData[i].dataFourierIm->GetNbinsX() > (Int_t)noOfPoints)
5204 noOfPoints =
fData[i].dataFourierIm->GetNbinsX();
5210 for (UInt_t i=0; i<
fData.size(); i++) {
5211 fData[i].dataFourierIm->GetXaxis()->SetRangeUser(xmin, xmax);
5212 fData[i].dataFourierIm->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5213 fData[i].theoryFourierIm->GetXaxis()->SetRangeUser(xmin, xmax);
5214 fData[i].theoryFourierIm->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5218 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
5222 fHistoFrame->GetYaxis()->SetTitle(
"Imaginary Fourier");
5225 for (UInt_t i=0; i<
fData.size(); i++) {
5226 fData[i].dataFourierIm->Draw(
"psame");
5230 for (UInt_t i=0; i<
fData.size(); i++) {
5231 fData[i].theoryFourierIm->Draw(
"same");
5243 xmin =
fData[0].dataFourierRe->GetBinLowEdge(1);
5244 xmax =
fData[0].dataFourierRe->GetBinLowEdge(
fData[0].dataFourierRe->GetNbinsX())+
fData[0].dataFourierRe->GetBinWidth(1);
5252 for (UInt_t i=1; i<
fData.size(); i++) {
5254 if (binContent < ymin)
5257 if (binContent > ymax)
5261 for (UInt_t i=0; i<
fData.size(); i++) {
5263 if (binContent < ymin)
5266 if (binContent > ymax)
5270 for (UInt_t i=0; i<
fData.size(); i++) {
5272 if (binContent < ymin)
5275 if (binContent > ymax)
5278 if (binContent < ymin)
5281 if (binContent > ymax)
5295 for (UInt_t i=0; i<
fData.size(); i++) {
5296 if (
fData[i].dataFourierRe->GetNbinsX() > (Int_t)noOfPoints)
5297 noOfPoints =
fData[i].dataFourierRe->GetNbinsX();
5303 for (UInt_t i=0; i<
fData.size(); i++) {
5304 fData[i].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
5305 fData[i].dataFourierRe->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5306 fData[i].theoryFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
5307 fData[i].theoryFourierRe->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5308 fData[i].dataFourierIm->GetXaxis()->SetRangeUser(xmin, xmax);
5309 fData[i].dataFourierIm->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5310 fData[i].theoryFourierIm->GetXaxis()->SetRangeUser(xmin, xmax);
5311 fData[i].theoryFourierIm->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5315 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
5319 fHistoFrame->GetYaxis()->SetTitle(
"Real/Imag Fourier");
5322 for (UInt_t i=0; i<
fData.size(); i++) {
5323 fData[i].dataFourierRe->Draw(
"psame");
5324 fData[i].dataFourierIm->Draw(
"psame");
5328 for (UInt_t i=0; i<
fData.size(); i++) {
5329 fData[i].theoryFourierRe->Draw(
"same");
5330 fData[i].theoryFourierIm->Draw(
"same");
5342 xmin =
fData[0].dataFourierPwr->GetBinLowEdge(1);
5343 xmax =
fData[0].dataFourierPwr->GetBinLowEdge(
fData[0].dataFourierPwr->GetNbinsX())+
fData[0].dataFourierPwr->GetBinWidth(1);
5351 if (binContent < ymin)
5354 if (binContent > ymax)
5356 for (UInt_t i=1; i<
fData.size(); i++) {
5358 if (binContent < ymin)
5361 if (binContent > ymax)
5364 if (binContent < ymin)
5367 if (binContent > ymax)
5381 for (UInt_t i=0; i<
fData.size(); i++) {
5382 if (
fData[i].dataFourierPwr->GetNbinsX() > (Int_t)noOfPoints)
5383 noOfPoints =
fData[i].dataFourierPwr->GetNbinsX();
5389 for (UInt_t i=0; i<
fData.size(); i++) {
5390 fData[i].dataFourierPwr->GetXaxis()->SetRangeUser(xmin, xmax);
5391 fData[i].dataFourierPwr->GetYaxis()->SetRangeUser(0.95*ymin, 1.05*ymax);
5392 fData[i].theoryFourierPwr->GetXaxis()->SetRangeUser(xmin, xmax);
5393 fData[i].theoryFourierPwr->GetYaxis()->SetRangeUser(0.95*ymin, 1.05*ymax);
5397 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
5401 fHistoFrame->GetYaxis()->SetTitle(
"Ampl. Fourier");
5404 for (UInt_t i=0; i<
fData.size(); i++) {
5405 fData[i].dataFourierPwr->Draw(
"psame");
5409 for (UInt_t i=0; i<
fData.size(); i++) {
5410 fData[i].theoryFourierPwr->Draw(
"same");
5420 xmin =
fData[0].dataFourierPhase->GetBinLowEdge(1);
5421 xmax =
fData[0].dataFourierPhase->GetBinLowEdge(
fData[0].dataFourierPhase->GetNbinsX())+
fData[0].dataFourierPhase->GetBinWidth(1);
5429 if (binContent < ymin)
5432 if (binContent > ymax)
5434 for (UInt_t i=1; i<
fData.size(); i++) {
5436 if (binContent < ymin)
5439 if (binContent > ymax)
5442 if (binContent < ymin)
5445 if (binContent > ymax)
5459 for (UInt_t i=0; i<
fData.size(); i++) {
5460 if (
fData[i].dataFourierPhase->GetNbinsX() > (Int_t)noOfPoints)
5461 noOfPoints =
fData[i].dataFourierPhase->GetNbinsX();
5466 for (UInt_t i=0; i<
fData.size(); i++) {
5467 fData[i].dataFourierPhase->GetXaxis()->SetRangeUser(xmin, xmax);
5468 fData[i].dataFourierPhase->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5469 fData[i].theoryFourierPhase->GetXaxis()->SetRangeUser(xmin, xmax);
5470 fData[i].theoryFourierPhase->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5474 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
5478 fHistoFrame->GetYaxis()->SetTitle(
"Phase Fourier");
5481 for (UInt_t i=0; i<
fData.size(); i++) {
5482 fData[i].dataFourierPhase->Draw(
"psame");
5486 for (UInt_t i=0; i<
fData.size(); i++) {
5487 fData[i].theoryFourierPhase->Draw(
"same");
5497 xmin =
fData[0].dataFourierPhaseOptReal->GetBinLowEdge(1);
5498 xmax =
fData[0].dataFourierPhaseOptReal->GetBinLowEdge(
fData[0].dataFourierPhaseOptReal->GetNbinsX())+
fData[0].dataFourierPhaseOptReal->GetBinWidth(1);
5506 if (binContent < ymin)
5509 if (binContent > ymax)
5511 for (UInt_t i=1; i<
fData.size(); i++) {
5513 if (binContent < ymin)
5516 if (binContent > ymax)
5519 if (binContent < ymin)
5522 if (binContent > ymax)
5536 for (UInt_t i=0; i<
fData.size(); i++) {
5537 if (
fData[i].dataFourierPhaseOptReal->GetNbinsX() > (Int_t)noOfPoints)
5538 noOfPoints =
fData[i].dataFourierPhaseOptReal->GetNbinsX();
5543 for (UInt_t i=0; i<
fData.size(); i++) {
5544 fData[i].dataFourierPhaseOptReal->GetXaxis()->SetRangeUser(xmin, xmax);
5545 fData[i].dataFourierPhaseOptReal->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5546 fData[i].theoryFourierPhaseOptReal->GetXaxis()->SetRangeUser(xmin, xmax);
5547 fData[i].theoryFourierPhaseOptReal->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5551 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
5555 fHistoFrame->GetYaxis()->SetTitle(
"Phase Opt. Real Fourier");
5558 for (UInt_t i=0; i<
fData.size(); i++) {
5559 fData[i].dataFourierPhaseOptReal->Draw(
"psame");
5563 for (UInt_t i=0; i<
fData.size(); i++) {
5564 fData[i].theoryFourierPhaseOptReal->Draw(
"same");
5604 if (
fData.size() == 0)
5608 TString xAxisTitle(
"");
5610 xAxisTitle = TString(
"Field (G)");
5612 xAxisTitle = TString(
"Field (T)");
5614 xAxisTitle = TString(
"Frequency (MHz)");
5616 xAxisTitle = TString(
"Frequency (Mc/s)");
5618 xAxisTitle = TString(
"??");
5622 double xmin, xmax, ymin, ymax, binContent;
5630 xmin =
fData[0].diffFourierRe->GetBinLowEdge(1);
5631 xmax =
fData[0].diffFourierRe->GetBinLowEdge(
fData[0].diffFourierRe->GetNbinsX())+
fData[0].diffFourierRe->GetBinWidth(1);
5638 for (UInt_t i=1; i<
fData.size(); i++) {
5640 if (binContent < ymin)
5643 if (binContent > ymax)
5656 for (UInt_t i=0; i<
fData.size(); i++) {
5657 fData[i].diffFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
5658 fData[i].diffFourierRe->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5662 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
5666 if (
fData[0].diffFourierTag == 1)
5667 fHistoFrame->GetYaxis()->SetTitle(
"Real Fourier (d-f: data-theory)");
5669 fHistoFrame->GetYaxis()->SetTitle(
"Real Fourier (f-d: [(F data)-(F theory)]");
5672 for (UInt_t i=0; i<
fData.size(); i++) {
5673 fData[i].diffFourierRe->Draw(
"plsame");
5685 xmin =
fData[0].diffFourierIm->GetBinLowEdge(1);
5686 xmax =
fData[0].diffFourierIm->GetBinLowEdge(
fData[0].diffFourierIm->GetNbinsX())+
fData[0].diffFourierIm->GetBinWidth(1);
5693 for (UInt_t i=1; i<
fData.size(); i++) {
5695 if (binContent < ymin)
5698 if (binContent > ymax)
5711 for (UInt_t i=0; i<
fData.size(); i++) {
5712 fData[i].diffFourierIm->GetXaxis()->SetRangeUser(xmin, xmax);
5713 fData[i].diffFourierIm->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5717 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
5721 if (
fData[0].diffFourierTag == 1)
5722 fHistoFrame->GetYaxis()->SetTitle(
"Imaginary Fourier (d-f: data-theory)");
5724 fHistoFrame->GetYaxis()->SetTitle(
"Imaginary Fourier (f-d: [(F data)-(F theory)]");
5727 for (UInt_t i=0; i<
fData.size(); i++) {
5728 fData[i].diffFourierIm->Draw(
"plsame");
5740 xmin =
fData[0].diffFourierRe->GetBinLowEdge(1);
5741 xmax =
fData[0].diffFourierRe->GetBinLowEdge(
fData[0].diffFourierRe->GetNbinsX())+
fData[0].diffFourierRe->GetBinWidth(1);
5748 for (UInt_t i=1; i<
fData.size(); i++) {
5750 if (binContent < ymin)
5753 if (binContent > ymax)
5756 for (UInt_t i=0; i<
fData.size(); i++) {
5758 if (binContent < ymin)
5761 if (binContent > ymax)
5774 for (UInt_t i=0; i<
fData.size(); i++) {
5775 fData[i].diffFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
5776 fData[i].diffFourierRe->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5777 fData[i].diffFourierIm->GetXaxis()->SetRangeUser(xmin, xmax);
5778 fData[i].diffFourierIm->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5782 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
5786 if (
fData[0].diffFourierTag == 1)
5787 fHistoFrame->GetYaxis()->SetTitle(
"Real+Imag Fourier (d-f: data-theory)");
5789 fHistoFrame->GetYaxis()->SetTitle(
"Real+Imag Fourier (f-d: [(F data)-(F theory)]");
5792 for (UInt_t i=0; i<
fData.size(); i++) {
5793 fData[i].diffFourierRe->Draw(
"plsame");
5794 fData[i].diffFourierIm->Draw(
"plsame");
5806 xmin =
fData[0].diffFourierPwr->GetBinLowEdge(1);
5807 xmax =
fData[0].diffFourierPwr->GetBinLowEdge(
fData[0].diffFourierPwr->GetNbinsX())+
fData[0].diffFourierPwr->GetBinWidth(1);
5814 for (UInt_t i=1; i<
fData.size(); i++) {
5816 if (binContent < ymin)
5819 if (binContent > ymax)
5832 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
5835 for (UInt_t i=0; i<
fData.size(); i++) {
5836 fData[i].diffFourierPwr->GetXaxis()->SetRangeUser(xmin, xmax);
5837 fData[i].diffFourierPwr->GetYaxis()->SetRangeUser(0.95*ymin, 1.05*ymax);
5842 if (
fData[0].diffFourierTag == 1)
5843 fHistoFrame->GetYaxis()->SetTitle(
"Ampl. Fourier (d-f: data-theory)");
5845 fHistoFrame->GetYaxis()->SetTitle(
"Ampl. Fourier (f-d: [(F data)-(F theory)]");
5848 for (UInt_t i=0; i<
fData.size(); i++) {
5849 fData[i].diffFourierPwr->Draw(
"plsame");
5859 xmin =
fData[0].diffFourierPhase->GetBinLowEdge(1);
5860 xmax =
fData[0].diffFourierPhase->GetBinLowEdge(
fData[0].diffFourierPhase->GetNbinsX())+
fData[0].diffFourierPhase->GetBinWidth(1);
5867 for (UInt_t i=1; i<
fData.size(); i++) {
5869 if (binContent < ymin)
5872 if (binContent > ymax)
5885 for (UInt_t i=0; i<
fData.size(); i++) {
5886 fData[i].diffFourierPhase->GetXaxis()->SetRangeUser(xmin, xmax);
5887 fData[i].diffFourierPhase->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5891 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
5895 if (
fData[0].diffFourierTag == 1)
5896 fHistoFrame->GetYaxis()->SetTitle(
"Phase Fourier (d-f: data-theory)");
5898 fHistoFrame->GetYaxis()->SetTitle(
"Phase Fourier [f-d: (F data)-(F theory)]");
5901 for (UInt_t i=0; i<
fData.size(); i++) {
5902 fData[i].diffFourierPhase->Draw(
"plsame");
5914 xmin =
fData[0].diffFourierPhaseOptReal->GetBinLowEdge(1);
5915 xmax =
fData[0].diffFourierPhaseOptReal->GetBinLowEdge(
fData[0].diffFourierPhaseOptReal->GetNbinsX())+
fData[0].diffFourierPhaseOptReal->GetBinWidth(1);
5922 for (UInt_t i=1; i<
fData.size(); i++) {
5924 if (binContent < ymin)
5927 if (binContent > ymax)
5940 for (UInt_t i=0; i<
fData.size(); i++) {
5941 fData[i].diffFourierPhaseOptReal->GetXaxis()->SetRangeUser(xmin, xmax);
5942 fData[i].diffFourierPhaseOptReal->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
5946 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
5950 if (
fData[0].diffFourierTag == 1)
5951 fHistoFrame->GetYaxis()->SetTitle(
"Real Fourier (d-f: data-theory)");
5953 fHistoFrame->GetYaxis()->SetTitle(
"Real Fourier (f-d: [(F data)-(F theory)]");
5956 for (UInt_t i=0; i<
fData.size(); i++) {
5957 fData[i].diffFourierPhaseOptReal->Draw(
"plsame");
5989 str = TString(
"phase = ");
6022 TString xAxisTitle(
"");
6026 xAxisTitle = TString(
"time (s)");
6028 xAxisTitle = TString(
"time (#mus)");
6032 xAxisTitle = TString(
"Field (G)");
6034 xAxisTitle = TString(
"Field (T)");
6036 xAxisTitle = TString(
"Frequency (MHz)");
6038 xAxisTitle = TString(
"Frequency (Mc/s)");
6040 xAxisTitle = TString(
"??");
6044 TString yAxisTitle(
"");
6050 if (runList->at(0).IsLifetimeCorrected()) {
6051 yAxisTitle =
"<asymmetry>";
6054 yAxisTitle =
"<N(t)> per nsec";
6056 yAxisTitle =
"<N(t)> per bin";
6060 yAxisTitle =
"<asymmetry>";
6063 yAxisTitle =
"<asymmetry>";
6066 yAxisTitle =
"<N(t)> per bin";
6073 yAxisTitle =
"<data-theory>";
6079 yAxisTitle =
"<Real Fourier>";
6082 yAxisTitle =
"<Imaginary Fourier>";
6085 yAxisTitle =
"<Real/Imag Fourier>";
6088 yAxisTitle =
"<Ampl. Fourier>";
6091 yAxisTitle =
"<Phase Fourier>";
6094 yAxisTitle =
"<Phase Opt. Real Fourier>";
6103 if (
fData[0].diffFourierTag == 1)
6104 yAxisTitle =
"<Real Fourier (d-f: data-theory)>";
6106 yAxisTitle =
"<Real Fourier (f-d: [(F data)-(F theory)]>";
6109 if (
fData[0].diffFourierTag == 1)
6110 yAxisTitle =
"<Imag Fourier (d-f: data-theory)>";
6112 yAxisTitle =
"<Imag Fourier (f-d: [(F data)-(F theory)]>";
6116 if (
fData[0].diffFourierTag == 1)
6117 yAxisTitle =
"<Real/Imag Fourier (d-f: data-theory)>";
6119 yAxisTitle =
"<Real/Imag Fourier (f-d: [(F data)-(F theory)]>";
6123 if (
fData[0].diffFourierTag == 1)
6124 yAxisTitle =
"<Ampl. Fourier (d-f: data-theory)>";
6126 yAxisTitle =
"<Ampl. Fourier (f-d: [(F data)-(F theory)]>";
6130 if (
fData[0].diffFourierTag == 1)
6131 yAxisTitle =
"<Phase Fourier (d-f: data-theory)>";
6133 yAxisTitle =
"<Phase Fourier (f-d: [(F data)-(F theory)]>";
6144 Double_t xmin, xmax, ymin, ymax;
6158 fHistoFrame->GetXaxis()->SetTitle(xAxisTitle.Data());
6159 fHistoFrame->GetYaxis()->SetTitle(yAxisTitle.Data());
6257 for (UInt_t i=0; i<
fData.size(); i++) {
6258 if ((
fData[i].dataFourierRe !=
nullptr) && (
fData[i].dataFourierIm !=
nullptr)) {
6259 for (Int_t j=0; j<
fData[i].dataFourierRe->GetNbinsX(); j++) {
6261 re =
fData[i].dataFourierRe->GetBinContent(j) * cp +
fData[i].dataFourierIm->GetBinContent(j) * sp;
6262 im =
fData[i].dataFourierIm->GetBinContent(j) * cp -
fData[i].dataFourierRe->GetBinContent(j) * sp;
6264 fData[i].dataFourierRe->SetBinContent(j, re);
6265 fData[i].dataFourierIm->SetBinContent(j, im);
6268 if ((
fData[i].theoryFourierRe !=
nullptr) && (
fData[i].theoryFourierIm !=
nullptr)) {
6269 for (Int_t j=0; j<
fData[i].theoryFourierRe->GetNbinsX(); j++) {
6271 re =
fData[i].theoryFourierRe->GetBinContent(j) * cp +
fData[i].theoryFourierIm->GetBinContent(j) * sp;
6272 im =
fData[i].theoryFourierIm->GetBinContent(j) * cp -
fData[i].theoryFourierRe->GetBinContent(j) * sp;
6274 fData[i].theoryFourierRe->SetBinContent(j, re);
6275 fData[i].theoryFourierIm->SetBinContent(j, im);
6278 if ((
fData[i].diffFourierRe !=
nullptr) && (
fData[i].diffFourierIm !=
nullptr)) {
6279 for (Int_t j=0; j<
fData[i].diffFourierRe->GetNbinsX(); j++) {
6281 re =
fData[i].diffFourierRe->GetBinContent(j) * cp +
fData[i].diffFourierIm->GetBinContent(j) * sp;
6282 im =
fData[i].diffFourierIm->GetBinContent(j) * cp -
fData[i].diffFourierRe->GetBinContent(j) * sp;
6284 fData[i].diffFourierRe->SetBinContent(j, re);
6285 fData[i].diffFourierIm->SetBinContent(j, im);
6310 for (UInt_t i=0; i<
fData.size(); i++) {
6311 if ((
fData[i].dataFourierRe !=
nullptr) && (
fData[i].dataFourierIm !=
nullptr)) {
6312 for (Int_t j=0; j<
fData[i].dataFourierRe->GetNbinsX(); j++) {
6314 re =
fData[i].dataFourierRe->GetBinContent(j) * cp -
fData[i].dataFourierIm->GetBinContent(j) * sp;
6315 im =
fData[i].dataFourierIm->GetBinContent(j) * cp +
fData[i].dataFourierRe->GetBinContent(j) * sp;
6317 fData[i].dataFourierRe->SetBinContent(j, re);
6318 fData[i].dataFourierIm->SetBinContent(j, im);
6321 if ((
fData[i].theoryFourierRe !=
nullptr) && (
fData[i].theoryFourierIm !=
nullptr)) {
6322 for (Int_t j=0; j<
fData[i].theoryFourierRe->GetNbinsX(); j++) {
6324 re =
fData[i].theoryFourierRe->GetBinContent(j) * cp -
fData[i].theoryFourierIm->GetBinContent(j) * sp;
6325 im =
fData[i].theoryFourierIm->GetBinContent(j) * cp +
fData[i].theoryFourierRe->GetBinContent(j) * sp;
6327 fData[i].theoryFourierRe->SetBinContent(j, re);
6328 fData[i].theoryFourierIm->SetBinContent(j, im);
6331 if ((
fData[i].diffFourierRe !=
nullptr) && (
fData[i].diffFourierIm !=
nullptr)) {
6332 for (Int_t j=0; j<
fData[i].diffFourierRe->GetNbinsX(); j++) {
6334 re =
fData[i].diffFourierRe->GetBinContent(j) * cp -
fData[i].diffFourierIm->GetBinContent(j) * sp;
6335 im =
fData[i].diffFourierIm->GetBinContent(j) * cp +
fData[i].diffFourierRe->GetBinContent(j) * sp;
6337 fData[i].diffFourierRe->SetBinContent(j, re);
6338 fData[i].diffFourierIm->SetBinContent(j, im);
6360 Bool_t willScale =
true;
6363 for (UInt_t i=0; i<cmd->size(); i++) {
6364 if (cmd->at(i).fLine.Contains(
"SCALE_N0_BKG", TString::kIgnoreCase)) {
6365 TObjArray *tokens =
nullptr;
6366 TObjString *ostr =
nullptr;
6368 tokens = cmd->at(i).fLine.Tokenize(
" \t");
6369 if (tokens->GetEntries() != 2) {
6370 std::cerr << std::endl <<
">> PRunSingleHisto::IsScaleN0AndBkg(): **WARNING** Found uncorrect 'SCALE_N0_BKG' command, will ignore it.";
6371 std::cerr << std::endl <<
">> Allowed commands: SCALE_N0_BKG TRUE | FALSE" << std::endl;
6374 ostr =
dynamic_cast<TObjString*
>(tokens->At(1));
6375 str = ostr->GetString();
6376 if (!str.CompareTo(
"FALSE", TString::kIgnoreCase)) {
6401 const UInt_t precLimit = 6;
6402 UInt_t decimalPoint = 0;
6403 UInt_t accuracy = 6;
6405 if (param.
fStep == 0.0) {
6408 snprintf(str,
sizeof(str),
"%lf", param.
fValue);
6411 for (UInt_t i=0; i<strlen(str); i++) {
6412 if (str[i] ==
'.') {
6419 for (Int_t i=strlen(str)-1; i>=0; i--) {
6420 if (str[i] !=
'0') {
6421 if (((UInt_t)i-decimalPoint) < precLimit)
6422 accuracy = (UInt_t)i-decimalPoint;
6424 accuracy = precLimit;
6431 for (UInt_t i=0; i<precLimit; i++) {
6432 if ((Int_t)(param.
fStep*pow(10.0,(Double_t)i)) != 0) {
6438 if (accuracy+1 <= precLimit)
6443 for (UInt_t i=0; i<precLimit; i++) {
6444 if ((Int_t)(param.
fStep*pow(10.0,(Double_t)i)) != 0) {
6450 UInt_t accuracy2 = 6;
6451 for (UInt_t i=0; i<precLimit; i++) {
6452 if ((Int_t)(param.
fStep*pow(10.0,(Double_t)i)) != 0) {
6458 if (accuracy2 > accuracy)
6459 accuracy = accuracy2;
6461 if (accuracy+1 <= precLimit)
6484 if (histo ==
nullptr)
6487 Int_t idx = histo->FindBin(xVal);
6490 if ((idx < 1) || (idx > histo->GetNbinsX()))
6495 if (histo->GetBinCenter(idx) > xVal)
6498 Double_t x0, x1, y0, y1;
6499 x0 = histo->GetBinCenter(idx);
6500 x1 = histo->GetBinCenter(idx+1);
6501 y0 = histo->GetBinContent(idx);
6502 y1 = histo->GetBinContent(idx+1);
6504 return (y1-y0)*(xVal-x0)/(x1-x0)+y0;
virtual void InitDataSet(PMusrCanvasDataSet &dataSet)
virtual PRunData * GetAsymmetry(UInt_t index, EDataSwitch tag=kIndex)
Double_t fPhaseIncrement
phase increment for manual phase optimization
virtual const PDoubleVector * GetXTheory()
virtual Double_t GetField(const TString &runName) const
Bool_t fValid
if true, everything looks OK
virtual TString GetRRFUnit()
Bool_t fYRangePresent
flag indicating if x-/y-range is present
std::unique_ptr< TGPopupMenu > fPopupFourier
popup menu of the Musrfit/Fourier sub menu
#define MSR_PLOT_ASYM_RRF
std::unique_ptr< TCanvas > fMainCanvas
main canvas
UInt_t diffFourierTag
0=not relevant, 1=d-f (Fourier of difference time spectra), 2=f-d (difference of Fourier spectra) ...
virtual const PDoubleVector * GetError()
TH1F * diffFourierIm
imaginary part of the Fourier transform of the diff histogram
PMsrFourierStructure fFourier
structure holding all the information necessary to perform the Fourier transform
virtual Int_t FindBin(const Double_t x, TGraphErrors *graph)
virtual void HandleFourierDifference()
TGraphErrors * data
data error graph
virtual Double_t GetEnergy(const TString &runName) const
TGraphErrors * diffFourierRe
real part of the Fourier transform of the diff error graph
virtual void PlotFourierPhaseValue(Bool_t unzoom=false)
virtual void HandleNonMusrDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data)
virtual void ExportData(const Char_t *fileName)
TH1F * dataFourierIm
imaginary part of the Fourier transform of the data histogram
Bool_t fFourierBlockPresent
flag indicating if a Fourier block is present in the msr-file
#define P_MENU_ID_FOURIER_PHASE_MINUS
Bool_t fTheoAsData
flag if true, calculate theory points only at the data points
virtual void UpdateInfoPad()
Bool_t fScaleN0AndBkg
true=N0 and background is scaled to (1/ns), otherwise (1/bin) for the single histogram case ...
virtual void DecrementFourierPhase()
TH1F * theoryFourierPhase
phase spectrum of the Fourier transform of the theory histogram
PMusrCanvasNonMusrDataList fNonMusrData
list of all error graphs to be plotted (non-muSR)
TGraphErrors * diffFourierPhase
phase spectrum of the Fourier transform of the diff error graph
std::vector< PMsrRunBlock > PMsrRunList
#define P_MENU_ID_FOURIER_PHASE_PLUS
virtual void HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data)
virtual Bool_t IsScaleN0AndBkg()
virtual Int_t GetRRFUnitTag()
TH1F * dataFourierRe
real part of the Fourier transform of the data histogram
Int_t fPlotTag
tag used for initial plot. 0=real, 1=imaginary, 2=real & imaginary (default), 3=power, 4=phase
#define MSR_FITTYPE_SINGLE_HISTO_RRF
#define FOURIER_PLOT_POWER
ClassImpQ(PMusrCanvas) PMusrCanvas
std::unique_ptr< TStyle > fStyle
A collection of all graphics attributes.
#define MSR_FITTYPE_SINGLE_HISTO
#define P_MENU_ID_FOURIER
TH1F * dataFourierPhaseOptReal
phase optimized real part spectrum Fourier transform of the data histogram
virtual const PDoubleVector * GetTheory()
TGraphErrors * theory
theory histogram belonging to the data error graph
TH1F * dataFourierPwr
power spectrum of the Fourier transform of the data histogram
virtual void UpdateParamTheoryPad()
virtual void PlotFourier(Bool_t unzoom=false)
TGraphErrors * dataFourierPhase
phase spectrum of the Fourier transform of the data error graph
virtual void CreateStyle()
#define MSR_PLOT_SINGLE_HISTO
Double_t fMin
chisq or max. likelihood
virtual Int_t GetRRFPacking()
virtual PRunData * GetMuMinus(UInt_t index, EDataSwitch tag=kIndex)
TH1F * theory
theory histogram belonging to the data histogram
virtual PRunData * GetAsymmetryRRF(UInt_t index, EDataSwitch tag=kIndex)
Bool_t fAveragedView
tag showing that the averaged view or normal view should be presented.
#define FOURIER_PLOT_IMAG
TGraphErrors * theoryFourierPhase
phase spectrum of the Fourier transform of the theory error graph
TH1F * theoryFourierPhaseOptReal
phase optimized real part spectrum Fourier transform of the theory histogram
TH1F * theoryFourierPwr
power spectrum of the Fourier transform of the theory histogram
virtual void CleanupDataSet(PMusrCanvasDataSet &dataSet)
#define FOURIER_PLOT_REAL
Bool_t fDCCorrected
if set true, the dc offset of the signal/theory will be removed before the FFT is made...
std::vector< Int_t > PIntVector
ClassImp(PMusrCanvasPlotRange) PMusrCanvasPlotRange
std::vector< PMusrCanvasAsciiDump > PMusrCanvasAsciiDumpVector
TH1F * data
data histogram
virtual Double_t GetTheoryTimeStep()
#define FOURIER_UNIT_CYCLES
Double_t fYmax
data/theory frame range
virtual void SetYRange(Double_t ymin, Double_t ymax)
TGraphErrors * dataFourierPwr
power spectrum of the Fourier transform of the data error graph
TH1F * fHistoFrame
fHistoFrame is a 'global' frame needed in order to plot histograms with (potentially) different x-fra...
virtual void WindowClosed()
virtual Double_t GetTheoryTimeStart()
std::vector< PMsrParamStructure > PMsrParamList
Int_t fTimeout
timeout after which the Done signal should be emited. If timeout <= 0, no timeout is taking place ...
#define FOURIER_PLOT_REAL_AND_IMAG
std::vector< Double_t > PDoubleVector
virtual Double_t GetRRFFreq(const char *unit)
virtual PRunData * GetSingleHisto(UInt_t index, EDataSwitch tag=kIndex)
#define P_MENU_ID_FOURIER_PWR
virtual void Transform(UInt_t apodizationTag=0)
virtual Double_t GetMaximum(TH1F *histo, Double_t xmin=-1.0, Double_t xmax=-1.0)
PIntVector fMarkerList
list of markers
virtual PMsrRunList * GetMsrRunList()
PMusrCanvasDataList fData
list of all histogram data to be plotted (asymmetry/single histogram)
#define FOURIER_UNIT_NOT_GIVEN
TH1F * theoryFourierIm
imaginary part of the Fourier transform of the theory histogram
#define FOURIER_UNIT_FREQ
#define P_MENU_ID_EXPORT_DATA
virtual Double_t GetInterpolatedValue(TH1F *histo, Double_t xVal)
Int_t fPreviousPlotView
tag showing the previous plot view
TGraphErrors * theoryFourierIm
imaginary part of the Fourier transform of the theory error graph
Int_t fApodization
tag indicating the kind of apodization wished, 0=no appodization (default), 1=weak, 2=medium, 3=strong (for details see the docu)
virtual PMsrStatisticStructure * GetMsrStatistic()
#define PV_FOURIER_REAL_AND_IMAG
#define MSR_FITTYPE_NON_MUSR
std::unique_ptr< TString > fRRFText
RRF information.
virtual void InitAverage()
#define PV_FOURIER_PHASE_OPT_REAL
virtual void HandleAverage()
#define P_MENU_ID_DIFFERENCE
TGraphErrors * dataFourierRe
real part of the Fourier transform of the data error graph
virtual Double_t GetYmax()
TMultiGraph * fMultiGraphData
fMultiGraphData is a 'global' graph needed in order to plot error graphs (data) with (potentially) di...
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)
#define MSR_PLOT_NON_MUSR
std::unique_ptr< TPaveText > fTheoryPad
theory pad used to display the theory and functions
virtual TH1F * GetRealFourier(const Double_t scale=1.0)
virtual const PDoubleVector * GetX()
TGraphErrors * theoryFourierPwr
power spectrum of the Fourier transform of the theory error graph
Bool_t fDifferenceView
tag showing that the shown data, fourier, are the difference between data and theory ...
virtual PMsrGlobalBlock * GetMsrGlobal()
virtual const Char_t * GetXAxisTitle(const TString &runName, const UInt_t idx) const
Double_t fStep
step / error / neg_error, depending on the situation
std::vector< PMsrLineStructure > PMsrLines
PMusrCanvasDataSet fDataAvg
set of all averaged data to be plotted (asymmetry/single histogram)
std::unique_ptr< TLatex > fCurrentFourierPhaseText
used in Re/Im Fourier to show the current phase in the pad
PIntVector fPhaseParamNo
parameter number(s) if used instead of a phase value
Double_t fRangeForPhaseCorrection[2]
field/frequency range for automatic phase correction
virtual const PDoubleVector * GetValue()
std::unique_ptr< TLatex > fRRFLatexText
used to display RRF info
virtual void GetExportDataSet(const TH1F *data, const Double_t xmin, const Double_t xmax, PMusrCanvasAsciiDumpVector &dumpData, const Bool_t hasError=true)
virtual Double_t GetXmin()
virtual void HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected)
virtual void HandleMenuPopup(Int_t id)
virtual void PlotFourierDifference(Bool_t unzoom=false)
virtual TH1F * GetPowerFourier(const Double_t scale=1.0)
#define MSR_PLOT_SINGLE_HISTO_RRF
virtual PRunData * GetNonMusr(UInt_t index, EDataSwitch tag=kIndex)
Bool_t fStartWithFourier
flag if true, the Fourier transform will be presented bypassing the time domain representation ...
PMusrCanvasPlotRange * dataRange
keep the msr-file plot data range
TH1F * dataFourierPhase
phase spectrum of the Fourier transform of the data histogram
virtual PMsrFourierStructure * GetMsrFourierList()
PDoubleVector fPhase
phase(s)
virtual void CleanupFourier()
virtual void CleanupAverage()
virtual TH1F * GetPhaseFourier(const Double_t scale=1.0)
std::unique_ptr< TTimer > fTimeoutTimer
timeout timer in order to terminate if no action is taking place for too long
virtual void LastCanvasClosed()
Int_t fUnits
flag used to indicate the units. 1=field units (G); 2=field units (T); 3=frequency units (MHz); 4=Mc/...
virtual void IncrementFourierPhase()
virtual void PlotAverage(Bool_t unzoom=false)
TH1F * diffFourierRe
real part of the Fourier transform of the diff histogram
TGraphErrors * diff
difference error graph, i.e. data-theory
UInt_t diffFourierTag
0=not relevant, 1=d-f (Fourier of difference time spectra), 2=f-d (difference of Fourier spectra) ...
#define MSR_FITTYPE_MU_MINUS
TH1F * diff
difference histogram, i.e. data-theory
virtual UInt_t GetNeededAccuracy(PMsrParamStructure param)
TMultiGraph * fMultiGraphDiff
fMultiGraphDiff is a 'global' graph needed in order to plot error graphs (data-theory) with (potentia...
virtual PMsrPlotList * GetMsrPlotList()
#define FOURIER_APOD_NONE
#define P_MENU_ID_FOURIER_PHASE
virtual void InitMusrCanvas(const Char_t *title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh)
virtual void SetMsrHandler(PMsrHandler *msrHandler)
virtual void InitFourier()
virtual void HandleDifference()
#define MSR_PLOT_MU_MINUS
#define FOURIER_PLOT_PHASE
#define FOURIER_UNIT_GAUSS
virtual const Char_t * GetYAxisTitle(const TString &runName, const UInt_t idx) const
std::unique_ptr< TLegend > fMultiGraphLegend
used for non-muSR plots to display a legend
virtual Int_t GetFitType()
TGraphErrors * theoryFourierRe
real part of the Fourier transform of the theory error graph
Bool_t fChisq
flag telling if min = chi2 or min = max.likelihood
#define FOURIER_APOD_NOT_GIVEN
PIntVector fRuns
list of runs to be plotted
virtual Double_t GetMinimum(TH1F *histo, Double_t xmin=-1.0, Double_t xmax=-1.0)
virtual PRunData * GetSingleHistoRRF(UInt_t index, EDataSwitch tag=kIndex)
virtual PMsrLines * GetMsrTheory()
#define FOURIER_UNIT_TESLA
PDoubleVector dataErr
error of the y-axis data set
PIntVector fColorList
list of colors
TH1F * diffFourierPhaseOptReal
phase optimized real part spectrum Fourier transform of the diff histogram
std::vector< PDoublePair > PDoublePairVector
TH1F * theoryFourierRe
real part of the Fourier transform of the theory histogram
virtual void Done(Int_t status=0)
Bool_t fBatchMode
musrview in ROOT batch mode
PDoubleVector dataX
x-axis data set
#define FOURIER_PLOT_PHASE_OPT_REAL
#define FOURIER_PLOT_NOT_GIVEN
virtual const Char_t * GetSetup(const TString &runName) const
std::unique_ptr< TPaveText > fTitlePad
title pad used to display a title
TRootCanvas * fImp
ROOT native GUI version of main window with menubar and drawing area.
virtual PMsrParamList * GetMsrParamList()
virtual void GetGroupingString(Int_t runNo, TString detector, TString &groupingStr)
TGPopupMenu * fPopupMain
popup menu Musrfit in the main menu bar
virtual void HandleFourier()
TH1F * diffFourierPwr
power spectrum of the Fourier transform of the diff histogram
Int_t fFourierPower
i.e. zero padding up to 2^fFourierPower, default = 0 which means NO zero padding
virtual void CleanupFourierDifference()
PDoubleVector data
y-axis data set
#define MSR_FITTYPE_ASYM_RRF
#define P_MENU_ID_FOURIER_REAL
virtual PRunData * GetAsymmetryBNMR(UInt_t index, EDataSwitch tag=kIndex)
#define P_MENU_ID_FOURIER_PHASE_OPT_REAL
virtual Double_t GetDataTimeStart()
virtual void PlotDifference(Bool_t unzoom=false)
UInt_t fNdf
number of degrees of freedom
#define P_MENU_ID_AVERAGE
virtual void UpdateDataTheoryPad()
virtual PMsrLines * GetMsrFunctions()
std::vector< TString > PStringVector
virtual void HandleDifferenceFourier()
Int_t fPlotType
plot type tag: -1 == undefined, MSR_PLOT_SINGLE_HISTO == single histogram, MSR_PLOT_ASYM == asymmetry...
virtual Double_t GetXmax()
PRunListCollection * fRunList
data handler
PDoubleVector fCurrentFourierPhase
holds the current Fourier phase(s)
virtual void CalcPhaseOptReFT()
PMusrCanvas::CalcPhaseOptReFT.
#define P_MENU_ID_FOURIER_REAL_AND_IMAG
TGraphErrors * diffFourierIm
imaginary part of the Fourier transform of the diff error graph
virtual PMsrLines * GetMsrCommands()
TH1F * diffFourierPhase
phase spectrum of the Fourier transform of the diff histogram
#define P_MENU_ID_FOURIER_IMAG
Double_t fPlotRange[2]
field/frequency plot range
virtual Double_t CalculateDiff(const Double_t x, const Double_t y, TH1F *theo)
virtual void SetTimeout(Int_t ival)
std::unique_ptr< TLegend > fInfoPad
info pad used to display a legend of the data plotted
virtual const PDoublePairVector * GetTemp(const TString &runName) const
virtual Double_t GetFitRange(UInt_t idx)
virtual void SaveGraphicsAndQuit(Char_t *fileName, Char_t *graphicsFormat)
PMsrHandler * fMsrHandler
msr-file handler
TGraphErrors * diffFourierPwr
power spectrum of the Fourier transform of the diff error graph
virtual Double_t GetYmin()
TString fDate
string holding fitting date and time
Bool_t fStartWithAvg
flag if true, the averaged data/Fourier will be presented
virtual void SetXRange(Double_t xmin, Double_t xmax)
virtual Double_t GetDataTimeStep()
Bool_t fToggleColor
tag showing if a single histo theory is color toggled
static const char * gFiletypes[]
std::unique_ptr< TPaveText > fParameterPad
parameter pad used to display the fitting parameters
virtual void PlotData(Bool_t unzoom=false)
Bool_t fPosErrorPresent
positive error is defined (as a number)
std::unique_ptr< TPad > fDataTheoryPad
data/theory pad used to display the data/theory
Int_t fCurrentPlotView
tag showing what the current plot view is: data, fourier, ...
#define P_MENU_PLOT_OFFSET
TGraphErrors * dataFourierIm
imaginary part of the Fourier transform of the data error graph
virtual TH1F * GetImaginaryFourier(const Double_t scale=1.0)
PMusrCanvasPlotRange * dataRange
keep the msr-file plot data range
Int_t fPlotNumber
plot number
virtual void CleanupDifference()