29 class RooAbsRealLValue;
44 class RooPlot :
public TNamed,
public RooPrintable {
47 RooPlot(
const char* name,
const char* title,
const RooAbsRealLValue &var, Double_t xmin, Double_t xmax, Int_t nBins) ;
48 RooPlot(
const RooAbsRealLValue &var, Double_t xmin, Double_t xmax, Int_t nBins);
49 RooPlot(Double_t xmin, Double_t xmax);
50 RooPlot(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax);
51 RooPlot(
const RooAbsRealLValue &var1,
const RooAbsRealLValue &var2);
52 RooPlot(
const RooAbsRealLValue &var1,
const RooAbsRealLValue &var2,
53 Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax);
56 static RooPlot* frame(
const RooAbsRealLValue &var, Double_t xmin, Double_t xmax, Int_t nBins);
57 static RooPlot* frameWithLabels(
const RooAbsRealLValue &var);
59 RooPlot* emptyClone(
const char* name) ;
62 virtual Stat_t GetBinContent(Int_t)
const;
63 virtual Stat_t GetBinContent(Int_t, Int_t)
const;
64 virtual Stat_t GetBinContent(Int_t, Int_t, Int_t)
const;
65 virtual void Draw(Option_t *options= 0);
68 TAxis* GetXaxis()
const ;
69 TAxis* GetYaxis()
const ;
70 Int_t GetNbinsX()
const ;
71 Int_t GetNdivisions(Option_t* axis =
"X")
const ;
72 Double_t GetMinimum(Double_t minval = -FLT_MAX)
const ;
73 Double_t GetMaximum(Double_t maxval = FLT_MAX)
const ;
75 void SetAxisColor(Color_t color = 1, Option_t* axis =
"X") ;
76 void SetAxisRange(Double_t xmin, Double_t xmax, Option_t* axis =
"X") ;
77 void SetBarOffset(Float_t offset = 0.25) ;
78 void SetBarWidth(Float_t width = 0.5) ;
79 void SetContour(Int_t nlevels,
const Double_t* levels = 0) ;
80 void SetContourLevel(Int_t level, Double_t value) ;
81 void SetDrawOption(Option_t* option =
"") ;
82 void SetFillAttributes() ;
83 void SetFillColor(Color_t fcolor) ;
84 void SetFillStyle(Style_t fstyle) ;
85 void SetLabelColor(Color_t color = 1, Option_t* axis =
"X") ;
86 void SetLabelFont(Style_t font = 62, Option_t* axis =
"X") ;
87 void SetLabelOffset(Float_t offset = 0.005, Option_t* axis =
"X") ;
88 void SetLabelSize(Float_t size = 0.02, Option_t* axis =
"X") ;
89 void SetLineAttributes() ;
90 void SetLineColor(Color_t lcolor) ;
91 void SetLineStyle(Style_t lstyle) ;
92 void SetLineWidth(Width_t lwidth) ;
93 void SetMarkerAttributes() ;
94 void SetMarkerColor(Color_t tcolor = 1) ;
95 void SetMarkerSize(Size_t msize = 1) ;
96 void SetMarkerStyle(Style_t mstyle = 1) ;
97 void SetName(
const char *name) ;
98 void SetTitle(
const char *name) ;
99 void SetNameTitle(
const char *name,
const char* title) ;
100 void SetNdivisions(Int_t n = 510, Option_t* axis =
"X") ;
101 void SetOption(Option_t* option =
" ") ;
102 void SetStats(Bool_t stats = kTRUE) ;
103 void SetTickLength(Float_t length = 0.02, Option_t* axis =
"X") ;
104 void SetTitleFont(Style_t font = 62, Option_t* axis =
"X") ;
105 void SetTitleOffset(Float_t offset = 1, Option_t* axis =
"X") ;
106 void SetTitleSize(Float_t size = 0.02, Option_t* axis =
"X") ;
107 void SetXTitle(
const char* title) ;
108 void SetYTitle(
const char* title) ;
109 void SetZTitle(
const char* title) ;
112 const char* nameOf(Int_t idx)
const ;
113 TObject *findObject(
const char *name,
const TClass* clas=0)
const;
114 TObject* getObject(Int_t idx)
const ;
115 Stat_t numItems()
const {
return _items.GetSize();}
117 void addPlotable(RooPlotable *plotable, Option_t *drawOptions=
"", Bool_t invisible=kFALSE, Bool_t refreshNorm=kFALSE);
118 void addObject(TObject* obj, Option_t* drawOptions=
"", Bool_t invisible=kFALSE);
119 void addTH1(TH1 *hist, Option_t* drawOptions=
"", Bool_t invisible=kFALSE);
120 std::unique_ptr<TLegend> BuildLegend()
const;
122 void remove(
const char* name=0, Bool_t deleteToo=kTRUE) ;
125 virtual void printName(std::ostream& os)
const ;
126 virtual void printTitle(std::ostream& os)
const ;
127 virtual void printClassName(std::ostream& os)
const ;
128 virtual void printArgs(std::ostream& os)
const ;
129 virtual void printValue(std::ostream& os)
const ;
130 virtual void printMultiline(std::ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent=
"")
const ;
132 virtual Int_t defaultPrintContents(Option_t* opt)
const ;
134 inline virtual void Print(Option_t *options= 0)
const {
135 printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
139 inline RooAbsRealLValue *getPlotVar()
const {
return _plotVarClone; }
141 inline Double_t getFitRangeNEvt()
const {
return _normNumEvts; }
142 Double_t getFitRangeNEvt(Double_t xlo, Double_t xhi)
const ;
144 inline Double_t getFitRangeBinW()
const {
return _normBinWidth; }
145 inline Double_t getPadFactor()
const {
return _padFactor; }
146 inline void setPadFactor(Double_t factor) {
if(factor >= 0) _padFactor= factor; }
147 void updateNormVars(
const RooArgSet &vars);
148 const RooArgSet *getNormVars()
const {
return _normVars; }
151 TAttLine *getAttLine(
const char *name=0)
const;
152 TAttFill *getAttFill(
const char *name=0)
const;
153 TAttMarker *getAttMarker(
const char *name=0)
const;
154 TAttText *getAttText(
const char *name=0)
const;
157 RooCurve* getCurve(
const char* name=0)
const ;
158 RooHist* getHist(
const char* name=0)
const ;
162 Bool_t drawBefore(
const char *before,
const char *target);
163 Bool_t drawAfter(
const char *after,
const char *target);
166 TString getDrawOptions(
const char *name)
const;
167 Bool_t setDrawOptions(
const char *name, TString options);
169 Bool_t getInvisible(
const char* name)
const ;
170 void setInvisible(
const char* name, Bool_t flag=kTRUE) ;
172 virtual void SetMaximum(Double_t maximum = -1111) ;
173 virtual void SetMinimum(Double_t minimum = -1111) ;
176 Double_t chiSquare(
int nFitParam=0)
const {
return chiSquare(0,0,nFitParam) ; }
177 Double_t chiSquare(
const char* pdfname,
const char* histname,
int nFitParam=0)
const ;
179 RooHist* residHist(
const char* histname=0,
const char* pdfname=0,
bool normalize=
false,
bool useAverage=kFALSE)
const ;
181 RooHist* pullHist(
const char* histname=0,
const char* pdfname=0,
bool useAverage=
false)
const
182 {
return residHist(histname,pdfname,
true,useAverage); }
184 void Browse(TBrowser *b) ;
186 static Bool_t addDirectoryStatus() ;
187 static Bool_t setAddDirectoryStatus(Bool_t flag) ;
191 RooPlot(
const RooPlot& other);
196 DrawOpt(
const char* _rawOpt=0) : invisible(kFALSE) { drawOptions[0] = 0 ; initialize(_rawOpt) ; }
197 void initialize(
const char* _rawOpt) ;
198 const char* rawOpt()
const ;
200 char drawOptions[128] ;
206 TString histName()
const ;
207 TString caller(
const char *method)
const;
208 void updateYAxis(Double_t ymin, Double_t ymax,
const char *label=
"");
209 void updateFitRangeNorm(
const TH1* hist);
210 void updateFitRangeNorm(
const RooPlotable* rp, Bool_t refeshNorm=kFALSE);
216 RooAbsRealLValue *_plotVarClone;
217 RooArgSet *_plotVarSet;
218 RooArgSet *_normVars;
220 const RooPlotable* _normObj ;
221 Double_t _normNumEvts;
222 Double_t _normBinWidth;
224 TIterator *_iterator;
231 static Bool_t _addDirStatus ;