A RooPlot is a plot frame and a container for graphics objects within that frame.
As a frame, it provides the TH1-style public interface for setting plot ranges, configuring axes, etc. As a container, it holds an arbitrary set of objects that might be histograms of data, curves representing a fit model, or text labels. Use the Draw() method to draw a frame and the objects it contains. Use the various add...() methods to add objects to be drawn. In general, the add...() methods create a private copy of the object you pass them and return a pointer to this copy. The caller owns the input object and this class owns the returned object. All RooAbsReal and RooAbsData derived classes implement plotOn() functions that facilitate to plot themselves on a given RooPlot, e.g.
These high level functions also take care of any projections or other mappings that need to be made to plot a multi-dimensional object onto a one-dimensional plot.
Classes | |
class | DrawOpt |
Public Member Functions | |
RooPlot () | |
Default constructor coverity[UNINIT_CTOR]. | |
RooPlot (const char *name, const char *title, const RooAbsRealLValue &var, Double_t xmin, Double_t xmax, Int_t nBins) | |
Create an 1-dimensional with all properties taken from 'var', but with an explicit range [xmin,xmax] and a default binning of 'nbins'. | |
RooPlot (const RooAbsRealLValue &var, Double_t xmin, Double_t xmax, Int_t nBins) | |
Create an 1-dimensional with all properties taken from 'var', but with an explicit range [xmin,xmax] and a default binning of 'nbins'. | |
RooPlot (const RooAbsRealLValue &var1, const RooAbsRealLValue &var2) | |
Construct a two-dimensional RooPlot with ranges and properties taken from variables var1 and var2. | |
RooPlot (const RooAbsRealLValue &var1, const RooAbsRealLValue &var2, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax) | |
Construct a two-dimensional RooPlot with ranges and properties taken from variables var1 and var2 but with an overriding range definition of [xmin,xmax] x [ymin,ymax]. | |
RooPlot (Double_t xmin, Double_t xmax) | |
Constructor of RooPlot with range [xmin,xmax]. | |
RooPlot (Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax) | |
Construct of a two-dimensional RooPlot with ranges [xmin,xmax] x [ymin,ymax]. | |
virtual | ~RooPlot () |
Destructor. | |
void | addObject (TObject *obj, Option_t *drawOptions="", Bool_t invisible=kFALSE) |
Add a generic object to this plot. | |
void | addPlotable (RooPlotable *plotable, Option_t *drawOptions="", Bool_t invisible=kFALSE, Bool_t refreshNorm=kFALSE) |
Add the specified plotable object to our plot. | |
void | addTH1 (TH1 *hist, Option_t *drawOptions="", Bool_t invisible=kFALSE) |
Add a TH1 histogram object to this plot. | |
void | Browse (TBrowser *b) |
Plot RooPlot when double-clicked in browser. | |
std::unique_ptr< TLegend > | BuildLegend () const |
Build a legend that contains all objects that have been drawn on the plot. | |
Double_t | chiSquare (const char *pdfname, const char *histname, int nFitParam=0) const |
Calculate and return reduced chi-squared between a curve and a histogram. | |
Double_t | chiSquare (int nFitParam=0) const |
Shortcut for RooPlot::chiSquare(const char* pdfname, const char* histname, int nFitParam=0) | |
virtual Int_t | defaultPrintContents (Option_t *opt) const |
Define default print options, for a given print style. | |
virtual void | Draw (Option_t *options=0) |
Draw this plot and all of the elements it contains. | |
Bool_t | 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 after the specified object. | |
Bool_t | 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 before the specified object. | |
RooPlot * | emptyClone (const char *name) |
Return empty clone of current RooPlot. | |
TObject * | findObject (const char *name, const TClass *clas=0) const |
Find the named object in our list of items and return a pointer to it. | |
TAttFill * | getAttFill (const char *name=0) const |
Return a pointer to the fill attributes of the named object in this plot, or zero if the named object does not exist or does not have fill attributes. | |
TAttLine * | getAttLine (const char *name=0) const |
Return a pointer to the line attributes of the named object in this plot, or zero if the named object does not exist or does not have line attributes. | |
TAttMarker * | getAttMarker (const char *name=0) const |
Return a pointer to the marker attributes of the named object in this plot, or zero if the named object does not exist or does not have marker attributes. | |
TAttText * | getAttText (const char *name=0) const |
Return a pointer to the text attributes of the named object in this plot, or zero if the named object does not exist or does not have text attributes. | |
RooCurve * | getCurve (const char *name=0) const |
Return a RooCurve pointer of the named object in this plot, or zero if the named object does not exist or is not a RooCurve. | |
TString | getDrawOptions (const char *name) const |
Return the Draw() options registered for the named object. | |
Double_t | getFitRangeBinW () const |
Return the bin width that is being used to normalise the PDF. | |
Double_t | getFitRangeNEvt () const |
Return the number of events in the fit range. | |
Double_t | getFitRangeNEvt (Double_t xlo, Double_t xhi) const |
Return the number of events that is associated with the range [xlo,xhi] This method is only fully functional for ranges not equal to the full range if the object that inserted the normalization data provided a link to an external object that can calculate the event count in in sub ranges. | |
RooHist * | getHist (const char *name=0) const |
Return a RooCurve pointer of the named object in this plot, or zero if the named object does not exist or is not a RooCurve. | |
Bool_t | getInvisible (const char *name) const |
Returns true of object with given name is set to be invisible. | |
Double_t | GetMaximum (Double_t maxval=FLT_MAX) const |
Double_t | GetMinimum (Double_t minval=-FLT_MAX) const |
Int_t | GetNbinsX () const |
Int_t | GetNdivisions (Option_t *axis="X") const |
const RooArgSet * | getNormVars () const |
TObject * | getObject (Int_t idx) const |
Return the name of the object at slot 'idx' in this RooPlot. | |
Double_t | getPadFactor () const |
RooAbsRealLValue * | getPlotVar () const |
TAxis * | GetXaxis () const |
TAxis * | GetYaxis () const |
const char * | nameOf (Int_t idx) const |
Return the name of the object at slot 'idx' in this RooPlot. | |
Stat_t | numItems () const |
virtual void | Print (Option_t *options=0) const |
Print TNamed name and title. | |
virtual void | printArgs (std::ostream &os) const |
Interface for printing of object arguments. | |
virtual void | printClassName (std::ostream &os) const |
Print frame class name. | |
virtual void | printMultiline (std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const |
Frame detailed printing. | |
virtual void | printName (std::ostream &os) const |
Print frame name. | |
virtual void | printTitle (std::ostream &os) const |
Print frame title. | |
virtual void | printValue (std::ostream &os) const |
Print frame arguments. | |
RooHist * | pullHist (const char *histname=0, const char *pdfname=0, bool useAverage=true) const |
Uses residHist() and sets normalize=true. | |
void | remove (const char *name=0, Bool_t deleteToo=kTRUE) |
Remove object with given name, or last object added if no name is given. | |
RooHist * | residHist (const char *histname=0, const char *pdfname=0, bool normalize=false, bool useAverage=true) const |
Return a RooHist (derives from TGraphAsymErrors) containing the residuals of a histogram. | |
void | SetAxisColor (Color_t color=1, Option_t *axis="X") |
void | SetAxisRange (Double_t xmin, Double_t xmax, Option_t *axis="X") |
void | SetBarOffset (Float_t offset=0.25) |
void | SetBarWidth (Float_t width=0.5) |
void | SetContour (Int_t nlevels, const Double_t *levels=0) |
void | SetContourLevel (Int_t level, Double_t value) |
void | SetDirectory (TDirectory *dir) |
Set the directory that this plot is associated to. | |
void | SetDrawOption (Option_t *option="") |
Bool_t | setDrawOptions (const char *name, TString options) |
Register the specified drawing options for the named object. | |
void | SetFillAttributes () |
void | SetFillColor (Color_t fcolor) |
void | SetFillStyle (Style_t fstyle) |
void | setInvisible (const char *name, Bool_t flag=kTRUE) |
If flag is true object with 'name' is set to be invisible i.e. | |
void | SetLabelColor (Color_t color=1, Option_t *axis="X") |
void | SetLabelFont (Style_t font=62, Option_t *axis="X") |
void | SetLabelOffset (Float_t offset=0.005, Option_t *axis="X") |
void | SetLabelSize (Float_t size=0.02, Option_t *axis="X") |
void | SetLineAttributes () |
void | SetLineColor (Color_t lcolor) |
void | SetLineStyle (Style_t lstyle) |
void | SetLineWidth (Width_t lwidth) |
void | SetMarkerAttributes () |
void | SetMarkerColor (Color_t tcolor=1) |
void | SetMarkerSize (Size_t msize=1) |
void | SetMarkerStyle (Style_t mstyle=1) |
virtual void | SetMaximum (Double_t maximum=-1111) |
Set maximum value of Y axis. | |
virtual void | SetMinimum (Double_t minimum=-1111) |
Set minimum value of Y axis. | |
void | SetName (const char *name) |
Set the name of the RooPlot to 'name'. | |
void | SetNameTitle (const char *name, const char *title) |
Set the name and title of the RooPlot to 'name' and 'title'. | |
void | SetNdivisions (Int_t n=510, Option_t *axis="X") |
void | SetOption (Option_t *option=" ") |
void | setPadFactor (Double_t factor) |
void | SetStats (Bool_t stats=kTRUE) |
Like TH1::SetStats(), but statistics boxes are off by default in RooFit. | |
void | SetTickLength (Float_t length=0.02, Option_t *axis="X") |
void | SetTitle (const char *name) |
Set the title of the RooPlot to 'title'. | |
void | SetTitleFont (Style_t font=62, Option_t *axis="X") |
void | SetTitleOffset (Float_t offset=1, Option_t *axis="X") |
void | SetTitleSize (Float_t size=0.02, Option_t *axis="X") |
void | SetXTitle (const char *title) |
void | SetYTitle (const char *title) |
void | SetZTitle (const char *title) |
void | updateNormVars (const RooArgSet &vars) |
Install the given set of observables are reference normalization variables for this frame. | |
![]() | |
TNamed () | |
TNamed (const char *name, const char *title) | |
TNamed (const TNamed &named) | |
TNamed copy ctor. | |
TNamed (const TString &name, const TString &title) | |
virtual | ~TNamed () |
TNamed destructor. | |
virtual void | Clear (Option_t *option="") |
Set name and title to empty strings (""). | |
virtual TObject * | Clone (const char *newname="") const |
Make a clone of an object using the Streamer facility. | |
virtual Int_t | Compare (const TObject *obj) const |
Compare two TNamed objects. | |
virtual void | Copy (TObject &named) const |
Copy this to obj. | |
virtual void | FillBuffer (char *&buffer) |
Encode TNamed into output buffer. | |
virtual const char * | GetName () const |
Returns name of object. | |
virtual const char * | GetTitle () const |
Returns title of object. | |
virtual ULong_t | Hash () const |
Return hash value for this object. | |
virtual Bool_t | IsSortable () const |
virtual void | ls (Option_t *option="") const |
List TNamed name and title. | |
TNamed & | operator= (const TNamed &rhs) |
TNamed assignment operator. | |
virtual Int_t | Sizeof () const |
Return size of the TNamed part of the TObject. | |
![]() | |
TObject () | |
TObject constructor. | |
TObject (const TObject &object) | |
TObject copy ctor. | |
virtual | ~TObject () |
TObject destructor. | |
void | AbstractMethod (const char *method) const |
Use this method to implement an "abstract" method that you don't want to leave purely abstract. | |
virtual void | AppendPad (Option_t *option="") |
Append graphics object to current pad. | |
ULong_t | CheckedHash () |
Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object. | |
virtual const char * | ClassName () const |
Returns name of class to which the object belongs. | |
virtual void | Delete (Option_t *option="") |
Delete this object. | |
virtual Int_t | DistancetoPrimitive (Int_t px, Int_t py) |
Computes distance from point (px,py) to the object. | |
virtual void | DrawClass () const |
Draw class inheritance tree of the class to which this object belongs. | |
virtual TObject * | DrawClone (Option_t *option="") const |
Draw a clone of this object in the current selected pad for instance with: gROOT->SetSelectedPad(gPad) . | |
virtual void | Dump () const |
Dump contents of object on stdout. | |
virtual void | Error (const char *method, const char *msgfmt,...) const |
Issue error message. | |
virtual void | Execute (const char *method, const char *params, Int_t *error=0) |
Execute method on this object with the given parameter string, e.g. | |
virtual void | Execute (TMethod *method, TObjArray *params, Int_t *error=0) |
Execute method on this object with parameters stored in the TObjArray. | |
virtual void | ExecuteEvent (Int_t event, Int_t px, Int_t py) |
Execute action corresponding to an event at (px,py). | |
virtual void | Fatal (const char *method, const char *msgfmt,...) const |
Issue fatal error message. | |
virtual TObject * | FindObject (const char *name) const |
Must be redefined in derived classes. | |
virtual TObject * | FindObject (const TObject *obj) const |
Must be redefined in derived classes. | |
virtual Option_t * | GetDrawOption () const |
Get option used by the graphics system to draw this object. | |
virtual const char * | GetIconName () const |
Returns mime type name of object. | |
virtual char * | GetObjectInfo (Int_t px, Int_t py) const |
Returns string containing info about the object at position (px,py). | |
virtual Option_t * | GetOption () const |
virtual UInt_t | GetUniqueID () const |
Return the unique object id. | |
virtual Bool_t | HandleTimer (TTimer *timer) |
Execute action in response of a timer timing out. | |
Bool_t | HasInconsistentHash () const |
Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e. | |
virtual void | Info (const char *method, const char *msgfmt,...) const |
Issue info message. | |
virtual Bool_t | InheritsFrom (const char *classname) const |
Returns kTRUE if object inherits from class "classname". | |
virtual Bool_t | InheritsFrom (const TClass *cl) const |
Returns kTRUE if object inherits from TClass cl. | |
virtual void | Inspect () const |
Dump contents of this object in a graphics canvas. | |
void | InvertBit (UInt_t f) |
Bool_t | IsDestructed () const |
IsDestructed. | |
virtual Bool_t | IsEqual (const TObject *obj) const |
Default equal comparison (objects are equal if they have the same address in memory). | |
virtual Bool_t | IsFolder () const |
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects). | |
R__ALWAYS_INLINE Bool_t | IsOnHeap () const |
R__ALWAYS_INLINE Bool_t | IsZombie () const |
void | MayNotUse (const char *method) const |
Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary). | |
virtual Bool_t | Notify () |
This method must be overridden to handle object notification. | |
void | Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const |
Use this method to declare a method obsolete. | |
void | operator delete (void *ptr) |
Operator delete. | |
void | operator delete[] (void *ptr) |
Operator delete []. | |
void * | operator new (size_t sz) |
void * | operator new (size_t sz, void *vp) |
void * | operator new[] (size_t sz) |
void * | operator new[] (size_t sz, void *vp) |
TObject & | operator= (const TObject &rhs) |
TObject assignment operator. | |
virtual void | Paint (Option_t *option="") |
This method must be overridden if a class wants to paint itself. | |
virtual void | Pop () |
Pop on object drawn in a pad to the top of the display list. | |
virtual Int_t | Read (const char *name) |
Read contents of object with specified name from the current directory. | |
virtual void | RecursiveRemove (TObject *obj) |
Recursively remove this object from a list. | |
void | ResetBit (UInt_t f) |
virtual void | SaveAs (const char *filename="", Option_t *option="") const |
Save this object in the file specified by filename. | |
virtual void | SavePrimitive (std::ostream &out, Option_t *option="") |
Save a primitive as a C++ statement(s) on output stream "out". | |
void | SetBit (UInt_t f) |
void | SetBit (UInt_t f, Bool_t set) |
Set or unset the user status bits as specified in f. | |
virtual void | SetUniqueID (UInt_t uid) |
Set the unique object id. | |
virtual void | SysError (const char *method, const char *msgfmt,...) const |
Issue system error message. | |
R__ALWAYS_INLINE Bool_t | TestBit (UInt_t f) const |
Int_t | TestBits (UInt_t f) const |
virtual void | UseCurrentStyle () |
Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked. | |
virtual void | Warning (const char *method, const char *msgfmt,...) const |
Issue warning message. | |
virtual Int_t | Write (const char *name=0, Int_t option=0, Int_t bufsize=0) |
Write this object to the current directory. | |
virtual Int_t | Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const |
Write this object to the current directory. | |
![]() | |
RooPrintable () | |
virtual | ~RooPrintable () |
virtual StyleOption | defaultPrintStyle (Option_t *opt) const |
virtual void | printAddress (std::ostream &os) const |
Print class name of object. | |
virtual void | printExtras (std::ostream &os) const |
Interface to print extras of object. | |
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, which is interpreted as an OR of 'enum ContentsOptions' values and in the style given by 'enum StyleOption'. | |
virtual void | printTree (std::ostream &os, TString indent="") const |
Interface for tree structure printing of object. | |
Static Public Member Functions | |
static void | AddDirectory (Bool_t add=kTRUE) |
Configure whether new instances of RooPlot will add themselves to gDirectory . | |
static Bool_t | addDirectoryStatus () |
Query whether new instances of RooPlot will add themselves to gDirectory . | |
static Bool_t | AddDirectoryStatus () |
Query whether new instances of RooPlot will add themselves to gDirectory . | |
static RooPlot * | frame (const RooAbsRealLValue &var, Double_t xmin, Double_t xmax, Int_t nBins) |
Create a new frame for a given variable in x. | |
static RooPlot * | frameWithLabels (const RooAbsRealLValue &var) |
Create a new frame for a given variable in x, adding bin labels. | |
static Bool_t | setAddDirectoryStatus (Bool_t flag) |
Configure whether new instances of RooPlot will add themselves to gDirectory . | |
![]() | |
static Longptr_t | GetDtorOnly () |
Return destructor only flag. | |
static Bool_t | GetObjectStat () |
Get status of object stat flag. | |
static void | SetDtorOnly (void *obj) |
Set destructor only flag. | |
static void | SetObjectStat (Bool_t stat) |
Turn on/off tracking of objects in the TObjectTable. | |
![]() | |
static std::ostream & | defaultPrintStream (std::ostream *os=0) |
Return a reference to the current default stream to use in Print(). | |
static void | nameFieldLength (Int_t newLen) |
Set length of field reserved from printing name of RooAbsArgs in multi-line collection printing to given amount. | |
Protected Member Functions | |
RooPlot (const RooPlot &other) | |
TString | caller (const char *method) const |
Utility function. | |
TString | histName () const |
Construct automatic name of internal TH1. | |
void | initialize () |
Perform initialization that is common to all constructors. | |
void | updateFitRangeNorm (const RooPlotable *rp, Bool_t refeshNorm=kFALSE) |
Update our plot normalization over our plot variable's fit range, which will be determined by the first suitable object added to our plot. | |
void | updateFitRangeNorm (const TH1 *hist) |
Update our plot normalization over our plot variable's fit range, which will be determined by the first suitable object added to our plot. | |
void | updateYAxis (Double_t ymin, Double_t ymax, const char *label="") |
Update our y-axis limits to accomodate an object whose spread in y is (ymin,ymax). | |
![]() | |
virtual void | DoError (int level, const char *location, const char *fmt, va_list va) const |
Interface to ErrorHandler (protected). | |
void | MakeZombie () |
Protected Attributes | |
Double_t | _defYmax |
Double_t | _defYmin |
TDirectory * | _dir |
TH1 * | _hist |
RooList | _items |
Double_t | _normBinWidth |
Double_t | _normNumEvts |
Pointer to normalization object ;. | |
const RooPlotable * | _normObj |
RooArgSet * | _normVars |
Double_t | _padFactor |
RooAbsRealLValue * | _plotVarClone |
RooArgSet * | _plotVarSet |
![]() | |
TString | fName |
TString | fTitle |
Static Protected Attributes | |
static Bool_t | _addDirStatus = kTRUE |
non-persistent | |
![]() | |
static Int_t | _nameLength |
Additional Inherited Members | |
![]() | |
enum | { kIsOnHeap = 0x01000000 , kNotDeleted = 0x02000000 , kZombie = 0x04000000 , kInconsistent = 0x08000000 , kBitMask = 0x00ffffff } |
enum | { kSingleKey = BIT(0) , kOverwrite = BIT(1) , kWriteDelete = BIT(2) } |
enum | EDeprecatedStatusBits { kObjInCanvas = BIT(3) } |
enum | EStatusBits { kCanDelete = BIT(0) , kMustCleanup = BIT(3) , kIsReferenced = BIT(4) , kHasUUID = BIT(5) , kCannotPick = BIT(6) , kNoContextMenu = BIT(8) , kInvalidObject = BIT(13) } |
![]() | |
enum | ContentsOption { kName =1 , kClassName =2 , kValue =4 , kArgs =8 , kExtras =16 , kAddress =32 , kTitle =64 , kCollectionHeader =128 } |
enum | StyleOption { kInline =1 , kSingleLine =2 , kStandard =3 , kVerbose =4 , kTreeStructure =5 } |
![]() | |
enum | { kOnlyPrepStep = BIT(3) } |
#include <RooPlot.h>
RooPlot::RooPlot | ( | ) |
Default constructor coverity[UNINIT_CTOR].
Definition at line 86 of file RooPlot.cxx.
RooPlot::RooPlot | ( | const char * | name, |
const char * | title, | ||
const RooAbsRealLValue & | var, | ||
Double_t | xmin, | ||
Double_t | xmax, | ||
Int_t | nBins | ||
) |
Create an 1-dimensional with all properties taken from 'var', but with an explicit range [xmin,xmax] and a default binning of 'nbins'.
Definition at line 189 of file RooPlot.cxx.
RooPlot::RooPlot | ( | const RooAbsRealLValue & | var, |
Double_t | xmin, | ||
Double_t | xmax, | ||
Int_t | nBins | ||
) |
Create an 1-dimensional with all properties taken from 'var', but with an explicit range [xmin,xmax] and a default binning of 'nbins'.
Definition at line 215 of file RooPlot.cxx.
Constructor of RooPlot with range [xmin,xmax].
Definition at line 97 of file RooPlot.cxx.
Construct of a two-dimensional RooPlot with ranges [xmin,xmax] x [ymin,ymax].
Definition at line 116 of file RooPlot.cxx.
RooPlot::RooPlot | ( | const RooAbsRealLValue & | var1, |
const RooAbsRealLValue & | var2 | ||
) |
Construct a two-dimensional RooPlot with ranges and properties taken from variables var1 and var2.
Definition at line 135 of file RooPlot.cxx.
RooPlot::RooPlot | ( | const RooAbsRealLValue & | var1, |
const RooAbsRealLValue & | var2, | ||
Double_t | xmin, | ||
Double_t | xmax, | ||
Double_t | ymin, | ||
Double_t | ymax | ||
) |
Construct a two-dimensional RooPlot with ranges and properties taken from variables var1 and var2 but with an overriding range definition of [xmin,xmax] x [ymin,ymax].
Definition at line 167 of file RooPlot.cxx.
|
virtual |
Destructor.
Definition at line 343 of file RooPlot.cxx.
|
protected |
Configure whether new instances of RooPlot will add themselves to gDirectory
.
Like TH1::AddDirectory().
|
static |
Query whether new instances of RooPlot will add themselves to gDirectory
.
When a file has been opened before a RooPlot instance is created, this instance will be associated to the file. Closing the file will e.g. write the instance to the file, and then delete it. Like TH1::AddDirectoryStatus().
Definition at line 78 of file RooPlot.cxx.
|
inlinestatic |
Query whether new instances of RooPlot will add themselves to gDirectory
.
When a file has been opened before a RooPlot instance is created, this instance will be associated to the file. Closing the file will e.g. write the instance to the file, and then delete it. Like TH1::AddDirectoryStatus().
Add a generic object to this plot.
The specified options will be used to Draw() this object later. The caller transfers ownership of the object with this call, and the object will be deleted when its containing plot object is destroyed.
Definition at line 392 of file RooPlot.cxx.
void RooPlot::addPlotable | ( | RooPlotable * | plotable, |
Option_t * | drawOptions = "" , |
||
Bool_t | invisible = kFALSE , |
||
Bool_t | refreshNorm = kFALSE |
||
) |
Add the specified plotable object to our plot.
Increase our y-axis limits to fit this object if necessary. The default lower-limit is zero unless we are plotting an object that takes on negative values. This call transfers ownership of the plotable object to this class. The plotable object will be deleted when this plot object is deleted.
Definition at line 540 of file RooPlot.cxx.
Add a TH1 histogram object to this plot.
The specified options will be used to Draw() this object later. "SAME" will be added to the options if they are not already present. The caller transfers ownership of the object with this call, and the object will be deleted when its containing plot object is destroyed.
Definition at line 411 of file RooPlot.cxx.
Plot RooPlot when double-clicked in browser.
Reimplemented from TObject.
Definition at line 1360 of file RooPlot.cxx.
std::unique_ptr< TLegend > RooPlot::BuildLegend | ( | ) | const |
Build a legend that contains all objects that have been drawn on the plot.
Definition at line 1421 of file RooPlot.cxx.
|
protected |
Utility function.
Definition at line 1036 of file RooPlot.cxx.
Double_t RooPlot::chiSquare | ( | const char * | curvename, |
const char * | histname, | ||
int | nFitParam = 0 |
||
) | const |
Calculate and return reduced chi-squared between a curve and a histogram.
[in] | curvename | Name of the curve or nullptr for last curve |
[in] | histname | Name of the histogram to compare to or nullptr for last added histogram |
[in] | nFitParam | If non-zero, reduce the number of degrees of freedom by this number. This means that the curve was fitted to the data with nFitParam floating parameters, which needs to be reflected in the calculation of \(\chi^2 / \mathrm{ndf}\). |
Definition at line 1082 of file RooPlot.cxx.
Shortcut for RooPlot::chiSquare(const char* pdfname, const char* histname, int nFitParam=0)
Define default print options, for a given print style.
Reimplemented from RooPrintable.
Definition at line 1268 of file RooPlot.cxx.
Draw this plot and all of the elements it contains.
The specified options only apply to the drawing of our frame. The options specified in our add...() methods will be used to draw each object we contain.
Reimplemented from TObject.
Definition at line 661 of file RooPlot.cxx.
Bool_t RooPlot::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 after the specified object.
Returns kFALSE if either object does not exist.
Definition at line 935 of file RooPlot.cxx.
Bool_t RooPlot::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 before the specified object.
Returns kFALSE if either object does not exist.
Definition at line 924 of file RooPlot.cxx.
RooPlot * RooPlot::emptyClone | ( | const char * | name | ) |
Return empty clone of current RooPlot.
Definition at line 296 of file RooPlot.cxx.
Find the named object in our list of items and return a pointer to it.
Return zero and print a warning message if the named object cannot be found. If no name is supplied the last object added is returned.
Note that the returned pointer is to a TObject and so will generally need casting. Use the getAtt...() methods to change the drawing style attributes of a contained object directly.
Definition at line 952 of file RooPlot.cxx.
|
static |
Create a new frame for a given variable in x.
This is just a wrapper for the RooPlot constructor with the same interface.
More details.
[in] | var | The variable on the x-axis |
[in] | xmin | Left edge of the x-axis |
[in] | xmax | Right edge of the x-axis |
[in] | nBins | number of bins on the x-axis |
Definition at line 249 of file RooPlot.cxx.
|
static |
Create a new frame for a given variable in x, adding bin labels.
The binning will be extracted from the variable given. The bin labels will be set as "%g-%g" for the left and right edges of each bin of the given variable.
More details.
[in] | var | The variable on the x-axis |
Definition at line 261 of file RooPlot.cxx.
TAttFill * RooPlot::getAttFill | ( | const char * | name = 0 | ) | const |
Return a pointer to the fill attributes of the named object in this plot, or zero if the named object does not exist or does not have fill attributes.
Definition at line 846 of file RooPlot.cxx.
TAttLine * RooPlot::getAttLine | ( | const char * | name = 0 | ) | const |
Return a pointer to the line attributes of the named object in this plot, or zero if the named object does not exist or does not have line attributes.
Definition at line 836 of file RooPlot.cxx.
TAttMarker * RooPlot::getAttMarker | ( | const char * | name = 0 | ) | const |
Return a pointer to the marker attributes of the named object in this plot, or zero if the named object does not exist or does not have marker attributes.
Definition at line 856 of file RooPlot.cxx.
TAttText * RooPlot::getAttText | ( | const char * | name = 0 | ) | const |
Return a pointer to the text attributes of the named object in this plot, or zero if the named object does not exist or does not have text attributes.
Definition at line 866 of file RooPlot.cxx.
RooCurve * RooPlot::getCurve | ( | const char * | name = 0 | ) | const |
Return a RooCurve pointer of the named object in this plot, or zero if the named object does not exist or is not a RooCurve.
Definition at line 877 of file RooPlot.cxx.
TString RooPlot::getDrawOptions | ( | const char * | name | ) | const |
Return the Draw() options registered for the named object.
Return an empty string if the named object cannot be found.
Definition at line 977 of file RooPlot.cxx.
|
inline |
|
inline |
Return the number of events that is associated with the range [xlo,xhi] This method is only fully functional for ranges not equal to the full range if the object that inserted the normalization data provided a link to an external object that can calculate the event count in in sub ranges.
An error will be printed if this function is used on sub-ranges while that information is not available
Definition at line 1219 of file RooPlot.cxx.
RooHist * RooPlot::getHist | ( | const char * | name = 0 | ) | const |
Return a RooCurve pointer of the named object in this plot, or zero if the named object does not exist or is not a RooCurve.
Definition at line 887 of file RooPlot.cxx.
Bool_t RooPlot::getInvisible | ( | const char * | name | ) | const |
Returns true of object with given name is set to be invisible.
Definition at line 1004 of file RooPlot.cxx.
Definition at line 1286 of file RooPlot.cxx.
Definition at line 1284 of file RooPlot.cxx.
Int_t RooPlot::GetNbinsX | ( | ) | const |
Definition at line 1280 of file RooPlot.cxx.
Definition at line 1282 of file RooPlot.cxx.
Return the name of the object at slot 'idx' in this RooPlot.
If the given index is out of range, return a null pointer
Definition at line 820 of file RooPlot.cxx.
|
inline |
TAxis * RooPlot::GetXaxis | ( | ) | const |
Definition at line 1276 of file RooPlot.cxx.
TAxis * RooPlot::GetYaxis | ( | ) | const |
Definition at line 1278 of file RooPlot.cxx.
|
protected |
Construct automatic name of internal TH1.
Definition at line 330 of file RooPlot.cxx.
|
protected |
Perform initialization that is common to all constructors.
Definition at line 307 of file RooPlot.cxx.
const char * RooPlot::nameOf | ( | Int_t | idx | ) | const |
Return the name of the object at slot 'idx' in this RooPlot.
If the given index is out of range, return a null pointer
Definition at line 804 of file RooPlot.cxx.
|
virtual |
Interface for printing of object arguments.
Arguments are loosely defined as external server objects in this context
Reimplemented from RooPrintable.
Definition at line 721 of file RooPlot.cxx.
|
virtual |
Print frame class name.
Reimplemented from RooPrintable.
Definition at line 712 of file RooPlot.cxx.
|
virtual |
Frame detailed printing.
Reimplemented from RooPrintable.
Definition at line 764 of file RooPlot.cxx.
|
virtual |
|
virtual |
|
virtual |
|
inline |
Uses residHist() and sets normalize=true.
Remove object with given name, or last object added if no name is given.
If deleteToo is true (default), the object removed from the RooPlot is also deleted.
Definition at line 899 of file RooPlot.cxx.
RooHist * RooPlot::residHist | ( | const char * | histname = 0 , |
const char * | curvename = 0 , |
||
bool | normalize = false , |
||
bool | useAverage = true |
||
) | const |
Return a RooHist (derives from TGraphAsymErrors) containing the residuals of a histogram.
The plotting range of the graph is adapted to the plotting range of the current plot.
histname | Name of the data histogram. Passing an empty string or nullptr will create residuals of the last-plotted histogram. |
curvename | Name of the curve to compare to data. Passing an empty string or nullptr will create residuals of the last-plotted curve. |
normalize | If true, the residuals are divided by the error of the histogram, effectively returning a pull histogram. |
useAverage | If true, the histogram is compared with the curve averaged in each bin. Otherwise, the curve is evaluated at the bin centres, which is not accurate for strongly curved distributions. |
Definition at line 1115 of file RooPlot.cxx.
Configure whether new instances of RooPlot will add themselves to gDirectory
.
Like TH1::AddDirectory().
Definition at line 79 of file RooPlot.cxx.
Definition at line 1290 of file RooPlot.cxx.
Definition at line 1292 of file RooPlot.cxx.
Definition at line 1294 of file RooPlot.cxx.
Definition at line 1296 of file RooPlot.cxx.
Definition at line 1298 of file RooPlot.cxx.
Definition at line 1300 of file RooPlot.cxx.
void RooPlot::SetDirectory | ( | TDirectory * | dir | ) |
Set the directory that this plot is associated to.
Setting it to nullptr
will remove the object from all directories. Like TH1::SetDirectory.
Definition at line 362 of file RooPlot.cxx.
Reimplemented from TObject.
Definition at line 1302 of file RooPlot.cxx.
Register the specified drawing options for the named object.
Return kFALSE if the named object cannot be found.
Definition at line 989 of file RooPlot.cxx.
void RooPlot::SetFillAttributes | ( | ) |
Definition at line 1304 of file RooPlot.cxx.
Definition at line 1306 of file RooPlot.cxx.
Definition at line 1308 of file RooPlot.cxx.
If flag is true object with 'name' is set to be invisible i.e.
it is not drawn when Draw() is called
Definition at line 1017 of file RooPlot.cxx.
Definition at line 1310 of file RooPlot.cxx.
Definition at line 1312 of file RooPlot.cxx.
Definition at line 1314 of file RooPlot.cxx.
Definition at line 1316 of file RooPlot.cxx.
void RooPlot::SetLineAttributes | ( | ) |
Definition at line 1318 of file RooPlot.cxx.
Definition at line 1320 of file RooPlot.cxx.
Definition at line 1322 of file RooPlot.cxx.
Definition at line 1324 of file RooPlot.cxx.
void RooPlot::SetMarkerAttributes | ( | ) |
Definition at line 1326 of file RooPlot.cxx.
Definition at line 1328 of file RooPlot.cxx.
Definition at line 1330 of file RooPlot.cxx.
Definition at line 1332 of file RooPlot.cxx.
Set maximum value of Y axis.
Definition at line 1051 of file RooPlot.cxx.
Set minimum value of Y axis.
Definition at line 1061 of file RooPlot.cxx.
|
virtual |
Set the name of the RooPlot to 'name'.
Reimplemented from TNamed.
Definition at line 1235 of file RooPlot.cxx.
|
virtual |
Set the name and title of the RooPlot to 'name' and 'title'.
Reimplemented from TNamed.
Definition at line 1246 of file RooPlot.cxx.
Definition at line 1334 of file RooPlot.cxx.
Definition at line 1336 of file RooPlot.cxx.
Like TH1::SetStats(), but statistics boxes are off by default in RooFit.
Definition at line 1338 of file RooPlot.cxx.
Definition at line 1340 of file RooPlot.cxx.
|
virtual |
Set the title of the RooPlot to 'title'.
Reimplemented from TNamed.
Definition at line 1257 of file RooPlot.cxx.
Definition at line 1342 of file RooPlot.cxx.
Definition at line 1344 of file RooPlot.cxx.
Definition at line 1346 of file RooPlot.cxx.
void RooPlot::SetXTitle | ( | const char * | title | ) |
Definition at line 1348 of file RooPlot.cxx.
void RooPlot::SetYTitle | ( | const char * | title | ) |
Definition at line 1350 of file RooPlot.cxx.
void RooPlot::SetZTitle | ( | const char * | title | ) |
Definition at line 1352 of file RooPlot.cxx.
|
protected |
Update our plot normalization over our plot variable's fit range, which will be determined by the first suitable object added to our plot.
Definition at line 586 of file RooPlot.cxx.
Update our plot normalization over our plot variable's fit range, which will be determined by the first suitable object added to our plot.
Definition at line 574 of file RooPlot.cxx.
Install the given set of observables are reference normalization variables for this frame.
These observables are e.g. later used to automatically project out observables when plotting functions on this frame. This function is only effective when called the first time on a frame
Definition at line 380 of file RooPlot.cxx.
Update our y-axis limits to accomodate an object whose spread in y is (ymin,ymax).
Use the specified y-axis label if we don't have one assigned already.
Definition at line 629 of file RooPlot.cxx.
|
protected |
|
protected |
|
protected |
|
protected |