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);
149 color = TColor::GetColor(
static_cast<Int_t
>(rand.Integer(255)),
static_cast<Int_t
>(rand.Integer(255)),
static_cast<Int_t
>(rand.Integer(255)));
150 fColorList.push_back(color);
155 InitFourierDataSets();
156 InitFourierCanvas(fTitle, wtopx, wtopy, ww, wh);
158 gStyle->SetHistMinimumZero(kTRUE);
204 const Bool_t showAverage,
const Bool_t showAveragePerDataSet,
205 const Int_t fourierPlotOpt, Double_t fourierXrange[], Double_t phase,
206 Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh,
208 fBatchMode(batch), fAveragedView(showAverage), fAveragedViewPerDataSet(showAveragePerDataSet),
209 fDataSetTag(dataSetTag), fCurrentPlotView(fourierPlotOpt), fTitle(title), fFourier(fourier),
210 fCurrentFourierPhase(phase), fMarkerList(markerList), fColorList(colorList)
212 fInitialXRange[0] = fourierXrange[0];
213 fInitialXRange[1] = fourierXrange[1];
222 for (UInt_t i=
static_cast<UInt_t
>(fMarkerList.size()); i<fourier.size(); i++) {
224 style = 20+static_cast<Int_t>(rand.Integer(10));
225 fMarkerList.push_back(style);
227 for (UInt_t i=
static_cast<UInt_t
>(fColorList.size()); i<fourier.size(); i++) {
229 color = TColor::GetColor(static_cast<Int_t>(rand.Integer(255)), static_cast<Int_t>(rand.Integer(255)), static_cast<Int_t>(rand.Integer(255)));
230 fColorList.push_back(color);
235 InitFourierDataSets();
236 InitFourierCanvas(fTitle, wtopx, wtopy, ww, wh);
238 gStyle->SetHistMinimumZero(kTRUE);
267 Emit(
"Done(Int_t)",
status);
308 if (event != kKeyPress)
316 }
else if (x ==
'u') {
321 }
else if (x ==
'a') {
338 }
else if (x ==
'd') {
355 }
else if (x ==
'c') {
365 }
else if (x ==
'+') {
367 }
else if (x ==
'-') {
509 static TString dir(
".");
512 fi.fIniDir = StrDup(dir);
513 fi.fOverwrite =
true;
514 new TGFileDialog(
nullptr,
fImp, kFDSave, &fi);
515 if (fi.fFilename && strlen(fi.fFilename)) {
530 if (gROOT->GetListOfCanvases()->IsEmpty()) {
570 strncpy(dtStr, dt.AsSQLString(),
sizeof(dtStr));
571 TString str(
"musrFT: ");
576 for (UInt_t i=0; i<
fFourier.size(); i++) {
577 strncpy(title,
fFourier[i]->GetDataTitle(),
sizeof(title));
621 fTimeoutTimer->Connect(
"Timeout()",
"PFourierCanvas",
this,
"Done()");
659 std::cout << std::endl <<
">> SaveGraphicsAndQuit: will dump the canvas into a graphics output file: " << fileName <<
" ..." << std::endl;
714 pfn = TString(pathFileName);
716 std::cerr << std::endl <<
">> PFourierCanvas::ExportData **ERROR** NO path file name provided. Will do nothing." << std::endl;
720 TString xAxis(
""), yAxis(
"");
721 Int_t xMinBin, xMaxBin;
726 yAxis = TString(
"<Real>");
727 xMinBin =
fFourierHistos[0].dataFourierRe->GetXaxis()->GetFirst();
732 yAxis = TString(
"<Imag>");
733 xMinBin =
fFourierHistos[0].dataFourierIm->GetXaxis()->GetFirst();
738 yAxis = TString(
"<Power>");
739 xMinBin =
fFourierHistos[0].dataFourierPwr->GetXaxis()->GetFirst();
740 xMaxBin =
fFourierHistos[0].dataFourierPwr->GetXaxis()->GetLast();
743 xAxis =
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetTitle();
744 yAxis = TString(
"<Phase>");
745 xMinBin =
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetFirst();
746 xMaxBin =
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetLast();
749 xAxis =
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetTitle();
750 yAxis = TString(
"<Phase>");
751 xMinBin =
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetFirst();
752 xMaxBin =
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetLast();
755 xAxis = TString(
"??");
756 yAxis = TString(
"??");
765 yAxis = TString(
"Real");
766 xMinBin =
fFourierHistos[0].dataFourierRe->GetXaxis()->GetFirst();
771 yAxis = TString(
"Imag");
772 xMinBin =
fFourierHistos[0].dataFourierIm->GetXaxis()->GetFirst();
777 yAxis = TString(
"Real+Imag");
778 xMinBin =
fFourierHistos[0].dataFourierRe->GetXaxis()->GetFirst();
783 yAxis = TString(
"Power");
784 xMinBin =
fFourierHistos[0].dataFourierPwr->GetXaxis()->GetFirst();
785 xMaxBin =
fFourierHistos[0].dataFourierPwr->GetXaxis()->GetLast();
788 xAxis =
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetTitle();
789 yAxis = TString(
"Phase");
790 xMinBin =
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetFirst();
791 xMaxBin =
fFourierHistos[0].dataFourierPhase->GetXaxis()->GetLast();
794 xAxis =
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetTitle();
795 yAxis = TString(
"Phase");
796 xMinBin =
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetFirst();
797 xMaxBin =
fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetLast();
800 xAxis = TString(
"??");
801 yAxis = TString(
"??");
809 std::ofstream fout(pfn.Data(), std::ofstream::out);
813 fout <<
"% " << pfn << std::endl;
814 fout <<
"% averaged data of:" << std::endl;
816 fout <<
"% " <<
fFourierHistos[i].dataFourierRe->GetTitle() << std::endl;
818 fout <<
"%------------" << std::endl;
819 fout <<
"% " << xAxis <<
", " << yAxis << std::endl;
820 for (Int_t i=xMinBin; i<xMaxBin; i++) {
835 fout <<
fFourierAverage[0].dataFourierPhaseOptReal->GetBinCenter(i) <<
", " <<
fFourierAverage[0].dataFourierPhaseOptReal->GetBinContent(i) << std::endl;
843 fout <<
"% " << pfn << std::endl;
844 fout <<
"% data of:" << std::endl;
846 fout <<
"% " <<
fFourierHistos[i].dataFourierRe->GetTitle() << std::endl;
848 fout <<
"%------------" << std::endl;
851 fout << xAxis << i <<
", " << yAxis << i <<
", ";
856 for (Int_t i=xMinBin; i<xMaxBin; i++) {
874 fout <<
fFourierHistos[j].dataFourierPhaseOptReal->GetBinCenter(i) <<
", " <<
fFourierHistos[j].dataFourierPhaseOptReal->GetBinContent(i) <<
", ";
915 switch (
fFourier[0]->GetUnitTag()) {
942 TString musrFTStyle(
"musrFTStyle");
943 fStyle = std::make_unique<TStyle>(musrFTStyle, musrFTStyle);
972 Double_t max = 0.0, dval = 0.0;
977 for (Int_t j=start; j<=end; j++) {
979 if (fabs(dval) > max)
984 for (Int_t j=1; j<
fFourierHistos[i].dataFourierRe->GetNbinsX(); j++) {
991 for (Int_t j=start; j<=end; j++) {
993 if (fabs(dval) > max)
998 for (Int_t j=1; j<
fFourierHistos[i].dataFourierIm->GetNbinsX(); j++) {
1006 for (Int_t j=start; j<=end; j++) {
1008 if (fabs(dval) > max)
1013 for (Int_t j=1; j<
fFourierHistos[i].dataFourierPwr->GetNbinsX(); j++) {
1021 for (Int_t j=start; j<=end; j++) {
1023 if (fabs(dval) > max)
1028 for (Int_t j=1; j<
fFourierHistos[i].dataFourierPhase->GetNbinsX(); j++) {
1036 for (Int_t j=start; j<=end; j++) {
1037 dval =
fFourierHistos[i].dataFourierPhaseOptReal->GetBinContent(j);
1038 if (fabs(dval) > max)
1043 for (Int_t j=1; j<
fFourierHistos[i].dataFourierPhaseOptReal->GetNbinsX(); j++) {
1104 TString canvasName = TString(
"fMainCanvas");
1105 fMainCanvas = std::make_unique<TCanvas>(canvasName.Data(), title, wtopx, wtopy, ww, wh);
1160 fBar->MapSubwindows();
1163 fPopupMain->Connect(
"TGPopupMenu",
"Activated(Int_t)",
"PFourierCanvas",
this,
"HandleMenuPopup(Int_t)");
1168 fTitlePad = std::make_unique<TPaveText>(0.0,
YTITLE, 1.0, 1.0,
"NDC");
1170 fTitlePad->SetFillColor(TColor::GetColor(255,255,255));
1178 fFourierPad->SetFillColor(TColor::GetColor(255,255,255));
1182 fInfoPad = std::make_unique<TLegend>(0.0, 0.0, 1.0,
YINFO,
"NDC");
1184 fInfoPad->SetFillColor(TColor::GetColor(255,255,255));
1191 std::cerr << std::endl <<
"PFourierCanvas::PFourierCanvas: **PANIC ERROR**: # Fourier != # Data Set Tags." << std::endl;
1198 fMainCanvas->Connect(
"ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",
"PFourierCanvas",
1199 this,
"HandleCmdKey(Int_t,Int_t,Int_t,TObject*)");
1251 Bool_t phaseOptRealPresent =
false;
1253 phaseOptRealPresent =
true;
1260 name = TString(
fFourierHistos[0].dataFourierRe->GetTitle()) +
"_avg";
1265 name = TString(
fFourierHistos[0].dataFourierIm->GetTitle()) +
"_avg";
1270 name = TString(
fFourierHistos[0].dataFourierPwr->GetTitle()) +
"_avg";
1275 name = TString(
fFourierHistos[0].dataFourierPhase->GetTitle()) +
"_avg";
1280 if (phaseOptRealPresent) {
1281 name = TString(
fFourierHistos[0].dataFourierPhaseOptReal->GetTitle()) +
"_avg";
1283 fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmin(),
1284 fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmax());
1288 for (Int_t j=0; j<
fFourierHistos[0].dataFourierRe->GetNbinsX(); j++) {
1303 for (Int_t j=0; j<
fFourierHistos[0].dataFourierIm->GetNbinsX(); j++) {
1318 for (Int_t j=0; j<
fFourierHistos[0].dataFourierPwr->GetNbinsX(); j++) {
1333 for (Int_t j=0; j<
fFourierHistos[0].dataFourierPhase->GetNbinsX(); j++) {
1347 if (phaseOptRealPresent) {
1349 for (Int_t j=0; j<
fFourierHistos[0].dataFourierPhaseOptReal->GetNbinsX(); j++) {
1378 Int_t start=0, end=0;
1383 start = -1, end = -1;
1385 if ((count == i) && (start == -1)) {
1406 name = TString(
fFourierHistos[start].dataFourierRe->GetTitle()) +
"_avg";
1411 name = TString(
fFourierHistos[start].dataFourierIm->GetTitle()) +
"_avg";
1416 name = TString(
fFourierHistos[start].dataFourierPwr->GetTitle()) +
"_avg";
1421 name = TString(
fFourierHistos[start].dataFourierPhase->GetTitle()) +
"_avg";
1426 if (phaseOptRealPresent) {
1427 name = TString(
fFourierHistos[start].dataFourierPhaseOptReal->GetTitle()) +
"_avg";
1429 fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmin(),
1430 fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmax());
1434 for (Int_t j=0; j<
fFourierHistos[0].dataFourierRe->GetNbinsX(); j++) {
1436 for (Int_t k=start; k<=end; k++) {
1440 fFourierAverage[i].dataFourierRe->SetBinContent(j, dval/(end-start+1));
1449 for (Int_t j=0; j<
fFourierHistos[0].dataFourierIm->GetNbinsX(); j++) {
1451 for (Int_t k=start; k<=end; k++) {
1455 fFourierAverage[i].dataFourierIm->SetBinContent(j, dval/(end-start+1));
1464 for (Int_t j=0; j<
fFourierHistos[0].dataFourierPwr->GetNbinsX(); j++) {
1466 for (Int_t k=start; k<=end; k++) {
1470 fFourierAverage[i].dataFourierPwr->SetBinContent(j, dval/(end-start+1));
1479 for (Int_t j=0; j<
fFourierHistos[0].dataFourierPhase->GetNbinsX(); j++) {
1481 for (Int_t k=start; k<=end; k++) {
1485 fFourierAverage[i].dataFourierPhase->SetBinContent(j, dval/(end-start+1));
1493 if (phaseOptRealPresent) {
1495 for (Int_t j=0; j<
fFourierHistos[0].dataFourierPhaseOptReal->GetNbinsX(); j++) {
1497 for (Int_t k=start; k<=end; k++) {
1501 fFourierAverage[i].dataFourierPhaseOptReal->SetBinContent(j, dval/(end-start+1));
1524 Double_t dval=0.0, max=0.0;
1530 for (Int_t j=start; j<=end; j++) {
1531 dval =
fFourierHistos[i].dataFourierPhaseOptReal->GetBinContent(j);
1532 if (fabs(dval) > max)
1535 for (Int_t j=1; j<
fFourierHistos[i].dataFourierPhaseOptReal->GetNbinsX(); j++) {
1566 Double_t xmin=0, xmax=0;
1570 Double_t ymin=0, ymax=0;
1573 fFourierHistos[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
1582 fFourierHistos[0].dataFourierRe->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
1584 fFourierHistos[0].dataFourierRe->GetYaxis()->SetTitleOffset(1.3);
1593 fFourierHistos[0].dataFourierIm->GetXaxis()->SetRangeUser(xmin, xmax);
1602 fFourierHistos[0].dataFourierIm->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
1603 fFourierHistos[0].dataFourierIm->GetYaxis()->SetTitleOffset(1.3);
1613 fFourierHistos[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
1626 fFourierHistos[0].dataFourierRe->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
1627 fFourierHistos[0].dataFourierRe->GetYaxis()->SetTitleOffset(1.3);
1641 fFourierHistos[0].dataFourierPwr->GetXaxis()->SetRangeUser(xmin, xmax);
1648 fFourierHistos[0].dataFourierPwr->GetYaxis()->SetRangeUser(ymin, 1.03*ymax);
1650 fFourierHistos[0].dataFourierPwr->GetYaxis()->SetTitleOffset(1.3);
1651 fFourierHistos[0].dataFourierPwr->GetYaxis()->SetDecimals(kTRUE);
1659 fFourierHistos[0].dataFourierPhase->GetXaxis()->SetRangeUser(xmin, xmax);
1668 fFourierHistos[0].dataFourierPhase->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax);
1669 fFourierHistos[0].dataFourierPhase->GetYaxis()->SetTitleOffset(1.3);
1670 fFourierHistos[0].dataFourierPhase->GetYaxis()->SetDecimals(kTRUE);
1671 fFourierHistos[0].dataFourierPhase->GetYaxis()->SetTitle(
"Phase");
1679 fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->SetRangeUser(xmin, xmax);
1688 fFourierHistos[0].dataFourierPhaseOptReal->GetYaxis()->SetRangeUser(ymin, 1.05*ymax);
1689 fFourierHistos[0].dataFourierPhaseOptReal->GetYaxis()->SetTitleOffset(1.3);
1690 fFourierHistos[0].dataFourierPhaseOptReal->GetYaxis()->SetDecimals(kTRUE);
1691 fFourierHistos[0].dataFourierPhaseOptReal->GetYaxis()->SetTitle(
"Phase Opt. Real");
1720 str = TString(
"phase = ");
1751 Double_t xmin=0.0, xmax=0.0;
1754 Double_t ymin=0.0, ymax=0.0;
1762 fFourierAverage[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
1771 fFourierAverage[0].dataFourierRe->GetYaxis()->SetRangeUser(1.03*ymin, 1.03*ymax);
1776 fFourierAverage[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
1780 fFourierAverage[0].dataFourierIm->GetXaxis()->SetRangeUser(xmin, xmax);
1789 fFourierAverage[0].dataFourierIm->GetYaxis()->SetRangeUser(1.03*ymin, 1.03*ymax);
1794 fFourierAverage[0].dataFourierIm->GetXaxis()->SetRangeUser(xmin, xmax);
1798 fFourierAverage[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
1807 fFourierAverage[0].dataFourierRe->GetYaxis()->SetRangeUser(1.03*ymin, 1.03*ymax);
1810 fFourierAverage[0].dataFourierRe->GetYaxis()->SetTitle(
"<Real+Imag>");
1812 fFourierAverage[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax);
1818 fFourierAverage[0].dataFourierPwr->GetXaxis()->SetRangeUser(xmin, xmax);
1825 fFourierAverage[0].dataFourierPwr->GetYaxis()->SetRangeUser(ymin, 1.03*ymax);
1833 fFourierAverage[0].dataFourierPhase->GetXaxis()->SetRangeUser(xmin, xmax);
1842 fFourierAverage[0].dataFourierPhase->GetYaxis()->SetRangeUser(1.03*ymin, 1.03*ymax);
1847 fFourierAverage[0].dataFourierPhase->GetXaxis()->SetRangeUser(xmin, xmax);
1852 std::cout <<
"debug> need to calculate phase opt. average first ..." << std::endl;
1856 fFourierAverage[0].dataFourierPhaseOptReal->GetXaxis()->SetRangeUser(xmin, xmax);
1865 fFourierAverage[0].dataFourierPhaseOptReal->GetYaxis()->SetRangeUser(ymin, 1.03*ymax);
1866 fFourierAverage[0].dataFourierPhaseOptReal->GetYaxis()->SetTitleOffset(1.3);
1867 fFourierAverage[0].dataFourierPhaseOptReal->GetYaxis()->SetDecimals(kTRUE);
1868 fFourierAverage[0].dataFourierPhaseOptReal->GetYaxis()->SetTitle(
"<Phase Opt. Real>");
1870 fFourierAverage[0].dataFourierPhaseOptReal->GetXaxis()->SetRangeUser(xmin, xmax);
1880 TString label = TString::Format(
"<%s>", str.Data());
1908 label = TString::Format(
"<%s>", str.Data());
1933 const Double_t cp = TMath::Cos(inc/180.0*TMath::Pi());
1934 const Double_t sp = TMath::Sin(inc/180.0*TMath::Pi());
1941 for (Int_t j=0; j<
fFourierHistos[i].dataFourierRe->GetNbinsX(); j++) {
1966 const Double_t cp = TMath::Cos(inc/180.0*TMath::Pi());
1967 const Double_t sp = TMath::Sin(inc/180.0*TMath::Pi());
1974 for (Int_t j=0; j<
fFourierHistos[i].dataFourierRe->GetNbinsX(); j++) {
2002 if (histo ==
nullptr)
2005 Int_t start=0, end=0;
2008 end = histo->GetNbinsX();
2010 start = histo->FindBin(xmin);
2011 if ((start==0) || (start==histo->GetNbinsX()+1))
2013 end = histo->FindBin(xmax);
2014 if ((end==0) || (end==histo->GetNbinsX()+1))
2015 end = histo->GetNbinsX();
2018 Double_t max = histo->GetBinContent(start);
2019 Double_t binContent;
2020 for (Int_t i=start; i<end; i++) {
2021 binContent = histo->GetBinContent(i);
2022 if (max < binContent)
2045 if (histo ==
nullptr)
2048 Int_t start=0, end=0;
2051 end = histo->GetNbinsX();
2053 start = histo->FindBin(xmin);
2054 if ((start==0) || (start==histo->GetNbinsX()+1))
2056 end = histo->FindBin(xmax);
2057 if ((end==0) || (end==histo->GetNbinsX()+1))
2058 end = histo->GetNbinsX();
2061 Double_t min = histo->GetBinContent(start);
2062 Double_t binContent;
2063 for (Int_t i=start; i<end; i++) {
2064 binContent = histo->GetBinContent(i);
2065 if (min > binContent)
2087 if (histo ==
nullptr)
2090 Int_t idx = histo->FindBin(xVal);
2093 if ((idx < 1) || (idx > histo->GetNbinsX()))
2098 if (histo->GetBinCenter(idx) > xVal)
2101 Double_t x0, x1, y0, y1;
2102 x0 = histo->GetBinCenter(idx);
2103 x1 = histo->GetBinCenter(idx+1);
2104 y0 = histo->GetBinContent(idx);
2105 y1 = histo->GetBinContent(idx+1);
2107 return (y1-y0)*(xVal-x0)/(x1-x0)+y0;
2125 Ssiz_t idx = str.First(
':');
2126 str.Remove(0, idx+1);
2127 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.