Logo ROOT  
Reference Guide
RooPlot.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooPlot.h,v 1.37 2007/06/18 11:52:41 wouter Exp $
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16#ifndef ROO_PLOT
17#define ROO_PLOT
18
19#include "RooPrintable.h"
20#include "TNamed.h"
21
22#include <memory>
23#include <float.h>
24
25class TH1 ;
26
27class RooAbsReal;
29class RooArgSet ;
30class RooHist;
31class RooCurve ;
32class RooPlotable;
33class TDirectory ;
34class TAttLine;
35class TAttFill;
36class TAttMarker;
37class TAttText;
38class TClass ;
39class TAxis;
40class TBrowser ;
41class TLegend;
42
43class RooPlot : public TNamed, public RooPrintable {
44public:
45 using Items = std::vector<std::pair<TObject*,std::string>>;
46
47 RooPlot() ;
48 RooPlot(const char* name, const char* title, const RooAbsRealLValue &var, double xmin, double xmax, Int_t nBins) ;
49 RooPlot(const RooAbsRealLValue &var, double xmin, double xmax, Int_t nBins);
50 RooPlot(double xmin, double xmax);
51 RooPlot(double xmin, double xmax, double ymin, double ymax);
52 RooPlot(const RooAbsRealLValue &var1, const RooAbsRealLValue &var2);
53 RooPlot(const RooAbsRealLValue &var1, const RooAbsRealLValue &var2,
54 double xmin, double xmax, double ymin, double ymax);
55 ~RooPlot() override;
56
57 static RooPlot* frame(const RooAbsRealLValue &var, double xmin, double xmax, Int_t nBins);
58 static RooPlot* frameWithLabels(const RooAbsRealLValue &var);
59
60 RooPlot* emptyClone(const char* name) ;
61
62 // implement the TH1 interface
63 virtual Stat_t GetBinContent(Int_t) const;
64 virtual Stat_t GetBinContent(Int_t, Int_t) const;
65 virtual Stat_t GetBinContent(Int_t, Int_t, Int_t) const;
66 void Draw(Option_t *options= nullptr) override;
67
68 // forwarding of relevant TH1 interface
69 TAxis* GetXaxis() const ;
70 TAxis* GetYaxis() const ;
71 Int_t GetNbinsX() const ;
72 Int_t GetNdivisions(Option_t* axis = "X") const ;
73 double GetMinimum(double minval = -FLT_MAX) const ;
74 double GetMaximum(double maxval = FLT_MAX) const ;
75
76 void SetAxisColor(Color_t color = 1, Option_t* axis = "X") ;
77 void SetAxisRange(double xmin, double xmax, Option_t* axis = "X") ;
78 void SetBarOffset(Float_t offset = 0.25) ;
79 void SetBarWidth(Float_t width = 0.5) ;
80 void SetContour(Int_t nlevels, const double* levels = nullptr) ;
81 void SetContourLevel(Int_t level, double value) ;
82 void SetDrawOption(Option_t* option = "") override ;
83 void SetFillAttributes() ;
84 void SetFillColor(Color_t fcolor) ;
85 void SetFillStyle(Style_t fstyle) ;
86 void SetLabelColor(Color_t color = 1, Option_t* axis = "X") ;
87 void SetLabelFont(Style_t font = 62, Option_t* axis = "X") ;
88 void SetLabelOffset(Float_t offset = 0.005, Option_t* axis = "X") ;
89 void SetLabelSize(Float_t size = 0.02, Option_t* axis = "X") ;
90 void SetLineAttributes() ;
91 void SetLineColor(Color_t lcolor) ;
92 void SetLineStyle(Style_t lstyle) ;
93 void SetLineWidth(Width_t lwidth) ;
94 void SetMarkerAttributes() ;
95 void SetMarkerColor(Color_t tcolor = 1) ;
96 void SetMarkerSize(Size_t msize = 1) ;
97 void SetMarkerStyle(Style_t mstyle = 1) ;
98 void SetName(const char *name) override ;
99 void SetTitle(const char *name) override ;
100 void SetNameTitle(const char *name, const char* title) override ;
101 void SetNdivisions(Int_t n = 510, Option_t* axis = "X") ;
102 void SetOption(Option_t* option = " ") ;
103 void SetStats(bool stats = true) ;
104 void SetTickLength(Float_t length = 0.02, Option_t* axis = "X") ;
105 void SetTitleFont(Style_t font = 62, Option_t* axis = "X") ;
106 void SetTitleOffset(Float_t offset = 1, Option_t* axis = "X") ;
107 void SetTitleSize(Float_t size = 0.02, Option_t* axis = "X") ;
108 void SetXTitle(const char* title) ;
109 void SetYTitle(const char* title) ;
110 void SetZTitle(const char* title) ;
111
112 // container management
113 const char* nameOf(Int_t idx) const ;
114 TObject *findObject(const char *name, const TClass* clas=nullptr) const;
115 TObject* getObject(Int_t idx) const ;
116 Stat_t numItems() const {return _items.size();}
117
118 void addPlotable(RooPlotable *plotable, Option_t *drawOptions= "", bool invisible=false, bool refreshNorm=false);
119 void addObject(TObject* obj, Option_t* drawOptions= "", bool invisible=false);
120 void addTH1(TH1 *hist, Option_t* drawOptions= "", bool invisible=false);
121 std::unique_ptr<TLegend> BuildLegend() const;
122
123 void remove(const char* name=nullptr, bool deleteToo=true) ;
124
125 // ascii printing
126 void printName(std::ostream& os) const override ;
127 void printTitle(std::ostream& os) const override ;
128 void printClassName(std::ostream& os) const override ;
129 void printArgs(std::ostream& os) const override ;
130 void printValue(std::ostream& os) const override ;
131 void printMultiline(std::ostream& os, Int_t content, bool verbose=false, TString indent="") const override ;
132
133 Int_t defaultPrintContents(Option_t* opt) const override ;
134
135 inline void Print(Option_t *options= nullptr) const override {
137 }
138
139 // data member get/set methods
140 inline RooAbsRealLValue *getPlotVar() const { return _plotVar; }
141 ///Return the number of events in the fit range
142 inline double getFitRangeNEvt() const { return _normNumEvts; }
143 double getFitRangeNEvt(double xlo, double xhi) const ;
144 ///Return the bin width that is being used to normalise the PDF
145 inline double getFitRangeBinW() const { return _normBinWidth; }
146 inline double getPadFactor() const { return _padFactor; }
147 inline void setPadFactor(double factor) { if(factor >= 0) _padFactor= factor; }
148 void updateNormVars(const RooArgSet &vars);
149 const RooArgSet *getNormVars() const { return _normVars; }
150
151 // get attributes of contained objects
152 TAttLine *getAttLine(const char *name=nullptr) const;
153 TAttFill *getAttFill(const char *name=nullptr) const;
154 TAttMarker *getAttMarker(const char *name=nullptr) const;
155 TAttText *getAttText(const char *name=nullptr) const;
156
157 // Convenient type-safe accessors
158 RooCurve* getCurve(const char* name=nullptr) const ;
159 RooHist* getHist(const char* name=nullptr) const ;
160
161
162 // rearrange drawing order of contained objects
163 bool drawBefore(const char *before, const char *target);
164 bool drawAfter(const char *after, const char *target);
165
166 // get/set drawing options for contained objects
167 TString getDrawOptions(const char *name) const;
168 bool setDrawOptions(const char *name, TString options);
169
170 bool getInvisible(const char* name) const ;
171 void setInvisible(const char* name, bool flag=true) ;
172
173 virtual void SetMaximum(double maximum = -1111) ;
174 virtual void SetMinimum(double minimum = -1111) ;
175
176 ///Shortcut for RooPlot::chiSquare(const char* pdfname, const char* histname, int nFitParam=nullptr)
177 double chiSquare(int nFitParam=0) const { return chiSquare(nullptr,nullptr,nFitParam) ; }
178 double chiSquare(const char* pdfname, const char* histname, int nFitParam=0) const ;
179
180 RooHist* residHist(const char* histname=nullptr, const char* pdfname=nullptr,bool normalize=false, bool useAverage=true) const ;
181 ///Uses residHist() and sets normalize=true
182 RooHist* pullHist(const char* histname=nullptr, const char* pdfname=nullptr, bool useAverage=true) const
183 { return residHist(histname,pdfname,true,useAverage); }
184
185 void Browse(TBrowser *b) override ;
186
187 /// \copydoc AddDirectoryStatus()
188 static bool addDirectoryStatus() ;
189 /// \copydoc AddDirectory()
190 static bool setAddDirectoryStatus(bool flag) ;
191
192 /// Configure whether new instances of RooPlot will add themselves to `gDirectory`.
193 /// Like TH1::AddDirectory().
194 static void AddDirectory(bool add=true) {
196 }
197 /// Query whether new instances of RooPlot will add themselves to `gDirectory`.
198 /// When a file has been opened before a RooPlot instance is created,
199 /// this instance will be associated to the file. Closing the file will e.g.
200 /// write the instance to the file, and then delete it.
201 /// Like TH1::AddDirectoryStatus().
202 static bool AddDirectoryStatus() {
203 return addDirectoryStatus();
204 }
205
206 void SetDirectory(TDirectory *dir);
207
208 static void fillItemsFromTList(Items & items, TList const& tlist);
209
210protected:
211
212 RooPlot(const RooPlot& other) = delete; // cannot be copied
213
214 class DrawOpt {
215 public:
216
217 DrawOpt(const char* _rawOpt=nullptr) : invisible(false) { drawOptions[0] = 0 ; initialize(_rawOpt) ; }
218 void initialize(const char* _rawOpt) ;
219 const char* rawOpt() const ;
220
221 char drawOptions[128] ;
223 } ;
224
225
226 void initialize();
227 TString histName() const ;
228 Items::iterator findItem(std::string const& name);
229 Items::const_iterator findItem(std::string const& name) const;
230
231 void updateYAxis(double ymin, double ymax, const char *label= "");
232 void updateFitRangeNorm(const TH1* hist);
233 void updateFitRangeNorm(const RooPlotable* rp, bool refeshNorm=false);
234
235 TH1* _hist = nullptr; ///< Histogram that we uses as basis for drawing the content
236 Items _items; ///< A list of the items we contain.
237 double _padFactor; ///< Scale our y-axis to _padFactor of our maximum contents.
238 RooAbsRealLValue *_plotVar = nullptr; ///< The variable we are plotting.
239 RooArgSet *_plotVarSet = nullptr; ///< A list owning the cloned tree nodes of the plotVarClone
240 RooArgSet *_normVars = nullptr; ///< Variables that PDF plots should be normalized over
241
242 const RooPlotable* _normObj = nullptr; ///<! Pointer to normalization object ;
243 double _normNumEvts; ///< Number of events in histogram (for normalization)
244 double _normBinWidth; ///< Histogram bin width (for normalization)
245
246 double _defYmin = 1e-5; ///< Default minimum for Yaxis (as calculated from contents)
247 double _defYmax = 1.0; ///< Default maximum for Yaxis (as calculated from contents)
248
249 TDirectory* _dir = nullptr; ///<! non-persistent
250
251 static bool _addDirStatus ; ///< static flag controlling AutoDirectoryAdd feature
252
253 ClassDefOverride(RooPlot,3) // Plot frame and container for graphics objects
254};
255
256#endif
#define e(i)
Definition: RSha256.hxx:103
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
short Style_t
Definition: RtypesCore.h:89
short Color_t
Definition: RtypesCore.h:92
float Size_t
Definition: RtypesCore.h:96
short Width_t
Definition: RtypesCore.h:91
float Float_t
Definition: RtypesCore.h:57
const char Option_t
Definition: RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
static void indent(ostringstream &buf, int indent_level)
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t b
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t target
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t width
char name[80]
Definition: TGX11.cxx:110
float xmin
Definition: THbookFile.cxx:95
float ymin
Definition: THbookFile.cxx:95
float xmax
Definition: THbookFile.cxx:95
float ymax
Definition: THbookFile.cxx:95
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:62
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:56
A RooCurve is a one-dimensional graphical representation of a real-valued function.
Definition: RooCurve.h:32
A RooHist is a graphical representation of binned data based on the TGraphAsymmErrors class.
Definition: RooHist.h:29
char drawOptions[128]
Definition: RooPlot.h:221
void initialize(const char *_rawOpt)
Initialize the DrawOpt helper class.
Definition: RooPlot.cxx:1187
DrawOpt(const char *_rawOpt=nullptr)
Definition: RooPlot.h:217
const char * rawOpt() const
Return the raw draw options.
Definition: RooPlot.cxx:1206
A RooPlot is a plot frame and a container for graphics objects within that frame.
Definition: RooPlot.h:43
RooPlot()
Default constructor coverity[UNINIT_CTOR].
Definition: RooPlot.cxx:87
void SetName(const char *name) override
Set the name of the RooPlot to 'name'.
Definition: RooPlot.cxx:1242
void SetAxisColor(Color_t color=1, Option_t *axis="X")
Definition: RooPlot.cxx:1297
void remove(const char *name=nullptr, bool deleteToo=true)
Remove object with given name, or last object added if no name is given.
Definition: RooPlot.cxx:910
RooPlot(const RooPlot &other)=delete
void SetDrawOption(Option_t *option="") override
Definition: RooPlot.cxx:1309
void updateYAxis(double ymin, double ymax, const char *label="")
Update our y-axis limits to accomodate an object whose spread in y is (ymin,ymax).
Definition: RooPlot.cxx:647
Items _items
A list of the items we contain.
Definition: RooPlot.h:236
void SetMarkerSize(Size_t msize=1)
Definition: RooPlot.cxx:1337
static RooPlot * frame(const RooAbsRealLValue &var, double xmin, double xmax, Int_t nBins)
Create a new frame for a given variable in x.
Definition: RooPlot.cxx:239
const RooPlotable * _normObj
! Pointer to normalization object ;
Definition: RooPlot.h:242
double _normNumEvts
Number of events in histogram (for normalization)
Definition: RooPlot.h:243
TObject * findObject(const char *name, const TClass *clas=nullptr) const
Find the named object in our list of items and return a pointer to it.
Definition: RooPlot.cxx:984
bool drawBefore(const char *before, const char *target)
Change the order in which our contained objects are drawn so that the target object is drawn just bef...
Definition: RooPlot.cxx:948
bool getInvisible(const char *name) const
Returns true of object with given name is set to be invisible.
Definition: RooPlot.cxx:1050
void SetTitle(const char *name) override
Set the title of the RooPlot to 'title'.
Definition: RooPlot.cxx:1264
RooArgSet * _normVars
Variables that PDF plots should be normalized over.
Definition: RooPlot.h:240
void addObject(TObject *obj, Option_t *drawOptions="", bool invisible=false)
Add a generic object to this plot.
Definition: RooPlot.cxx:410
void addTH1(TH1 *hist, Option_t *drawOptions="", bool invisible=false)
Add a TH1 histogram object to this plot.
Definition: RooPlot.cxx:429
double _padFactor
Scale our y-axis to _padFactor of our maximum contents.
Definition: RooPlot.h:237
void SetMarkerColor(Color_t tcolor=1)
Definition: RooPlot.cxx:1335
void printMultiline(std::ostream &os, Int_t content, bool verbose=false, TString indent="") const override
Frame detailed printing.
Definition: RooPlot.cxx:780
void SetXTitle(const char *title)
Definition: RooPlot.cxx:1355
void SetFillColor(Color_t fcolor)
Definition: RooPlot.cxx:1313
RooArgSet * _plotVarSet
A list owning the cloned tree nodes of the plotVarClone.
Definition: RooPlot.h:239
void SetNdivisions(Int_t n=510, Option_t *axis="X")
Definition: RooPlot.cxx:1341
TDirectory * _dir
! non-persistent
Definition: RooPlot.h:249
TString histName() const
Construct automatic name of internal TH1.
Definition: RooPlot.cxx:318
TH1 * _hist
Histogram that we uses as basis for drawing the content.
Definition: RooPlot.h:235
void SetMarkerStyle(Style_t mstyle=1)
Definition: RooPlot.cxx:1339
void printName(std::ostream &os) const override
Print frame name.
Definition: RooPlot.cxx:711
TString getDrawOptions(const char *name) const
Return the Draw() options registered for the named object.
Definition: RooPlot.cxx:1022
double _normBinWidth
Histogram bin width (for normalization)
Definition: RooPlot.h:244
void SetZTitle(const char *title)
Definition: RooPlot.cxx:1359
void setInvisible(const char *name, bool flag=true)
If flag is true object with 'name' is set to be invisible i.e.
Definition: RooPlot.cxx:1063
void SetContour(Int_t nlevels, const double *levels=nullptr)
Definition: RooPlot.cxx:1305
void printClassName(std::ostream &os) const override
Print frame class name.
Definition: RooPlot.cxx:729
bool setDrawOptions(const char *name, TString options)
Register the specified drawing options for the named object.
Definition: RooPlot.cxx:1035
void SetStats(bool stats=true)
Like TH1::SetStats(), but statistics boxes are off by default in RooFit.
Definition: RooPlot.cxx:1345
double getFitRangeNEvt() const
Return the number of events in the fit range.
Definition: RooPlot.h:142
virtual void SetMinimum(double minimum=-1111)
Set minimum value of Y axis.
Definition: RooPlot.cxx:1089
const RooArgSet * getNormVars() const
Definition: RooPlot.h:149
std::vector< std::pair< TObject *, std::string > > Items
Definition: RooPlot.h:45
double GetMaximum(double maxval=FLT_MAX) const
Definition: RooPlot.cxx:1293
void Print(Option_t *options=nullptr) const override
Print TNamed name and title.
Definition: RooPlot.h:135
TAttLine * getAttLine(const char *name=nullptr) const
Return a pointer to the line attributes of the named object in this plot, or zero if the named object...
Definition: RooPlot.cxx:849
bool drawAfter(const char *after, const char *target)
Change the order in which our contained objects are drawn so that the target object is drawn just aft...
Definition: RooPlot.cxx:963
RooAbsRealLValue * _plotVar
The variable we are plotting.
Definition: RooPlot.h:238
void SetDirectory(TDirectory *dir)
Set the directory that this plot is associated to.
Definition: RooPlot.cxx:350
~RooPlot() override
Destructor.
Definition: RooPlot.cxx:331
Stat_t numItems() const
Definition: RooPlot.h:116
void SetLabelOffset(Float_t offset=0.005, Option_t *axis="X")
Definition: RooPlot.cxx:1321
TAttFill * getAttFill(const char *name=nullptr) const
Return a pointer to the fill attributes of the named object in this plot, or zero if the named object...
Definition: RooPlot.cxx:859
void printTitle(std::ostream &os) const override
Print frame title.
Definition: RooPlot.cxx:720
void SetLineWidth(Width_t lwidth)
Definition: RooPlot.cxx:1331
void SetTickLength(Float_t length=0.02, Option_t *axis="X")
Definition: RooPlot.cxx:1347
virtual Stat_t GetBinContent(Int_t) const
A plot object is a frame without any bin contents of its own so this method always returns zero.
Definition: RooPlot.cxx:378
void SetFillAttributes()
Definition: RooPlot.cxx:1311
void SetContourLevel(Int_t level, double value)
Definition: RooPlot.cxx:1307
static bool addDirectoryStatus()
Query whether new instances of RooPlot will add themselves to gDirectory.
Definition: RooPlot.cxx:79
void SetLabelSize(Float_t size=0.02, Option_t *axis="X")
Definition: RooPlot.cxx:1323
double chiSquare(int nFitParam=0) const
Shortcut for RooPlot::chiSquare(const char* pdfname, const char* histname, int nFitParam=nullptr)
Definition: RooPlot.h:177
Items::iterator findItem(std::string const &name)
Definition: RooPlot.cxx:1003
void SetOption(Option_t *option=" ")
Definition: RooPlot.cxx:1343
TObject * getObject(Int_t idx) const
Return the name of the object at slot 'idx' in this RooPlot.
Definition: RooPlot.cxx:833
virtual void SetMaximum(double maximum=-1111)
Set maximum value of Y axis.
Definition: RooPlot.cxx:1079
TAxis * GetYaxis() const
Definition: RooPlot.cxx:1285
RooAbsRealLValue * getPlotVar() const
Definition: RooPlot.h:140
void Draw(Option_t *options=nullptr) override
Draw this plot and all of the elements it contains.
Definition: RooPlot.cxx:679
void SetLabelFont(Style_t font=62, Option_t *axis="X")
Definition: RooPlot.cxx:1319
void Browse(TBrowser *b) override
Plot RooPlot when double-clicked in browser.
Definition: RooPlot.cxx:1367
double _defYmax
Default maximum for Yaxis (as calculated from contents)
Definition: RooPlot.h:247
void SetLineStyle(Style_t lstyle)
Definition: RooPlot.cxx:1329
TAttMarker * getAttMarker(const char *name=nullptr) const
Return a pointer to the marker attributes of the named object in this plot, or zero if the named obje...
Definition: RooPlot.cxx:869
void SetTitleFont(Style_t font=62, Option_t *axis="X")
Definition: RooPlot.cxx:1349
void SetAxisRange(double xmin, double xmax, Option_t *axis="X")
Definition: RooPlot.cxx:1299
TAxis * GetXaxis() const
Definition: RooPlot.cxx:1283
void SetLineColor(Color_t lcolor)
Definition: RooPlot.cxx:1327
void SetFillStyle(Style_t fstyle)
Definition: RooPlot.cxx:1315
const char * nameOf(Int_t idx) const
Return the name of the object at slot 'idx' in this RooPlot.
Definition: RooPlot.cxx:817
void updateNormVars(const RooArgSet &vars)
Install the given set of observables are reference normalization variables for this frame.
Definition: RooPlot.cxx:368
RooHist * residHist(const char *histname=nullptr, const char *pdfname=nullptr, bool normalize=false, bool useAverage=true) const
Return a RooHist (derives from TGraphAsymErrors) containing the residuals of a histogram.
Definition: RooPlot.cxx:1143
RooPlot * emptyClone(const char *name)
Return empty clone of current RooPlot.
Definition: RooPlot.cxx:285
void SetMarkerAttributes()
Definition: RooPlot.cxx:1333
void SetNameTitle(const char *name, const char *title) override
Set the name and title of the RooPlot to 'name' and 'title'.
Definition: RooPlot.cxx:1253
void setPadFactor(double factor)
Definition: RooPlot.h:147
Int_t defaultPrintContents(Option_t *opt) const override
Define default print options, for a given print style.
Definition: RooPlot.cxx:1275
RooCurve * getCurve(const char *name=nullptr) const
Return a RooCurve pointer of the named object in this plot, or zero if the named object does not exis...
Definition: RooPlot.cxx:890
RooHist * pullHist(const char *histname=nullptr, const char *pdfname=nullptr, bool useAverage=true) const
Uses residHist() and sets normalize=true.
Definition: RooPlot.h:182
static bool setAddDirectoryStatus(bool flag)
Configure whether new instances of RooPlot will add themselves to gDirectory.
Definition: RooPlot.cxx:80
TAttText * getAttText(const char *name=nullptr) const
Return a pointer to the text attributes of the named object in this plot, or zero if the named object...
Definition: RooPlot.cxx:879
void SetLabelColor(Color_t color=1, Option_t *axis="X")
Definition: RooPlot.cxx:1317
Int_t GetNbinsX() const
Definition: RooPlot.cxx:1287
static void fillItemsFromTList(Items &items, TList const &tlist)
RooFit-internal function for backwards compatibility.
Definition: RooPlot.cxx:1444
void SetLineAttributes()
Definition: RooPlot.cxx:1325
static bool _addDirStatus
static flag controlling AutoDirectoryAdd feature
Definition: RooPlot.h:251
void printValue(std::ostream &os) const override
Print frame arguments.
Definition: RooPlot.cxx:752
void SetYTitle(const char *title)
Definition: RooPlot.cxx:1357
double getPadFactor() const
Definition: RooPlot.h:146
static void AddDirectory(bool add=true)
Configure whether new instances of RooPlot will add themselves to gDirectory.
Definition: RooPlot.h:194
void printArgs(std::ostream &os) const override
Interface for printing of object arguments.
Definition: RooPlot.cxx:738
std::unique_ptr< TLegend > BuildLegend() const
Build a legend that contains all objects that have been drawn on the plot.
Definition: RooPlot.cxx:1432
RooHist * getHist(const char *name=nullptr) const
Return a RooCurve pointer of the named object in this plot, or zero if the named object does not exis...
Definition: RooPlot.cxx:900
void updateFitRangeNorm(const TH1 *hist)
Update our plot normalization over our plot variable's fit range, which will be determined by the fir...
Definition: RooPlot.cxx:592
void SetTitleSize(Float_t size=0.02, Option_t *axis="X")
Definition: RooPlot.cxx:1353
double _defYmin
Default minimum for Yaxis (as calculated from contents)
Definition: RooPlot.h:246
void SetBarOffset(Float_t offset=0.25)
Definition: RooPlot.cxx:1301
void SetBarWidth(Float_t width=0.5)
Definition: RooPlot.cxx:1303
Int_t GetNdivisions(Option_t *axis="X") const
Definition: RooPlot.cxx:1289
void addPlotable(RooPlotable *plotable, Option_t *drawOptions="", bool invisible=false, bool refreshNorm=false)
Add the specified plotable object to our plot.
Definition: RooPlot.cxx:558
void initialize()
Perform initialization that is common to all constructors.
Definition: RooPlot.cxx:296
static RooPlot * frameWithLabels(const RooAbsRealLValue &var)
Create a new frame for a given variable in x, adding bin labels.
Definition: RooPlot.cxx:251
void SetTitleOffset(Float_t offset=1, Option_t *axis="X")
Definition: RooPlot.cxx:1351
static bool AddDirectoryStatus()
Query whether new instances of RooPlot will add themselves to gDirectory.
Definition: RooPlot.h:202
double GetMinimum(double minval=-FLT_MAX) const
Definition: RooPlot.cxx:1291
double getFitRangeBinW() const
Return the bin width that is being used to normalise the PDF.
Definition: RooPlot.h:145
Class RooPotable is a base class for objects that can be inserted into RooPlots and take advantage of...
Definition: RooPlotable.h:26
RooPlotable is a 'mix-in' base class that define the standard RooFit plotting and printing methods.
Definition: RooPrintable.h:25
virtual StyleOption defaultPrintStyle(Option_t *opt) const
static std::ostream & defaultPrintStream(std::ostream *os=nullptr)
Return a reference to the current default stream to use in Print().
virtual void printStream(std::ostream &os, Int_t contents, StyleOption style, TString indent="") const
Print description of object on ostream, printing contents set by contents integer,...
Fill Area Attributes class.
Definition: TAttFill.h:19
Line Attributes class.
Definition: TAttLine.h:18
Marker Attributes class.
Definition: TAttMarker.h:19
Text Attributes class.
Definition: TAttText.h:18
Class to manage histogram axis.
Definition: TAxis.h:30
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:81
Describe directory structure in memory.
Definition: TDirectory.h:45
TH1 is the base class of all histogram classes in ROOT.
Definition: TH1.h:58
This class displays a legend box (TPaveText) containing several legend entries.
Definition: TLegend.h:23
A doubly linked list.
Definition: TList.h:38
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
Mother of all ROOT objects.
Definition: TObject.h:37
Basic string class.
Definition: TString.h:136
const Int_t n
Definition: legend1.C:16