30#ifndef _PFOURIERCANVAS_H_
31#define _PFOURIERCANVAS_H_
40#include <TRootCanvas.h>
53#define P_MENU_ID_FOURIER 10001
54#define P_MENU_ID_AVERAGE 10002
55#define P_MENU_ID_AVERAGE_PER_DATA_SET 10003
56#define P_MENU_ID_EXPORT_DATA 10004
58#define P_MENU_ID_FOURIER_REAL 100
59#define P_MENU_ID_FOURIER_IMAG 101
60#define P_MENU_ID_FOURIER_REAL_AND_IMAG 102
61#define P_MENU_ID_FOURIER_PWR 103
62#define P_MENU_ID_FOURIER_PHASE 104
63#define P_MENU_ID_FOURIER_PHASE_OPT_REAL 105
64#define P_MENU_ID_FOURIER_PHASE_PLUS 106
65#define P_MENU_ID_FOURIER_PHASE_MINUS 107
169 const Bool_t showAverage,
const Bool_t showAveragePerDataSet,
170 const Int_t fourierPlotOpt, Double_t fourierXrange[2], Double_t phase,
171 Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh,
const Bool_t batch);
196 const Bool_t showAverage,
const Bool_t showAveragePerDataSet,
197 const Int_t fourierPlotOpt, Double_t fourierXrange[2], Double_t phase,
198 Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh,
224 virtual void HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected);
299 virtual void ExportData(
const Char_t *pathFileName);
355 virtual void InitFourierCanvas(
const Char_t* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh);
386 virtual Double_t
GetMaximum(TH1F* histo, Double_t xmin=-1.0, Double_t xmax=-1.0);
393 virtual Double_t
GetMinimum(TH1F* histo, Double_t xmin=-1.0, Double_t xmax=-1.0);
std::vector< PFourierCanvasDataSet > PFourierCanvasDataList
std::vector< Int_t > PIntVector
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, ...
PFourierCanvas(std::vector< PFourier * > &fourier, PIntVector dataSetTag, const Char_t *title, const Bool_t showAverage, const Bool_t showAveragePerDataSet, const Int_t fourierPlotOpt, Double_t fourierXrange[2], Double_t phase, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh, const PIntVector markerList, const PIntVector colorList, const Bool_t batch)
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.
PFourierCanvas(std::vector< PFourier * > &fourier, PIntVector dataSetTag, const Char_t *title, const Bool_t showAverage, const Bool_t showAveragePerDataSet, const Int_t fourierPlotOpt, Double_t fourierXrange[2], Double_t phase, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh, const Bool_t batch)
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)
Double_t fInitialYRange[2]
keeps the initial y-range
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.
TH1F * dataFourierPhaseOptReal
Phase-optimized real spectrum: maximized absorption mode with minimal imaginary component.
TH1F * dataFourierPhase
Phase spectrum φ = atan2(Im, Re): phase angle in radians.
TH1F * dataFourierPwr
Power spectrum |F| = √(Re² + Im²): phase-independent amplitude.
TH1F * dataFourierIm
Imaginary part Im(F): dispersion-mode spectrum.
std::vector< Double_t > optPhase
Optimal phase parameters [c₀, c₁] for phase correction: φ(ω) = c₀ + c₁·ω
TH1F * dataFourierRe
Real part Re(F): absorption-mode spectrum (mixed phase if uncorrected)