38#include <TGFileDialog.h>
43#include "icons/musrFT_icon.xpm"
45#include "PMacDockIcon.h"
46#include "icons/musrFT_icon_png.h"
52static const Char_t *
gFiletypes[] = {
"Data files",
"*.dat",
134 const Bool_t showAverage,
const Bool_t showAveragePerDataSet,
135 const Int_t fourierPlotOpt, Double_t fourierXrange[], Double_t phase,
136 Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh,
137 const Bool_t batch) :
138 fBatchMode(batch), fAveragedView(showAverage), fAveragedViewPerDataSet(showAveragePerDataSet),
139 fDataSetTag(dataSetTag), fCurrentPlotView(fourierPlotOpt), fTitle(title), fFourier(fourier),
140 fCurrentFourierPhase(phase)
142 fInitialXRange[0] = fourierXrange[0];
143 fInitialXRange[1] = fourierXrange[1];
152 for (UInt_t i=0; i<fourier.size(); i++) {
154 style = 20+
static_cast<Int_t
>(rand.Integer(10));
155 fMarkerList.push_back(style);
159 Int_t r =
static_cast<Int_t
>(rand.Integer(255));
160 Int_t g =
static_cast<Int_t
>(rand.Integer(255));
161 Int_t b =
static_cast<Int_t
>(rand.Integer(255));
162 color = TColor::GetColor(r, g, b);
163 fColorList.push_back(color);
168 InitFourierDataSets();
169 InitFourierCanvas(fTitle, wtopx, wtopy, ww, wh);
171 gStyle->SetHistMinimumZero(kTRUE);
217 const Bool_t showAverage,
const Bool_t showAveragePerDataSet,
218 const Int_t fourierPlotOpt, Double_t fourierXrange[], Double_t phase,
219 Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh,
221 fBatchMode(batch), fAveragedView(showAverage), fAveragedViewPerDataSet(showAveragePerDataSet),
222 fDataSetTag(dataSetTag), fCurrentPlotView(fourierPlotOpt), fTitle(title), fFourier(fourier),
223 fCurrentFourierPhase(phase), fMarkerList(markerList), fColorList(colorList)
225 fInitialXRange[0] = fourierXrange[0];
226 fInitialXRange[1] = fourierXrange[1];
235 for (UInt_t i=
static_cast<UInt_t
>(fMarkerList.size()); i<fourier.size(); i++) {
237 style = 20+static_cast<Int_t>(rand.Integer(10));
238 fMarkerList.push_back(style);
240 for (UInt_t i=
static_cast<UInt_t
>(fColorList.size()); i<fourier.size(); i++) {
245 Int_t r = static_cast<Int_t>(rand.Integer(255));
246 Int_t g = static_cast<Int_t>(rand.Integer(255));
247 Int_t b = static_cast<Int_t>(rand.Integer(255));
248 color = TColor::GetColor(r, g, b);
249 fColorList.push_back(color);
254 InitFourierDataSets();
255 InitFourierCanvas(fTitle, wtopx, wtopy, ww, wh);
257 gStyle->SetHistMinimumZero(kTRUE);
286 Emit(
"Done(Int_t)",
status);
327 if (event != kKeyPress)
335 }
else if (x ==
'u') {
340 }
else if (x ==
'a') {
357 }
else if (x ==
'd') {
374 }
else if (x ==
'c') {
384 }
else if (x ==
'+') {
386 }
else if (x ==
'-') {
528 static TString dir(
".");
531 fi.fIniDir = StrDup(dir);
532 fi.fOverwrite =
true;
533 new TGFileDialog(
nullptr,
fImp, kFDSave, &fi);
534 if (fi.fFilename && strlen(fi.fFilename)) {
549 if (gROOT->GetListOfCanvases()->IsEmpty()) {
589 strncpy(dtStr, dt.AsSQLString(),
sizeof(dtStr));
590 TString str(
"musrFT: ");
595 for (UInt_t i=0; i<
fFourier.size(); i++) {
596 strncpy(title,
fFourier[i]->GetDataTitle(),
sizeof(title));
640 fTimeoutTimer->Connect(
"Timeout()",
"PFourierCanvas",
this,
"Done()");
678 std::cout << std::endl <<
">> SaveGraphicsAndQuit: will dump the canvas into a graphics output file: " << fileName <<
" ..." << std::endl;
733 pfn = TString(pathFileName);
735 std::cerr << std::endl <<
">> PFourierCanvas::ExportData **ERROR** NO path file name provided. Will do nothing." << std::endl;
739 TString xAxis(
""), yAxis(
"");
740 Int_t xMinBin, xMaxBin;
745 yAxis = TString(
"<Real>");
746 xMinBin =
fFourierHistos[0].dataFourierRe->GetXaxis()->GetFirst();
751 yAxis = TString(
"<Imag>");
752 xMinBin =
fFourierHistos[0].dataFourierIm->GetXaxis()->GetFirst();
757 yAxis = TString(
"<Power>");
758 xMinBin =
fFourierHistos[0].dataFourierPwr->GetXaxis()->GetFirst();
759 xMaxBin =
fFourierHistos[0].dataFourierPwr->GetXaxis()->GetLast();
762 xAxis =
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetTitle();
763 yAxis = TString(
"<Phase>");
764 xMinBin =
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetFirst();
765 xMaxBin =
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetLast();
768 xAxis =
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetTitle();
769 yAxis = TString(
"<Phase>");
770 xMinBin =
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetFirst();
771 xMaxBin =
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetLast();
774 xAxis = TString(
"??");
775 yAxis = TString(
"??");
784 yAxis = TString(
"Real");
785 xMinBin =
fFourierHistos[0].dataFourierRe->GetXaxis()->GetFirst();
790 yAxis = TString(
"Imag");
791 xMinBin =
fFourierHistos[0].dataFourierIm->GetXaxis()->GetFirst();
796 yAxis = TString(
"Real+Imag");
797 xMinBin =
fFourierHistos[0].dataFourierRe->GetXaxis()->GetFirst();
802 yAxis = TString(
"Power");
803 xMinBin =
fFourierHistos[0].dataFourierPwr->GetXaxis()->GetFirst();
804 xMaxBin =
fFourierHistos[0].dataFourierPwr->GetXaxis()->GetLast();
807 xAxis =
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetTitle();
808 yAxis = TString(
"Phase");
809 xMinBin =
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetFirst();
810 xMaxBin =
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetLast();
813 xAxis =
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetTitle();
814 yAxis = TString(
"Phase");
815 xMinBin =
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetFirst();
816 xMaxBin =
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetLast();
819 xAxis = TString(
"??");
820 yAxis = TString(
"??");
828 std::ofstream fout(pfn.Data(), std::ofstream::out);
832 fout <<
"% " << pfn << std::endl;
833 fout <<
"% averaged data of:" << std::endl;
835 fout <<
"% " <<
fFourierHistos[i].dataFourierRe->GetTitle() << std::endl;
837 fout <<
"%------------" << std::endl;
838 fout <<
"% " << xAxis <<
", " << yAxis << std::endl;
839 for (Int_t i=xMinBin; i<xMaxBin; i++) {
854 fout <<
fFourierAverage[0].dataFourierPhaseOptReal->GetBinCenter(i) <<
", " <<
fFourierAverage[0].dataFourierPhaseOptReal->GetBinContent(i) << std::endl;
862 fout <<
"% " << pfn << std::endl;
863 fout <<
"% data of:" << std::endl;
865 fout <<
"% " <<
fFourierHistos[i].dataFourierRe->GetTitle() << std::endl;
867 fout <<
"%------------" << std::endl;
870 fout << xAxis << i <<
", " << yAxis << i <<
", ";
875 for (Int_t i=xMinBin; i<xMaxBin; i++) {
893 fout <<
fFourierHistos[j].dataFourierPhaseOptReal->GetBinCenter(i) <<
", " <<
fFourierHistos[j].dataFourierPhaseOptReal->GetBinContent(i) <<
", ";
934 switch (
fFourier[0]->GetUnitTag()) {
961 TString musrFTStyle(
"musrFTStyle");
962 fStyle = std::make_unique<TStyle>(musrFTStyle, musrFTStyle);
991 Double_t max = 0.0, dval = 0.0;
996 for (Int_t j=start; j<=end; j++) {
998 if (fabs(dval) > max)
1003 for (Int_t j=1; j<
fFourierHistos[i].dataFourierRe->GetNbinsX(); j++) {
1010 for (Int_t j=start; j<=end; j++) {
1012 if (fabs(dval) > max)
1017 for (Int_t j=1; j<
fFourierHistos[i].dataFourierIm->GetNbinsX(); j++) {
1025 for (Int_t j=start; j<=end; j++) {
1027 if (fabs(dval) > max)
1032 for (Int_t j=1; j<
fFourierHistos[i].dataFourierPwr->GetNbinsX(); j++) {
1040 for (Int_t j=start; j<=end; j++) {
1042 if (fabs(dval) > max)
1047 for (Int_t j=1; j<
fFourierHistos[i].dataFourierPhase->GetNbinsX(); j++) {
1055 for (Int_t j=start; j<=end; j++) {
1056 dval =
fFourierHistos[i].dataFourierPhaseOptReal->GetBinContent(j);
1057 if (fabs(dval) > max)
1062 for (Int_t j=1; j<
fFourierHistos[i].dataFourierPhaseOptReal->GetNbinsX(); j++) {
1123 TString canvasName = TString(
"fMainCanvas");
1124 fMainCanvas = std::make_unique<TCanvas>(canvasName.Data(), title, wtopx, wtopy, ww, wh);
1130 fImp->SetIconPixmap(
const_cast<char**
>(musrFT_icon_xpm));
1131 fImp->SetClassHints(
"musrFT",
"musrFT");
1135 SetMacDockIcon(musrFT_icon_png, musrFT_icon_png_len);
1187 fBar->MapSubwindows();
1190 fPopupMain->Connect(
"TGPopupMenu",
"Activated(Int_t)",
"PFourierCanvas",
this,
"HandleMenuPopup(Int_t)");
1195 fTitlePad = std::make_unique<TPaveText>(0.0,
YTITLE, 1.0, 1.0,
"NDC");
1197 fTitlePad->SetFillColor(TColor::GetColor(255,255,255));
1205 fFourierPad->SetFillColor(TColor::GetColor(255,255,255));
1209 fInfoPad = std::make_unique<TLegend>(0.0, 0.0, 1.0,
YINFO,
"NDC");
1211 fInfoPad->SetFillColor(TColor::GetColor(255,255,255));
1218 std::cerr << std::endl <<
"PFourierCanvas::PFourierCanvas: **PANIC ERROR**: # Fourier != # Data Set Tags." << std::endl;
1225 fMainCanvas->Connect(
"ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",
"PFourierCanvas",
1226 this,
"HandleCmdKey(Int_t,Int_t,Int_t,TObject*)");
1278 Bool_t phaseOptRealPresent =
false;
1280 phaseOptRealPresent =
true;
1287 name = TString(
fFourierHistos[0].dataFourierRe->GetTitle()) +
"_avg";
1292 name = TString(
fFourierHistos[0].dataFourierIm->GetTitle()) +
"_avg";
1297 name = TString(
fFourierHistos[0].dataFourierPwr->GetTitle()) +
"_avg";
1302 name = TString(
fFourierHistos[0].dataFourierPhase->GetTitle()) +
"_avg";
1307 if (phaseOptRealPresent) {
1308 name = TString(
fFourierHistos[0].dataFourierPhaseOptReal->GetTitle()) +
"_avg";
1310 fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmin(),
1311 fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmax());
1315 for (Int_t j=0; j<
fFourierHistos[0].dataFourierRe->GetNbinsX(); j++) {
1330 for (Int_t j=0; j<
fFourierHistos[0].dataFourierIm->GetNbinsX(); j++) {
1345 for (Int_t j=0; j<
fFourierHistos[0].dataFourierPwr->GetNbinsX(); j++) {
1360 for (Int_t j=0; j<
fFourierHistos[0].dataFourierPhase->GetNbinsX(); j++) {
1374 if (phaseOptRealPresent) {
1376 for (Int_t j=0; j<
fFourierHistos[0].dataFourierPhaseOptReal->GetNbinsX(); j++) {
1405 Int_t start=0, end=0;
1410 start = -1, end = -1;
1412 if ((count == i) && (start == -1)) {
1433 name = TString(
fFourierHistos[start].dataFourierRe->GetTitle()) +
"_avg";
1438 name = TString(
fFourierHistos[start].dataFourierIm->GetTitle()) +
"_avg";
1443 name = TString(
fFourierHistos[start].dataFourierPwr->GetTitle()) +
"_avg";
1448 name = TString(
fFourierHistos[start].dataFourierPhase->GetTitle()) +
"_avg";
1453 if (phaseOptRealPresent) {
1454 name = TString(
fFourierHistos[start].dataFourierPhaseOptReal->GetTitle()) +
"_avg";
1456 fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmin(),
1457 fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmax());
1461 for (Int_t j=0; j<
fFourierHistos[0].dataFourierRe->GetNbinsX(); j++) {
1463 for (Int_t k=start; k<=end; k++) {
1467 fFourierAverage[i].dataFourierRe->SetBinContent(j, dval/(end-start+1));
1476 for (Int_t j=0; j<
fFourierHistos[0].dataFourierIm->GetNbinsX(); j++) {
1478 for (Int_t k=start; k<=end; k++) {
1482 fFourierAverage[i].dataFourierIm->SetBinContent(j, dval/(end-start+1));
1491 for (Int_t j=0; j<
fFourierHistos[0].dataFourierPwr->GetNbinsX(); j++) {
1493 for (Int_t k=start; k<=end; k++) {
1497 fFourierAverage[i].dataFourierPwr->SetBinContent(j, dval/(end-start+1));
1506 for (Int_t j=0; j<
fFourierHistos[0].dataFourierPhase->GetNbinsX(); j++) {
1508 for (Int_t k=start; k<=end; k++) {
1512 fFourierAverage[i].dataFourierPhase->SetBinContent(j, dval/(end-start+1));
1520 if (phaseOptRealPresent) {
1522 for (Int_t j=0; j<
fFourierHistos[0].dataFourierPhaseOptReal->GetNbinsX(); j++) {
1524 for (Int_t k=start; k<=end; k++) {
1528 fFourierAverage[i].dataFourierPhaseOptReal->SetBinContent(j, dval/(end-start+1));
1551 Double_t dval=0.0, max=0.0;
1557 for (Int_t j=start; j<=end; j++) {
1558 dval =
fFourierHistos[i].dataFourierPhaseOptReal->GetBinContent(j);
1559 if (fabs(dval) > max)
1562 for (Int_t j=1; j<
fFourierHistos[i].dataFourierPhaseOptReal->GetNbinsX(); j++) {
1593 Double_t xmin=0, xmax=0;
1597 Double_t ymin=0, ymax=0;
1600 fFourierHistos[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
1609 fFourierHistos[0].dataFourierRe->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
1611 fFourierHistos[0].dataFourierRe->GetYaxis()->SetTitleOffset(1.3);
1620 fFourierHistos[0].dataFourierIm->GetXaxis()->SetRangeUser(xmin, xmax);
1629 fFourierHistos[0].dataFourierIm->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
1630 fFourierHistos[0].dataFourierIm->GetYaxis()->SetTitleOffset(1.3);
1640 fFourierHistos[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
1653 fFourierHistos[0].dataFourierRe->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
1654 fFourierHistos[0].dataFourierRe->GetYaxis()->SetTitleOffset(1.3);
1668 fFourierHistos[0].dataFourierPwr->GetXaxis()->SetRangeUser(xmin, xmax);
1675 fFourierHistos[0].dataFourierPwr->GetYaxis()->SetRangeUser(ymin, 1.03*ymax);
1677 fFourierHistos[0].dataFourierPwr->GetYaxis()->SetTitleOffset(1.3);
1678 fFourierHistos[0].dataFourierPwr->GetYaxis()->SetDecimals(kTRUE);
1686 fFourierHistos[0].dataFourierPhase->GetXaxis()->SetRangeUser(xmin, xmax);
1695 fFourierHistos[0].dataFourierPhase->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
1696 fFourierHistos[0].dataFourierPhase->GetYaxis()->SetTitleOffset(1.3);
1697 fFourierHistos[0].dataFourierPhase->GetYaxis()->SetDecimals(kTRUE);
1698 fFourierHistos[0].dataFourierPhase->GetYaxis()->SetTitle(
"Phase");
1706 fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->SetRangeUser(xmin, xmax);
1715 fFourierHistos[0].dataFourierPhaseOptReal->GetYaxis()->SetRangeUser(ymin, 1.05*ymax);
1716 fFourierHistos[0].dataFourierPhaseOptReal->GetYaxis()->SetTitleOffset(1.3);
1717 fFourierHistos[0].dataFourierPhaseOptReal->GetYaxis()->SetDecimals(kTRUE);
1718 fFourierHistos[0].dataFourierPhaseOptReal->GetYaxis()->SetTitle(
"Phase Opt. Real");
1747 str = TString(
"phase = ");
1778 Double_t xmin=0.0, xmax=0.0;
1781 Double_t ymin=0.0, ymax=0.0;
1789 fFourierAverage[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
1798 fFourierAverage[0].dataFourierRe->GetYaxis()->SetRangeUser(1.03*ymin, 1.03*ymax);
1803 fFourierAverage[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
1807 fFourierAverage[0].dataFourierIm->GetXaxis()->SetRangeUser(xmin, xmax);
1816 fFourierAverage[0].dataFourierIm->GetYaxis()->SetRangeUser(1.03*ymin, 1.03*ymax);
1821 fFourierAverage[0].dataFourierIm->GetXaxis()->SetRangeUser(xmin, xmax);
1825 fFourierAverage[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
1834 fFourierAverage[0].dataFourierRe->GetYaxis()->SetRangeUser(1.03*ymin, 1.03*ymax);
1837 fFourierAverage[0].dataFourierRe->GetYaxis()->SetTitle(
"<Real+Imag>");
1839 fFourierAverage[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
1845 fFourierAverage[0].dataFourierPwr->GetXaxis()->SetRangeUser(xmin, xmax);
1852 fFourierAverage[0].dataFourierPwr->GetYaxis()->SetRangeUser(ymin, 1.03*ymax);
1860 fFourierAverage[0].dataFourierPhase->GetXaxis()->SetRangeUser(xmin, xmax);
1869 fFourierAverage[0].dataFourierPhase->GetYaxis()->SetRangeUser(1.03*ymin, 1.03*ymax);
1874 fFourierAverage[0].dataFourierPhase->GetXaxis()->SetRangeUser(xmin, xmax);
1879 std::cout <<
"debug> need to calculate phase opt. average first ..." << std::endl;
1883 fFourierAverage[0].dataFourierPhaseOptReal->GetXaxis()->SetRangeUser(xmin, xmax);
1892 fFourierAverage[0].dataFourierPhaseOptReal->GetYaxis()->SetRangeUser(ymin, 1.03*ymax);
1893 fFourierAverage[0].dataFourierPhaseOptReal->GetYaxis()->SetTitleOffset(1.3);
1894 fFourierAverage[0].dataFourierPhaseOptReal->GetYaxis()->SetDecimals(kTRUE);
1895 fFourierAverage[0].dataFourierPhaseOptReal->GetYaxis()->SetTitle(
"<Phase Opt. Real>");
1897 fFourierAverage[0].dataFourierPhaseOptReal->GetXaxis()->SetRangeUser(xmin, xmax);
1907 TString label = TString::Format(
"<%s>", str.Data());
1935 label = TString::Format(
"<%s>", str.Data());
1960 const Double_t cp = TMath::Cos(inc/180.0*TMath::Pi());
1961 const Double_t sp = TMath::Sin(inc/180.0*TMath::Pi());
1968 for (Int_t j=0; j<
fFourierHistos[i].dataFourierRe->GetNbinsX(); j++) {
1993 const Double_t cp = TMath::Cos(inc/180.0*TMath::Pi());
1994 const Double_t sp = TMath::Sin(inc/180.0*TMath::Pi());
2001 for (Int_t j=0; j<
fFourierHistos[i].dataFourierRe->GetNbinsX(); j++) {
2029 if (histo ==
nullptr)
2032 Int_t start=0, end=0;
2035 end = histo->GetNbinsX();
2037 start = histo->FindBin(xmin);
2038 if ((start==0) || (start==histo->GetNbinsX()+1))
2040 end = histo->FindBin(xmax);
2041 if ((end==0) || (end==histo->GetNbinsX()+1))
2042 end = histo->GetNbinsX();
2045 Double_t max = histo->GetBinContent(start);
2046 Double_t binContent;
2047 for (Int_t i=start; i<end; i++) {
2048 binContent = histo->GetBinContent(i);
2049 if (max < binContent)
2072 if (histo ==
nullptr)
2075 Int_t start=0, end=0;
2078 end = histo->GetNbinsX();
2080 start = histo->FindBin(xmin);
2081 if ((start==0) || (start==histo->GetNbinsX()+1))
2083 end = histo->FindBin(xmax);
2084 if ((end==0) || (end==histo->GetNbinsX()+1))
2085 end = histo->GetNbinsX();
2088 Double_t min = histo->GetBinContent(start);
2089 Double_t binContent;
2090 for (Int_t i=start; i<end; i++) {
2091 binContent = histo->GetBinContent(i);
2092 if (min > binContent)
2114 if (histo ==
nullptr)
2117 Int_t idx = histo->FindBin(xVal);
2120 if ((idx < 1) || (idx > histo->GetNbinsX()))
2125 if (histo->GetBinCenter(idx) > xVal)
2128 Double_t x0, x1, y0, y1;
2129 x0 = histo->GetBinCenter(idx);
2130 x1 = histo->GetBinCenter(idx+1);
2131 y0 = histo->GetBinContent(idx);
2132 y1 = histo->GetBinContent(idx+1);
2134 return (y1-y0)*(xVal-x0)/(x1-x0)+y0;
2152 Ssiz_t idx = str.First(
':');
2153 str.Remove(0, idx+1);
2154 idx = str.First(
',');
static const Char_t * gFiletypes[]
ClassImpQ(PFourierCanvas) PFourierCanvas
#define P_MENU_ID_AVERAGE_PER_DATA_SET
#define P_MENU_ID_FOURIER_PHASE_PLUS
#define P_MENU_ID_FOURIER
#define P_MENU_ID_FOURIER_IMAG
#define P_MENU_ID_AVERAGE
#define P_MENU_ID_EXPORT_DATA
#define P_MENU_ID_FOURIER_REAL
#define P_MENU_ID_FOURIER_PHASE_MINUS
#define P_MENU_ID_FOURIER_REAL_AND_IMAG
#define P_MENU_ID_FOURIER_PWR
#define P_MENU_ID_FOURIER_PHASE
#define P_MENU_ID_FOURIER_PHASE_OPT_REAL
#define YINFO
Y-position of info/legend pad.
#define YTITLE
Y-position of title pad.
#define FOURIER_UNIT_FREQ
Frequency in MHz.
#define FOURIER_PLOT_REAL_AND_IMAG
Plot both real and imaginary components (default).
#define FOURIER_UNIT_GAUSS
Magnetic field in Gauss (G).
#define FOURIER_PLOT_NOT_GIVEN
Plot type not specified.
#define FOURIER_PLOT_POWER
Plot power spectrum |F(ω)|²
#define FOURIER_PLOT_REAL
Plot real component only.
#define FOURIER_PLOT_PHASE_OPT_REAL
Plot phase-optimized real component.
#define FOURIER_UNIT_CYCLES
Angular frequency in Mc/s (Mega-cycles per second).
std::vector< Int_t > PIntVector
#define FOURIER_PLOT_IMAG
Plot imaginary component only.
#define FOURIER_PLOT_PHASE
Plot phase spectrum arg(F(ω)).
#define FOURIER_UNIT_TESLA
Magnetic field in Tesla (T).
virtual void CalcPhaseOptReal()
Calculates phase-optimized real Fourier for all datasets.
Bool_t fValid
if true, everything looks OK
Double_t fInitialXRange[2]
keeps the initial x-range
virtual void LastCanvasClosed()
virtual void HandleMenuPopup(Int_t id)
virtual void HandleAverage()
Computes averaged Fourier spectra across runs or per dataset.
std::unique_ptr< TStyle > fStyle
A collection of all graphics attributes.
virtual void Done(Int_t status=0)
virtual void SetTimeout(Int_t ival)
Int_t fCurrentPlotView
tag showing what the current plot view is: real, imag, power, phase, ...
virtual void DecrementFourierPhase()
Decreases phase by 5° and redraws Re/Im spectra.
virtual void PlotFourier()
Draws individual Fourier spectra (non-averaged view).
PIntVector fMarkerList
list of markers
std::unique_ptr< TPaveText > fTitlePad
title pad used to display a title
Bool_t fBatchMode
musrview in ROOT batch mode
virtual void PlotAverage()
Draws averaged Fourier spectra (averaged view modes).
std::unique_ptr< TLatex > fCurrentFourierPhaseText
used in Re/Im Fourier to show the current phase in the pad
PFourierCanvasDataList fFourierAverage
keeps the average of the Fourier histos
Double_t fCurrentFourierPhase
keeps the current Fourier phase (real/imag)
std::vector< PFourier * > fFourier
keeps all the Fourier data, ownership is with the caller
Int_t fTimeout
timeout after which the Done signal should be emited. If timeout <= 0, no timeout is taking place
virtual void PlotFourierPhaseValue()
Displays current phase value as text overlay on canvas.
virtual void SaveGraphicsAndQuit(const Char_t *fileName)
virtual void HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected)
PFourierCanvasDataList fFourierHistos
keeps all the Fourier histos
virtual Double_t GetInterpolatedValue(TH1F *histo, Double_t xVal)
std::unique_ptr< TLegend > fLegAvgPerDataSet
legend used for averaged per data set view
TGPopupMenu * fPopupMain
popup menu MusrFT in the main menu bar
PIntVector fDataSetTag
vector holding the data set tags
std::unique_ptr< TCanvas > fMainCanvas
main canvas
std::unique_ptr< TLegend > fInfoPad
info pad used to display a legend of the data plotted
PIntVector fColorList
list of colors
virtual Double_t GetMaximum(TH1F *histo, Double_t xmin=-1.0, Double_t xmax=-1.0)
virtual void UpdateInfoPad()
virtual void UpdateFourierPad()
virtual void CreateStyle()
Initializes ROOT plotting style (colors, fonts, margins, etc.).
virtual Double_t GetMinimum(TH1F *histo, Double_t xmin=-1.0, Double_t xmax=-1.0)
virtual void InitFourierCanvas(const Char_t *title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh)
std::unique_ptr< TGPopupMenu > fPopupFourier
popup menu of the MusrFT/Fourier sub menu
Bool_t fAveragedView
tag showing that the averaged view for ALL data or normal view should be presented.
virtual void CreateXaxisTitle()
Creates X-axis label based on unit type (Gauss/Tesla/MHz/Mc/s).
virtual void IncrementFourierPhase()
Increases phase by 5° and redraws Re/Im spectra.
virtual void InitFourierDataSets()
Generates all Fourier histograms (Re/Im/Pwr/Phase) from PFourier objects.
virtual void CleanupAverage()
Deletes averaged histogram data to free memory.
std::unique_ptr< TPad > fFourierPad
fourier pad used to display the fourier
TRootCanvas * fImp
ROOT native GUI version of main window with menubar and drawing area.
virtual void ExportData(const Char_t *pathFileName)
virtual TString GetDataSetName(TString title)
std::unique_ptr< TTimer > fTimeoutTimer
timeout timer in order to terminate if no action is taking place for too long
Bool_t fAveragedViewPerDataSet
tag showing that the averaged view for individual data sets or normal view should be presented.