30#ifndef _PMUSRCANVAS_H_
31#define _PMUSRCANVAS_H_
36#include <TRootCanvas.h>
43#include <TGraphErrors.h>
44#include <TMultiGraph.h>
64#define PV_FOURIER_REAL 2
65#define PV_FOURIER_IMAG 3
66#define PV_FOURIER_REAL_AND_IMAG 4
67#define PV_FOURIER_PWR 5
68#define PV_FOURIER_PHASE 6
69#define PV_FOURIER_PHASE_OPT_REAL 7
74#define P_MENU_ID_DATA 10001
75#define P_MENU_ID_FOURIER 10002
76#define P_MENU_ID_DIFFERENCE 10003
77#define P_MENU_ID_AVERAGE 10004
78#define P_MENU_ID_EXPORT_DATA 10005
80#define P_MENU_PLOT_OFFSET 1000
85#define P_MENU_ID_FOURIER_REAL 100
86#define P_MENU_ID_FOURIER_IMAG 101
87#define P_MENU_ID_FOURIER_REAL_AND_IMAG 102
88#define P_MENU_ID_FOURIER_PWR 103
89#define P_MENU_ID_FOURIER_PHASE 104
90#define P_MENU_ID_FOURIER_PHASE_OPT_REAL 105
91#define P_MENU_ID_FOURIER_PHASE_PLUS 106
92#define P_MENU_ID_FOURIER_PHASE_MINUS 107
111 virtual void SetXRange(Double_t xmin, Double_t xmax);
113 virtual void SetYRange(Double_t ymin, Double_t ymax);
291 PMusrCanvas(
const Int_t number,
const Char_t* title,
292 Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh,
const Bool_t batch,
293 const Bool_t fourier=
false,
const Bool_t avg=
false,
const Bool_t theoAsData=
false);
313 PMusrCanvas(
const Int_t number,
const Char_t* title,
314 Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh,
317 const Bool_t fourier=
false,
const Bool_t avg=
false,
const Bool_t theoAsData=
false);
344 virtual void HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected);
355 virtual void ExportData(
const Char_t *fileName);
421 virtual void InitMusrCanvas(
const Char_t* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh);
439 virtual Double_t
CalculateDiff(
const Double_t x,
const Double_t y, TH1F *theo);
440 virtual Double_t
CalculateDiff(
const Double_t x,
const Double_t y, TGraphErrors *theo);
441 virtual Int_t
FindBin(
const Double_t x, TGraphErrors *graph);
443 virtual Double_t
GetMaximum(TH1F* histo, Double_t xmin=-1.0, Double_t xmax=-1.0);
444 virtual Double_t
GetMinimum(TH1F* histo, Double_t xmin=-1.0, Double_t xmax=-1.0);
445 virtual Double_t
GetMaximum(TGraphErrors* graph, Double_t xmin=-1.0, Double_t xmax=-1.0);
446 virtual Double_t
GetMinimum(TGraphErrors* graph, Double_t xmin=-1.0, Double_t xmax=-1.0);
448 virtual void PlotData(Bool_t unzoom=
false);
462 virtual void GetExportDataSet(
const TH1F *data,
const Double_t xmin,
const Double_t xmax,
std::vector< PMusrCanvasDataSet > PMusrCanvasDataList
std::vector< PMusrCanvasNonMusrDataSet > PMusrCanvasNonMusrDataList
std::vector< PMusrCanvasAsciiDump > PMusrCanvasAsciiDumpVector
std::vector< Int_t > PIntVector
std::vector< Double_t > PDoubleVector
MSR file parser and manager for the musrfit framework.
Helper class for managing plot axis ranges.
Bool_t fXRangePresent
Flag: true if X-range explicitly set.
virtual void SetXRange(Double_t xmin, Double_t xmax)
Sets X-axis range and marks it as present.
Double_t fYmin
Minimum Y value.
PMusrCanvasPlotRange()
Default constructor.
virtual Double_t GetXmax()
Returns maximum X value.
virtual Bool_t IsYRangePresent()
Returns true if Y-axis range has been explicitly set.
Bool_t fYRangePresent
Flag: true if Y-range explicitly set.
virtual ~PMusrCanvasPlotRange()
Destructor.
Double_t fYmax
Maximum Y value.
virtual Double_t GetYmin()
Returns minimum Y value.
virtual Double_t GetXmin()
Returns minimum X value.
Double_t fXmax
Maximum X value.
virtual Double_t GetYmax()
Returns maximum Y value.
Double_t fXmin
Minimum X value.
virtual void SetYRange(Double_t ymin, Double_t ymax)
Sets Y-axis range and marks it as present.
virtual Bool_t IsXRangePresent()
Returns true if X-axis range has been explicitly set.
virtual Double_t CalculateDiff(const Double_t x, const Double_t y, TH1F *theo)
virtual Int_t FindBin(const Double_t x, TGraphErrors *graph)
PMsrFourierStructure fFourier
structure holding all the information necessary to perform the Fourier transform
virtual void CleanupFourier()
std::unique_ptr< TTimer > fTimeoutTimer
timeout timer in order to terminate if no action is taking place for too long
Bool_t fValid
if true, everything looks OK
virtual void InitMusrCanvas(const Char_t *title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh)
Int_t fPreviousPlotView
tag showing the previous plot view
std::unique_ptr< TPaveText > fTitlePad
title pad used to display a title
PRunListCollection * fRunList
data handler
virtual void HandleFourier()
PMusrCanvasDataSet fDataAvg
set of all averaged data to be plotted (asymmetry/single histogram)
virtual void Done(Int_t status=0)
ROOT signal emitted when canvas is closed or timeout occurs.
virtual void SaveGraphicsAndQuit(Char_t *fileName, Char_t *graphicsFormat)
Saves canvas to graphics file and emits Done signal.
Bool_t fYRangePresent
flag indicating if x-/y-range is present
PIntVector fMarkerList
list of markers
virtual void CleanupAverage()
virtual void InitDataSet(PMusrCanvasDataSet &dataSet)
virtual void CreateStyle()
virtual void PlotFourierDifference(Bool_t unzoom=false)
virtual void HandleAverage()
std::unique_ptr< TGPopupMenu > fPopupFourier
popup menu of the Musrfit/Fourier sub menu
PDoubleVector fCurrentFourierPhase
holds the current Fourier phase(s)
Bool_t fTheoAsData
flag if true, calculate theory points only at the data points
Int_t fPlotType
plot type tag: -1 == undefined, MSR_PLOT_SINGLE_HISTO == single histogram, MSR_PLOT_ASYM == asymmetry...
Int_t fCurrentPlotView
tag showing what the current plot view is: data, fourier, ...
virtual void HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data)
virtual void HandleDifferenceFourier()
virtual void CalcPhaseOptReFT()
PMusrCanvas::CalcPhaseOptReFT.
virtual void SetMsrHandler(PMsrHandler *msrHandler)
Sets the MSR file handler for accessing fit parameters and configuration.
virtual Double_t GetMinimum(TH1F *histo, Double_t xmin=-1.0, Double_t xmax=-1.0)
std::unique_ptr< TPad > fDataTheoryPad
data/theory pad used to display the data/theory
std::unique_ptr< TLatex > fRRFLatexText
used to display RRF info
virtual void LastCanvasClosed()
ROOT slot called when this is the last canvas being closed.
virtual Double_t GetMaximum(TH1F *histo, Double_t xmin=-1.0, Double_t xmax=-1.0)
Bool_t fBatchMode
musrview in ROOT batch mode
virtual void CleanupDifference()
std::unique_ptr< TStyle > fStyle
A collection of all graphics attributes.
virtual void SetRunListCollection(PRunListCollection *runList)
Sets the run list collection for accessing fit data and results.
virtual void HandleDifference()
std::unique_ptr< TLegend > fInfoPad
info pad used to display a legend of the data plotted
std::unique_ptr< TCanvas > fMainCanvas
main canvas
TMultiGraph * fMultiGraphData
fMultiGraphData is a 'global' graph needed in order to plot error graphs (data) with (potentially) di...
PIntVector fColorList
list of colors
virtual Bool_t IsValid()
Returns true if canvas initialized successfully.
PMsrHandler * fMsrHandler
msr-file handler
PMusrCanvas()
Default constructor.
virtual void HandleFourierDifference()
PMusrCanvasDataList fData
list of all histogram data to be plotted (asymmetry/single histogram)
Bool_t fAveragedView
tag showing that the averaged view or normal view should be presented.
std::unique_ptr< TLatex > fCurrentFourierPhaseText
used in Re/Im Fourier to show the current phase in the pad
Double_t fYmax
data/theory frame range
TGPopupMenu * fPopupMain
popup menu Musrfit in the main menu bar
TH1F * fHistoFrame
fHistoFrame is a 'global' frame needed in order to plot histograms with (potentially) different x-fra...
virtual void InitAverage()
virtual void UpdateInfoPad()
Updates info/legend pad with run information.
Int_t fPlotNumber
plot number
Bool_t fStartWithFourier
flag if true, the Fourier transform will be presented bypassing the time domain representation
virtual void InitFourier()
virtual void CleanupFourierDifference()
virtual void PlotDifference(Bool_t unzoom=false)
virtual void HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected)
ROOT slot handling keyboard commands (e.g., 'f' for Fourier, 'd' for data)
virtual Bool_t IsScaleN0AndBkg()
virtual void SetTimeout(Int_t ival)
Sets timeout in seconds after which Done signal is emitted (0=no timeout)
virtual void IncrementFourierPhase()
virtual Double_t GetInterpolatedValue(TH1F *histo, Double_t xVal)
virtual void PlotData(Bool_t unzoom=false)
std::unique_ptr< TString > fRRFText
RRF information.
TMultiGraph * fMultiGraphDiff
fMultiGraphDiff is a 'global' graph needed in order to plot error graphs (data-theory) with (potentia...
Bool_t fStartWithAvg
flag if true, the averaged data/Fourier will be presented
virtual void CleanupDataSet(PMusrCanvasDataSet &dataSet)
TRootCanvas * fImp
ROOT native GUI version of main window with menubar and drawing area.
virtual void HandleMenuPopup(Int_t id)
ROOT slot handling menu selections.
virtual UInt_t GetNeededAccuracy(PMsrParamStructure param)
virtual void PlotFourier(Bool_t unzoom=false)
std::unique_ptr< TLegend > fMultiGraphLegend
used for non-muSR plots to display a legend
Int_t fTimeout
timeout after which the Done signal should be emited. If timeout <= 0, no timeout is taking place
virtual void ExportData(const Char_t *fileName)
Exports displayed data to ASCII file.
Bool_t fToggleColor
tag showing if a single histo theory is color toggled
virtual void HandleNonMusrDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data)
virtual void PlotFourierPhaseValue(Bool_t unzoom=false)
std::unique_ptr< TPaveText > fTheoryPad
theory pad used to display the theory and functions
virtual void DecrementFourierPhase()
Bool_t fDifferenceView
tag showing that the shown data, fourier, are the difference between data and theory
virtual void UpdateParamTheoryPad()
Updates parameter and theory display pads with current fit results.
virtual void UpdateDataTheoryPad()
Updates main data/theory plotting pad.
virtual ~PMusrCanvas()
Destructor - cleans up all histograms, graphs, and ROOT objects.
std::unique_ptr< TPaveText > fParameterPad
parameter pad used to display the fitting parameters
virtual void PlotAverage(Bool_t unzoom=false)
Bool_t fScaleN0AndBkg
true=N0 and background is scaled to (1/ns), otherwise (1/bin) for the single histogram case
virtual void WindowClosed()
ROOT slot called when canvas window is closed.
virtual void GetExportDataSet(const TH1F *data, const Double_t xmin, const Double_t xmax, PMusrCanvasAsciiDumpVector &dumpData, const Bool_t hasError=true)
PMusrCanvasNonMusrDataList fNonMusrData
list of all error graphs to be plotted (non-muSR)
Manager class for all processed μSR run data during fitting.
PDoubleVector dataErr
error of the y-axis data set
PDoubleVector dataX
x-axis data set
PDoubleVector data
y-axis data set
TH1F * theoryFourierIm
imaginary part of the Fourier transform of the theory histogram
TH1F * theoryFourierPwr
power spectrum of the Fourier transform of the theory histogram
UInt_t diffFourierTag
0=not relevant, 1=d-f (Fourier of difference time spectra), 2=f-d (difference of Fourier spectra)
TH1F * theory
theory histogram belonging to the data histogram
TH1F * dataFourierRe
real part of the Fourier transform of the data histogram
TH1F * diffFourierPhase
phase spectrum of the Fourier transform of the diff histogram
TH1F * dataFourierPhase
phase spectrum of the Fourier transform of the data histogram
TH1F * theoryFourierPhaseOptReal
phase optimized real part spectrum Fourier transform of the theory histogram
TH1F * diff
difference histogram, i.e. data-theory
TH1F * diffFourierPhaseOptReal
phase optimized real part spectrum Fourier transform of the diff histogram
TH1F * dataFourierIm
imaginary part of the Fourier transform of the data histogram
TH1F * data
data histogram
TH1F * diffFourierIm
imaginary part of the Fourier transform of the diff histogram
TH1F * theoryFourierPhase
phase spectrum of the Fourier transform of the theory histogram
TH1F * dataFourierPhaseOptReal
phase optimized real part spectrum Fourier transform of the data histogram
PMusrCanvasPlotRange * dataRange
keep the msr-file plot data range
TH1F * diffFourierPwr
power spectrum of the Fourier transform of the diff histogram
TH1F * dataFourierPwr
power spectrum of the Fourier transform of the data histogram
TH1F * diffFourierRe
real part of the Fourier transform of the diff histogram
TH1F * theoryFourierRe
real part of the Fourier transform of the theory histogram
TGraphErrors * dataFourierPhase
phase spectrum of the Fourier transform of the data error graph
TGraphErrors * theoryFourierRe
real part of the Fourier transform of the theory error graph
TGraphErrors * theoryFourierIm
imaginary part of the Fourier transform of the theory error graph
TGraphErrors * dataFourierRe
real part of the Fourier transform of the data error graph
TGraphErrors * theoryFourierPwr
power spectrum of the Fourier transform of the theory error graph
TGraphErrors * data
data error graph
TGraphErrors * theoryFourierPhase
phase spectrum of the Fourier transform of the theory error graph
UInt_t diffFourierTag
0=not relevant, 1=d-f (Fourier of difference time spectra), 2=f-d (difference of Fourier spectra)
TGraphErrors * diffFourierPhase
phase spectrum of the Fourier transform of the diff error graph
TGraphErrors * diffFourierPwr
power spectrum of the Fourier transform of the diff error graph
PMusrCanvasPlotRange * dataRange
keep the msr-file plot data range
TGraphErrors * diffFourierRe
real part of the Fourier transform of the diff error graph
TGraphErrors * dataFourierIm
imaginary part of the Fourier transform of the data error graph
TGraphErrors * diffFourierIm
imaginary part of the Fourier transform of the diff error graph
TGraphErrors * theory
theory histogram belonging to the data error graph
TGraphErrors * diff
difference error graph, i.e. data-theory
TGraphErrors * dataFourierPwr
power spectrum of the Fourier transform of the data error graph