12#ifndef ROOT_TRatioPlot
13#define ROOT_TRatioPlot
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
short Color_t
Color number (short).
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
#define ClassDefOverride(name, id)
Class to manage histogram axis.
Using a TBrowser one can browse all ROOT objects.
Provides an indirection to the TFitResult class and with a semantics identical to a TFitResult pointe...
TFitResult * Get() const
Return contained pointer.
Extends the ROOT::Fit::Result class with a TNamed inheritance providing easy possibility for I/O.
TH1 is the base class of all histogram classes in ROOT.
Use the TLine constructor to create a simple line.
TObject()
TObject constructor.
The most important graphics class in the ROOT system.
@ kForceHideUp
Always hide the first label of the upper y axis.
@ kHideUp
Hide the first label of the upper y axis when there is low space.
@ kNoHide
Do not hide labels when there is low space.
@ kHideLow
Hide the last label of the lower y axis when there is low space.
@ kForceHideLow
Always hide the last label of the lower y axis.
TGraphErrors * fConfidenceInterval2
Stores the graph for the 2 sigma band.
TAxis * GetLowerRefXaxis() const
TGraphErrors * GetConfidenceInterval2() const
Returns the graph for the 2 sigma confidence interval in the fit residual case.
void SetConfidenceIntervalColors(TColorNumber ci1, TColorNumber ci2)
TRatioPlot(TH1 *h1, THStack *st, Option_t *option="pois")
TAxis * GetLowYaxis() const
virtual void SetGridlines(Double_t *gridlines, Int_t numGridlines)
Int_t fErrorMode
Stores the error mode, sym, asym or func.
TAxis * GetLowerRefYaxis() const
TGaxis * fUpperGXaxisMirror
Upper mirror of the x axis.
TRatioPlot & operator=(const TRatioPlot &)=delete
TGaxis * fLowerGXaxisMirror
Lower mirror of the x axis.
virtual Bool_t SyncPadMargins()
TPad * GetLowerPad() const
TAxis * GetUpperRefYaxis() const
TRatioPlot(TH1 *h1, TH1 *h2, Option_t *option="pois")
TAxis * GetUpYaxis() const
Float_t fLowBottomMargin
Stores the bottom margin of the lower pad.
void SetUpBottomMargin(Float_t margin)
Float_t fUpBottomMargin
Stores the bottom margin of the upper pad.
TH1 * fH1
Stores the primary histogram.
void SetH2DrawOpt(Option_t *opt)
virtual void CreateVisualAxes()
TFitResult * fFitResult
Stores the explicit fit result given in the fit residual case. Can be 0.
virtual void Init(TH1 *h1, TH1 *h2, Option_t *option="")
Color_t fCi1Color
Stores the color for the 1 sigma band.
TGaxis * fUpperGYaxis
Upper graphical y axis.
Double_t fC2
Stores the scale factor for h2.
virtual void ConnectPadsSignals()
void SetLowBottomMargin(Float_t margin)
void SetConfidenceIntervalColors(Color_t ci1=kYellow, Color_t ci2=kGreen)
Double_t fC1
Stores the scale factor for h1 (or THStack sum).
Float_t fLowTopMargin
Stores the top margin of the lower pad.
TString fH2DrawOpt
Stores draw option for h2 given in constructor.
void SetUpTopMargin(Float_t margin)
TGaxis * fLowerGXaxis
Lower graphical x axis.
Bool_t fIsUpdating
! Keeps track of whether its currently updating to reject other calls until done
virtual void SyncAxesRanges()
void SetGraphDrawOpt(Option_t *opt)
Double_t fCl1
Stores the confidence level for the inner confidence interval band.
@ kErrorAsymmetric
Use TH1::GetBinErrorUp and TH1::GetBinErrorLow for the error, depending on y values.
@ kErrorFunc
Use the square root of the function value as the error.
@ kErrorSymmetric
Use the regular TH1::GetBinError as the error.
Float_t GetSeparationMargin() const
void ImportAxisAttributes(TGaxis *gaxis, TAxis *axis)
void SetFitDrawOpt(Option_t *opt)
std::vector< TLine * > fGridlines
Keeps TLine objects for the gridlines.
TPad * fLowerPad
The pad which contains the calculated lower plot part.
TAxis * fSharedXAxis
X axis that stores the range for both plots.
void SetFitResult(TFitResultPtr fitres)
Explicitly specify the fit result that is to be used for fit residual calculation.
TString fFitDrawOpt
Stores draw option for the fit function in the fit residual case.
TGaxis * fUpperGYaxisMirror
Upper mirror of the y axis.
TGraphErrors * GetConfidenceInterval1() const
Returns the graph for the 1 sigma confidence interval in the fit residual case.
TAxis * fUpYaxis
Clone of the upper y axis.
TVirtualPad * fParentPad
Stores the pad the ratio plot was created in.
Float_t fUpTopMargin
Stores the top margin of the upper pad.
TGraph * GetCalculationOutputGraph() const
Get the output of the calculation in the form of a graph.
void SetH1DrawOpt(Option_t *opt)
TGraph * fRatioGraph
Stores the lower plot's graph.
TRatioPlot(const TRatioPlot &)=delete
Int_t fMode
Stores which calculation is supposed to be performed as specified by user option.
void SetSplitFraction(Float_t sf)
TObject * fHistDrawProxy
The object which is actually drawn, this might be TH1 or THStack.
virtual TObject * GetUpperRefObject() const
Float_t fRightMargin
Stores the common right margin of both pads.
virtual void UpdateVisualAxes()
TGaxis * fLowerGYaxisMirror
Lower mirror of the y axis.
Int_t fHideLabelMode
Stores which label to hide if the margin is to narrow, if at all.
TRatioPlot(THStack *st, TH1 *h2, Option_t *option="pois")
TPad * fTopPad
The Pad that drawn on top on the others to have consistent coordinates.
void SetInsetWidth(Double_t width)
@ kDifference
Calculate the difference between the histograms.
@ kDivideHist
Use TH1::Divide to create the ratio.
@ kFitResidual
Calculate the fit residual between the histogram and a fit stored within it.
@ kDifferenceSign
Calculate the difference divided by the error.
@ kDivideGraph
Use TGraphAsymmErrors::Divide to create the ratio.
TH1 * fH2
Stores the secondary histogram, if there is one.
Double_t fCl2
Stores the confidence level for the outer confidence interval band.
TAxis * fLowYaxis
Clone of the lower y axis.
TString fOption
Stores the option which is given in the constructor as a string.
TPad * fUpperPad
The pad which contains the upper plot part.
Bool_t fShowConfidenceIntervals
Stores whether to show the confidence interval bands. From Draw option.
virtual void SetGridlines(std::vector< double > gridlines)
void SetLowTopMargin(Float_t margin)
void SetSeparationMargin(Float_t)
Bool_t fHistDrawProxyStack
If stack was assigned as proxy.
void SetLeftMargin(Float_t margin)
Float_t fLeftMargin
Stores the common left margin of both pads.
TAxis * GetUpperRefXaxis() const
Float_t fSplitFraction
Stores the fraction at which the upper and lower pads meet.
void Paint(Option_t *opt="") override
This method must be overridden if a class wants to paint itself.
TGraphErrors * fConfidenceInterval1
Stores the graph for the 1 sigma band.
TRatioPlot(TH1 *h1, Option_t *option="", TFitResult *fitres=nullptr)
TGaxis * fUpperGXaxis
Upper graphical x axis.
virtual TGraph * GetLowerRefGraph() const
std::vector< double > fGridlinePositions
Stores the y positions for the gridlines.
TString fH1DrawOpt
Stores draw option for h1 given in constructor.
Bool_t fShowGridlines
Stores whether to show the gridlines at all.
void Draw(Option_t *chopt="") override
Default Draw method for all objects.
TString fGraphDrawOpt
Stores draw option for the lower plot graph given in constructor.
Color_t fCi2Color
Stores the color for the 2 sigma band.
void SetRightMargin(Float_t margin)
TGaxis * fLowerGYaxis
Lower graphical y axis.
void SetConfidenceLevels(Double_t cl1, Double_t cl2)
TPad * GetUpperPad() const
TVirtualPad is an abstract base class for the Pad and Canvas classes.