ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
RooPlot Class Reference

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 settting 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.

RooPlot *frame = x.frame() ;
data.plotOn(frame) ;
pdf.plotOn(frame) ;

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.

Definition at line 41 of file RooPlot.h.

Classes

class  DrawOpt
 

Public Member Functions

 RooPlot ()
 Default constructor coverity[UNINIT_CTOR]. More...
 
 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'. More...
 
 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'. More...
 
 RooPlot (Double_t xmin, Double_t xmax)
 Constructor of RooPlot with range [xmin,xmax]. More...
 
 RooPlot (Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax)
 Construct of a two-dimensioanl RooPlot with ranges [xmin,xmax] x [ymin,ymax]. More...
 
 RooPlot (const RooAbsRealLValue &var1, const RooAbsRealLValue &var2)
 Construct a two-dimensional RooPlot with ranges and properties taken from variables var1 and var2. More...
 
 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]. More...
 
virtual ~RooPlot ()
 Destructor. More...
 
RooPlotemptyClone (const char *name)
 Return empty clone of current RooPlot. More...
 
virtual Stat_t GetBinContent (Int_t) const
 A plot object is a frame without any bin contents of its own so this method always returns zero. More...
 
virtual Stat_t GetBinContent (Int_t, Int_t) const
 A plot object is a frame without any bin contents of its own so this method always returns zero. More...
 
virtual Stat_t GetBinContent (Int_t, Int_t, Int_t) const
 A plot object is a frame without any bin contents of its own so this method always returns zero. More...
 
virtual void Draw (Option_t *options=0)
 Draw this plot and all of the elements it contains. More...
 
TAxisGetXaxis () const
 
TAxisGetYaxis () const
 
Int_t GetNbinsX () const
 
Int_t GetNdivisions (Option_t *axis="X") const
 
Double_t GetMinimum (Double_t minval=-FLT_MAX) const
 
Double_t GetMaximum (Double_t maxval=FLT_MAX) const
 
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 SetDrawOption (Option_t *option="")
 Set drawing option for object. More...
 
void SetFillAttributes ()
 
void SetFillColor (Color_t fcolor)
 
void SetFillStyle (Style_t fstyle)
 
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)
 
void SetName (const char *name)
 Set the name of the RooPlot to 'name'. More...
 
void SetTitle (const char *name)
 Set the title of the RooPlot to 'title'. More...
 
void SetNameTitle (const char *name, const char *title)
 Set the name and title of the RooPlot to 'name' and 'title'. More...
 
void SetNdivisions (Int_t n=510, Option_t *axis="X")
 
void SetOption (Option_t *option=" ")
 
void SetStats (Bool_t stats=kTRUE)
 
void SetTickLength (Float_t length=0.02, Option_t *axis="X")
 
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)
 
const char * nameOf (Int_t idx) const
 Return the name of the object at slot 'idx' in this RooPlot. More...
 
TObjectfindObject (const char *name, const TClass *clas=0) const
 Find the named object in our list of items and return a pointer to it. More...
 
TObjectgetObject (Int_t idx) const
 Return the name of the object at slot 'idx' in this RooPlot. More...
 
Stat_t numItems () const
 
void addPlotable (RooPlotable *plotable, Option_t *drawOptions="", Bool_t invisible=kFALSE, Bool_t refreshNorm=kFALSE)
 Add the specified plotable object to our plot. More...
 
void addObject (TObject *obj, Option_t *drawOptions="", Bool_t invisible=kFALSE)
 Add a generic object to this plot. More...
 
void addTH1 (TH1 *hist, Option_t *drawOptions="", Bool_t invisible=kFALSE)
 Add a TH1 histogram object to this plot. More...
 
void remove (const char *name=0, Bool_t deleteToo=kTRUE)
 Remove object with given name, or last object added if no name is given. More...
 
virtual void printName (std::ostream &os) const
 Print frame name. More...
 
virtual void printTitle (std::ostream &os) const
 Print frame title. More...
 
virtual void printClassName (std::ostream &os) const
 Print frame class name. More...
 
virtual void printArgs (std::ostream &os) const
 Interface for printing of object arguments. More...
 
virtual void printValue (std::ostream &os) const
 Print frame arguments. More...
 
virtual void printMultiline (std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const
 Frame detailed printing. More...
 
virtual Int_t defaultPrintContents (Option_t *opt) const
 Define default print options, for a given print style. More...
 
virtual void Print (Option_t *options=0) const
 Print TNamed name and title. More...
 
RooAbsRealLValuegetPlotVar () const
 
Double_t getFitRangeNEvt () const
 
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. More...
 
Double_t getFitRangeBinW () const
 
Double_t getPadFactor () const
 
void setPadFactor (Double_t factor)
 
void updateNormVars (const RooArgSet &vars)
 Install the given set of observables are reference normalization variables for this frame. More...
 
const RooArgSetgetNormVars () const
 
TAttLinegetAttLine (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. More...
 
TAttFillgetAttFill (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. More...
 
TAttMarkergetAttMarker (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. More...
 
TAttTextgetAttText (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. More...
 
RooCurvegetCurve (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. More...
 
RooHistgetHist (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. More...
 
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. More...
 
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. More...
 
TString getDrawOptions (const char *name) const
 Return the Draw() options registered for the named object. More...
 
Bool_t setDrawOptions (const char *name, TString options)
 Register the specified drawing options for the named object. More...
 
Bool_t getInvisible (const char *name) const
 Returns true of object with given name is set to be invisible. More...
 
void setInvisible (const char *name, Bool_t flag=kTRUE)
 If flag is true object with 'name' is set to be invisible i.e. More...
 
virtual void SetMaximum (Double_t maximum=-1111)
 Set maximum value of Y axis. More...
 
virtual void SetMinimum (Double_t minimum=-1111)
 Set minimum value of Y axis. More...
 
Double_t chiSquare (int nFitParam=0) const
 
Double_t chiSquare (const char *pdfname, const char *histname, int nFitParam=0) const
 Calculate and return reduced chi-squared of curve with given name with respect to histogram with given name. More...
 
RooHistresidHist (const char *histname=0, const char *pdfname=0, bool normalize=false, bool useAverage=kFALSE) const
 Return a RooHist containing the residuals of histogram 'histname' with respect to curve 'curvename'. More...
 
RooHistpullHist (const char *histname=0, const char *pdfname=0, bool useAverage=false) const
 
void Browse (TBrowser *b)
 Plot RooPlot when double-clicked in browser. More...
 
- Public Member Functions inherited from TNamed
 TNamed ()
 
 TNamed (const char *name, const char *title)
 
 TNamed (const TString &name, const TString &title)
 
 TNamed (const TNamed &named)
 
TNamedoperator= (const TNamed &rhs)
 TNamed assignment operator. More...
 
virtual ~TNamed ()
 
virtual void Clear (Option_t *option="")
 Set name and title to empty strings (""). More...
 
virtual TObjectClone (const char *newname="") const
 Make a clone of an object using the Streamer facility. More...
 
virtual Int_t Compare (const TObject *obj) const
 Compare two TNamed objects. More...
 
virtual void Copy (TObject &named) const
 Copy this to obj. More...
 
virtual void FillBuffer (char *&buffer)
 Encode TNamed into output buffer. More...
 
virtual const char * GetName () const
 Returns name of object. More...
 
virtual const char * GetTitle () const
 Returns title of object. More...
 
virtual ULong_t Hash () const
 Return hash value for this object. More...
 
virtual Bool_t IsSortable () const
 
virtual void ls (Option_t *option="") const
 List TNamed name and title. More...
 
virtual Int_t Sizeof () const
 Return size of the TNamed part of the TObject. More...
 
- Public Member Functions inherited from TObject
 TObject ()
 
 TObject (const TObject &object)
 TObject copy ctor. More...
 
TObjectoperator= (const TObject &rhs)
 TObject assignment operator. More...
 
virtual ~TObject ()
 TObject destructor. More...
 
virtual void AppendPad (Option_t *option="")
 Append graphics object to current pad. More...
 
virtual const char * ClassName () const
 Returns name of class to which the object belongs. More...
 
virtual void Delete (Option_t *option="")
 Delete this object. More...
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 Computes distance from point (px,py) to the object. More...
 
virtual void DrawClass () const
 Draw class inheritance tree of the class to which this object belongs. More...
 
virtual TObjectDrawClone (Option_t *option="") const
 Draw a clone of this object in the current pad. More...
 
virtual void Dump () const
 Dump contents of object on stdout. More...
 
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. More...
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=0)
 Execute method on this object with parameters stored in the TObjArray. More...
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 Execute action corresponding to an event at (px,py). More...
 
virtual TObjectFindObject (const char *name) const
 Must be redefined in derived classes. More...
 
virtual TObjectFindObject (const TObject *obj) const
 Must be redefined in derived classes. More...
 
virtual Option_tGetDrawOption () const
 Get option used by the graphics system to draw this object. More...
 
virtual UInt_t GetUniqueID () const
 Return the unique object id. More...
 
virtual const char * GetIconName () const
 Returns mime type name of object. More...
 
virtual Option_tGetOption () const
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 Returns string containing info about the object at position (px,py). More...
 
virtual Bool_t HandleTimer (TTimer *timer)
 Execute action in response of a timer timing out. More...
 
virtual Bool_t InheritsFrom (const char *classname) const
 Returns kTRUE if object inherits from class "classname". More...
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 Returns kTRUE if object inherits from TClass cl. More...
 
virtual void Inspect () const
 Dump contents of this object in a graphics canvas. More...
 
virtual Bool_t IsFolder () const
 Returns kTRUE in case object contains browsable objects (like containers or lists of other objects). More...
 
virtual Bool_t IsEqual (const TObject *obj) const
 Default equal comparison (objects are equal if they have the same address in memory). More...
 
Bool_t IsOnHeap () const
 
Bool_t IsZombie () const
 
virtual Bool_t Notify ()
 This method must be overridden to handle object notification. More...
 
virtual void Paint (Option_t *option="")
 This method must be overridden if a class wants to paint itself. More...
 
virtual void Pop ()
 Pop on object drawn in a pad to the top of the display list. More...
 
virtual Int_t Read (const char *name)
 Read contents of object with specified name from the current directory. More...
 
virtual void RecursiveRemove (TObject *obj)
 Recursively remove this object from a list. More...
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 Save this object in the file specified by filename. More...
 
virtual void SavePrimitive (std::ostream &out, Option_t *option="")
 Save a primitive as a C++ statement(s) on output stream "out". More...
 
virtual void SetUniqueID (UInt_t uid)
 Set the unique object id. More...
 
virtual void UseCurrentStyle ()
 Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked. More...
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0)
 Write this object to the current directory. More...
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const
 Write this object to the current directory. More...
 
voidoperator new (size_t sz)
 
voidoperator new[] (size_t sz)
 
voidoperator new (size_t sz, void *vp)
 
voidoperator new[] (size_t sz, void *vp)
 
void operator delete (void *ptr)
 Operator delete. More...
 
void operator delete[] (void *ptr)
 Operator delete []. More...
 
void SetBit (UInt_t f, Bool_t set)
 Set or unset the user status bits as specified in f. More...
 
void SetBit (UInt_t f)
 
void ResetBit (UInt_t f)
 
Bool_t TestBit (UInt_t f) const
 
Int_t TestBits (UInt_t f) const
 
void InvertBit (UInt_t f)
 
virtual void Info (const char *method, const char *msgfmt,...) const
 Issue info message. More...
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 Issue warning message. More...
 
virtual void Error (const char *method, const char *msgfmt,...) const
 Issue error message. More...
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 Issue system error message. More...
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 Issue fatal error message. More...
 
void AbstractMethod (const char *method) const
 Use this method to implement an "abstract" method that you don't want to leave purely abstract. More...
 
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). More...
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 Use this method to declare a method obsolete. More...
 
- Public Member Functions inherited from RooPrintable
 RooPrintable ()
 
virtual ~RooPrintable ()
 
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'. More...
 
virtual void printAddress (std::ostream &os) const
 Print class name of object. More...
 
virtual void printExtras (std::ostream &os) const
 Interface to print extras of object. More...
 
virtual void printTree (std::ostream &os, TString indent="") const
 Interface for tree structure printing of object. More...
 
virtual StyleOption defaultPrintStyle (Option_t *opt) const
 

Static Public Member Functions

static Bool_t addDirectoryStatus ()
 
static Bool_t setAddDirectoryStatus (Bool_t flag)
 
- Static Public Member Functions inherited from TObject
static Long_t GetDtorOnly ()
 Return destructor only flag. More...
 
static void SetDtorOnly (void *obj)
 Set destructor only flag. More...
 
static Bool_t GetObjectStat ()
 Get status of object stat flag. More...
 
static void SetObjectStat (Bool_t stat)
 Turn on/off tracking of objects in the TObjectTable. More...
 
- Static Public Member Functions inherited from RooPrintable
static std::ostream & defaultPrintStream (std::ostream *os=0)
 Return a reference to the current default stream to use in Print(). More...
 
static void nameFieldLength (Int_t newLen)
 Set length of field reserved from printing name of RooAbsArgs in multi-line collection printing to given amount. More...
 

Protected Member Functions

 RooPlot (const RooPlot &other)
 
void initialize ()
 Perform initialization that is common to all constructors. More...
 
TString histName () const
 Construct automatic name of internal TH1. More...
 
TString caller (const char *method) const
 Utility function. More...
 
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). More...
 
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. More...
 
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. More...
 
- Protected Member Functions inherited from TObject
void MakeZombie ()
 
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 Interface to ErrorHandler (protected). More...
 

Protected Attributes

TH1_hist
 
RooList _items
 
Double_t _padFactor
 
RooAbsRealLValue_plotVarClone
 
RooArgSet_plotVarSet
 
RooArgSet_normVars
 
const RooPlotable_normObj
 
Double_t _normNumEvts
 Pointer to normalization object ;. More...
 
Double_t _normBinWidth
 
TIterator_iterator
 
Double_t _defYmin
 non-persistent More...
 
Double_t _defYmax
 
TDirectory_dir
 
- Protected Attributes inherited from TNamed
TString fName
 
TString fTitle
 

Static Protected Attributes

static Bool_t _addDirStatus = kTRUE
 non-persistent More...
 
- Static Protected Attributes inherited from RooPrintable
static Int_t _nameLength
 

Additional Inherited Members

- Public Types inherited from TObject
enum  EStatusBits {
  kCanDelete = BIT(0), kMustCleanup = BIT(3), kObjInCanvas = BIT(3), kIsReferenced = BIT(4),
  kHasUUID = BIT(5), kCannotPick = BIT(6), kNoContextMenu = BIT(8), kInvalidObject = BIT(13)
}
 
enum  { kIsOnHeap = 0x01000000, kNotDeleted = 0x02000000, kZombie = 0x04000000, kBitMask = 0x00ffffff }
 
enum  { kSingleKey = BIT(0), kOverwrite = BIT(1), kWriteDelete = BIT(2) }
 
- Public Types inherited from RooPrintable
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
}
 

#include <RooPlot.h>

Inheritance diagram for RooPlot:
[legend]

Constructor & Destructor Documentation

RooPlot::RooPlot ( )

Default constructor coverity[UNINIT_CTOR].

Definition at line 87 of file RooPlot.cxx.

Referenced by emptyClone().

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 211 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 241 of file RooPlot.cxx.

RooPlot::RooPlot ( Double_t  xmin,
Double_t  xmax 
)

Constructor of RooPlot with range [xmin,xmax].

Definition at line 101 of file RooPlot.cxx.

RooPlot::RooPlot ( Double_t  xmin,
Double_t  xmax,
Double_t  ymin,
Double_t  ymax 
)

Construct of a two-dimensioanl RooPlot with ranges [xmin,xmax] x [ymin,ymax].

Definition at line 126 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 149 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 185 of file RooPlot.cxx.

RooPlot::~RooPlot ( )
virtual

Destructor.

Definition at line 325 of file RooPlot.cxx.

RooPlot::RooPlot ( const RooPlot other)
protected

Member Function Documentation

Bool_t RooPlot::addDirectoryStatus ( )
static

Definition at line 79 of file RooPlot.cxx.

Referenced by RooStats::SamplingDistPlot::Draw(), initialize(), and RooPlot().

void RooPlot::addObject ( TObject obj,
Option_t drawOptions = "",
Bool_t  invisible = kFALSE 
)

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.

Referenced by addTH1(), ClassImp(), RooMinuit::contour(), RooMinimizer::contour(), RooStats::SamplingDistPlot::Draw(), RooStats::LikelihoodIntervalPlot::Draw(), RooStats::HistFactory::FormatFrameForLikelihood(), RooAbsPdf::paramOn(), RooFitResult::plotOn(), and RooAbsData::statOn().

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 447 of file RooPlot.cxx.

Referenced by RooAbsData::plotAsymOn(), RooAbsReal::plotAsymOn(), RooAbsData::plotEffOn(), RooFitResult::plotOn(), RooAbsData::plotOn(), RooAbsReal::plotOn(), RooAbsReal::plotOnWithErrorBand(), RooDataSet::plotOnXY(), and RooUnitTest::runCompTests().

void RooPlot::addTH1 ( TH1 hist,
Option_t drawOptions = "",
Bool_t  invisible = kFALSE 
)

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.

Referenced by RooStats::SamplingDistPlot::Draw().

void RooPlot::Browse ( TBrowser b)
virtual

Plot RooPlot when double-clicked in browser.

Reimplemented from TObject.

Definition at line 1164 of file RooPlot.cxx.

TString RooPlot::caller ( const char *  method) const
protected

Utility function.

Definition at line 934 of file RooPlot.cxx.

Referenced by drawAfter(), drawBefore(), getDrawOptions(), getInvisible(), setDrawOptions(), and setInvisible().

Double_t RooPlot::chiSquare ( int  nFitParam = 0) const
inline

Definition at line 166 of file RooPlot.h.

Referenced by chiSquare().

Double_t RooPlot::chiSquare ( const char *  curvename,
const char *  histname,
int  nFitParam = 0 
) const

Calculate and return reduced chi-squared of curve with given name with respect to histogram with given name.

If nFitParam is non-zero, it is used to reduce the number of degrees of freedom for a chi^2 for a curve that was fitted to the data with that number of floating parameters

Definition at line 972 of file RooPlot.cxx.

Int_t RooPlot::defaultPrintContents ( Option_t opt) const
virtual

Define default print options, for a given print style.

Reimplemented from RooPrintable.

Definition at line 1110 of file RooPlot.cxx.

Referenced by Print().

void RooPlot::Draw ( Option_t option = 0)
virtual
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 833 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 822 of file RooPlot.cxx.

Referenced by RooAbsReal::plotOn(), and RooAbsReal::plotOnWithErrorBand().

RooPlot * RooPlot::emptyClone ( const char *  name)

Return empty clone of current RooPlot.

Definition at line 275 of file RooPlot.cxx.

TObject * RooPlot::findObject ( const char *  name,
const TClass clas = 0 
) const

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 850 of file RooPlot.cxx.

Referenced by chiSquare(), getAttFill(), getAttLine(), getAttMarker(), getAttText(), getCurve(), getHist(), RooAbsData::plotOn(), RooAbsReal::plotOn(), remove(), residHist(), and RooUnitTest::runCompTests().

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 744 of file RooPlot.cxx.

Referenced by RooAbsData::plotOn(), RooAbsReal::plotOn(), and RooAbsReal::plotOnWithErrorBand().

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 734 of file RooPlot.cxx.

Referenced by RooAbsData::plotOn(), RooAbsReal::plotOn(), RooAbsReal::plotOnWithErrorBand(), and RooUnitTest::runCompTests().

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 754 of file RooPlot.cxx.

Referenced by RooAbsData::plotOn(), and RooUnitTest::runCompTests().

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 764 of file RooPlot.cxx.

Stat_t RooPlot::GetBinContent ( Int_t  ) const
virtual

A plot object is a frame without any bin contents of its own so this method always returns zero.

Definition at line 360 of file RooPlot.cxx.

Stat_t RooPlot::GetBinContent ( Int_t  ,
Int_t   
) const
virtual

A plot object is a frame without any bin contents of its own so this method always returns zero.

Definition at line 369 of file RooPlot.cxx.

Stat_t RooPlot::GetBinContent ( Int_t  ,
Int_t  ,
Int_t   
) const
virtual

A plot object is a frame without any bin contents of its own so this method always returns zero.

Definition at line 379 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 775 of file RooPlot.cxx.

Referenced by ClassImp(), RooStats::HistFactory::FitModelAndPlot(), RooAbsReal::plotOn(), and RooAbsReal::plotOnWithErrorBand().

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 875 of file RooPlot.cxx.

Double_t RooPlot::getFitRangeBinW ( ) const
inline

Definition at line 135 of file RooPlot.h.

Referenced by RooAbsPdf::plotOn(), and RooAbsData::plotOn().

Double_t RooPlot::getFitRangeNEvt ( ) const
inline

Definition at line 133 of file RooPlot.h.

Referenced by getFitRangeNEvt(), RooAbsPdf::plotOn(), and RooAbsData::plotOn().

Double_t RooPlot::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.

An error will be printed if this function is used on sub-ranges while that information is not available

Definition at line 1061 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 785 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 902 of file RooPlot.cxx.

Double_t RooPlot::GetMaximum ( Double_t  maxval = FLT_MAX) const

Definition at line 1122 of file RooPlot.cxx.

Referenced by RooAbsReal::plotOnWithErrorBand(), and updateYAxis().

Double_t RooPlot::GetMinimum ( Double_t  minval = -FLT_MAX) const

Definition at line 1121 of file RooPlot.cxx.

Referenced by RooAbsReal::plotOnWithErrorBand(), and updateYAxis().

Int_t RooPlot::GetNbinsX ( ) const
Int_t RooPlot::GetNdivisions ( Option_t axis = "X") const

Definition at line 1120 of file RooPlot.cxx.

const RooArgSet* RooPlot::getNormVars ( ) const
inline
TObject * RooPlot::getObject ( 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 718 of file RooPlot.cxx.

Referenced by RooAbsReal::plotOn(), and RooAbsReal::plotOnWithErrorBand().

Double_t RooPlot::getPadFactor ( ) const
inline

Definition at line 136 of file RooPlot.h.

Referenced by updateYAxis().

RooAbsRealLValue* RooPlot::getPlotVar ( ) const
inline
TAxis * RooPlot::GetXaxis ( ) const
TAxis * RooPlot::GetYaxis ( ) const
TString RooPlot::histName ( ) const
protected

Construct automatic name of internal TH1.

Definition at line 312 of file RooPlot.cxx.

Referenced by initialize(), and RooPlot().

void RooPlot::initialize ( void  )
protected

Perform initialization that is common to all constructors.

Definition at line 286 of file RooPlot.cxx.

Referenced by RooPlot().

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 702 of file RooPlot.cxx.

Stat_t RooPlot::numItems ( ) const
inline

Definition at line 109 of file RooPlot.h.

Referenced by RooAbsReal::plotOn(), and RooAbsReal::plotOnWithErrorBand().

virtual void RooPlot::Print ( Option_t option = 0) const
inlinevirtual

Print TNamed name and title.

Reimplemented from TNamed.

Definition at line 127 of file RooPlot.h.

Referenced by RooUnitTest::runCompTests().

void RooPlot::printArgs ( std::ostream &  os) const
virtual

Interface for printing of object arguments.

Arguments are loosely defined as external server objects in this context

Reimplemented from RooPrintable.

Definition at line 619 of file RooPlot.cxx.

void RooPlot::printClassName ( std::ostream &  os) const
virtual

Print frame class name.

Reimplemented from RooPrintable.

Definition at line 610 of file RooPlot.cxx.

void RooPlot::printMultiline ( std::ostream &  os,
Int_t  content,
Bool_t  verbose = kFALSE,
TString  indent = "" 
) const
virtual

Frame detailed printing.

Reimplemented from RooPrintable.

Definition at line 662 of file RooPlot.cxx.

void RooPlot::printName ( std::ostream &  os) const
virtual

Print frame name.

Reimplemented from RooPrintable.

Definition at line 592 of file RooPlot.cxx.

void RooPlot::printTitle ( std::ostream &  os) const
virtual

Print frame title.

Reimplemented from RooPrintable.

Definition at line 601 of file RooPlot.cxx.

void RooPlot::printValue ( std::ostream &  os) const
virtual

Print frame arguments.

Reimplemented from RooPrintable.

Definition at line 633 of file RooPlot.cxx.

RooHist* RooPlot::pullHist ( const char *  histname = 0,
const char *  pdfname = 0,
bool  useAverage = false 
) const
inline

Definition at line 170 of file RooPlot.h.

void RooPlot::remove ( const char *  name = 0,
Bool_t  deleteToo = kTRUE 
)

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 797 of file RooPlot.cxx.

Referenced by RooAbsReal::plotOnWithErrorBand().

RooHist * RooPlot::residHist ( const char *  histname = 0,
const char *  curvename = 0,
bool  normalize = false,
bool  useAverage = kFALSE 
) const

Return a RooHist containing the residuals of histogram 'histname' with respect to curve 'curvename'.

If normalize is true the residuals are divided by the error on the histogram, effectively returning a pull histogram

Definition at line 998 of file RooPlot.cxx.

Referenced by pullHist().

Bool_t RooPlot::setAddDirectoryStatus ( Bool_t  flag)
static

Definition at line 80 of file RooPlot.cxx.

Referenced by RooStats::SamplingDistPlot::Draw(), and RooWorkspace::import().

void RooPlot::SetAxisColor ( Color_t  color = 1,
Option_t axis = "X" 
)

Definition at line 1125 of file RooPlot.cxx.

void RooPlot::SetAxisRange ( Double_t  xmin,
Double_t  xmax,
Option_t axis = "X" 
)

Definition at line 1126 of file RooPlot.cxx.

void RooPlot::SetBarOffset ( Float_t  offset = 0.25)

Definition at line 1127 of file RooPlot.cxx.

void RooPlot::SetBarWidth ( Float_t  width = 0.5)

Definition at line 1128 of file RooPlot.cxx.

void RooPlot::SetContour ( Int_t  nlevels,
const Double_t levels = 0 
)

Definition at line 1129 of file RooPlot.cxx.

void RooPlot::SetContourLevel ( Int_t  level,
Double_t  value 
)

Definition at line 1130 of file RooPlot.cxx.

void RooPlot::SetDrawOption ( Option_t option = "")
virtual

Set drawing option for object.

This option only affects the drawing style and is stored in the option field of the TObjOptLink supporting a TPad's primitive list (TList). Note that it does not make sense to call object.SetDrawOption(option) before having called object.Draw().

Reimplemented from TObject.

Definition at line 1131 of file RooPlot.cxx.

Bool_t RooPlot::setDrawOptions ( const char *  name,
TString  options 
)

Register the specified drawing options for the named object.

Return kFALSE if the named object cannot be found.

Definition at line 887 of file RooPlot.cxx.

void RooPlot::SetFillAttributes ( )

Definition at line 1132 of file RooPlot.cxx.

void RooPlot::SetFillColor ( Color_t  fcolor)

Definition at line 1133 of file RooPlot.cxx.

void RooPlot::SetFillStyle ( Style_t  fstyle)

Definition at line 1134 of file RooPlot.cxx.

void RooPlot::setInvisible ( const char *  name,
Bool_t  flag = kTRUE 
)

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 915 of file RooPlot.cxx.

void RooPlot::SetLabelColor ( Color_t  color = 1,
Option_t axis = "X" 
)

Definition at line 1135 of file RooPlot.cxx.

void RooPlot::SetLabelFont ( Style_t  font = 62,
Option_t axis = "X" 
)

Definition at line 1136 of file RooPlot.cxx.

void RooPlot::SetLabelOffset ( Float_t  offset = 0.005,
Option_t axis = "X" 
)

Definition at line 1137 of file RooPlot.cxx.

void RooPlot::SetLabelSize ( Float_t  size = 0.02,
Option_t axis = "X" 
)

Definition at line 1138 of file RooPlot.cxx.

void RooPlot::SetLineAttributes ( )

Definition at line 1139 of file RooPlot.cxx.

void RooPlot::SetLineColor ( Color_t  lcolor)

Definition at line 1140 of file RooPlot.cxx.

void RooPlot::SetLineStyle ( Style_t  lstyle)

Definition at line 1141 of file RooPlot.cxx.

void RooPlot::SetLineWidth ( Width_t  lwidth)

Definition at line 1142 of file RooPlot.cxx.

void RooPlot::SetMarkerAttributes ( )

Definition at line 1143 of file RooPlot.cxx.

void RooPlot::SetMarkerColor ( Color_t  tcolor = 1)

Definition at line 1144 of file RooPlot.cxx.

void RooPlot::SetMarkerSize ( Size_t  msize = 1)

Definition at line 1145 of file RooPlot.cxx.

void RooPlot::SetMarkerStyle ( Style_t  mstyle = 1)

Definition at line 1146 of file RooPlot.cxx.

void RooPlot::SetMaximum ( Double_t  maximum = -1111)
virtual
void RooPlot::SetMinimum ( Double_t  minimum = -1111)
virtual
void RooPlot::SetName ( const char *  name)
virtual

Set the name of the RooPlot to 'name'.

Reimplemented from TNamed.

Definition at line 1077 of file RooPlot.cxx.

Referenced by emptyClone(), RooAbsRealLValue::frame(), initialize(), RooUnitTest::regPlot(), and StandardHistFactoryPlotsWithCategories().

void RooPlot::SetNameTitle ( const char *  name,
const char *  title 
)
virtual

Set the name and title of the RooPlot to 'name' and 'title'.

Reimplemented from TNamed.

Definition at line 1088 of file RooPlot.cxx.

void RooPlot::SetNdivisions ( Int_t  n = 510,
Option_t axis = "X" 
)

Definition at line 1147 of file RooPlot.cxx.

void RooPlot::SetOption ( Option_t option = " ")

Definition at line 1148 of file RooPlot.cxx.

void RooPlot::setPadFactor ( Double_t  factor)
inline

Definition at line 137 of file RooPlot.h.

Referenced by initialize().

void RooPlot::SetStats ( Bool_t  stats = kTRUE)

Definition at line 1149 of file RooPlot.cxx.

void RooPlot::SetTickLength ( Float_t  length = 0.02,
Option_t axis = "X" 
)

Definition at line 1150 of file RooPlot.cxx.

void RooPlot::SetTitle ( const char *  name)
virtual
void RooPlot::SetTitleFont ( Style_t  font = 62,
Option_t axis = "X" 
)

Definition at line 1151 of file RooPlot.cxx.

void RooPlot::SetTitleOffset ( Float_t  offset = 1,
Option_t axis = "X" 
)

Definition at line 1152 of file RooPlot.cxx.

void RooPlot::SetTitleSize ( Float_t  size = 0.02,
Option_t axis = "X" 
)

Definition at line 1153 of file RooPlot.cxx.

void RooPlot::SetXTitle ( const char *  title)

Definition at line 1154 of file RooPlot.cxx.

Referenced by RooPlot().

void RooPlot::SetYTitle ( const char *  title)

Definition at line 1155 of file RooPlot.cxx.

Referenced by RooPlot(), and StandardHistFactoryPlotsWithCategories().

void RooPlot::SetZTitle ( const char *  title)

Definition at line 1156 of file RooPlot.cxx.

void RooPlot::updateFitRangeNorm ( const TH1 hist)
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 472 of file RooPlot.cxx.

Referenced by addPlotable(), and addTH1().

void RooPlot::updateFitRangeNorm ( const RooPlotable rp,
Bool_t  refreshNorm = kFALSE 
)
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 484 of file RooPlot.cxx.

void RooPlot::updateNormVars ( const RooArgSet vars)

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 350 of file RooPlot.cxx.

Referenced by RooAbsData::plotAsymOn(), RooAbsData::plotEffOn(), RooAbsPdf::plotOn(), and RooAbsData::plotOn().

void RooPlot::updateYAxis ( Double_t  ymin,
Double_t  ymax,
const char *  label = "" 
)
protected

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 527 of file RooPlot.cxx.

Referenced by addPlotable(), and addTH1().

Member Data Documentation

Bool_t RooPlot::_addDirStatus = kTRUE
staticprotected

non-persistent

Definition at line 220 of file RooPlot.h.

Double_t RooPlot::_defYmax
protected

Definition at line 216 of file RooPlot.h.

Referenced by SetMaximum(), and updateYAxis().

Double_t RooPlot::_defYmin
protected

non-persistent

Definition at line 215 of file RooPlot.h.

Referenced by SetMinimum(), and updateYAxis().

TDirectory* RooPlot::_dir
protected

Definition at line 218 of file RooPlot.h.

Referenced by initialize(), RooPlot(), SetName(), SetNameTitle(), and ~RooPlot().

TH1* RooPlot::_hist
protected
RooList RooPlot::_items
protected
TIterator* RooPlot::_iterator
protected

Definition at line 213 of file RooPlot.h.

Referenced by Draw(), initialize(), printMultiline(), printValue(), RooPlot(), and ~RooPlot().

Double_t RooPlot::_normBinWidth
protected

Definition at line 211 of file RooPlot.h.

Referenced by getFitRangeBinW(), initialize(), RooPlot(), and updateFitRangeNorm().

Double_t RooPlot::_normNumEvts
protected

Pointer to normalization object ;.

Definition at line 210 of file RooPlot.h.

Referenced by getFitRangeNEvt(), initialize(), and updateFitRangeNorm().

const RooPlotable* RooPlot::_normObj
protected

Definition at line 209 of file RooPlot.h.

Referenced by getFitRangeNEvt(), and updateFitRangeNorm().

RooArgSet* RooPlot::_normVars
protected

Definition at line 207 of file RooPlot.h.

Referenced by getNormVars(), initialize(), updateNormVars(), and ~RooPlot().

Double_t RooPlot::_padFactor
protected

Definition at line 204 of file RooPlot.h.

Referenced by getPadFactor(), and setPadFactor().

RooAbsRealLValue* RooPlot::_plotVarClone
protected

Definition at line 205 of file RooPlot.h.

Referenced by emptyClone(), getPlotVar(), histName(), printArgs(), printMultiline(), and RooPlot().

RooArgSet* RooPlot::_plotVarSet
protected

Definition at line 206 of file RooPlot.h.

Referenced by RooPlot(), and ~RooPlot().

Collaboration diagram for RooPlot:
[legend]

The documentation for this class was generated from the following files: