12 #ifndef ROOT_TRatioPlot 13 #define ROOT_TRatioPlot 258 virtual void SetGridlines(std::vector<double> gridlines);
TRatioPlot()
TRatioPlot default constructor.
TVirtualPad * fParentPad
Stores the pad the ratio plot was created in.
TGaxis * fUpperGYaxisMirror
Upper mirror of the y axis.
void SetUpBottomMargin(Float_t margin)
Sets the bottom margin of the upper pad.
void SetFitResult(TFitResultPtr fitres)
Explicitly specify the fit result that is to be used for fit residual calculation.
The Histogram stack class.
TRatioPlot & operator=(const TRatioPlot &)=delete
void RangeAxisChanged()
Slot that receives the RangeAxisChanged signal from any of the pads and reacts correspondingly.
TAxis * GetLowerRefYaxis() const
Shortcut for:
TAxis * GetUpperRefYaxis() const
Gets the y axis of the object returned by TRatioPlot::GetUpperRefObject.
Float_t fLowTopMargin
Stores the top margin of the lower pad.
TH1 * fH2
Stores the secondary histogram, if there is one.
Color_t fCi2Color
Stores the color for the 2 sigma band.
void SetLeftMargin(Float_t margin)
Sets the left margin of both pads.
TAxis * fLowYaxis
Clone of the lower y axis.
virtual TGraph * GetLowerRefGraph() const
Returns the reference graph for the lower pad, which means the graph that is responsible for setting ...
virtual void SyncAxesRanges()
Syncs the axes ranges from the shared ones to the actual ones.
TObject * fHistDrawProxy
The object which is actually drawn, this might be TH1 or THStack.
TAxis * GetYaxis() const
Get y axis of the graph.
TGraph * fRatioGraph
Stores the lower plot's graph.
void SetInsetWidth(Double_t width)
Set the inset on the outer sides of all the pads.
virtual void Draw(Option_t *chopt="")
Draws the ratio plot to the currently active pad.
void SetSplitFraction(Float_t sf)
Set the fraction of the parent pad, at which the to sub pads should meet.
Float_t fSplitFraction
Stores the fraction at which the upper and lower pads meet.
TString fH2DrawOpt
Stores draw option for h2 given in constructor.
Int_t fErrorMode
Stores the error mode, sym, asym or func.
void SetConfidenceLevels(Double_t cl1, Double_t cl2)
Sets the confidence levels used to calculate the bands in the fit residual case.
TPad * GetUpperPad() const
TString fGraphDrawOpt
Stores draw option for the lower plot graph given in constructor.
Double_t fCl1
Stores the confidence level for the inner confidence interval band.
void SetLowBottomMargin(Float_t margin)
Sets the bottom margin of the lower pad.
TFitResult * fFitResult
Stores the explicit fit result given in the fit residual case. Can be 0.
virtual TObject * GetUpperRefObject() const
Return the reference object.
void SetH1DrawOpt(Option_t *opt)
Sets the drawing option for h1.
TAxis * GetLowerRefXaxis() const
Shortcut for:
TString fH1DrawOpt
Stores draw option for h1 given in constructor.
TGraphErrors * fConfidenceInterval2
Stores the graph for the 2 sigma band.
std::vector< double > fGridlinePositions
Stores the y positions for the gridlines.
TGraph with asymmetric error bars.
Calculate the difference between the histograms.
#define ClassDef(name, id)
TGaxis * fLowerGXaxisMirror
Lower mirror of the x axis.
TString fFitDrawOpt
Stores draw option for the fit function in the fit residual case.
Extends the ROOT::Fit::Result class with a TNamed inheritance providing easy possibility for I/O...
Use TH1::Divide to create the ratio.
Int_t fMode
Stores which calculation is supposed to be performed as specified by user option. ...
TPad * GetLowerPad() const
TAxis * GetUpperRefXaxis() const
Gets the x axis of the object returned by TRatioPlot::GetUpperRefObject.
void UnZoomed()
Slot for the UnZoomed signal that was introduced to TAxis.
virtual void SetupPads()
Setup the pads.
Color_t fCi1Color
Stores the color for the 1 sigma band.
TPad * fUpperPad
The pad which contains the upper plot part.
Float_t GetSeparationMargin() const
Return the separation margin value.
Bool_t IsDrawn()
Check if ... is drawn.
TAxis * GetUpYaxis() const
void SetConfidenceIntervalColors(Color_t ci1=kGreen, Color_t ci2=kYellow)
Set the confidence interval colors.
void SetH2DrawOpt(Option_t *opt)
Sets the drawing option for h2.
Hide the first label of the upper y axis when there is low space.
TGaxis * fUpperGXaxisMirror
Upper mirror of the x axis.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Use the regular TH1::GetBinError as the error.
Double_t fCl2
Stores the confidence level for the outer confidence interval band.
virtual ~TRatioPlot()
Destructor.
virtual Bool_t SyncPadMargins()
Figures out which pad margin has deviated from the stored ones, to figure out what the new nominal is...
virtual void SetGridlines(Double_t *gridlines, Int_t numGridlines)
Set where horizontal, dashed lines are drawn on the lower pad.
Using a TBrowser one can browse all ROOT objects.
Double_t fC1
Stores the scale factor for h1 (or THStack sum)
TGaxis * fUpperGYaxis
Upper graphical y axis.
Always hide the first label of the upper y axis.
Class to manage histogram axis.
TAxis * GetLowYaxis() const
virtual void Init(TH1 *h1, TH1 *h2, Option_t *option="")
Internal method that shares constructor logic.
Use TH1::GetBinErrorUp and TH1::GetBinErrorLow for the error, depending on y values.
std::vector< TLine * > fGridlines
Keeps TLine objects for the gridlines.
Provides an indirection to the TFitResult class and with a semantics identical to a TFitResult pointe...
Bool_t fShowGridlines
Stores whether to show the gridlines at all.
void SetUpTopMargin(Float_t margin)
Sets the top margin of the upper pad.
The most important graphics class in the ROOT system.
Float_t fLeftMargin
Stores the common left margin of both pads.
TGaxis * fUpperGXaxis
Upper graphical x axis.
Int_t fHideLabelMode
Stores which label to hide if the margin is to narrow, if at all.
TH1 * fH1
Stores the primary histogram.
void SetPadMargins()
Sets the margins of all the pads to the value specified in class members.
virtual void CreateVisualAxes()
(Re-)Creates the TGAxis objects that are used for consistent display of the axes. ...
Float_t fRightMargin
Stores the common right margin of both pads.
Use the square root of the function value as the error.
TAxis * GetXaxis() const
Get x axis of the graph.
TGaxis * fLowerGXaxis
Lower graphical x axis.
TPad * fLowerPad
The pad which contains the calculated lower plot part.
void SetFitDrawOpt(Option_t *opt)
Sets the drawing option for the fit in the fit residual case.
void CreateGridline()
Create a grid line.
Bool_t fIsUpdating
Keeps track of whether its currently updating to reject other calls until done.
Use TGraphAsymmErrors::Divide to create the ratio.
Hide the last label of the lower y axis when there is low space.
Float_t fUpTopMargin
Stores the top margin of the upper pad.
Float_t fUpBottomMargin
Stores the bottom margin of the upper pad.
TGraphErrors * fConfidenceInterval1
Stores the graph for the 1 sigma band.
TString fOption
Stores the option which is given in the constructor as a string.
TGaxis * fLowerGYaxisMirror
Lower mirror of the y axis.
void SetSeparationMargin(Float_t)
Sets the margin that separates the two pads.
void SetGraphDrawOpt(Option_t *opt)
Sets the drawing option for the lower graph.
Always hide the last label of the lower y axis.
TGraph * GetCalculationOutputGraph() const
Get the output of the calculation in the form of a graph.
Float_t fLowBottomMargin
Stores the bottom margin of the lower pad.
TAxis * fSharedXAxis
X axis that stores the range for both plots.
Mother of all ROOT objects.
TAxis * fUpYaxis
Clone of the upper y axis.
Double_t fC2
Stores the scale factor for h2.
Calculate the fit residual between the histogram and a fit stored within it.
void ImportAxisAttributes(TGaxis *gaxis, TAxis *axis)
Internal method to import TAxis attributes to a TGaxis.
Bool_t fShowConfidenceIntervals
Stores whether to show the confidence interval bands. From Draw option.
TGraphErrors * GetConfidenceInterval1() const
Returns the graph for the 1 sigma confidence interval in the fit residual case.
void SubPadResized()
Slot that handles common resizing of upper and lower pad.
TFitResult * Get() const
Return contained pointer.
A Graph is a graphics object made of two arrays X and Y with npoints each.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
A TGraphErrors is a TGraph with error bars.
virtual void Paint(Option_t *opt="")
Creates the visual axes when painting.
void SetRightMargin(Float_t margin)
Sets the right margin of both pads.
Class for displaying ratios, differences and fit residuals.
Bool_t fIsPadUpdating
Keeps track whether pads are updating during resizing.
Do not hide labels when there is low space.
TGaxis * fLowerGYaxis
Lower graphical y axis.
Int_t BuildLowerPlot()
Build the lower plot according to which constructor was called, and which options were passed...
TPad * fTopPad
The Pad that drawn on top on the others to have consistent coordinates.
virtual void Browse(TBrowser *b)
Browse.
void SetLowTopMargin(Float_t margin)
Sets the top margin of the lower pad.
Calculate the difference divided by the error.
TGraphErrors * GetConfidenceInterval2() const
Returns the graph for the 2 sigma confidence interval in the fit residual case.