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 void Draw(Option_t *options= nullptr) override;
64
65 // forwarding of relevant TH1 interface
66 TAxis* GetXaxis() const ;
67 TAxis* GetYaxis() const ;
68 Int_t GetNbinsX() const ;
69 Int_t GetNdivisions(Option_t* axis = "X") const ;
70 double GetMinimum(double minval = -FLT_MAX) const ;
71 double GetMaximum(double maxval = FLT_MAX) const ;
72
73 void SetAxisColor(Color_t color = 1, Option_t* axis = "X") ;
74 void SetAxisRange(double xmin, double xmax, Option_t* axis = "X") ;
75 void SetBarOffset(Float_t offset = 0.25) ;
76 void SetBarWidth(Float_t width = 0.5) ;
77 void SetContour(Int_t nlevels, const double* levels = nullptr) ;
78 void SetContourLevel(Int_t level, double value) ;
79 void SetDrawOption(Option_t* option = "") override ;
80 void SetFillAttributes() ;
81 void SetFillColor(Color_t fcolor) ;
82 void SetFillStyle(Style_t fstyle) ;
83 void SetLabelColor(Color_t color = 1, Option_t* axis = "X") ;
84 void SetLabelFont(Style_t font = 62, Option_t* axis = "X") ;
85 void SetLabelOffset(Float_t offset = 0.005, Option_t* axis = "X") ;
86 void SetLabelSize(Float_t size = 0.02, Option_t* axis = "X") ;
87 void SetLineAttributes() ;
88 void SetLineColor(Color_t lcolor) ;
89 void SetLineStyle(Style_t lstyle) ;
90 void SetLineWidth(Width_t lwidth) ;
91 void SetMarkerAttributes() ;
92 void SetMarkerColor(Color_t tcolor = 1) ;
93 void SetMarkerSize(Size_t msize = 1) ;
94 void SetMarkerStyle(Style_t mstyle = 1) ;
95 void SetName(const char *name) override ;
96 void SetTitle(const char *name) override ;
97 void SetNameTitle(const char *name, const char* title) override ;
98 void SetNdivisions(Int_t n = 510, Option_t* axis = "X") ;
99 void SetOption(Option_t* option = " ") ;
100 void SetStats(bool stats = true) ;
101 void SetTickLength(Float_t length = 0.02, Option_t* axis = "X") ;
102 void SetTitleFont(Style_t font = 62, Option_t* axis = "X") ;
103 void SetTitleOffset(Float_t offset = 1, Option_t* axis = "X") ;
104 void SetTitleSize(Float_t size = 0.02, Option_t* axis = "X") ;
105 void SetXTitle(const char* title) ;
106 void SetYTitle(const char* title) ;
107 void SetZTitle(const char* title) ;
108
109 // container management
110 const char* nameOf(Int_t idx) const ;
111 TObject *findObject(const char *name, const TClass* clas=nullptr) const;
112 TObject* getObject(Int_t idx) const ;
113 Stat_t numItems() const {return _items.size();}
114
115 void addPlotable(RooPlotable *plotable, Option_t *drawOptions= "", bool invisible=false, bool refreshNorm=false);
116 void addObject(TObject* obj, Option_t* drawOptions= "", bool invisible=false);
117 void addTH1(TH1 *hist, Option_t* drawOptions= "", bool invisible=false);
118 std::unique_ptr<TLegend> BuildLegend() const;
119
120 void remove(const char* name=nullptr, bool deleteToo=true) ;
121
122 // ascii printing
123 void printName(std::ostream& os) const override ;
124 void printTitle(std::ostream& os) const override ;
125 void printClassName(std::ostream& os) const override ;
126 void printArgs(std::ostream& os) const override ;
127 void printValue(std::ostream& os) const override ;
128 void printMultiline(std::ostream& os, Int_t content, bool verbose=false, TString indent="") const override ;
129
130 Int_t defaultPrintContents(Option_t* opt) const override ;
131
132 inline void Print(Option_t *options= nullptr) const override {
134 }
135
136 // data member get/set methods
137 inline RooAbsRealLValue *getPlotVar() const { return _plotVar; }
138 ///Return the number of events in the fit range
139 inline double getFitRangeNEvt() const { return _normNumEvts; }
140 double getFitRangeNEvt(double xlo, double xhi) const ;
141 ///Return the bin width that is being used to normalise the PDF
142 inline double getFitRangeBinW() const { return _normBinWidth; }
143 inline double getPadFactor() const { return _padFactor; }
144 inline void setPadFactor(double factor) { if(factor >= 0) _padFactor= factor; }
145 void updateNormVars(const RooArgSet &vars);
146 const RooArgSet *getNormVars() const { return _normVars; }
147
148 // get attributes of contained objects
149 TAttLine *getAttLine(const char *name=nullptr) const;
150 TAttFill *getAttFill(const char *name=nullptr) const;
151 TAttMarker *getAttMarker(const char *name=nullptr) const;
152 TAttText *getAttText(const char *name=nullptr) const;
153
154 // Convenient type-safe accessors
155 RooCurve* getCurve(const char* name=nullptr) const ;
156 RooHist* getHist(const char* name=nullptr) const ;
157
158
159 // rearrange drawing order of contained objects
160 bool drawBefore(const char *before, const char *target);
161 bool drawAfter(const char *after, const char *target);
162
163 // get/set drawing options for contained objects
164 TString getDrawOptions(const char *name) const;
165 bool setDrawOptions(const char *name, TString options);
166
167 bool getInvisible(const char* name) const ;
168 void setInvisible(const char* name, bool flag=true) ;
169
170 virtual void SetMaximum(double maximum = -1111) ;
171 virtual void SetMinimum(double minimum = -1111) ;
172
173 ///Shortcut for RooPlot::chiSquare(const char* pdfname, const char* histname, int nFitParam=nullptr)
174 double chiSquare(int nFitParam=0) const { return chiSquare(nullptr,nullptr,nFitParam) ; }
175 double chiSquare(const char* pdfname, const char* histname, int nFitParam=0) const ;
176
177 RooHist* residHist(const char* histname=nullptr, const char* pdfname=nullptr,bool normalize=false, bool useAverage=true) const ;
178 ///Uses residHist() and sets normalize=true
179 RooHist* pullHist(const char* histname=nullptr, const char* pdfname=nullptr, bool useAverage=true) const
180 { return residHist(histname,pdfname,true,useAverage); }
181
182 void Browse(TBrowser *b) override ;
183
184 /// \copydoc AddDirectoryStatus()
185 static bool addDirectoryStatus() ;
186 /// \copydoc AddDirectory()
187 static bool setAddDirectoryStatus(bool flag) ;
188
189 /// Configure whether new instances of RooPlot will add themselves to `gDirectory`.
190 /// Like TH1::AddDirectory().
191 static void AddDirectory(bool add=true) {
193 }
194 /// Query whether new instances of RooPlot will add themselves to `gDirectory`.
195 /// When a file has been opened before a RooPlot instance is created,
196 /// this instance will be associated to the file. Closing the file will e.g.
197 /// write the instance to the file, and then delete it.
198 /// Like TH1::AddDirectoryStatus().
199 static bool AddDirectoryStatus() {
200 return addDirectoryStatus();
201 }
202
203 void SetDirectory(TDirectory *dir);
204
205 static void fillItemsFromTList(Items & items, TList const& tlist);
206
208
209protected:
210
211 RooPlot(const RooPlot& other) = delete; // cannot be copied
212
213 class DrawOpt {
214 public:
215
216 DrawOpt(const char* _rawOpt=nullptr) : invisible(false) { drawOptions[0] = 0 ; initialize(_rawOpt) ; }
217 void initialize(const char* _rawOpt) ;
218 const char* rawOpt() const ;
219
220 char drawOptions[128] ;
222 } ;
223
224
225 void initialize();
226 TString histName() const ;
227 Items::iterator findItem(std::string const& name);
228 Items::const_iterator findItem(std::string const& name) const;
229
230 void updateYAxis(double ymin, double ymax, const char *label= "");
231 void updateFitRangeNorm(const TH1* hist);
232 void updateFitRangeNorm(const RooPlotable* rp, bool refeshNorm=false);
233
234 TH1* _hist = nullptr; ///< Histogram that we uses as basis for drawing the content
235 Items _items; ///< A list of the items we contain.
236 double _padFactor; ///< Scale our y-axis to _padFactor of our maximum contents.
237 RooAbsRealLValue *_plotVar = nullptr; ///< The variable we are plotting.
238 RooArgSet *_plotVarSet = nullptr; ///< A list owning the cloned tree nodes of the plotVarClone
239 RooArgSet *_normVars = nullptr; ///< Variables that PDF plots should be normalized over
240
241 const RooPlotable* _normObj = nullptr; ///<! Pointer to normalization object ;
242 double _normNumEvts; ///< Number of events in histogram (for normalization)
243 double _normBinWidth; ///< Histogram bin width (for normalization)
244
245 double _defYmin = 1e-5; ///< Default minimum for Yaxis (as calculated from contents)
246 double _defYmax = 1.0; ///< Default maximum for Yaxis (as calculated from contents)
247
248 TDirectory* _dir = nullptr; ///<! non-persistent
249
250 static bool _addDirStatus ; ///< static flag controlling AutoDirectoryAdd feature
251
252 ClassDefOverride(RooPlot,3) // Plot frame and container for graphics objects
253};
254
255#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:60
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:220
void initialize(const char *_rawOpt)
Initialize the DrawOpt helper class.
Definition: RooPlot.cxx:1181
DrawOpt(const char *_rawOpt=nullptr)
Definition: RooPlot.h:216
const char * rawOpt() const
Return the raw draw options.
Definition: RooPlot.cxx:1200
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:1236
void SetAxisColor(Color_t color=1, Option_t *axis="X")
Definition: RooPlot.cxx:1291
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:883
RooPlot(const RooPlot &other)=delete
void SetDrawOption(Option_t *option="") override
Definition: RooPlot.cxx:1303
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:620
Items _items
A list of the items we contain.
Definition: RooPlot.h:235
void SetMarkerSize(Size_t msize=1)
Definition: RooPlot.cxx:1331
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:241
double _normNumEvts
Number of events in histogram (for normalization)
Definition: RooPlot.h:242
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:957
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:921
bool getInvisible(const char *name) const
Returns true of object with given name is set to be invisible.
Definition: RooPlot.cxx:1023
void SetTitle(const char *name) override
Set the title of the RooPlot to 'title'.
Definition: RooPlot.cxx:1258
RooArgSet * _normVars
Variables that PDF plots should be normalized over.
Definition: RooPlot.h:239
void addObject(TObject *obj, Option_t *drawOptions="", bool invisible=false)
Add a generic object to this plot.
Definition: RooPlot.cxx:383
void addTH1(TH1 *hist, Option_t *drawOptions="", bool invisible=false)
Add a TH1 histogram object to this plot.
Definition: RooPlot.cxx:402
double _padFactor
Scale our y-axis to _padFactor of our maximum contents.
Definition: RooPlot.h:236
void SetMarkerColor(Color_t tcolor=1)
Definition: RooPlot.cxx:1329
void printMultiline(std::ostream &os, Int_t content, bool verbose=false, TString indent="") const override
Frame detailed printing.
Definition: RooPlot.cxx:753
void SetXTitle(const char *title)
Definition: RooPlot.cxx:1349
void SetFillColor(Color_t fcolor)
Definition: RooPlot.cxx:1307
RooArgSet * _plotVarSet
A list owning the cloned tree nodes of the plotVarClone.
Definition: RooPlot.h:238
void SetNdivisions(Int_t n=510, Option_t *axis="X")
Definition: RooPlot.cxx:1335
TDirectory * _dir
! non-persistent
Definition: RooPlot.h:248
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:234
void SetMarkerStyle(Style_t mstyle=1)
Definition: RooPlot.cxx:1333
void printName(std::ostream &os) const override
Print frame name.
Definition: RooPlot.cxx:684
TString getDrawOptions(const char *name) const
Return the Draw() options registered for the named object.
Definition: RooPlot.cxx:995
double _normBinWidth
Histogram bin width (for normalization)
Definition: RooPlot.h:243
void SetZTitle(const char *title)
Definition: RooPlot.cxx:1353
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:1036
void SetContour(Int_t nlevels, const double *levels=nullptr)
Definition: RooPlot.cxx:1299
void printClassName(std::ostream &os) const override
Print frame class name.
Definition: RooPlot.cxx:702
bool setDrawOptions(const char *name, TString options)
Register the specified drawing options for the named object.
Definition: RooPlot.cxx:1008
void SetStats(bool stats=true)
Like TH1::SetStats(), but statistics boxes are off by default in RooFit.
Definition: RooPlot.cxx:1339
double getFitRangeNEvt() const
Return the number of events in the fit range.
Definition: RooPlot.h:139
virtual void SetMinimum(double minimum=-1111)
Set minimum value of Y axis.
Definition: RooPlot.cxx:1062
const RooArgSet * getNormVars() const
Definition: RooPlot.h:146
std::vector< std::pair< TObject *, std::string > > Items
Definition: RooPlot.h:45
double GetMaximum(double maxval=FLT_MAX) const
Definition: RooPlot.cxx:1287
void Print(Option_t *options=nullptr) const override
Print TNamed name and title.
Definition: RooPlot.h:132
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:822
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:936
RooAbsRealLValue * _plotVar
The variable we are plotting.
Definition: RooPlot.h:237
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:113
void SetLabelOffset(Float_t offset=0.005, Option_t *axis="X")
Definition: RooPlot.cxx:1315
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:832
void printTitle(std::ostream &os) const override
Print frame title.
Definition: RooPlot.cxx:693
void SetLineWidth(Width_t lwidth)
Definition: RooPlot.cxx:1325
void SetTickLength(Float_t length=0.02, Option_t *axis="X")
Definition: RooPlot.cxx:1341
void SetFillAttributes()
Definition: RooPlot.cxx:1305
void SetContourLevel(Int_t level, double value)
Definition: RooPlot.cxx:1301
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:1317
double chiSquare(int nFitParam=0) const
Shortcut for RooPlot::chiSquare(const char* pdfname, const char* histname, int nFitParam=nullptr)
Definition: RooPlot.h:174
Items::iterator findItem(std::string const &name)
Definition: RooPlot.cxx:976
void SetOption(Option_t *option=" ")
Definition: RooPlot.cxx:1337
TObject * getObject(Int_t idx) const
Return the name of the object at slot 'idx' in this RooPlot.
Definition: RooPlot.cxx:806
virtual void SetMaximum(double maximum=-1111)
Set maximum value of Y axis.
Definition: RooPlot.cxx:1052
TAxis * GetYaxis() const
Definition: RooPlot.cxx:1279
RooAbsRealLValue * getPlotVar() const
Definition: RooPlot.h:137
void Draw(Option_t *options=nullptr) override
Draw this plot and all of the elements it contains.
Definition: RooPlot.cxx:652
void SetLabelFont(Style_t font=62, Option_t *axis="X")
Definition: RooPlot.cxx:1313
void Browse(TBrowser *b) override
Plot RooPlot when double-clicked in browser.
Definition: RooPlot.cxx:1361
double _defYmax
Default maximum for Yaxis (as calculated from contents)
Definition: RooPlot.h:246
void SetLineStyle(Style_t lstyle)
Definition: RooPlot.cxx:1323
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:842
void SetTitleFont(Style_t font=62, Option_t *axis="X")
Definition: RooPlot.cxx:1343
void SetAxisRange(double xmin, double xmax, Option_t *axis="X")
Definition: RooPlot.cxx:1293
TAxis * GetXaxis() const
Definition: RooPlot.cxx:1277
void SetLineColor(Color_t lcolor)
Definition: RooPlot.cxx:1321
void SetFillStyle(Style_t fstyle)
Definition: RooPlot.cxx:1309
const char * nameOf(Int_t idx) const
Return the name of the object at slot 'idx' in this RooPlot.
Definition: RooPlot.cxx:790
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:1116
RooPlot * emptyClone(const char *name)
Return empty clone of current RooPlot.
Definition: RooPlot.cxx:285
void SetMarkerAttributes()
Definition: RooPlot.cxx:1327
void createInternalPlotVarClone()
Replaces the pointer to the plot variable with a pointer to a clone of the plot variable that is owne...
Definition: RooPlot.cxx:1451
void SetNameTitle(const char *name, const char *title) override
Set the name and title of the RooPlot to 'name' and 'title'.
Definition: RooPlot.cxx:1247
void setPadFactor(double factor)
Definition: RooPlot.h:144
Int_t defaultPrintContents(Option_t *opt) const override
Define default print options, for a given print style.
Definition: RooPlot.cxx:1269
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:863
RooHist * pullHist(const char *histname=nullptr, const char *pdfname=nullptr, bool useAverage=true) const
Uses residHist() and sets normalize=true.
Definition: RooPlot.h:179
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:852
void SetLabelColor(Color_t color=1, Option_t *axis="X")
Definition: RooPlot.cxx:1311
Int_t GetNbinsX() const
Definition: RooPlot.cxx:1281
static void fillItemsFromTList(Items &items, TList const &tlist)
RooFit-internal function for backwards compatibility.
Definition: RooPlot.cxx:1438
void SetLineAttributes()
Definition: RooPlot.cxx:1319
static bool _addDirStatus
static flag controlling AutoDirectoryAdd feature
Definition: RooPlot.h:250
void printValue(std::ostream &os) const override
Print frame arguments.
Definition: RooPlot.cxx:725
void SetYTitle(const char *title)
Definition: RooPlot.cxx:1351
double getPadFactor() const
Definition: RooPlot.h:143
static void AddDirectory(bool add=true)
Configure whether new instances of RooPlot will add themselves to gDirectory.
Definition: RooPlot.h:191
void printArgs(std::ostream &os) const override
Interface for printing of object arguments.
Definition: RooPlot.cxx:711
std::unique_ptr< TLegend > BuildLegend() const
Build a legend that contains all objects that have been drawn on the plot.
Definition: RooPlot.cxx:1426
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:873
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:565
void SetTitleSize(Float_t size=0.02, Option_t *axis="X")
Definition: RooPlot.cxx:1347
double _defYmin
Default minimum for Yaxis (as calculated from contents)
Definition: RooPlot.h:245
void SetBarOffset(Float_t offset=0.25)
Definition: RooPlot.cxx:1295
void SetBarWidth(Float_t width=0.5)
Definition: RooPlot.cxx:1297
Int_t GetNdivisions(Option_t *axis="X") const
Definition: RooPlot.cxx:1283
void addPlotable(RooPlotable *plotable, Option_t *drawOptions="", bool invisible=false, bool refreshNorm=false)
Add the specified plotable object to our plot.
Definition: RooPlot.cxx:531
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:1345
static bool AddDirectoryStatus()
Query whether new instances of RooPlot will add themselves to gDirectory.
Definition: RooPlot.h:199
double GetMinimum(double minval=-FLT_MAX) const
Definition: RooPlot.cxx:1285
double getFitRangeBinW() const
Return the bin width that is being used to normalise the PDF.
Definition: RooPlot.h:142
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:41
Basic string class.
Definition: TString.h:136
const Int_t n
Definition: legend1.C:16