Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 <cfloat>
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 RooAbsRealLValue &var, double xmin, double xmax, Int_t nBins);
49 RooPlot(double xmin, double xmax, int nBins=100);
50 RooPlot(const RooAbsRealLValue &var1, const RooAbsRealLValue &var2);
51 RooPlot(const RooAbsRealLValue &var1, const RooAbsRealLValue &var2,
52 double xmin, double xmax, double ymin, double ymax);
53 ~RooPlot() override;
54
55 RooPlot(const RooPlot& other) = delete; // cannot be copied
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* tClass=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 class DrawOpt {
212 public:
213
214 DrawOpt(const char* _rawOpt=nullptr) : invisible(false) { drawOptions[0] = 0 ; initialize(_rawOpt) ; }
215 void initialize(const char* _rawOpt) ;
216 const char* rawOpt() const ;
217
218 char drawOptions[128] ;
220 } ;
221
222
223 void initialize();
224 TString histName() const ;
225 Items::iterator findItem(std::string const& name);
226 Items::const_iterator findItem(std::string const& name) const;
227
228 void updateYAxis(double ymin, double ymax, const char *label= "");
229 void updateFitRangeNorm(const TH1* hist);
230 void updateFitRangeNorm(const RooPlotable* rp, bool refreshNorm=false);
231
232 TH1* _hist = nullptr; ///< Histogram that we uses as basis for drawing the content
233 Items _items; ///< A list of the items we contain.
234 double _padFactor; ///< Scale our y-axis to _padFactor of our maximum contents.
235 RooAbsRealLValue *_plotVar = nullptr; ///< The variable we are plotting.
236 RooArgSet *_plotVarSet = nullptr; ///< A list owning the cloned tree nodes of the plotVarClone
237 RooArgSet *_normVars = nullptr; ///< Variables that PDF plots should be normalized over
238
239 const RooPlotable* _normObj = nullptr; ///<! Pointer to normalization object ;
240 double _normNumEvts = 0; ///< Number of events in histogram (for normalization)
241 double _normBinWidth = 0; ///< Histogram bin width (for normalization)
242
243 double _defYmin = 1e-5; ///< Default minimum for Yaxis (as calculated from contents)
244 double _defYmax = 1.0; ///< Default maximum for Yaxis (as calculated from contents)
245
246 TDirectory* _dir = nullptr; ///<! non-persistent
247
248 static bool _addDirStatus ; ///< static flag controlling AutoDirectoryAdd feature
249
250 ClassDefOverride(RooPlot,3) // Plot frame and container for graphics objects
251};
252
253#endif
#define b(i)
Definition RSha256.hxx:100
#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:82
short Color_t
Definition RtypesCore.h:85
float Size_t
Definition RtypesCore.h:89
short Width_t
Definition RtypesCore.h:84
float Float_t
Definition RtypesCore.h:57
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
static void indent(ostringstream &buf, int indent_level)
Option_t Option_t option
Option_t Option_t SetLineWidth
Option_t Option_t SetFillStyle
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 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 SetLineColor
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t SetFillColor
Option_t Option_t SetMarkerStyle
Option_t Option_t width
char name[80]
Definition TGX11.cxx:110
float xmin
float ymin
float xmax
float ymax
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
One-dimensional graphical representation of a real-valued function.
Definition RooCurve.h:36
Graphical representation of binned data based on the TGraphAsymmErrors class.
Definition RooHist.h:29
char drawOptions[128]
Definition RooPlot.h:218
DrawOpt(const char *_rawOpt=nullptr)
Definition RooPlot.h:214
const char * rawOpt() const
Return the raw draw options.
Definition RooPlot.cxx:1145
Plot frame and a container for graphics objects within that frame.
Definition RooPlot.h:43
RooPlot()
Default constructor coverity[UNINIT_CTOR].
Definition RooPlot.cxx:85
void SetName(const char *name) override
Set the name of the RooPlot to 'name'.
Definition RooPlot.cxx:1181
void SetAxisColor(Color_t color=1, Option_t *axis="X")
Definition RooPlot.cxx:1236
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:828
RooPlot(const RooPlot &other)=delete
void SetDrawOption(Option_t *option="") override
Definition RooPlot.cxx:1248
void updateYAxis(double ymin, double ymax, const char *label="")
Update our y-axis limits to accommodate an object whose spread in y is (ymin,ymax).
Definition RooPlot.cxx:565
Items _items
A list of the items we contain.
Definition RooPlot.h:233
void SetMarkerSize(Size_t msize=1)
Definition RooPlot.cxx:1276
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:185
const RooPlotable * _normObj
! Pointer to normalization object ;
Definition RooPlot.h:239
double _normNumEvts
Number of events in histogram (for normalization)
Definition RooPlot.h:240
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:866
bool getInvisible(const char *name) const
Returns true of object with given name is set to be invisible.
Definition RooPlot.cxx:968
void SetTitle(const char *name) override
Set the title of the RooPlot to 'title'.
Definition RooPlot.cxx:1203
RooArgSet * _normVars
Variables that PDF plots should be normalized over.
Definition RooPlot.h:237
void addObject(TObject *obj, Option_t *drawOptions="", bool invisible=false)
Add a generic object to this plot.
Definition RooPlot.cxx:326
void addTH1(TH1 *hist, Option_t *drawOptions="", bool invisible=false)
Add a TH1 histogram object to this plot.
Definition RooPlot.cxx:345
double _padFactor
Scale our y-axis to _padFactor of our maximum contents.
Definition RooPlot.h:234
void SetMarkerColor(Color_t tcolor=1)
Definition RooPlot.cxx:1274
void printMultiline(std::ostream &os, Int_t content, bool verbose=false, TString indent="") const override
Frame detailed printing.
Definition RooPlot.cxx:698
void SetXTitle(const char *title)
Definition RooPlot.cxx:1294
RooArgSet * _plotVarSet
A list owning the cloned tree nodes of the plotVarClone.
Definition RooPlot.h:236
void SetNdivisions(Int_t n=510, Option_t *axis="X")
Definition RooPlot.cxx:1280
TDirectory * _dir
! non-persistent
Definition RooPlot.h:246
TString histName() const
Construct automatic name of internal TH1.
Definition RooPlot.cxx:261
TH1 * _hist
Histogram that we uses as basis for drawing the content.
Definition RooPlot.h:232
void printName(std::ostream &os) const override
Print frame name.
Definition RooPlot.cxx:629
TString getDrawOptions(const char *name) const
Return the Draw() options registered for the named object.
Definition RooPlot.cxx:940
double _normBinWidth
Histogram bin width (for normalization)
Definition RooPlot.h:241
void SetZTitle(const char *title)
Definition RooPlot.cxx:1298
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:981
void SetContour(Int_t nlevels, const double *levels=nullptr)
Definition RooPlot.cxx:1244
void printClassName(std::ostream &os) const override
Print frame class name.
Definition RooPlot.cxx:647
bool setDrawOptions(const char *name, TString options)
Register the specified drawing options for the named object.
Definition RooPlot.cxx:953
TObject * findObject(const char *name, const TClass *tClass=nullptr) const
Find the named object in our list of items and return a pointer to it.
Definition RooPlot.cxx:902
void SetStats(bool stats=true)
Like TH1::SetStats(), but statistics boxes are off by default in RooFit.
Definition RooPlot.cxx:1284
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:1007
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:1232
void Print(Option_t *options=nullptr) const override
This method must be overridden when a class wants to print itself.
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:767
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:881
RooAbsRealLValue * _plotVar
The variable we are plotting.
Definition RooPlot.h:235
void SetDirectory(TDirectory *dir)
Set the directory that this plot is associated to.
Definition RooPlot.cxx:293
~RooPlot() override
Destructor.
Definition RooPlot.cxx:274
Stat_t numItems() const
Definition RooPlot.h:113
void SetLabelOffset(Float_t offset=0.005, Option_t *axis="X")
Definition RooPlot.cxx:1260
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:777
void printTitle(std::ostream &os) const override
Print frame title.
Definition RooPlot.cxx:638
void SetTickLength(Float_t length=0.02, Option_t *axis="X")
Definition RooPlot.cxx:1286
void SetFillAttributes()
Definition RooPlot.cxx:1250
void SetContourLevel(Int_t level, double value)
Definition RooPlot.cxx:1246
static bool addDirectoryStatus()
Query whether new instances of RooPlot will add themselves to gDirectory.
Definition RooPlot.cxx:77
void SetLabelSize(Float_t size=0.02, Option_t *axis="X")
Definition RooPlot.cxx:1262
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:921
void SetOption(Option_t *option=" ")
Definition RooPlot.cxx:1282
TObject * getObject(Int_t idx) const
Return the name of the object at slot 'idx' in this RooPlot.
Definition RooPlot.cxx:751
virtual void SetMaximum(double maximum=-1111)
Set maximum value of Y axis.
Definition RooPlot.cxx:997
TAxis * GetYaxis() const
Definition RooPlot.cxx:1224
RooAbsRealLValue * getPlotVar() const
Definition RooPlot.h:137
void SetLabelFont(Style_t font=62, Option_t *axis="X")
Definition RooPlot.cxx:1258
void Browse(TBrowser *b) override
Plot RooPlot when double-clicked in browser.
Definition RooPlot.cxx:1306
double _defYmax
Default maximum for Yaxis (as calculated from contents)
Definition RooPlot.h:244
void SetLineStyle(Style_t lstyle)
Definition RooPlot.cxx:1268
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:787
void SetTitleFont(Style_t font=62, Option_t *axis="X")
Definition RooPlot.cxx:1288
void SetAxisRange(double xmin, double xmax, Option_t *axis="X")
Definition RooPlot.cxx:1238
TAxis * GetXaxis() const
Definition RooPlot.cxx:1222
const char * nameOf(Int_t idx) const
Return the name of the object at slot 'idx' in this RooPlot.
Definition RooPlot.cxx:735
void updateNormVars(const RooArgSet &vars)
Install the given set of observables are reference normalization variables for this frame.
Definition RooPlot.cxx:311
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:1061
RooPlot * emptyClone(const char *name)
Return empty clone of current RooPlot.
Definition RooPlot.cxx:231
void SetMarkerAttributes()
Definition RooPlot.cxx:1272
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:1397
void SetNameTitle(const char *name, const char *title) override
Set the name and title of the RooPlot to 'name' and 'title'.
Definition RooPlot.cxx:1192
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:1214
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:808
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:78
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:797
void SetLabelColor(Color_t color=1, Option_t *axis="X")
Definition RooPlot.cxx:1256
Int_t GetNbinsX() const
Definition RooPlot.cxx:1226
static void fillItemsFromTList(Items &items, TList const &tlist)
RooFit-internal function for backwards compatibility.
Definition RooPlot.cxx:1384
void SetLineAttributes()
Definition RooPlot.cxx:1264
static bool _addDirStatus
static flag controlling AutoDirectoryAdd feature
Definition RooPlot.h:248
void printValue(std::ostream &os) const override
Print frame arguments.
Definition RooPlot.cxx:670
void SetYTitle(const char *title)
Definition RooPlot.cxx:1296
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:656
std::unique_ptr< TLegend > BuildLegend() const
Build a legend that contains all objects that have been drawn on the plot.
Definition RooPlot.cxx:1372
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:818
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:510
void SetTitleSize(Float_t size=0.02, Option_t *axis="X")
Definition RooPlot.cxx:1292
double _defYmin
Default minimum for Yaxis (as calculated from contents)
Definition RooPlot.h:243
void SetBarOffset(Float_t offset=0.25)
Definition RooPlot.cxx:1240
void SetBarWidth(Float_t width=0.5)
Definition RooPlot.cxx:1242
Int_t GetNdivisions(Option_t *axis="X") const
Definition RooPlot.cxx:1228
void addPlotable(RooPlotable *plotable, Option_t *drawOptions="", bool invisible=false, bool refreshNorm=false)
Add the specified plotable object to our plot.
Definition RooPlot.cxx:476
void initialize()
Perform initialization that is common to all constructors.
Definition RooPlot.cxx:242
static RooPlot * frameWithLabels(const RooAbsRealLValue &var)
Create a new frame for a given variable in x, adding bin labels.
Definition RooPlot.cxx:197
void SetTitleOffset(Float_t offset=1, Option_t *axis="X")
Definition RooPlot.cxx:1290
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:1230
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
A 'mix-in' base class that define the standard RooFit plotting and printing methods.
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:31
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:59
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:139
const Int_t n
Definition legend1.C:16
th1 Draw()