#ifndef ROO_PLOT
#define ROO_PLOT
#include <float.h>
#include "RooList.h"
#include "RooPrintable.h"
#include "TNamed.h"
class TH1 ;
class RooAbsReal;
class RooAbsRealLValue;
class RooArgSet ;
class RooHist;
class RooCurve ;
class RooPlotable;
class TDirectory ;
class TAttLine;
class TAttFill;
class TAttMarker;
class TAttText;
class TClass ;
class TAxis;
class TBrowser ;
class RooPlot : public TNamed, public RooPrintable {
public:
RooPlot() ;
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, Double_t xmax);
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();
RooPlot* emptyClone(const char* name) ;
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;
virtual void Draw(Option_t *options= 0);
TAxis* GetXaxis() const ;
TAxis* GetYaxis() 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 = "") ;
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) ;
void SetTitle(const char *name) ;
void SetNameTitle(const char *name, const char* title) ;
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 ;
TObject *findObject(const char *name, const TClass* clas=0) const;
TObject* getObject(Int_t idx) const ;
Stat_t numItems() const {return _items.GetSize();}
void addPlotable(RooPlotable *plotable, Option_t *drawOptions= "", Bool_t invisible=kFALSE, Bool_t refreshNorm=kFALSE);
void addObject(TObject* obj, Option_t* drawOptions= "", Bool_t invisible=kFALSE);
void addTH1(TH1 *hist, Option_t* drawOptions= "", Bool_t invisible=kFALSE);
void remove(const char* name=0, Bool_t deleteToo=kTRUE) ;
virtual void printName(ostream& os) const ;
virtual void printTitle(ostream& os) const ;
virtual void printClassName(ostream& os) const ;
virtual void printArgs(ostream& os) const ;
virtual void printValue(ostream& os) const ;
virtual void printMultiline(ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
virtual Int_t defaultPrintContents(Option_t* opt) const ;
inline virtual void Print(Option_t *options= 0) const {
printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
}
inline RooAbsRealLValue *getPlotVar() const { return _plotVarClone; }
inline Double_t getFitRangeNEvt() const { return _normNumEvts; }
Double_t getFitRangeNEvt(Double_t xlo, Double_t xhi) const ;
inline Double_t getFitRangeBinW() const { return _normBinWidth; }
inline Double_t getPadFactor() const { return _padFactor; }
inline void setPadFactor(Double_t factor) { if(factor >= 0) _padFactor= factor; }
void updateNormVars(const RooArgSet &vars);
const RooArgSet *getNormVars() const { return _normVars; }
TAttLine *getAttLine(const char *name=0) const;
TAttFill *getAttFill(const char *name=0) const;
TAttMarker *getAttMarker(const char *name=0) const;
TAttText *getAttText(const char *name=0) const;
RooCurve* getCurve(const char* name=0) const ;
RooHist* getHist(const char* name=0) const ;
Bool_t drawBefore(const char *before, const char *target);
Bool_t drawAfter(const char *after, const char *target);
TString getDrawOptions(const char *name) const;
Bool_t setDrawOptions(const char *name, TString options);
Bool_t getInvisible(const char* name) const ;
void setInvisible(const char* name, Bool_t flag=kTRUE) ;
virtual void SetMaximum(Double_t maximum = -1111) ;
virtual void SetMinimum(Double_t minimum = -1111) ;
Double_t chiSquare(int nFitParam=0) const { return chiSquare(0,0,nFitParam) ; }
Double_t chiSquare(const char* pdfname, const char* histname, int nFitParam=0) const ;
RooHist* residHist(const char* histname=0, const char* pdfname=0,bool normalize=false) const ;
RooHist* pullHist(const char* histname=0, const char* pdfname=0) const { return residHist(histname,pdfname,true); }
void Browse(TBrowser *b) ;
protected:
RooPlot(const RooPlot& other);
class DrawOpt {
public:
DrawOpt(const char* _rawOpt=0) : invisible(kFALSE) { drawOptions[0] = 0 ; initialize(_rawOpt) ; }
void initialize(const char* _rawOpt) ;
const char* rawOpt() const ;
char drawOptions[128] ;
Bool_t invisible ;
} ;
void initialize();
TString histName() const ;
TString caller(const char *method) const;
void updateYAxis(Double_t ymin, Double_t ymax, const char *label= "");
void updateFitRangeNorm(const TH1* hist);
void updateFitRangeNorm(const RooPlotable* rp, Bool_t refeshNorm=kFALSE);
TH1* _hist ;
RooList _items;
Double_t _padFactor;
RooAbsRealLValue *_plotVarClone;
RooArgSet *_plotVarSet;
RooArgSet *_normVars;
const RooPlotable* _normObj ;
Double_t _normNumEvts;
Double_t _normBinWidth;
TIterator *_iterator;
Double_t _defYmin ;
Double_t _defYmax ;
TDirectory* _dir ;
ClassDef(RooPlot,2)
};
#endif