Logo ROOT  
Reference Guide
TRatioPlot.h
Go to the documentation of this file.
1 // @(#)root/gpad:$Id$
2 // Author: Paul Gessinger 25/08/2016
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2016, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TRatioPlot
13 #define ROOT_TRatioPlot
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // ROOT_TRatioPlot //
19 // //
20 // A collection of histograms //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TObject.h"
25 
26 #include "TString.h"
27 
28 #include "TGraph.h"
29 
30 class TH1;
31 class TPad;
32 class TVirtualPad;
33 class TGraphAsymmErrors;
34 class TGraphErrors;
35 class TAxis;
36 class TGaxis;
37 class TLine;
38 class TFitResultPtr;
39 class TFitResult;
40 class THStack;
41 class TBrowser;
42 
43 class TRatioPlot : public TObject {
44 
45 private:
46  TRatioPlot& operator=(const TRatioPlot&) = delete; // Not implemented
47  TRatioPlot(const TRatioPlot &hrp) = delete;
48 
50  kDivideHist = 1, ///< Use `TH1::Divide` to create the ratio.
51  kDivideGraph = 2, ///< Use `TGraphAsymmErrors::Divide` to create the ratio.
52  kDifference = 3, ///< Calculate the difference between the histograms.
53  kFitResidual = 4, ///< Calculate the fit residual between the histogram and a fit stored within it.
54  kDifferenceSign = 5 ///< Calculate the difference divided by the error.
55  };
56 
57  enum ErrorMode {
58  kErrorSymmetric = 1, ///< Use the regular `TH1::GetBinError` as the error
59  kErrorAsymmetric = 2, ///< Use `TH1::GetBinErrorUp` and `TH1::GetBinErrorLow` for the error, depending on y values.
60  kErrorFunc = 3 ///< Use the square root of the function value as the error.
61  };
62 
64  kHideUp = 1, ///< Hide the first label of the upper y axis when there is low space.
65  kHideLow = 2, ///< Hide the last label of the lower y axis when there is low space.
66  kNoHide = 3, ///< Do not hide labels when there is low space.
67  kForceHideUp = 4, ///< Always hide the first label of the upper y axis
68  kForceHideLow = 5 ///< Always hide the last label of the lower y axis
69  };
70 
71 
72 protected:
73 
74  TVirtualPad *fParentPad = 0; ///< Stores the pad the ratio plot was created in
75  TPad *fUpperPad = 0; ///< The pad which contains the upper plot part
76  TPad *fLowerPad = 0; ///< The pad which contains the calculated lower plot part
77  TPad *fTopPad = 0; ///< The Pad that drawn on top on the others to have consistent coordinates
78 
79  TH1 *fH1 = 0; ///< Stores the primary histogram
80  TH1 *fH2 = 0; ///< Stores the secondary histogram, if there is one
81  TObject *fHistDrawProxy = 0; ///< The object which is actually drawn, this might be TH1 or THStack
82 
83  Int_t fMode = 0; ///< Stores which calculation is supposed to be performed as specified by user option
84  Int_t fErrorMode = TRatioPlot::ErrorMode::kErrorSymmetric; ///< Stores the error mode, sym, asym or func
85  TString fOption = ""; ///< Stores the option which is given in the constructor as a string
86  TString fH1DrawOpt = ""; ///< Stores draw option for h1 given in constructor
87  TString fH2DrawOpt = ""; ///< Stores draw option for h2 given in constructor
88  TString fGraphDrawOpt = ""; ///< Stores draw option for the lower plot graph given in constructor
89  TString fFitDrawOpt = ""; ///< Stores draw option for the fit function in the fit residual case
90 
91  Float_t fSplitFraction = 0.3; ///< Stores the fraction at which the upper and lower pads meet
92 
93  TGraph *fRatioGraph = 0; ///< Stores the lower plot's graph
94  TGraphErrors *fConfidenceInterval1 = 0; ///< Stores the graph for the 1 sigma band
95  TGraphErrors *fConfidenceInterval2 = 0; ///< Stores the graph for the 2 sigma band
96  Color_t fCi1Color = kGreen; ///< Stores the color for the 1 sigma band
97  Color_t fCi2Color = kYellow; ///< Stores the color for the 2 sigma band
98 
99  Bool_t fShowConfidenceIntervals = kTRUE; ///< Stores whether to show the confidence interval bands. From Draw option
100 
101  Double_t fCl1 = 0.6827; ///< Stores the confidence level for the inner confidence interval band
102  Double_t fCl2 = 0.9545; ///< Stores the confidence level for the outer confidence interval band
103 
104  Double_t fC1 = 1.; ///< Stores the scale factor for h1 (or THStack sum)
105  Double_t fC2 = 1.; ///< Stores the scale factor for h2
106 
107  TFitResult *fFitResult = 0; ///< Stores the explicit fit result given in the fit residual case. Can be 0
108 
109  TAxis *fSharedXAxis = 0; ///< X axis that stores the range for both plots
110  TGaxis *fUpperGXaxis = 0; ///< Upper graphical x axis
111  TGaxis *fLowerGXaxis = 0; ///< Lower graphical x axis
112  TGaxis *fUpperGYaxis = 0; ///< Upper graphical y axis
113  TGaxis *fLowerGYaxis = 0; ///< Lower graphical y axis
114  TGaxis *fUpperGXaxisMirror = 0; ///< Upper mirror of the x axis
115  TGaxis *fLowerGXaxisMirror = 0; ///< Lower mirror of the x axis
116  TGaxis *fUpperGYaxisMirror = 0; ///< Upper mirror of the y axis
117  TGaxis *fLowerGYaxisMirror = 0; ///< Lower mirror of the y axis
118 
119  TAxis *fUpYaxis = 0; ///< Clone of the upper y axis
120  TAxis *fLowYaxis = 0; ///< Clone of the lower y axis
121 
122  std::vector<TLine*> fGridlines; ///< Keeps TLine objects for the gridlines
123  std::vector<double> fGridlinePositions; ///< Stores the y positions for the gridlines
124  Bool_t fShowGridlines = kTRUE; ///< Stores whether to show the gridlines at all
125  Int_t fHideLabelMode = TRatioPlot::HideLabelMode::kHideLow; ///< Stores which label to hide if the margin is to narrow, if at all
126 
127  // store margins to be able do determine
128  // what has changed when user drags
129  Float_t fUpTopMargin = 0.1; ///< Stores the top margin of the upper pad
130  Float_t fUpBottomMargin = 0.05; ///< Stores the bottom margin of the upper pad
131  Float_t fLowTopMargin = 0.05; ///< Stores the top margin of the lower pad
132  Float_t fLowBottomMargin = 0.3; ///< Stores the bottom margin of the lower pad
133 
134  Float_t fLeftMargin = 0.1; ///< Stores the common left margin of both pads
135  Float_t fRightMargin = 0.1; ///< Stores the common right margin of both pads
136 
138 
139  Bool_t fIsUpdating = kFALSE; ///< Keeps track of whether its currently updating to reject other calls until done
140  Bool_t fIsPadUpdating = kFALSE; ///< Keeps track whether pads are updating during resizing
141 
142  virtual void SyncAxesRanges();
143  virtual void SetupPads();
144  virtual void CreateVisualAxes();
145  virtual Bool_t SyncPadMargins();
146  void SetPadMargins();
147  void CreateGridline();
149 
150  void ImportAxisAttributes(TGaxis* gaxis, TAxis* axis);
151 
152  Bool_t IsDrawn();
153 
154  virtual void Init(TH1* h1, TH1* h2, Option_t *option = "");
155 
156 public:
157 
158  TRatioPlot();
159  virtual ~TRatioPlot();
160  TRatioPlot(TH1* h1, TH1* h2, Option_t *option = "pois");
161 
162  TRatioPlot(THStack* st, TH1* h2, Option_t *option = "pois");
163 
164  TRatioPlot(TH1* h1, Option_t *option = "", TFitResult *fitres = 0);
165 
166  void SetH1DrawOpt(Option_t *opt);
167  void SetH2DrawOpt(Option_t *opt);
168  void SetGraphDrawOpt(Option_t *opt);
169  void SetFitDrawOpt(Option_t *opt);
170 
172 
173  virtual void Draw(Option_t *chopt="");
174  virtual void Browse(TBrowser *b);
175 
176 
177  virtual void Paint(Option_t *opt = "");
178 
179  // Slots for signal receiving
180  void UnZoomed();
181  void RangeAxisChanged();
182  void SubPadResized();
183 
184  // Getters
185  TAxis *GetXaxis() const { return fSharedXAxis; }
186  TAxis *GetUpYaxis() const { return fUpYaxis; }
187  TAxis *GetLowYaxis() const { return fLowYaxis; }
188 
189  virtual TGraph *GetLowerRefGraph() const;
190 
191  ////////////////////////////////////////////////////////////////////////////////
192  /// Shortcut for:
193  ///
194  /// ~~~{.cpp}
195  /// rp->GetLowerRefGraph()->GetXaxis();
196  /// ~~~
197 
199 
200  ////////////////////////////////////////////////////////////////////////////////
201  /// Shortcut for:
202  ///
203  /// ~~~{.cpp}
204  /// rp->GetLowerRefGraph()->GetYaxis();
205  /// ~~~
206 
208 
209  virtual TObject *GetUpperRefObject() const;
210  TAxis *GetUpperRefXaxis() const;
211  TAxis *GetUpperRefYaxis() const;
212 
213  ////////////////////////////////////////////////////////////////////////////////
214  /// Get the output of the calculation in the form of a graph. The type of
215  /// the return value depends on the input option that was given in the constructor.
216 
218 
219  ////////////////////////////////////////////////////////////////////////////////
220  /// Returns the graph for the 1 sigma confidence interval in the fit residual case
221 
223 
224  ////////////////////////////////////////////////////////////////////////////////
225  /// Returns the graph for the 2 sigma confidence interval in the fit residual case
226 
228 
229  TPad * GetUpperPad() const { return fUpperPad; }
230  TPad * GetLowerPad() const { return fLowerPad; }
231 
232  // Setters
233 
234  ////////////////////////////////////////////////////////////////////////////////
235  /// Explicitly specify the fit result that is to be used for fit residual calculation.
236  /// If it is not provided, the last fit registered in the global fitter is used.
237  /// The fit result can also be specified in the constructor.
238  ///
239  /// \param fitres The fit result coming from the fit function call
240 
241  void SetFitResult(TFitResultPtr fitres) { fFitResult = fitres.Get(); }
242 
243  // Setters for margins
244  void SetUpTopMargin(Float_t margin);
245  void SetUpBottomMargin(Float_t margin);
246  void SetLowTopMargin(Float_t margin);
247  void SetLowBottomMargin(Float_t margin);
248  void SetLeftMargin(Float_t margin);
249  void SetRightMargin(Float_t margin);
250 
253  void SetSplitFraction(Float_t sf);
254  void SetConfidenceLevels(Double_t cl1, Double_t cl2);
255 
256  virtual void SetGridlines(Double_t *gridlines, Int_t numGridlines);
257  virtual void SetGridlines(std::vector<double> gridlines);
258 
260 
261  void SetC1(Double_t c1) { fC1 = c1; }
262  void SetC2(Double_t c2) { fC2 = c2; }
263 
264  ClassDef(TRatioPlot, 1) //A ratio of histograms
265 };
266 
267 #endif
TRatioPlot::kErrorFunc
@ kErrorFunc
Use the square root of the function value as the error.
Definition: TRatioPlot.h:60
TRatioPlot::SetGraphDrawOpt
void SetGraphDrawOpt(Option_t *opt)
Sets the drawing option for the lower graph.
Definition: TRatioPlot.cxx:353
TRatioPlot::fUpBottomMargin
Float_t fUpBottomMargin
Stores the bottom margin of the upper pad.
Definition: TRatioPlot.h:130
TRatioPlot::GetUpperRefXaxis
TAxis * GetUpperRefXaxis() const
Gets the x axis of the object returned by TRatioPlot::GetUpperRefObject.
Definition: TRatioPlot.cxx:720
TAxis
Class to manage histogram axis.
Definition: TAxis.h:30
TRatioPlot::GetXaxis
TAxis * GetXaxis() const
Definition: TRatioPlot.h:185
TRatioPlot::fMode
Int_t fMode
Stores which calculation is supposed to be performed as specified by user option.
Definition: TRatioPlot.h:83
TRatioPlot::SetupPads
virtual void SetupPads()
Setup the pads.
Definition: TRatioPlot.cxx:369
TRatioPlot::SetFitDrawOpt
void SetFitDrawOpt(Option_t *opt)
Sets the drawing option for the fit in the fit residual case.
Definition: TRatioPlot.cxx:361
TRatioPlot::kDifferenceSign
@ kDifferenceSign
Calculate the difference divided by the error.
Definition: TRatioPlot.h:54
TRatioPlot::kForceHideUp
@ kForceHideUp
Always hide the first label of the upper y axis.
Definition: TRatioPlot.h:67
TBrowser
Definition: TBrowser.h:37
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TRatioPlot::kHideLow
@ kHideLow
Hide the last label of the lower y axis when there is low space.
Definition: TRatioPlot.h:65
TRatioPlot::SetConfidenceIntervalColors
void SetConfidenceIntervalColors(Color_t ci1=kGreen, Color_t ci2=kYellow)
Set the confidence interval colors.
Definition: TRatioPlot.cxx:1704
TRatioPlot::fH1DrawOpt
TString fH1DrawOpt
Stores draw option for h1 given in constructor.
Definition: TRatioPlot.h:86
TRatioPlot::fConfidenceInterval2
TGraphErrors * fConfidenceInterval2
Stores the graph for the 2 sigma band.
Definition: TRatioPlot.h:95
TRatioPlot::fUpTopMargin
Float_t fUpTopMargin
Stores the top margin of the upper pad.
Definition: TRatioPlot.h:129
TRatioPlot::fUpperGXaxisMirror
TGaxis * fUpperGXaxisMirror
Upper mirror of the x axis.
Definition: TRatioPlot.h:114
TLine
Definition: TLine.h:22
TRatioPlot::fShowConfidenceIntervals
Bool_t fShowConfidenceIntervals
Stores whether to show the confidence interval bands. From Draw option.
Definition: TRatioPlot.h:99
TRatioPlot::~TRatioPlot
virtual ~TRatioPlot()
Destructor.
Definition: TRatioPlot.cxx:109
TRatioPlot::fOption
TString fOption
Stores the option which is given in the constructor as a string.
Definition: TRatioPlot.h:85
TRatioPlot::SetSeparationMargin
void SetSeparationMargin(Float_t)
Sets the margin that separates the two pads.
Definition: TRatioPlot.cxx:503
TPad
Definition: TPad.h:26
TRatioPlot::SyncPadMargins
virtual Bool_t SyncPadMargins()
Figures out which pad margin has deviated from the stored ones, to figure out what the new nominal is...
Definition: TRatioPlot.cxx:1396
TRatioPlot::UnZoomed
void UnZoomed()
Slot for the UnZoomed signal that was introduced to TAxis.
Definition: TRatioPlot.cxx:1551
kGreen
@ kGreen
Definition: Rtypes.h:66
TRatioPlot::GetLowerPad
TPad * GetLowerPad() const
Definition: TRatioPlot.h:230
TRatioPlot::fCi1Color
Color_t fCi1Color
Stores the color for the 1 sigma band.
Definition: TRatioPlot.h:96
TRatioPlot::fSharedXAxis
TAxis * fSharedXAxis
X axis that stores the range for both plots.
Definition: TRatioPlot.h:109
TRatioPlot::SetRightMargin
void SetRightMargin(Float_t margin)
Sets the right margin of both pads.
Definition: TRatioPlot.cxx:487
THStack
Definition: THStack.h:38
TRatioPlot::SetH2DrawOpt
void SetH2DrawOpt(Option_t *opt)
Sets the drawing option for h2.
Definition: TRatioPlot.cxx:341
TRatioPlot::Paint
virtual void Paint(Option_t *opt="")
Creates the visual axes when painting.
Definition: TRatioPlot.cxx:827
TRatioPlot::fUpperGYaxis
TGaxis * fUpperGYaxis
Upper graphical y axis.
Definition: TRatioPlot.h:112
TRatioPlot::fC2
Double_t fC2
Stores the scale factor for h2.
Definition: TRatioPlot.h:105
TRatioPlot::ImportAxisAttributes
void ImportAxisAttributes(TGaxis *gaxis, TAxis *axis)
Internal method to import TAxis attributes to a TGaxis.
Definition: TRatioPlot.cxx:1714
TGraph.h
TRatioPlot::GetConfidenceInterval1
TGraphErrors * GetConfidenceInterval1() const
Returns the graph for the 1 sigma confidence interval in the fit residual case.
Definition: TRatioPlot.h:222
TRatioPlot::SetC2
void SetC2(Double_t c2)
Definition: TRatioPlot.h:262
TRatioPlot::SubPadResized
void SubPadResized()
Slot that handles common resizing of upper and lower pad.
Definition: TRatioPlot.cxx:1567
TFitResult
Definition: TFitResult.h:34
Float_t
float Float_t
Definition: RtypesCore.h:57
width
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
TRatioPlot::Browse
virtual void Browse(TBrowser *b)
Browse.
Definition: TRatioPlot.cxx:422
Int_t
int Int_t
Definition: RtypesCore.h:45
TRatioPlot::SetLowTopMargin
void SetLowTopMargin(Float_t margin)
Sets the top margin of the lower pad.
Definition: TRatioPlot.cxx:455
TRatioPlot::HideLabelMode
HideLabelMode
Definition: TRatioPlot.h:63
TRatioPlot::fLeftMargin
Float_t fLeftMargin
Stores the common left margin of both pads.
Definition: TRatioPlot.h:134
TRatioPlot::fHideLabelMode
Int_t fHideLabelMode
Stores which label to hide if the margin is to narrow, if at all.
Definition: TRatioPlot.h:125
TRatioPlot::fC1
Double_t fC1
Stores the scale factor for h1 (or THStack sum)
Definition: TRatioPlot.h:104
TRatioPlot::kHideUp
@ kHideUp
Hide the first label of the upper y axis when there is low space.
Definition: TRatioPlot.h:64
TRatioPlot::TRatioPlot
TRatioPlot()
TRatioPlot default constructor.
Definition: TRatioPlot.cxx:102
TRatioPlot::fRightMargin
Float_t fRightMargin
Stores the common right margin of both pads.
Definition: TRatioPlot.h:135
TRatioPlot::Init
virtual void Init(TH1 *h1, TH1 *h2, Option_t *option="")
Internal method that shares constructor logic.
Definition: TRatioPlot.cxx:139
TRatioPlot::BuildLowerPlot
Int_t BuildLowerPlot()
Build the lower plot according to which constructor was called, and which options were passed.
Definition: TRatioPlot.cxx:859
TRatioPlot::SetUpTopMargin
void SetUpTopMargin(Float_t margin)
Sets the top margin of the upper pad.
Definition: TRatioPlot.cxx:433
TString
Definition: TString.h:136
TGraph::GetYaxis
TAxis * GetYaxis() const
Get y axis of the graph.
Definition: TGraph.cxx:1636
Color_t
short Color_t
Definition: RtypesCore.h:83
b
#define b(i)
Definition: RSha256.hxx:118
TRatioPlot::CreateGridline
void CreateGridline()
Create a grid line.
Definition: TRatioPlot.cxx:756
TString.h
h1
TH1F * h1
Definition: legend1.C:5
TRatioPlot::fH1
TH1 * fH1
Stores the primary histogram.
Definition: TRatioPlot.h:79
TRatioPlot::SetPadMargins
void SetPadMargins()
Sets the margins of all the pads to the value specified in class members.
Definition: TRatioPlot.cxx:1379
bool
TRatioPlot::GetUpperRefYaxis
TAxis * GetUpperRefYaxis() const
Gets the y axis of the object returned by TRatioPlot::GetUpperRefObject.
Definition: TRatioPlot.cxx:738
TRatioPlot::fConfidenceInterval1
TGraphErrors * fConfidenceInterval1
Stores the graph for the 1 sigma band.
Definition: TRatioPlot.h:94
TRatioPlot::fLowerGYaxisMirror
TGaxis * fLowerGYaxisMirror
Lower mirror of the y axis.
Definition: TRatioPlot.h:117
TRatioPlot::GetCalculationOutputGraph
TGraph * GetCalculationOutputGraph() const
Get the output of the calculation in the form of a graph.
Definition: TRatioPlot.h:217
TRatioPlot::SetUpBottomMargin
void SetUpBottomMargin(Float_t margin)
Sets the bottom margin of the upper pad.
Definition: TRatioPlot.cxx:444
TRatioPlot::fLowBottomMargin
Float_t fLowBottomMargin
Stores the bottom margin of the lower pad.
Definition: TRatioPlot.h:132
TRatioPlot::fHistDrawProxy
TObject * fHistDrawProxy
The object which is actually drawn, this might be TH1 or THStack.
Definition: TRatioPlot.h:81
TRatioPlot::fUpYaxis
TAxis * fUpYaxis
Clone of the upper y axis.
Definition: TRatioPlot.h:119
TGraph::GetXaxis
TAxis * GetXaxis() const
Get x axis of the graph.
Definition: TGraph.cxx:1626
TRatioPlot::GetLowerRefYaxis
TAxis * GetLowerRefYaxis() const
Shortcut for:
Definition: TRatioPlot.h:207
TRatioPlot::fIsUpdating
Bool_t fIsUpdating
Keeps track of whether its currently updating to reject other calls until done.
Definition: TRatioPlot.h:139
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TFitResultPtr
Definition: TFitResultPtr.h:32
TRatioPlot::fLowYaxis
TAxis * fLowYaxis
Clone of the lower y axis.
Definition: TRatioPlot.h:120
TRatioPlot::fCi2Color
Color_t fCi2Color
Stores the color for the 2 sigma band.
Definition: TRatioPlot.h:97
TRatioPlot::GetUpperPad
TPad * GetUpperPad() const
Definition: TRatioPlot.h:229
TRatioPlot::SetC1
void SetC1(Double_t c1)
Definition: TRatioPlot.h:261
TRatioPlot::fInsetWidth
Float_t fInsetWidth
Definition: TRatioPlot.h:137
TRatioPlot::kDivideHist
@ kDivideHist
Use TH1::Divide to create the ratio.
Definition: TRatioPlot.h:50
TRatioPlot::GetLowerRefGraph
virtual TGraph * GetLowerRefGraph() const
Returns the reference graph for the lower pad, which means the graph that is responsible for setting ...
Definition: TRatioPlot.cxx:668
TRatioPlot::SetLowBottomMargin
void SetLowBottomMargin(Float_t margin)
Sets the bottom margin of the lower pad.
Definition: TRatioPlot.cxx:466
TRatioPlot::SetInsetWidth
void SetInsetWidth(Double_t width)
Set the inset on the outer sides of all the pads.
Definition: TRatioPlot.cxx:1635
TRatioPlot::Draw
virtual void Draw(Option_t *chopt="")
Draws the ratio plot to the currently active pad.
Definition: TRatioPlot.cxx:539
TRatioPlot::SetSplitFraction
void SetSplitFraction(Float_t sf)
Set the fraction of the parent pad, at which the to sub pads should meet.
Definition: TRatioPlot.cxx:1614
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TFitResultPtr::Get
TFitResult * Get() const
Return contained pointer.
Definition: TFitResultPtr.cxx:86
TRatioPlot::fIsPadUpdating
Bool_t fIsPadUpdating
Keeps track whether pads are updating during resizing.
Definition: TRatioPlot.h:140
TRatioPlot::GetUpperRefObject
virtual TObject * GetUpperRefObject() const
Return the reference object.
Definition: TRatioPlot.cxx:702
TRatioPlot::kFitResidual
@ kFitResidual
Calculate the fit residual between the histogram and a fit stored within it.
Definition: TRatioPlot.h:53
TRatioPlot::SetH1DrawOpt
void SetH1DrawOpt(Option_t *opt)
Sets the drawing option for h1.
Definition: TRatioPlot.cxx:333
TRatioPlot::kErrorSymmetric
@ kErrorSymmetric
Use the regular TH1::GetBinError as the error.
Definition: TRatioPlot.h:58
TRatioPlot::fTopPad
TPad * fTopPad
The Pad that drawn on top on the others to have consistent coordinates.
Definition: TRatioPlot.h:77
TRatioPlot::kErrorAsymmetric
@ kErrorAsymmetric
Use TH1::GetBinErrorUp and TH1::GetBinErrorLow for the error, depending on y values.
Definition: TRatioPlot.h:59
TRatioPlot::fCl1
Double_t fCl1
Stores the confidence level for the inner confidence interval band.
Definition: TRatioPlot.h:101
TRatioPlot::fGraphDrawOpt
TString fGraphDrawOpt
Stores draw option for the lower plot graph given in constructor.
Definition: TRatioPlot.h:88
TGraphAsymmErrors
Definition: TGraphAsymmErrors.h:26
TRatioPlot::GetUpYaxis
TAxis * GetUpYaxis() const
Definition: TRatioPlot.h:186
TRatioPlot::fLowerGYaxis
TGaxis * fLowerGYaxis
Lower graphical y axis.
Definition: TRatioPlot.h:113
TRatioPlot::fUpperPad
TPad * fUpperPad
The pad which contains the upper plot part.
Definition: TRatioPlot.h:75
TRatioPlot::GetLowerRefXaxis
TAxis * GetLowerRefXaxis() const
Shortcut for:
Definition: TRatioPlot.h:198
TRatioPlot::ErrorMode
ErrorMode
Definition: TRatioPlot.h:57
TRatioPlot::fLowerGXaxisMirror
TGaxis * fLowerGXaxisMirror
Lower mirror of the x axis.
Definition: TRatioPlot.h:115
TRatioPlot::fFitDrawOpt
TString fFitDrawOpt
Stores draw option for the fit function in the fit residual case.
Definition: TRatioPlot.h:89
TRatioPlot::SetFitResult
void SetFitResult(TFitResultPtr fitres)
Explicitly specify the fit result that is to be used for fit residual calculation.
Definition: TRatioPlot.h:241
TRatioPlot::fCl2
Double_t fCl2
Stores the confidence level for the outer confidence interval band.
Definition: TRatioPlot.h:102
Double_t
double Double_t
Definition: RtypesCore.h:59
TRatioPlot::SetGridlines
virtual void SetGridlines(Double_t *gridlines, Int_t numGridlines)
Set where horizontal, dashed lines are drawn on the lower pad.
Definition: TRatioPlot.cxx:1685
TGraph
Definition: TGraph.h:41
TVirtualPad
Definition: TVirtualPad.h:50
TRatioPlot::GetConfidenceInterval2
TGraphErrors * GetConfidenceInterval2() const
Returns the graph for the 2 sigma confidence interval in the fit residual case.
Definition: TRatioPlot.h:227
TGraphErrors
Definition: TGraphErrors.h:26
TObject.h
TRatioPlot::GetSeparationMargin
Float_t GetSeparationMargin() const
Return the separation margin value.
Definition: TRatioPlot.cxx:514
TRatioPlot::IsDrawn
Bool_t IsDrawn()
Check if ... is drawn.
Definition: TRatioPlot.cxx:1605
TRatioPlot::RangeAxisChanged
void RangeAxisChanged()
Slot that receives the RangeAxisChanged signal from any of the pads and reacts correspondingly.
Definition: TRatioPlot.cxx:1465
TGaxis
Definition: TGaxis.h:23
TRatioPlot::kNoHide
@ kNoHide
Do not hide labels when there is low space.
Definition: TRatioPlot.h:66
TRatioPlot::fH2
TH1 * fH2
Stores the secondary histogram, if there is one.
Definition: TRatioPlot.h:80
TRatioPlot::fParentPad
TVirtualPad * fParentPad
Stores the pad the ratio plot was created in.
Definition: TRatioPlot.h:74
TRatioPlot::fUpperGYaxisMirror
TGaxis * fUpperGYaxisMirror
Upper mirror of the y axis.
Definition: TRatioPlot.h:116
TRatioPlot::kDivideGraph
@ kDivideGraph
Use TGraphAsymmErrors::Divide to create the ratio.
Definition: TRatioPlot.h:51
TRatioPlot
Definition: TRatioPlot.h:43
TObject
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TH1
Definition: TH1.h:57
TRatioPlot::kDifference
@ kDifference
Calculate the difference between the histograms.
Definition: TRatioPlot.h:52
TRatioPlot::fRatioGraph
TGraph * fRatioGraph
Stores the lower plot's graph.
Definition: TRatioPlot.h:93
TRatioPlot::operator=
TRatioPlot & operator=(const TRatioPlot &)=delete
c2
return c2
Definition: legend2.C:14
TRatioPlot::fShowGridlines
Bool_t fShowGridlines
Stores whether to show the gridlines at all.
Definition: TRatioPlot.h:124
TRatioPlot::fSplitFraction
Float_t fSplitFraction
Stores the fraction at which the upper and lower pads meet.
Definition: TRatioPlot.h:91
TRatioPlot::fUpperGXaxis
TGaxis * fUpperGXaxis
Upper graphical x axis.
Definition: TRatioPlot.h:110
TRatioPlot::fLowTopMargin
Float_t fLowTopMargin
Stores the top margin of the lower pad.
Definition: TRatioPlot.h:131
TRatioPlot::SetConfidenceLevels
void SetConfidenceLevels(Double_t cl1, Double_t cl2)
Sets the confidence levels used to calculate the bands in the fit residual case.
Definition: TRatioPlot.cxx:1656
TRatioPlot::SetLeftMargin
void SetLeftMargin(Float_t margin)
Sets the left margin of both pads.
Definition: TRatioPlot.cxx:476
TRatioPlot::GetLowYaxis
TAxis * GetLowYaxis() const
Definition: TRatioPlot.h:187
TRatioPlot::CreateVisualAxes
virtual void CreateVisualAxes()
(Re-)Creates the TGAxis objects that are used for consistent display of the axes.
Definition: TRatioPlot.cxx:1104
TRatioPlot::SyncAxesRanges
virtual void SyncAxesRanges()
Syncs the axes ranges from the shared ones to the actual ones.
Definition: TRatioPlot.cxx:839
TRatioPlot::kForceHideLow
@ kForceHideLow
Always hide the last label of the lower y axis.
Definition: TRatioPlot.h:68
TRatioPlot::CalculationMode
CalculationMode
Definition: TRatioPlot.h:49
TRatioPlot::fGridlines
std::vector< TLine * > fGridlines
Keeps TLine objects for the gridlines.
Definition: TRatioPlot.h:122
TRatioPlot::fLowerGXaxis
TGaxis * fLowerGXaxis
Lower graphical x axis.
Definition: TRatioPlot.h:111
kYellow
@ kYellow
Definition: Rtypes.h:66
TRatioPlot::fH2DrawOpt
TString fH2DrawOpt
Stores draw option for h2 given in constructor.
Definition: TRatioPlot.h:87
TRatioPlot::fFitResult
TFitResult * fFitResult
Stores the explicit fit result given in the fit residual case. Can be 0.
Definition: TRatioPlot.h:107
TRatioPlot::fLowerPad
TPad * fLowerPad
The pad which contains the calculated lower plot part.
Definition: TRatioPlot.h:76
TRatioPlot::fErrorMode
Int_t fErrorMode
Stores the error mode, sym, asym or func.
Definition: TRatioPlot.h:84
TRatioPlot::fGridlinePositions
std::vector< double > fGridlinePositions
Stores the y positions for the gridlines.
Definition: TRatioPlot.h:123
int
c1
return c1
Definition: legend1.C:41