Docs | All | Real | Category | PDF | DataSet | Plot | Container | Misc | Aux | User |
RooPlotclass description - source file - inheritance tree (.pdf) class RooPlot : public TH1, public RooPrintable
protected: Data Membersprotected: Class DescriptionA RooPlot is a plot frame and a container for graphics objects within that frame. As a frame, it provides the TH1 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. RooPlot(Double_t xmin, Double_t xmax) : TH1(histName(),"A RooPlot",100,xmin,xmax), _items(), _plotVarClone(0), _plotVarSet(0), _normObj(0), _defYmin(1e-5), _defYmax(1) Create an empty frame with the specified x-axis limits. RooPlot(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax) : TH1(histName(),"A RooPlot",100,xmin,xmax), _items(), _plotVarClone(0), _plotVarSet(0), _normObj(0), _defYmin(1e-5), _defYmax(0) Create an empty frame with the specified x- and y-axis limits. RooPlot(const RooAbsRealLValue &var1, const RooAbsRealLValue &var2) : TH1(histName(),"A RooPlot",100,var1.getMin(),var1.getMax()), _items(), _plotVarClone(0), _plotVarSet(0), _normObj(0), _defYmin(1e-5), _defYmax(0) Create an empty frame with the specified x- and y-axis limits and with labels determined by the specified variables. RooPlot(const RooAbsRealLValue &var1, const RooAbsRealLValue &var2, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax) : TH1(histName(),"A RooPlot",100,xmin,xmax), _items(), _plotVarClone(0), _plotVarSet(0), _normObj(0), _defYmin(1e-5), _defYmax(0) Create an empty frame with the specified x- and y-axis limits and with labels determined by the specified variables. RooPlot(const char* name, const char* title, const RooAbsRealLValue &var, Double_t xmin, Double_t xmax, Int_t nbins) : TH1(name,title,nbins,xmin,xmax), _items(), _plotVarClone(0), _plotVarSet(0), _normObj(0), _defYmin(1e-5), _defYmax(1) 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) : TH1(histName(),"RooPlot",nbins,xmin,xmax), _items(), _plotVarClone(0), _plotVarSet(0), _normObj(0), _defYmin(1e-5), _defYmax(1) 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. TString histName() const ~RooPlot() Delete the items in our container and our iterator. void updateNormVars(const RooArgSet &vars) Stat_t GetBinContent(Int_t /*i*/) const A plot object is a frame without any bin contents of its own so this method always returns zero. 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. 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. 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) const 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) 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 TObject* 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 TAttLine* getAttLine(const char *name) 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. TAttFill* getAttFill(const char *name) 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. TAttMarker* getAttMarker(const char *name) 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) 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) 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 RooHist* getHist(const char* name) 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 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) 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. TString 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. 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. Bool_t getInvisible(const char* name) const void setInvisible(const char* name, Bool_t flag) TString caller(const char *method) const void SetMaximum(Double_t maximum) void SetMinimum(Double_t minimum) Double_t chiSquare(const char* curvename, const char* histname, Int_t nFitParam) const Find curve object RooHist* pullHist(const char* histname, const char* curvename) const Find curve object Double_t getFitRangeNEvt(Double_t xlo, Double_t xhi) const Inline FunctionsStat_t numItems() const void Print(Option_t* options = "0") const RooAbsRealLValue* getPlotVar() const Double_t getFitRangeNEvt(Double_t xlo, Double_t xhi) const Double_t getFitRangeBinW() const Double_t getPadFactor() const void setPadFactor(Double_t factor) const RooArgSet* getNormVars() const Double_t chiSquare(const char* pdfname, const char* histname, int nFitParam = 0) const RooPlot RooPlot(const RooPlot& other) TClass* Class() TClass* IsA() const void ShowMembers(TMemberInspector& insp, char* parent) void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b)
|
Page maintained by Wouter Verkerke and David Kirkby |