38#include <TGFileDialog.h>
45static const Char_t *
gFiletypes[] = {
"Data files",
"*.dat",
127 const Bool_t showAverage,
const Bool_t showAveragePerDataSet,
128 const Int_t fourierPlotOpt, Double_t fourierXrange[], Double_t phase,
129 Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh,
130 const Bool_t batch) :
131 fBatchMode(batch), fAveragedView(showAverage), fAveragedViewPerDataSet(showAveragePerDataSet),
132 fDataSetTag(dataSetTag), fCurrentPlotView(fourierPlotOpt), fTitle(title), fFourier(fourier),
133 fCurrentFourierPhase(phase)
135 fInitialXRange[0] = fourierXrange[0];
136 fInitialXRange[1] = fourierXrange[1];
145 for (UInt_t i=0; i<fourier.size(); i++) {
147 style = 20+
static_cast<Int_t
>(rand.Integer(10));
148 fMarkerList.push_back(style);
152 Int_t r =
static_cast<Int_t
>(rand.Integer(255));
153 Int_t g =
static_cast<Int_t
>(rand.Integer(255));
154 Int_t b =
static_cast<Int_t
>(rand.Integer(255));
155 color = TColor::GetColor(r, g, b);
156 fColorList.push_back(color);
161 InitFourierDataSets();
162 InitFourierCanvas(fTitle, wtopx, wtopy, ww, wh);
164 gStyle->SetHistMinimumZero(kTRUE);
210 const Bool_t showAverage,
const Bool_t showAveragePerDataSet,
211 const Int_t fourierPlotOpt, Double_t fourierXrange[], Double_t phase,
212 Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh,
214 fBatchMode(batch), fAveragedView(showAverage), fAveragedViewPerDataSet(showAveragePerDataSet),
215 fDataSetTag(dataSetTag), fCurrentPlotView(fourierPlotOpt), fTitle(title), fFourier(fourier),
216 fCurrentFourierPhase(phase), fMarkerList(markerList), fColorList(colorList)
218 fInitialXRange[0] = fourierXrange[0];
219 fInitialXRange[1] = fourierXrange[1];
228 for (UInt_t i=
static_cast<UInt_t
>(fMarkerList.size()); i<fourier.size(); i++) {
230 style = 20+static_cast<Int_t>(rand.Integer(10));
231 fMarkerList.push_back(style);
233 for (UInt_t i=
static_cast<UInt_t
>(fColorList.size()); i<fourier.size(); i++) {
238 Int_t r = static_cast<Int_t>(rand.Integer(255));
239 Int_t g = static_cast<Int_t>(rand.Integer(255));
240 Int_t b = static_cast<Int_t>(rand.Integer(255));
241 color = TColor::GetColor(r, g, b);
242 fColorList.push_back(color);
247 InitFourierDataSets();
248 InitFourierCanvas(fTitle, wtopx, wtopy, ww, wh);
250 gStyle->SetHistMinimumZero(kTRUE);
279 Emit(
"Done(Int_t)",
status);
320 if (event != kKeyPress)
328 }
else if (x ==
'u') {
333 }
else if (x ==
'a') {
350 }
else if (x ==
'd') {
367 }
else if (x ==
'c') {
377 }
else if (x ==
'+') {
379 }
else if (x ==
'-') {
521 static TString dir(
".");
524 fi.fIniDir = StrDup(dir);
525 fi.fOverwrite =
true;
526 new TGFileDialog(
nullptr,
fImp, kFDSave, &fi);
527 if (fi.fFilename && strlen(fi.fFilename)) {
542 if (gROOT->GetListOfCanvases()->IsEmpty()) {
582 strncpy(dtStr, dt.AsSQLString(),
sizeof(dtStr));
583 TString str(
"musrFT: ");
588 for (UInt_t i=0; i<
fFourier.size(); i++) {
589 strncpy(title,
fFourier[i]->GetDataTitle(),
sizeof(title));
633 fTimeoutTimer->Connect(
"Timeout()",
"PFourierCanvas",
this,
"Done()");
671 std::cout << std::endl <<
">> SaveGraphicsAndQuit: will dump the canvas into a graphics output file: " << fileName <<
" ..." << std::endl;
726 pfn = TString(pathFileName);
728 std::cerr << std::endl <<
">> PFourierCanvas::ExportData **ERROR** NO path file name provided. Will do nothing." << std::endl;
732 TString xAxis(
""), yAxis(
"");
733 Int_t xMinBin, xMaxBin;
738 yAxis = TString(
"<Real>");
739 xMinBin =
fFourierHistos[0].dataFourierRe->GetXaxis()->GetFirst();
744 yAxis = TString(
"<Imag>");
745 xMinBin =
fFourierHistos[0].dataFourierIm->GetXaxis()->GetFirst();
750 yAxis = TString(
"<Power>");
751 xMinBin =
fFourierHistos[0].dataFourierPwr->GetXaxis()->GetFirst();
752 xMaxBin =
fFourierHistos[0].dataFourierPwr->GetXaxis()->GetLast();
755 xAxis =
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetTitle();
756 yAxis = TString(
"<Phase>");
757 xMinBin =
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetFirst();
758 xMaxBin =
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetLast();
761 xAxis =
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetTitle();
762 yAxis = TString(
"<Phase>");
763 xMinBin =
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetFirst();
764 xMaxBin =
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetLast();
767 xAxis = TString(
"??");
768 yAxis = TString(
"??");
777 yAxis = TString(
"Real");
778 xMinBin =
fFourierHistos[0].dataFourierRe->GetXaxis()->GetFirst();
783 yAxis = TString(
"Imag");
784 xMinBin =
fFourierHistos[0].dataFourierIm->GetXaxis()->GetFirst();
789 yAxis = TString(
"Real+Imag");
790 xMinBin =
fFourierHistos[0].dataFourierRe->GetXaxis()->GetFirst();
795 yAxis = TString(
"Power");
796 xMinBin =
fFourierHistos[0].dataFourierPwr->GetXaxis()->GetFirst();
797 xMaxBin =
fFourierHistos[0].dataFourierPwr->GetXaxis()->GetLast();
800 xAxis =
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetTitle();
801 yAxis = TString(
"Phase");
802 xMinBin =
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetFirst();
803 xMaxBin =
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetLast();
806 xAxis =
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetTitle();
807 yAxis = TString(
"Phase");
808 xMinBin =
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetFirst();
809 xMaxBin =
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetLast();
812 xAxis = TString(
"??");
813 yAxis = TString(
"??");
821 std::ofstream fout(pfn.Data(), std::ofstream::out);
825 fout <<
"% " << pfn << std::endl;
826 fout <<
"% averaged data of:" << std::endl;
828 fout <<
"% " <<
fFourierHistos[i].dataFourierRe->GetTitle() << std::endl;
830 fout <<
"%------------" << std::endl;
831 fout <<
"% " << xAxis <<
", " << yAxis << std::endl;
832 for (Int_t i=xMinBin; i<xMaxBin; i++) {
847 fout <<
fFourierAverage[0].dataFourierPhaseOptReal->GetBinCenter(i) <<
", " <<
fFourierAverage[0].dataFourierPhaseOptReal->GetBinContent(i) << std::endl;
855 fout <<
"% " << pfn << std::endl;
856 fout <<
"% data of:" << std::endl;
858 fout <<
"% " <<
fFourierHistos[i].dataFourierRe->GetTitle() << std::endl;
860 fout <<
"%------------" << std::endl;
863 fout << xAxis << i <<
", " << yAxis << i <<
", ";
868 for (Int_t i=xMinBin; i<xMaxBin; i++) {
886 fout <<
fFourierHistos[j].dataFourierPhaseOptReal->GetBinCenter(i) <<
", " <<
fFourierHistos[j].dataFourierPhaseOptReal->GetBinContent(i) <<
", ";
927 switch (
fFourier[0]->GetUnitTag()) {
954 TString musrFTStyle(
"musrFTStyle");
955 fStyle = std::make_unique<TStyle>(musrFTStyle, musrFTStyle);
984 Double_t max = 0.0, dval = 0.0;
989 for (Int_t j=start; j<=end; j++) {
991 if (fabs(dval) > max)
996 for (Int_t j=1; j<
fFourierHistos[i].dataFourierRe->GetNbinsX(); j++) {
1003 for (Int_t j=start; j<=end; j++) {
1005 if (fabs(dval) > max)
1010 for (Int_t j=1; j<
fFourierHistos[i].dataFourierIm->GetNbinsX(); j++) {
1018 for (Int_t j=start; j<=end; j++) {
1020 if (fabs(dval) > max)
1025 for (Int_t j=1; j<
fFourierHistos[i].dataFourierPwr->GetNbinsX(); j++) {
1033 for (Int_t j=start; j<=end; j++) {
1035 if (fabs(dval) > max)
1040 for (Int_t j=1; j<
fFourierHistos[i].dataFourierPhase->GetNbinsX(); j++) {
1048 for (Int_t j=start; j<=end; j++) {
1049 dval =
fFourierHistos[i].dataFourierPhaseOptReal->GetBinContent(j);
1050 if (fabs(dval) > max)
1055 for (Int_t j=1; j<
fFourierHistos[i].dataFourierPhaseOptReal->GetNbinsX(); j++) {
1116 TString canvasName = TString(
"fMainCanvas");
1117 fMainCanvas = std::make_unique<TCanvas>(canvasName.Data(), title, wtopx, wtopy, ww, wh);
1172 fBar->MapSubwindows();
1175 fPopupMain->Connect(
"TGPopupMenu",
"Activated(Int_t)",
"PFourierCanvas",
this,
"HandleMenuPopup(Int_t)");
1180 fTitlePad = std::make_unique<TPaveText>(0.0,
YTITLE, 1.0, 1.0,
"NDC");
1182 fTitlePad->SetFillColor(TColor::GetColor(255,255,255));
1190 fFourierPad->SetFillColor(TColor::GetColor(255,255,255));
1194 fInfoPad = std::make_unique<TLegend>(0.0, 0.0, 1.0,
YINFO,
"NDC");
1196 fInfoPad->SetFillColor(TColor::GetColor(255,255,255));
1203 std::cerr << std::endl <<
"PFourierCanvas::PFourierCanvas: **PANIC ERROR**: # Fourier != # Data Set Tags." << std::endl;
1210 fMainCanvas->Connect(
"ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",
"PFourierCanvas",
1211 this,
"HandleCmdKey(Int_t,Int_t,Int_t,TObject*)");
1263 Bool_t phaseOptRealPresent =
false;
1265 phaseOptRealPresent =
true;
1272 name = TString(
fFourierHistos[0].dataFourierRe->GetTitle()) +
"_avg";
1277 name = TString(
fFourierHistos[0].dataFourierIm->GetTitle()) +
"_avg";
1282 name = TString(
fFourierHistos[0].dataFourierPwr->GetTitle()) +
"_avg";
1287 name = TString(
fFourierHistos[0].dataFourierPhase->GetTitle()) +
"_avg";
1292 if (phaseOptRealPresent) {
1293 name = TString(
fFourierHistos[0].dataFourierPhaseOptReal->GetTitle()) +
"_avg";
1295 fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmin(),
1296 fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmax());
1300 for (Int_t j=0; j<
fFourierHistos[0].dataFourierRe->GetNbinsX(); j++) {
1315 for (Int_t j=0; j<
fFourierHistos[0].dataFourierIm->GetNbinsX(); j++) {
1330 for (Int_t j=0; j<
fFourierHistos[0].dataFourierPwr->GetNbinsX(); j++) {
1345 for (Int_t j=0; j<
fFourierHistos[0].dataFourierPhase->GetNbinsX(); j++) {
1359 if (phaseOptRealPresent) {
1361 for (Int_t j=0; j<
fFourierHistos[0].dataFourierPhaseOptReal->GetNbinsX(); j++) {
1390 Int_t start=0, end=0;
1395 start = -1, end = -1;
1397 if ((count == i) && (start == -1)) {
1418 name = TString(
fFourierHistos[start].dataFourierRe->GetTitle()) +
"_avg";
1423 name = TString(
fFourierHistos[start].dataFourierIm->GetTitle()) +
"_avg";
1428 name = TString(
fFourierHistos[start].dataFourierPwr->GetTitle()) +
"_avg";
1433 name = TString(
fFourierHistos[start].dataFourierPhase->GetTitle()) +
"_avg";
1438 if (phaseOptRealPresent) {
1439 name = TString(
fFourierHistos[start].dataFourierPhaseOptReal->GetTitle()) +
"_avg";
1441 fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmin(),
1442 fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmax());
1446 for (Int_t j=0; j<
fFourierHistos[0].dataFourierRe->GetNbinsX(); j++) {
1448 for (Int_t k=start; k<=end; k++) {
1452 fFourierAverage[i].dataFourierRe->SetBinContent(j, dval/(end-start+1));
1461 for (Int_t j=0; j<
fFourierHistos[0].dataFourierIm->GetNbinsX(); j++) {
1463 for (Int_t k=start; k<=end; k++) {
1467 fFourierAverage[i].dataFourierIm->SetBinContent(j, dval/(end-start+1));
1476 for (Int_t j=0; j<
fFourierHistos[0].dataFourierPwr->GetNbinsX(); j++) {
1478 for (Int_t k=start; k<=end; k++) {
1482 fFourierAverage[i].dataFourierPwr->SetBinContent(j, dval/(end-start+1));
1491 for (Int_t j=0; j<
fFourierHistos[0].dataFourierPhase->GetNbinsX(); j++) {
1493 for (Int_t k=start; k<=end; k++) {
1497 fFourierAverage[i].dataFourierPhase->SetBinContent(j, dval/(end-start+1));
1505 if (phaseOptRealPresent) {
1507 for (Int_t j=0; j<
fFourierHistos[0].dataFourierPhaseOptReal->GetNbinsX(); j++) {
1509 for (Int_t k=start; k<=end; k++) {
1513 fFourierAverage[i].dataFourierPhaseOptReal->SetBinContent(j, dval/(end-start+1));
1536 Double_t dval=0.0, max=0.0;
1542 for (Int_t j=start; j<=end; j++) {
1543 dval =
fFourierHistos[i].dataFourierPhaseOptReal->GetBinContent(j);
1544 if (fabs(dval) > max)
1547 for (Int_t j=1; j<
fFourierHistos[i].dataFourierPhaseOptReal->GetNbinsX(); j++) {
1578 Double_t xmin=0, xmax=0;
1582 Double_t ymin=0, ymax=0;
1585 fFourierHistos[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
1594 fFourierHistos[0].dataFourierRe->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
1596 fFourierHistos[0].dataFourierRe->GetYaxis()->SetTitleOffset(1.3);
1605 fFourierHistos[0].dataFourierIm->GetXaxis()->SetRangeUser(xmin, xmax);
1614 fFourierHistos[0].dataFourierIm->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
1615 fFourierHistos[0].dataFourierIm->GetYaxis()->SetTitleOffset(1.3);
1625 fFourierHistos[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
1638 fFourierHistos[0].dataFourierRe->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
1639 fFourierHistos[0].dataFourierRe->GetYaxis()->SetTitleOffset(1.3);
1653 fFourierHistos[0].dataFourierPwr->GetXaxis()->SetRangeUser(xmin, xmax);
1660 fFourierHistos[0].dataFourierPwr->GetYaxis()->SetRangeUser(ymin, 1.03*ymax);
1662 fFourierHistos[0].dataFourierPwr->GetYaxis()->SetTitleOffset(1.3);
1663 fFourierHistos[0].dataFourierPwr->GetYaxis()->SetDecimals(kTRUE);
1671 fFourierHistos[0].dataFourierPhase->GetXaxis()->SetRangeUser(xmin, xmax);
1680 fFourierHistos[0].dataFourierPhase->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
1681 fFourierHistos[0].dataFourierPhase->GetYaxis()->SetTitleOffset(1.3);
1682 fFourierHistos[0].dataFourierPhase->GetYaxis()->SetDecimals(kTRUE);
1683 fFourierHistos[0].dataFourierPhase->GetYaxis()->SetTitle(
"Phase");
1691 fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->SetRangeUser(xmin, xmax);
1700 fFourierHistos[0].dataFourierPhaseOptReal->GetYaxis()->SetRangeUser(ymin, 1.05*ymax);
1701 fFourierHistos[0].dataFourierPhaseOptReal->GetYaxis()->SetTitleOffset(1.3);
1702 fFourierHistos[0].dataFourierPhaseOptReal->GetYaxis()->SetDecimals(kTRUE);
1703 fFourierHistos[0].dataFourierPhaseOptReal->GetYaxis()->SetTitle(
"Phase Opt. Real");
1732 str = TString(
"phase = ");
1763 Double_t xmin=0.0, xmax=0.0;
1766 Double_t ymin=0.0, ymax=0.0;
1774 fFourierAverage[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
1783 fFourierAverage[0].dataFourierRe->GetYaxis()->SetRangeUser(1.03*ymin, 1.03*ymax);
1788 fFourierAverage[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
1792 fFourierAverage[0].dataFourierIm->GetXaxis()->SetRangeUser(xmin, xmax);
1801 fFourierAverage[0].dataFourierIm->GetYaxis()->SetRangeUser(1.03*ymin, 1.03*ymax);
1806 fFourierAverage[0].dataFourierIm->GetXaxis()->SetRangeUser(xmin, xmax);
1810 fFourierAverage[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
1819 fFourierAverage[0].dataFourierRe->GetYaxis()->SetRangeUser(1.03*ymin, 1.03*ymax);
1822 fFourierAverage[0].dataFourierRe->GetYaxis()->SetTitle(
"<Real+Imag>");
1824 fFourierAverage[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
1830 fFourierAverage[0].dataFourierPwr->GetXaxis()->SetRangeUser(xmin, xmax);
1837 fFourierAverage[0].dataFourierPwr->GetYaxis()->SetRangeUser(ymin, 1.03*ymax);
1845 fFourierAverage[0].dataFourierPhase->GetXaxis()->SetRangeUser(xmin, xmax);
1854 fFourierAverage[0].dataFourierPhase->GetYaxis()->SetRangeUser(1.03*ymin, 1.03*ymax);
1859 fFourierAverage[0].dataFourierPhase->GetXaxis()->SetRangeUser(xmin, xmax);
1864 std::cout <<
"debug> need to calculate phase opt. average first ..." << std::endl;
1868 fFourierAverage[0].dataFourierPhaseOptReal->GetXaxis()->SetRangeUser(xmin, xmax);
1877 fFourierAverage[0].dataFourierPhaseOptReal->GetYaxis()->SetRangeUser(ymin, 1.03*ymax);
1878 fFourierAverage[0].dataFourierPhaseOptReal->GetYaxis()->SetTitleOffset(1.3);
1879 fFourierAverage[0].dataFourierPhaseOptReal->GetYaxis()->SetDecimals(kTRUE);
1880 fFourierAverage[0].dataFourierPhaseOptReal->GetYaxis()->SetTitle(
"<Phase Opt. Real>");
1882 fFourierAverage[0].dataFourierPhaseOptReal->GetXaxis()->SetRangeUser(xmin, xmax);
1892 TString label = TString::Format(
"<%s>", str.Data());
1920 label = TString::Format(
"<%s>", str.Data());
1945 const Double_t cp = TMath::Cos(inc/180.0*TMath::Pi());
1946 const Double_t sp = TMath::Sin(inc/180.0*TMath::Pi());
1953 for (Int_t j=0; j<
fFourierHistos[i].dataFourierRe->GetNbinsX(); j++) {
1978 const Double_t cp = TMath::Cos(inc/180.0*TMath::Pi());
1979 const Double_t sp = TMath::Sin(inc/180.0*TMath::Pi());
1986 for (Int_t j=0; j<
fFourierHistos[i].dataFourierRe->GetNbinsX(); j++) {
2014 if (histo ==
nullptr)
2017 Int_t start=0, end=0;
2020 end = histo->GetNbinsX();
2022 start = histo->FindBin(xmin);
2023 if ((start==0) || (start==histo->GetNbinsX()+1))
2025 end = histo->FindBin(xmax);
2026 if ((end==0) || (end==histo->GetNbinsX()+1))
2027 end = histo->GetNbinsX();
2030 Double_t max = histo->GetBinContent(start);
2031 Double_t binContent;
2032 for (Int_t i=start; i<end; i++) {
2033 binContent = histo->GetBinContent(i);
2034 if (max < binContent)
2057 if (histo ==
nullptr)
2060 Int_t start=0, end=0;
2063 end = histo->GetNbinsX();
2065 start = histo->FindBin(xmin);
2066 if ((start==0) || (start==histo->GetNbinsX()+1))
2068 end = histo->FindBin(xmax);
2069 if ((end==0) || (end==histo->GetNbinsX()+1))
2070 end = histo->GetNbinsX();
2073 Double_t min = histo->GetBinContent(start);
2074 Double_t binContent;
2075 for (Int_t i=start; i<end; i++) {
2076 binContent = histo->GetBinContent(i);
2077 if (min > binContent)
2099 if (histo ==
nullptr)
2102 Int_t idx = histo->FindBin(xVal);
2105 if ((idx < 1) || (idx > histo->GetNbinsX()))
2110 if (histo->GetBinCenter(idx) > xVal)
2113 Double_t x0, x1, y0, y1;
2114 x0 = histo->GetBinCenter(idx);
2115 x1 = histo->GetBinCenter(idx+1);
2116 y0 = histo->GetBinContent(idx);
2117 y1 = histo->GetBinContent(idx+1);
2119 return (y1-y0)*(xVal-x0)/(x1-x0)+y0;
2137 Ssiz_t idx = str.First(
':');
2138 str.Remove(0, idx+1);
2139 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.