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 <ROOT/RConfig.hxx> // for the R__DEPRECATED macro
23
24#include <memory>
25#include <cfloat>
26
27class TH1 ;
28
29class RooAbsReal;
31class RooArgSet ;
32class RooHist;
33class RooCurve ;
34class RooPlotable;
35class TDirectory ;
36class TAttLine;
37class TAttFill;
38class TAttMarker;
39class TAttText;
40class TClass ;
41class TAxis;
42class TBrowser ;
43class TLegend;
44
45class RooPlot : public TNamed, public RooPrintable {
46public:
47 using Items = std::vector<std::pair<TObject*,std::string>>;
48
49 RooPlot() ;
50 RooPlot(const char* name, const char* title, const RooAbsRealLValue &var, double xmin, double xmax, Int_t nBins)
51 R__DEPRECATED(6,36, "Use the constructor that doesn't take the name and title, and then call SetName() and SetTitle() on the RooPlot.");
52 RooPlot(const RooAbsRealLValue &var, double xmin, double xmax, Int_t nBins);
53 RooPlot(double xmin, double xmax, int nBins=100);
54 RooPlot(double xmin, double xmax, double ymin, double ymax)
55 R__DEPRECATED(6,36, "Use RooPlot(double xmin, double xmax); SetMinimum(ymin); SetMaximum(ymax);");
56 RooPlot(const RooAbsRealLValue &var1, const RooAbsRealLValue &var2);
57 RooPlot(const RooAbsRealLValue &var1, const RooAbsRealLValue &var2,
58 double xmin, double xmax, double ymin, double ymax);
59 ~RooPlot() override;
60
61 RooPlot(const RooPlot& other) = delete; // cannot be copied
62
63 static RooPlot* frame(const RooAbsRealLValue &var, double xmin, double xmax, Int_t nBins);
64 static RooPlot* frameWithLabels(const RooAbsRealLValue &var);
65
66 RooPlot* emptyClone(const char* name) ;
67
68 // implement the TH1 interface
69 void Draw(Option_t *options= nullptr) override;
70
71 // forwarding of relevant TH1 interface
72 TAxis* GetXaxis() const ;
73 TAxis* GetYaxis() const ;
74 Int_t GetNbinsX() const ;
75 Int_t GetNdivisions(Option_t* axis = "X") const ;
76 double GetMinimum(double minval = -FLT_MAX) const ;
77 double GetMaximum(double maxval = FLT_MAX) const ;
78
79 void SetAxisColor(Color_t color = 1, Option_t* axis = "X") ;
80 void SetAxisRange(double xmin, double xmax, Option_t* axis = "X") ;
81 void SetBarOffset(Float_t offset = 0.25) ;
82 void SetBarWidth(Float_t width = 0.5) ;
83 void SetContour(Int_t nlevels, const double* levels = nullptr) ;
84 void SetContourLevel(Int_t level, double value) ;
85 void SetDrawOption(Option_t* option = "") override ;
86 void SetFillAttributes() ;
87 void SetFillColor(Color_t fcolor) ;
88 void SetFillStyle(Style_t fstyle) ;
89 void SetLabelColor(Color_t color = 1, Option_t* axis = "X") ;
90 void SetLabelFont(Style_t font = 62, Option_t* axis = "X") ;
91 void SetLabelOffset(Float_t offset = 0.005, Option_t* axis = "X") ;
92 void SetLabelSize(Float_t size = 0.02, Option_t* axis = "X") ;
93 void SetLineAttributes() ;
94 void SetLineColor(Color_t lcolor) ;
95 void SetLineStyle(Style_t lstyle) ;
96 void SetLineWidth(Width_t lwidth) ;
97 void SetMarkerAttributes() ;
98 void SetMarkerColor(Color_t tcolor = 1) ;
99 void SetMarkerSize(Size_t msize = 1) ;
100 void SetMarkerStyle(Style_t mstyle = 1) ;
101 void SetName(const char *name) override ;
102 void SetTitle(const char *name) override ;
103 void SetNameTitle(const char *name, const char* title) override ;
104 void SetNdivisions(Int_t n = 510, Option_t* axis = "X") ;
105 void SetOption(Option_t* option = " ") ;
106 void SetStats(bool stats = true) ;
107 void SetTickLength(Float_t length = 0.02, Option_t* axis = "X") ;
108 void SetTitleFont(Style_t font = 62, Option_t* axis = "X") ;
109 void SetTitleOffset(Float_t offset = 1, Option_t* axis = "X") ;
110 void SetTitleSize(Float_t size = 0.02, Option_t* axis = "X") ;
111 void SetXTitle(const char* title) ;
112 void SetYTitle(const char* title) ;
113 void SetZTitle(const char* title) ;
114
115 // container management
116 const char* nameOf(Int_t idx) const ;
117 TObject *findObject(const char *name, const TClass* tClass=nullptr) const;
118 TObject* getObject(Int_t idx) const ;
119 Stat_t numItems() const {return _items.size();}
120
121 void addPlotable(RooPlotable *plotable, Option_t *drawOptions= "", bool invisible=false, bool refreshNorm=false);
122 void addObject(TObject* obj, Option_t* drawOptions= "", bool invisible=false);
123 void addTH1(TH1 *hist, Option_t* drawOptions= "", bool invisible=false);
124 std::unique_ptr<TLegend> BuildLegend() const;
125
126 void remove(const char* name=nullptr, bool deleteToo=true) ;
127
128 // ascii printing
129 void printName(std::ostream& os) const override ;
130 void printTitle(std::ostream& os) const override ;
131 void printClassName(std::ostream& os) const override ;
132 void printArgs(std::ostream& os) const override ;
133 void printValue(std::ostream& os) const override ;
134 void printMultiline(std::ostream& os, Int_t content, bool verbose=false, TString indent="") const override ;
135
136 Int_t defaultPrintContents(Option_t* opt) const override ;
137
138 inline void Print(Option_t *options= nullptr) const override {
140 }
141
142 // data member get/set methods
143 inline RooAbsRealLValue *getPlotVar() const { return _plotVar; }
144 ///Return the number of events in the fit range
145 inline double getFitRangeNEvt() const { return _normNumEvts; }
146 double getFitRangeNEvt(double xlo, double xhi) const ;
147 ///Return the bin width that is being used to normalise the PDF
148 inline double getFitRangeBinW() const { return _normBinWidth; }
149 inline double getPadFactor() const { return _padFactor; }
150 inline void setPadFactor(double factor) { if(factor >= 0) _padFactor= factor; }
151 void updateNormVars(const RooArgSet &vars);
152 const RooArgSet *getNormVars() const { return _normVars; }
153
154 // get attributes of contained objects
155 TAttLine *getAttLine(const char *name=nullptr) const;
156 TAttFill *getAttFill(const char *name=nullptr) const;
157 TAttMarker *getAttMarker(const char *name=nullptr) const;
158 TAttText *getAttText(const char *name=nullptr) const;
159
160 // Convenient type-safe accessors
161 RooCurve* getCurve(const char* name=nullptr) const ;
162 RooHist* getHist(const char* name=nullptr) const ;
163
164
165 // rearrange drawing order of contained objects
166 bool drawBefore(const char *before, const char *target);
167 bool drawAfter(const char *after, const char *target);
168
169 // get/set drawing options for contained objects
170 TString getDrawOptions(const char *name) const;
171 bool setDrawOptions(const char *name, TString options);
172
173 bool getInvisible(const char* name) const ;
174 void setInvisible(const char* name, bool flag=true) ;
175
176 virtual void SetMaximum(double maximum = -1111) ;
177 virtual void SetMinimum(double minimum = -1111) ;
178
179 ///Shortcut for RooPlot::chiSquare(const char* pdfname, const char* histname, int nFitParam=nullptr)
180 double chiSquare(int nFitParam=0) const { return chiSquare(nullptr,nullptr,nFitParam) ; }
181 double chiSquare(const char* pdfname, const char* histname, int nFitParam=0) const ;
182
183 RooHist* residHist(const char* histname=nullptr, const char* pdfname=nullptr,bool normalize=false, bool useAverage=true) const ;
184 ///Uses residHist() and sets normalize=true
185 RooHist* pullHist(const char* histname=nullptr, const char* pdfname=nullptr, bool useAverage=true) const
186 { return residHist(histname,pdfname,true,useAverage); }
187
188 void Browse(TBrowser *b) override ;
189
190 /// \copydoc AddDirectoryStatus()
191 static bool addDirectoryStatus() ;
192 /// \copydoc AddDirectory()
193 static bool setAddDirectoryStatus(bool flag) ;
194
195 /// Configure whether new instances of RooPlot will add themselves to `gDirectory`.
196 /// Like TH1::AddDirectory().
197 static void AddDirectory(bool add=true) {
199 }
200 /// Query whether new instances of RooPlot will add themselves to `gDirectory`.
201 /// When a file has been opened before a RooPlot instance is created,
202 /// this instance will be associated to the file. Closing the file will e.g.
203 /// write the instance to the file, and then delete it.
204 /// Like TH1::AddDirectoryStatus().
205 static bool AddDirectoryStatus() {
206 return addDirectoryStatus();
207 }
208
209 void SetDirectory(TDirectory *dir);
210
211 static void fillItemsFromTList(Items & items, TList const& tlist);
212
214
215protected:
216
217 class DrawOpt {
218 public:
219
220 DrawOpt(const char* _rawOpt=nullptr) : invisible(false) { drawOptions[0] = 0 ; initialize(_rawOpt) ; }
221 void initialize(const char* _rawOpt) ;
222 const char* rawOpt() const ;
223
224 char drawOptions[128] ;
226 } ;
227
228
229 void initialize();
230 TString histName() const ;
231 Items::iterator findItem(std::string const& name);
232 Items::const_iterator findItem(std::string const& name) const;
233
234 void updateYAxis(double ymin, double ymax, const char *label= "");
235 void updateFitRangeNorm(const TH1* hist);
236 void updateFitRangeNorm(const RooPlotable* rp, bool refreshNorm=false);
237
238 TH1* _hist = nullptr; ///< Histogram that we uses as basis for drawing the content
239 Items _items; ///< A list of the items we contain.
240 double _padFactor; ///< Scale our y-axis to _padFactor of our maximum contents.
241 RooAbsRealLValue *_plotVar = nullptr; ///< The variable we are plotting.
242 RooArgSet *_plotVarSet = nullptr; ///< A list owning the cloned tree nodes of the plotVarClone
243 RooArgSet *_normVars = nullptr; ///< Variables that PDF plots should be normalized over
244
245 const RooPlotable* _normObj = nullptr; ///<! Pointer to normalization object ;
246 double _normNumEvts = 0; ///< Number of events in histogram (for normalization)
247 double _normBinWidth = 0; ///< Histogram bin width (for normalization)
248
249 double _defYmin = 1e-5; ///< Default minimum for Yaxis (as calculated from contents)
250 double _defYmax = 1.0; ///< Default maximum for Yaxis (as calculated from contents)
251
252 TDirectory* _dir = nullptr; ///<! non-persistent
253
254 static bool _addDirStatus ; ///< static flag controlling AutoDirectoryAdd feature
255
256 ClassDefOverride(RooPlot,3) // Plot frame and container for graphics objects
257};
258
259#endif
#define R__DEPRECATED(MAJOR, MINOR, REASON)
Definition RConfig.hxx:504
#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: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:341
#define X(type, name)
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 TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
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:55
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:224
DrawOpt(const char *_rawOpt=nullptr)
Definition RooPlot.h:220
const char * rawOpt() const
Return the raw draw options.
Definition RooPlot.cxx:1185
Plot frame and a container for graphics objects within that frame.
Definition RooPlot.h:45
RooPlot()
Default constructor coverity[UNINIT_CTOR].
Definition RooPlot.cxx:85
void SetAxisColor(Color_t color=1, Option_t *axis="X")
Definition RooPlot.cxx:1276
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:868
void SetDrawOption(Option_t *option="") override
Definition RooPlot.cxx:1288
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:605
Items _items
A list of the items we contain.
Definition RooPlot.h:239
void SetMarkerSize(Size_t msize=1)
Definition RooPlot.cxx:1316
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:225
const RooPlotable * _normObj
! Pointer to normalization object ;
Definition RooPlot.h:245
double _normNumEvts
Number of events in histogram (for normalization)
Definition RooPlot.h:246
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:906
bool getInvisible(const char *name) const
Returns true of object with given name is set to be invisible.
Definition RooPlot.cxx:1008
void SetTitle(const char *name) override
Set the title of the RooPlot to 'title'.
Definition RooPlot.cxx:1243
RooArgSet * _normVars
Variables that PDF plots should be normalized over.
Definition RooPlot.h:243
void addObject(TObject *obj, Option_t *drawOptions="", bool invisible=false)
Add a generic object to this plot.
Definition RooPlot.cxx:366
Use the constructor that doesn t take the name and title
Definition RooPlot.h:51
void addTH1(TH1 *hist, Option_t *drawOptions="", bool invisible=false)
Add a TH1 histogram object to this plot.
Definition RooPlot.cxx:385
double _padFactor
Scale our y-axis to _padFactor of our maximum contents.
Definition RooPlot.h:240
void SetMarkerColor(Color_t tcolor=1)
Definition RooPlot.cxx:1314
void printMultiline(std::ostream &os, Int_t content, bool verbose=false, TString indent="") const override
Frame detailed printing.
Definition RooPlot.cxx:738
void SetXTitle(const char *title)
Definition RooPlot.cxx:1334
RooArgSet * _plotVarSet
A list owning the cloned tree nodes of the plotVarClone.
Definition RooPlot.h:242
void SetNdivisions(Int_t n=510, Option_t *axis="X")
Definition RooPlot.cxx:1320
TDirectory * _dir
! non-persistent
Definition RooPlot.h:252
TString histName() const
Construct automatic name of internal TH1.
Definition RooPlot.cxx:301
TH1 * _hist
Histogram that we uses as basis for drawing the content.
Definition RooPlot.h:238
void printName(std::ostream &os) const override
Print frame name.
Definition RooPlot.cxx:669
TString getDrawOptions(const char *name) const
Return the Draw() options registered for the named object.
Definition RooPlot.cxx:980
double _normBinWidth
Histogram bin width (for normalization)
Definition RooPlot.h:247
void SetZTitle(const char *title)
Definition RooPlot.cxx:1338
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:1021
void SetContour(Int_t nlevels, const double *levels=nullptr)
Definition RooPlot.cxx:1284
void printClassName(std::ostream &os) const override
Print frame class name.
Definition RooPlot.cxx:687
bool setDrawOptions(const char *name, TString options)
Register the specified drawing options for the named object.
Definition RooPlot.cxx:993
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:942
void SetStats(bool stats=true)
Like TH1::SetStats(), but statistics boxes are off by default in RooFit.
Definition RooPlot.cxx:1324
double getFitRangeNEvt() const
Return the number of events in the fit range.
Definition RooPlot.h:145
const RooArgSet * getNormVars() const
Definition RooPlot.h:152
std::vector< std::pair< TObject *, std::string > > Items
Definition RooPlot.h:47
double GetMaximum(double maxval=FLT_MAX) const
Definition RooPlot.cxx:1272
void Print(Option_t *options=nullptr) const override
This method must be overridden when a class wants to print itself.
Definition RooPlot.h:138
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:807
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:921
RooAbsRealLValue * _plotVar
The variable we are plotting.
Definition RooPlot.h:241
void SetDirectory(TDirectory *dir)
Set the directory that this plot is associated to.
Definition RooPlot.cxx:333
Stat_t numItems() const
Definition RooPlot.h:119
void SetLabelOffset(Float_t offset=0.005, Option_t *axis="X")
Definition RooPlot.cxx:1300
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:817
void printTitle(std::ostream &os) const override
Print frame title.
Definition RooPlot.cxx:678
void SetTickLength(Float_t length=0.02, Option_t *axis="X")
Definition RooPlot.cxx:1326
void SetFillAttributes()
Definition RooPlot.cxx:1290
void SetContourLevel(Int_t level, double value)
Definition RooPlot.cxx:1286
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:1302
double chiSquare(int nFitParam=0) const
Shortcut for RooPlot::chiSquare(const char* pdfname, const char* histname, int nFitParam=nullptr)
Definition RooPlot.h:180
Items::iterator findItem(std::string const &name)
Definition RooPlot.cxx:961
void SetOption(Option_t *option=" ")
Definition RooPlot.cxx:1322
TObject * getObject(Int_t idx) const
Return the name of the object at slot 'idx' in this RooPlot.
Definition RooPlot.cxx:791
TAxis * GetYaxis() const
Definition RooPlot.cxx:1264
RooAbsRealLValue * getPlotVar() const
Definition RooPlot.h:143
void SetLabelFont(Style_t font=62, Option_t *axis="X")
Definition RooPlot.cxx:1298
void Browse(TBrowser *b) override
Plot RooPlot when double-clicked in browser.
Definition RooPlot.cxx:1346
double _defYmax
Default maximum for Yaxis (as calculated from contents)
Definition RooPlot.h:250
void SetLineStyle(Style_t lstyle)
Definition RooPlot.cxx:1308
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:827
void SetTitleFont(Style_t font=62, Option_t *axis="X")
Definition RooPlot.cxx:1328
void SetAxisRange(double xmin, double xmax, Option_t *axis="X")
Definition RooPlot.cxx:1278
TAxis * GetXaxis() const
Definition RooPlot.cxx:1262
const char * nameOf(Int_t idx) const
Return the name of the object at slot 'idx' in this RooPlot.
Definition RooPlot.cxx:775
void updateNormVars(const RooArgSet &vars)
Install the given set of observables are reference normalization variables for this frame.
Definition RooPlot.cxx:351
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:1101
RooPlot * emptyClone(const char *name)
Return empty clone of current RooPlot.
Definition RooPlot.cxx:271
void SetMarkerAttributes()
Definition RooPlot.cxx:1312
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:1437
void SetNameTitle(const char *name, const char *title) override
Set the name and title of the RooPlot to 'name' and 'title'.
Definition RooPlot.cxx:1232
void setPadFactor(double factor)
Definition RooPlot.h:150
Int_t defaultPrintContents(Option_t *opt) const override
Define default print options, for a given print style.
Definition RooPlot.cxx:1254
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:848
RooHist * pullHist(const char *histname=nullptr, const char *pdfname=nullptr, bool useAverage=true) const
Uses residHist() and sets normalize=true.
Definition RooPlot.h:185
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:837
void SetLabelColor(Color_t color=1, Option_t *axis="X")
Definition RooPlot.cxx:1296
SetMaximum(ymax)
Int_t GetNbinsX() const
Definition RooPlot.cxx:1266
static void fillItemsFromTList(Items &items, TList const &tlist)
RooFit-internal function for backwards compatibility.
Definition RooPlot.cxx:1424
void SetLineAttributes()
Definition RooPlot.cxx:1304
static bool _addDirStatus
static flag controlling AutoDirectoryAdd feature
Definition RooPlot.h:254
void printValue(std::ostream &os) const override
Print frame arguments.
Definition RooPlot.cxx:710
void SetYTitle(const char *title)
Definition RooPlot.cxx:1336
double getPadFactor() const
Definition RooPlot.h:149
static void AddDirectory(bool add=true)
Configure whether new instances of RooPlot will add themselves to gDirectory.
Definition RooPlot.h:197
void printArgs(std::ostream &os) const override
Interface for printing of object arguments.
Definition RooPlot.cxx:696
std::unique_ptr< TLegend > BuildLegend() const
Build a legend that contains all objects that have been drawn on the plot.
Definition RooPlot.cxx:1412
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:858
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:550
void SetTitleSize(Float_t size=0.02, Option_t *axis="X")
Definition RooPlot.cxx:1332
double _defYmin
Default minimum for Yaxis (as calculated from contents)
Definition RooPlot.h:249
SetMinimum(ymin)
void SetBarOffset(Float_t offset=0.25)
Definition RooPlot.cxx:1280
void SetBarWidth(Float_t width=0.5)
Definition RooPlot.cxx:1282
Int_t GetNdivisions(Option_t *axis="X") const
Definition RooPlot.cxx:1268
void addPlotable(RooPlotable *plotable, Option_t *drawOptions="", bool invisible=false, bool refreshNorm=false)
Add the specified plotable object to our plot.
Definition RooPlot.cxx:516
void initialize()
Perform initialization that is common to all constructors.
Definition RooPlot.cxx:282
static RooPlot * frameWithLabels(const RooAbsRealLValue &var)
Create a new frame for a given variable in x, adding bin labels.
Definition RooPlot.cxx:237
void SetTitleOffset(Float_t offset=1, Option_t *axis="X")
Definition RooPlot.cxx:1330
Use the constructor that doesn t take the name and and then call SetName() and SetTitle() on the RooPlot.")
static bool AddDirectoryStatus()
Query whether new instances of RooPlot will add themselves to gDirectory.
Definition RooPlot.h:205
double GetMinimum(double minval=-FLT_MAX) const
Definition RooPlot.cxx:1270
double getFitRangeBinW() const
Return the bin width that is being used to normalise the PDF.
Definition RooPlot.h:148
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()