library: libRooFit #include "RooPlot.h" |
RooPlot
class description - header file - source file - inheritance tree (.pdf)
protected:
RooPlot(const RooPlot& other)
TString caller(const char* method) const
TString histName() const
void initialize()
void updateFitRangeNorm(const TH1* hist)
void updateFitRangeNorm(const RooPlotable* rp, Bool_t refeshNorm = kFALSE)
void updateYAxis(Double_t ymin, Double_t ymax, const char* label = "")
public:
RooPlot(const char* name, const char* title, const RooAbsRealLValue& var, Double_t xmin, Double_t xmax, Int_t nBins)
RooPlot(const RooAbsRealLValue& var, Double_t xmin, Double_t xmax, Int_t nBins)
RooPlot(Double_t xmin = 0, Double_t xmax = 1)
RooPlot(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax)
RooPlot(const RooAbsRealLValue& var1, const RooAbsRealLValue& var2)
RooPlot(const RooAbsRealLValue& var1, const RooAbsRealLValue& var2, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax)
virtual ~RooPlot()
void addObject(TObject* obj, Option_t* drawOptions = "", Bool_t invisible = kFALSE)
void addPlotable(RooPlotable* plotable, Option_t* drawOptions = "", Bool_t invisible = kFALSE, Bool_t refreshNorm = kFALSE)
void addTH1(TH1* hist, Option_t* drawOptions = "", Bool_t invisible = kFALSE)
Double_t chiSquare(int nFitParam = 0) const
Double_t chiSquare(const char* pdfname, const char* histname, int nFitParam = 0) const
static TClass* Class()
virtual void Draw(Option_t* options = "0")
Bool_t drawAfter(const char* after, const char* target)
Bool_t drawBefore(const char* before, const char* target)
TObject* findObject(const char* name, const TClass* clas = 0) const
TAttFill* getAttFill(const char* name = "0") const
TAttLine* getAttLine(const char* name = "0") const
TAttMarker* getAttMarker(const char* name = "0") const
TAttText* getAttText(const char* name = "0") const
virtual Stat_t GetBinContent(Int_t) const
virtual Stat_t GetBinContent(Int_t, Int_t) const
virtual Stat_t GetBinContent(Int_t, Int_t, Int_t) const
RooCurve* getCurve(const char* name = "0") const
TString getDrawOptions(const char* name) const
Double_t getFitRangeBinW() const
Double_t getFitRangeNEvt() const
Double_t getFitRangeNEvt(Double_t xlo, Double_t xhi) const
RooHist* getHist(const char* name = "0") const
Bool_t getInvisible(const char* name) const
const RooArgSet* getNormVars() const
TObject* getObject(Int_t idx) const
Double_t getPadFactor() const
RooAbsRealLValue* getPlotVar() const
virtual TClass* IsA() const
const char* nameOf(Int_t idx) const
Stat_t numItems() const
virtual void Print(Option_t* options = "0") const
virtual void printToStream(ostream& os, RooPrintable::PrintOption opt = Standard, TString indent = ) const
RooHist* pullHist(const char* histname = "0", const char* pdfname = "0") const
RooHist* residHist(const char* histname = "0", const char* pdfname = "0", bool normalize = false) const
Bool_t setDrawOptions(const char* name, TString options)
void setInvisible(const char* name, Bool_t flag = kTRUE)
virtual void SetMaximum(Double_t maximum = -1111)
virtual void SetMinimum(Double_t minimum = -1111)
void setPadFactor(Double_t factor)
virtual void ShowMembers(TMemberInspector& insp, char* parent)
virtual void Streamer(TBuffer& b)
void StreamerNVirtual(TBuffer& b)
void updateNormVars(const RooArgSet& vars)
protected:
RooList _items A list of the items we contain.
Double_t _padFactor Scale our y-axis to _padFactor of our maximum contents.
RooAbsRealLValue* _plotVarClone A clone of the variable we are plotting.
RooArgSet* _plotVarSet A list owning the cloned tree nodes of the plotVarClone
RooArgSet* _normVars Variables that PDF plots should be normalized over
const RooPlotable* _normObj ! Pointer to normalization object ;
Double_t _normNumEvts Number of events in histogram (for normalization)
Double_t _normBinWidth Histogram bin width (for normalization)
TIterator* _iterator ! non-persistent
Double_t _defYmin Default minimum for Yaxis (as calculated from contents)
Double_t _defYmax Default maximum for Yaxis (as calculated from contents)
RooPlot(const char* name, const char* title, const RooAbsRealLValue &var, Double_t xmin, Double_t xmax, Int_t nbins)
Create an empty frame with its title and x-axis range and label taken
from the specified real variable. We keep a clone of the variable
so that we do not depend on its lifetime and are decoupled from
any later changes to its state.
RooPlot(const RooAbsRealLValue &var, Double_t xmin, Double_t xmax, Int_t nbins)
Create an empty frame with its title and x-axis range and label taken
from the specified real variable. We keep a clone of the variable
so that we do not depend on its lifetime and are decoupled from
any later changes to its state.
void initialize()
Perform initialization that is common to all constructors.
void addObject(TObject *obj, Option_t *drawOptions, Bool_t invisible)
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.
void addTH1(TH1 *hist, Option_t *drawOptions, Bool_t invisible)
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. Note that histograms
should probably not be drawn with error bars since they will not
be calculated correctly for bins with low statistics, and will
not be accounted for in the automatic y-axis range adjustment. To
histogram data in a RooDataSet without these problems, use
RooDataSet::plotOn(). The caller transfers ownership of the
object with this call, and the object will be deleted when its
containing plot object is destroyed.
void addPlotable(RooPlotable *plotable, Option_t *drawOptions, Bool_t invisible, Bool_t refreshNorm)
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.
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 updateFitRangeNorm(const RooPlotable* rp, Bool_t refreshNorm)
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). Use the specified y-axis label if we don't
have one assigned already.
void Draw(Option_t *options)
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.
void printToStream(ostream& os, PrintOption opt, TString indent)
Print info about this plot object to the specified stream.
Standard: plot variable and number of contained objects
Shape: list of our contained objects
const char* nameOf(Int_t idx)
Return the name of the object at slot 'idx' in this RooPlot.
If the given index is out of range, return a null pointer
TObject* getObject(Int_t idx)
Return the name of the object at slot 'idx' in this RooPlot.
If the given index is out of range, return a null pointer
TAttLine * getAttLine(const char *name)
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.
TAttFill * getAttFill(const char *name)
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.
TAttMarker * getAttMarker(const char *name)
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)
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)
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
RooHist* getHist(const char* name)
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 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.
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.
Returns kFALSE if either object does not exist.
TObject * findObject(const char *name, const TClass* clas)
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.
TString getDrawOptions(const char *name)
Return the Draw() options registered for the named object. Return
an empty string if the named object cannot be found.
Bool_t setDrawOptions(const char *name, TString options)
Register the specified drawing options for the named object.
Return kFALSE if the named object cannot be found.
RooHist* residHist(const char* histname, const char* curvename,bool normalize)
Find curve object