musrfit
1.9.2
|
#include <PFourierCanvas.h>
Public Member Functions | |
PFourierCanvas () | |
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) | |
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 | Done (Int_t status=0) |
virtual void | HandleCmdKey (Int_t event, Int_t x, Int_t y, TObject *selected) |
virtual void | HandleMenuPopup (Int_t id) |
virtual void | LastCanvasClosed () |
virtual void | UpdateFourierPad () |
virtual void | UpdateInfoPad () |
virtual Bool_t | IsValid () |
virtual void | SetTimeout (Int_t ival) |
virtual void | SaveGraphicsAndQuit (const Char_t *fileName) |
virtual void | ExportData (const Char_t *pathFileName) |
Private Member Functions | |
virtual void | CreateXaxisTitle () |
virtual void | CreateStyle () |
virtual void | InitFourierDataSets () |
virtual void | InitFourierCanvas (const Char_t *title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh) |
virtual void | CleanupAverage () |
virtual void | HandleAverage () |
virtual void | CalcPhaseOptReal () |
virtual void | PlotFourier () |
virtual void | PlotFourierPhaseValue () |
virtual void | PlotAverage () |
virtual void | IncrementFourierPhase () |
virtual void | DecrementFourierPhase () |
virtual Double_t | GetMaximum (TH1F *histo, Double_t xmin=-1.0, Double_t xmax=-1.0) |
virtual Double_t | GetMinimum (TH1F *histo, Double_t xmin=-1.0, Double_t xmax=-1.0) |
virtual Double_t | GetInterpolatedValue (TH1F *histo, Double_t xVal) |
virtual TString | GetDataSetName (TString title) |
Private Attributes | |
Int_t | fTimeout |
timeout after which the Done signal should be emited. If timeout <= 0, no timeout is taking place More... | |
Bool_t | fBatchMode |
musrview in ROOT batch mode More... | |
Bool_t | fValid |
if true, everything looks OK More... | |
Bool_t | fAveragedView |
tag showing that the averaged view for ALL data or normal view should be presented. More... | |
Bool_t | fAveragedViewPerDataSet |
tag showing that the averaged view for individual data sets or normal view should be presented. More... | |
PIntVector | fDataSetTag |
vector holding the data set tags More... | |
Int_t | fCurrentPlotView |
tag showing what the current plot view is: real, imag, power, phase, ... More... | |
Double_t | fInitialXRange [2] |
keeps the initial x-range More... | |
Double_t | fInitialYRange [2] |
keeps the initial y-range More... | |
TString | fTitle |
TString | fXaxisTitle |
std::vector< PFourier * > | fFourier |
keeps all the Fourier data, ownership is with the caller More... | |
PFourierCanvasDataList | fFourierHistos |
keeps all the Fourier histos More... | |
PFourierCanvasDataList | fFourierAverage |
keeps the average of the Fourier histos More... | |
Double_t | fCurrentFourierPhase |
keeps the current Fourier phase (real/imag) More... | |
std::unique_ptr< TLatex > | fCurrentFourierPhaseText |
used in Re/Im Fourier to show the current phase in the pad More... | |
std::unique_ptr< TStyle > | fStyle |
A collection of all graphics attributes. More... | |
std::unique_ptr< TTimer > | fTimeoutTimer |
timeout timer in order to terminate if no action is taking place for too long More... | |
PIntVector | fMarkerList |
list of markers More... | |
PIntVector | fColorList |
list of colors More... | |
TRootCanvas * | fImp |
ROOT native GUI version of main window with menubar and drawing area. More... | |
TGMenuBar * | fBar |
menu bar More... | |
TGPopupMenu * | fPopupMain |
popup menu MusrFT in the main menu bar More... | |
std::unique_ptr< TGPopupMenu > | fPopupFourier |
popup menu of the MusrFT/Fourier sub menu More... | |
std::unique_ptr< TCanvas > | fMainCanvas |
main canvas More... | |
std::unique_ptr< TPaveText > | fTitlePad |
title pad used to display a title More... | |
std::unique_ptr< TPad > | fFourierPad |
fourier pad used to display the fourier More... | |
std::unique_ptr< TLegend > | fInfoPad |
info pad used to display a legend of the data plotted More... | |
std::unique_ptr< TLegend > | fLegAvgPerDataSet |
legend used for averaged per data set view More... | |
Definition at line 90 of file PFourierCanvas.h.
PFourierCanvas::PFourierCanvas | ( | ) |
PFourierCanvas::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 | ||
) |
PFourierCanvas::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 | ||
) |
|
privatevirtual |
calculate the phase opt. real FT
Definition at line 1327 of file PFourierCanvas.cpp.
References fColorList, fFourier, fFourierHistos, fInitialXRange, and fMarkerList.
Referenced by PlotAverage(), and PlotFourier().
|
privatevirtual |
Cleanup average Fourier data sets.
Definition at line 1016 of file PFourierCanvas.cpp.
References fFourierAverage.
Referenced by HandleAverage(), HandleCmdKey(), HandleMenuPopup(), and InitFourierDataSets().
|
privatevirtual |
Set styles for the canvas. Perhaps one could transfer them to the startup-file in the future.
Definition at line 748 of file PFourierCanvas.cpp.
References fStyle.
|
privatevirtual |
Creates the x-axis title based on the Fourier units used.
Definition at line 721 of file PFourierCanvas.cpp.
References fFourier, FOURIER_UNIT_CYCLES, FOURIER_UNIT_FREQ, FOURIER_UNIT_GAUSS, FOURIER_UNIT_TESLA, and fXaxisTitle.
|
privatevirtual |
Decrements the Fourier phase and recalculate the real/imaginary part of the Fourier transform.
Definition at line 1767 of file PFourierCanvas.cpp.
References fCurrentFourierPhase, fCurrentPlotView, fFourierHistos, FOURIER_PLOT_PHASE, FOURIER_PLOT_POWER, and PlotFourierPhaseValue().
Referenced by HandleCmdKey(), and HandleMenuPopup().
|
virtual |
Signal emitted that the user wants to terminate the application.
status | Status info |
Definition at line 192 of file PFourierCanvas.cpp.
References status.
Referenced by HandleCmdKey(), LastCanvasClosed(), and SaveGraphicsAndQuit().
|
virtual |
Exports the currently displayed Fourier data set in ascii column format.
Definition at line 517 of file PFourierCanvas.cpp.
References fAveragedView, fCurrentPlotView, fFourierAverage, fFourierHistos, FOURIER_PLOT_IMAG, FOURIER_PLOT_PHASE, FOURIER_PLOT_PHASE_OPT_REAL, FOURIER_PLOT_POWER, FOURIER_PLOT_REAL, and FOURIER_PLOT_REAL_AND_IMAG.
Referenced by HandleMenuPopup().
|
privatevirtual |
filters out the data set name from the title
return:
title | title of the Fourier histogram |
Definition at line 1929 of file PFourierCanvas.cpp.
Referenced by PlotAverage().
|
privatevirtual |
search for xVal in histo. If xVal is not found exactly, interpolate and return the interpolated y-value.
return:
histo | pointer of the histogram |
xVal | x-value to be looked for |
Definition at line 1893 of file PFourierCanvas.cpp.
Referenced by HandleAverage().
|
privatevirtual |
returns the maximum of a histogram in the range [xmin, xmax]. If xmin = xmax = -1.0, the whole histogram range is used.
return:
histo | pointer of the histogram |
xmin | lower edge for the search interval. |
xmax | upper edge for the search interval. |
Definition at line 1808 of file PFourierCanvas.cpp.
Referenced by PlotAverage(), and PlotFourier().
|
privatevirtual |
returns the minimum of a histogram in the range [xmin, xmax]. If xmin = xmax = -1.0, the whole histogram range is used.
return:
histo | pointer of the histogram |
xmin | lower edge for the search interval. |
xmax | upper edge for the search interval. |
Definition at line 1851 of file PFourierCanvas.cpp.
Referenced by PlotAverage(), and PlotFourier().
|
privatevirtual |
Average Fourier data sets.
Definition at line 1049 of file PFourierCanvas.cpp.
References CleanupAverage(), fAveragedView, fAveragedViewPerDataSet, fColorList, fDataSetTag, fFourierAverage, fFourierHistos, and GetInterpolatedValue().
Referenced by HandleCmdKey(), HandleMenuPopup(), and PlotAverage().
|
virtual |
Filters keyboard events, and if they are a command key (see below) carries out the necessary actions.
Currently implemented command keys:
event | event type |
x | character key |
y | not used |
selected | not used |
Definition at line 215 of file PFourierCanvas.cpp.
References CleanupAverage(), DecrementFourierPhase(), Done(), fAveragedView, fAveragedViewPerDataSet, fBatchMode, fFourierPad, fMainCanvas, fPopupMain, HandleAverage(), IncrementFourierPhase(), P_MENU_ID_AVERAGE, P_MENU_ID_AVERAGE_PER_DATA_SET, PlotAverage(), and PlotFourier().
|
virtual |
Handles the MusrFT menu.
id | identification key of the selected menu |
Definition at line 289 of file PFourierCanvas.cpp.
References CleanupAverage(), DecrementFourierPhase(), ExportData(), fAveragedView, fAveragedViewPerDataSet, fBatchMode, fCurrentPlotView, fImp, FOURIER_PLOT_IMAG, FOURIER_PLOT_PHASE, FOURIER_PLOT_PHASE_OPT_REAL, FOURIER_PLOT_POWER, FOURIER_PLOT_REAL, fPopupFourier, fPopupMain, gFiletypes, HandleAverage(), IncrementFourierPhase(), P_MENU_ID_AVERAGE, P_MENU_ID_AVERAGE_PER_DATA_SET, P_MENU_ID_EXPORT_DATA, P_MENU_ID_FOURIER, P_MENU_ID_FOURIER_IMAG, P_MENU_ID_FOURIER_PHASE, P_MENU_ID_FOURIER_PHASE_MINUS, P_MENU_ID_FOURIER_PHASE_OPT_REAL, P_MENU_ID_FOURIER_PHASE_PLUS, P_MENU_ID_FOURIER_PWR, P_MENU_ID_FOURIER_REAL, P_MENU_ID_FOURIER_REAL_AND_IMAG, PlotAverage(), and PlotFourier().
|
privatevirtual |
Increments the Fourier phase and recalculate the real/imaginary part of the Fourier transform.
Definition at line 1734 of file PFourierCanvas.cpp.
References fCurrentFourierPhase, fCurrentPlotView, fFourierHistos, FOURIER_PLOT_PHASE, FOURIER_PLOT_POWER, and PlotFourierPhaseValue().
Referenced by HandleCmdKey(), and HandleMenuPopup().
|
privatevirtual |
Initialize the class, and sets up the necessary objects.
title | Title to be displayed |
wtopx | top x coordinate (in pixels) to place the canvas. |
wtopy | top y coordinate (in pixels) to place the canvas. |
ww | width (in pixels) of the canvas. |
wh | height (in pixels) of the canvas. |
Definition at line 905 of file PFourierCanvas.cpp.
References fAveragedView, fAveragedViewPerDataSet, fBar, fBatchMode, fCurrentPlotView, fDataSetTag, fFourier, fFourierPad, fImp, fInfoPad, fMainCanvas, FOURIER_PLOT_IMAG, FOURIER_PLOT_PHASE, FOURIER_PLOT_PHASE_OPT_REAL, FOURIER_PLOT_POWER, FOURIER_PLOT_REAL, FOURIER_PLOT_REAL_AND_IMAG, fPopupFourier, fPopupMain, fTitlePad, fValid, P_MENU_ID_AVERAGE, P_MENU_ID_AVERAGE_PER_DATA_SET, P_MENU_ID_EXPORT_DATA, P_MENU_ID_FOURIER, P_MENU_ID_FOURIER_IMAG, P_MENU_ID_FOURIER_PHASE, P_MENU_ID_FOURIER_PHASE_MINUS, P_MENU_ID_FOURIER_PHASE_OPT_REAL, P_MENU_ID_FOURIER_PHASE_PLUS, P_MENU_ID_FOURIER_PWR, P_MENU_ID_FOURIER_REAL, P_MENU_ID_FOURIER_REAL_AND_IMAG, YINFO, and YTITLE.
|
privatevirtual |
Initialize the Fourier data sets, i.e. get the TH1F objects, set markers, set colors, ...
Definition at line 764 of file PFourierCanvas.cpp.
References CleanupAverage(), fColorList, fCurrentPlotView, fFourier, fFourierHistos, fInitialXRange, fMarkerList, and FOURIER_PLOT_PHASE_OPT_REAL.
|
inlinevirtual |
Definition at line 112 of file PFourierCanvas.h.
References fValid.
|
virtual |
Slot called when the last canvas has been closed. Will emit Done(0) which will terminate the application.
Definition at line 413 of file PFourierCanvas.cpp.
References Done().
|
privatevirtual |
Plot the average of the given Fourier data sets.
Definition at line 1551 of file PFourierCanvas.cpp.
References CalcPhaseOptReal(), fAveragedViewPerDataSet, fCurrentPlotView, fFourierAverage, fFourierHistos, fFourierPad, fInitialXRange, fLegAvgPerDataSet, fMainCanvas, FOURIER_PLOT_IMAG, FOURIER_PLOT_PHASE, FOURIER_PLOT_PHASE_OPT_REAL, FOURIER_PLOT_POWER, FOURIER_PLOT_REAL, FOURIER_PLOT_REAL_AND_IMAG, fXaxisTitle, GetDataSetName(), GetMaximum(), GetMinimum(), and HandleAverage().
Referenced by HandleCmdKey(), HandleMenuPopup(), and UpdateFourierPad().
|
privatevirtual |
Plot the Fourier spectra.
Definition at line 1362 of file PFourierCanvas.cpp.
References CalcPhaseOptReal(), fCurrentPlotView, fFourierHistos, fFourierPad, fInitialXRange, fMainCanvas, FOURIER_PLOT_IMAG, FOURIER_PLOT_PHASE, FOURIER_PLOT_PHASE_OPT_REAL, FOURIER_PLOT_POWER, FOURIER_PLOT_REAL, FOURIER_PLOT_REAL_AND_IMAG, fXaxisTitle, GetMaximum(), and GetMinimum().
Referenced by HandleCmdKey(), HandleMenuPopup(), and UpdateFourierPad().
|
privatevirtual |
Writes the Fourier phase value into the data window.
Definition at line 1522 of file PFourierCanvas.cpp.
References fCurrentFourierPhase, fCurrentFourierPhaseText, and fFourierPad.
Referenced by DecrementFourierPhase(), and IncrementFourierPhase().
|
virtual |
Will save the canvas as graphics output. Needed in the batch mode of musrview.
fileName | file name under which the canvas shall be saved. |
Definition at line 502 of file PFourierCanvas.cpp.
References Done(), and fMainCanvas.
|
virtual |
sets the timeout after which the program shall terminate.
timeout | after which the done signal shall be emitted. Given in seconds |
Definition at line 480 of file PFourierCanvas.cpp.
References fTimeout, fTimeoutTimer, and timeout.
|
virtual |
Feeds the pad with the Fourier data sets and refreshes it.
Definition at line 426 of file PFourierCanvas.cpp.
References fAveragedView, fAveragedViewPerDataSet, fFourierPad, fMainCanvas, fValid, PlotAverage(), and PlotFourier().
|
virtual |
Feeds the pad with the legend and refreshes it.
Definition at line 447 of file PFourierCanvas.cpp.
References fFourier, fFourierHistos, fInfoPad, fMainCanvas, and fValid.
|
private |
tag showing that the averaged view for ALL data or normal view should be presented.
Definition at line 123 of file PFourierCanvas.h.
Referenced by ClassImpQ(), ExportData(), HandleAverage(), HandleCmdKey(), HandleMenuPopup(), InitFourierCanvas(), and UpdateFourierPad().
|
private |
tag showing that the averaged view for individual data sets or normal view should be presented.
Definition at line 124 of file PFourierCanvas.h.
Referenced by ClassImpQ(), HandleAverage(), HandleCmdKey(), HandleMenuPopup(), InitFourierCanvas(), PlotAverage(), and UpdateFourierPad().
|
private |
menu bar
Definition at line 147 of file PFourierCanvas.h.
Referenced by ClassImpQ(), and InitFourierCanvas().
|
private |
musrview in ROOT batch mode
Definition at line 121 of file PFourierCanvas.h.
Referenced by ClassImpQ(), HandleCmdKey(), HandleMenuPopup(), and InitFourierCanvas().
|
private |
list of colors
Definition at line 143 of file PFourierCanvas.h.
Referenced by CalcPhaseOptReal(), HandleAverage(), and InitFourierDataSets().
|
private |
keeps the current Fourier phase (real/imag)
Definition at line 135 of file PFourierCanvas.h.
Referenced by ClassImpQ(), DecrementFourierPhase(), IncrementFourierPhase(), and PlotFourierPhaseValue().
|
private |
used in Re/Im Fourier to show the current phase in the pad
Definition at line 136 of file PFourierCanvas.h.
Referenced by PlotFourierPhaseValue().
|
private |
tag showing what the current plot view is: real, imag, power, phase, ...
Definition at line 126 of file PFourierCanvas.h.
Referenced by ClassImpQ(), DecrementFourierPhase(), ExportData(), HandleMenuPopup(), IncrementFourierPhase(), InitFourierCanvas(), InitFourierDataSets(), PlotAverage(), and PlotFourier().
|
private |
vector holding the data set tags
Definition at line 125 of file PFourierCanvas.h.
Referenced by HandleAverage(), and InitFourierCanvas().
|
private |
keeps all the Fourier data, ownership is with the caller
Definition at line 132 of file PFourierCanvas.h.
Referenced by CalcPhaseOptReal(), CreateXaxisTitle(), InitFourierCanvas(), InitFourierDataSets(), and UpdateInfoPad().
|
private |
keeps the average of the Fourier histos
Definition at line 134 of file PFourierCanvas.h.
Referenced by CleanupAverage(), ExportData(), HandleAverage(), and PlotAverage().
|
private |
keeps all the Fourier histos
Definition at line 133 of file PFourierCanvas.h.
Referenced by CalcPhaseOptReal(), DecrementFourierPhase(), ExportData(), HandleAverage(), IncrementFourierPhase(), InitFourierDataSets(), PlotAverage(), PlotFourier(), and UpdateInfoPad().
|
private |
fourier pad used to display the fourier
Definition at line 154 of file PFourierCanvas.h.
Referenced by HandleCmdKey(), InitFourierCanvas(), PlotAverage(), PlotFourier(), PlotFourierPhaseValue(), and UpdateFourierPad().
|
private |
ROOT native GUI version of main window with menubar and drawing area.
Definition at line 146 of file PFourierCanvas.h.
Referenced by ClassImpQ(), HandleMenuPopup(), and InitFourierCanvas().
|
private |
info pad used to display a legend of the data plotted
Definition at line 155 of file PFourierCanvas.h.
Referenced by InitFourierCanvas(), and UpdateInfoPad().
|
private |
keeps the initial x-range
Definition at line 127 of file PFourierCanvas.h.
Referenced by CalcPhaseOptReal(), ClassImpQ(), InitFourierDataSets(), PlotAverage(), and PlotFourier().
|
private |
keeps the initial y-range
Definition at line 128 of file PFourierCanvas.h.
|
private |
legend used for averaged per data set view
Definition at line 156 of file PFourierCanvas.h.
Referenced by PlotAverage().
|
private |
main canvas
Definition at line 152 of file PFourierCanvas.h.
Referenced by HandleCmdKey(), InitFourierCanvas(), PlotAverage(), PlotFourier(), SaveGraphicsAndQuit(), UpdateFourierPad(), and UpdateInfoPad().
|
private |
list of markers
Definition at line 142 of file PFourierCanvas.h.
Referenced by CalcPhaseOptReal(), and InitFourierDataSets().
|
private |
popup menu of the MusrFT/Fourier sub menu
Definition at line 149 of file PFourierCanvas.h.
Referenced by HandleMenuPopup(), and InitFourierCanvas().
|
private |
popup menu MusrFT in the main menu bar
Definition at line 148 of file PFourierCanvas.h.
Referenced by ClassImpQ(), HandleCmdKey(), HandleMenuPopup(), and InitFourierCanvas().
|
private |
A collection of all graphics attributes.
Definition at line 138 of file PFourierCanvas.h.
Referenced by CreateStyle().
|
private |
timeout after which the Done signal should be emited. If timeout <= 0, no timeout is taking place
Definition at line 120 of file PFourierCanvas.h.
Referenced by ClassImpQ(), and SetTimeout().
|
private |
timeout timer in order to terminate if no action is taking place for too long
Definition at line 140 of file PFourierCanvas.h.
Referenced by SetTimeout().
|
private |
Definition at line 130 of file PFourierCanvas.h.
Referenced by ClassImpQ().
|
private |
title pad used to display a title
Definition at line 153 of file PFourierCanvas.h.
Referenced by InitFourierCanvas().
|
private |
if true, everything looks OK
Definition at line 122 of file PFourierCanvas.h.
Referenced by ClassImpQ(), InitFourierCanvas(), IsValid(), UpdateFourierPad(), and UpdateInfoPad().
|
private |
Definition at line 131 of file PFourierCanvas.h.
Referenced by ClassImpQ(), CreateXaxisTitle(), PlotAverage(), and PlotFourier().