85RooPlot::RooPlot() : _hist(0), _plotVarClone(0), _plotVarSet(0), _normVars(0), _normObj(0), _dir(0)
100 _hist(0), _items(), _plotVarClone(0), _plotVarSet(0), _normObj(0),
101 _defYmin(1
e-5), _defYmax(1), _dir(0)
125 _hist(0), _items(), _plotVarClone(0),
126 _plotVarSet(0), _normObj(0), _defYmin(1
e-5), _defYmax(0), _dir(0)
149 _plotVarClone(0), _plotVarSet(0), _normObj(0), _defYmin(1
e-5), _defYmax(0), _dir(0)
161 coutE(
InputArguments) <<
"RooPlot::RooPlot: cannot create plot for variable without finite limits: "
166 coutE(
InputArguments) <<
"RooPlot::RooPlot: cannot create plot for variable without finite limits: "
185 _hist(0), _items(), _plotVarClone(0),
186 _plotVarSet(0), _normObj(0), _defYmin(1
e-5), _defYmax(0), _dir(0)
211 _plotVarClone(0), _plotVarSet(0), _normObj(0), _defYmin(1
e-5), _defYmax(1), _dir(0)
241 _plotVarClone(0), _plotVarSet(0), _normObj(0), _defYmin(1
e-5), _defYmax(1), _dir(0)
259 TString title(
"A RooPlot of \"");
301 for(
int i=0; i<nbins; ++i){
313 TString title(
"A RooPlot of \"");
496 if(
graph->GetXaxis()->IsAlphanumeric())
return;
502 std::vector<double>
x;
503 std::vector<double>
y;
514 for(
int i=0; i<
n; ++i){
520 std::map<int,double> minValues;
521 std::map<int,double> maxValues;
525 for(
int i=0; i<
n; ++i){
528 if(maxValues.find(bin)!=maxValues.end()){
529 maxValues[bin] = std::max(maxValues[bin],
y);
533 if(minValues.find(bin)!=minValues.end()){
534 minValues[bin] = std::min(minValues[bin],
y);
545 for(
auto it = maxValues.begin(); it != maxValues.end(); ++it){
549 for(
auto it = minValues.rbegin(); it != minValues.rend(); ++it){
563 if(
graph->GetXaxis()->IsAlphanumeric())
return;
570 for(
int i=0; i<
n; ++i){
571 if(
graph->GetPoint(i,
x,
y)!=i)
break;
627 const TAxis* xa = ((
TH1*)hist)->GetXaxis() ;
642 if (!refreshNorm) return ;
650 <<
" will supercede previous event count of " <<
_normNumEvts <<
" for normalization of PDF projections" << endl ;
765 os << IsA()->GetName() ;
824 os <<
indent <<
"RooPlot " <<
GetName() <<
" (" <<
GetTitle() <<
") has no associated plot variable" << endl ;
957 coutE(
InputArguments) <<
"RooPlot::remove(" <<
GetName() <<
") ERROR: plot frame is empty, cannot remove last object" << endl ;
1009 while((obj=iter->
Next())) {
1011 (!clas || (obj->IsA()==clas))) {
1043 if(0 == link)
return kFALSE;
1058 if(0 == link)
return kFALSE;
1090 if(strlen(method)) {
1092 name.Append(method);
1148 return curve->
chiSquare(*hist,nFitParam) ;
1190 const char* extraOpt = strtok(0,
":") ;
1202 static char buf[128] ;
1203 strlcpy(buf,drawOptions,128) ;
1205 strlcat(buf,
":I",128) ;
1226 coutW(
Plotting) <<
"RooPlot::getFitRangeNEvt(" <<
GetName() <<
") WARNING: Unable to obtain event count in range "
1227 << xlo <<
" to " << xhi <<
", substituting full event count" << endl ;
1334void RooPlot::Streamer(
TBuffer &R__b)
1357 _hist->TH1::Streamer(R__b);
1360 RooPrintable::Streamer(R__b);
1385 std::unique_ptr<TLegend>
leg(
new TLegend(0.5, 0.7, 0.9, 0.9));
1386 leg->SetBorderSize(0);
1387 leg->SetFillStyle(0);
static void indent(ostringstream &buf, int indent_level)
include TDocParser_001 C image html pict1_TDocParser_001 png width
char * Form(const char *fmt,...)
virtual Double_t binLow(Int_t bin) const =0
virtual Double_t binHigh(Int_t bin) const =0
virtual Double_t binCenter(Int_t bin) const =0
virtual Int_t binNumber(Double_t x) const =0
RooAbsArg * find(const char *name) const
Find object with given name in list.
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
virtual Double_t getMax(const char *name=0) const
Get maximum of currently defined range.
Bool_t hasMax(const char *name=0) const
Check if variable has an upper bound.
virtual const RooAbsBinning & getBinning(const char *name=0, Bool_t verbose=kTRUE, Bool_t createOnTheFly=kFALSE) const =0
Retrive binning configuration with given name or default binning.
Bool_t hasMin(const char *name=0) const
Check if variable has a lower bound.
virtual Double_t getMin(const char *name=0) const
Get miniminum of currently defined range.
TString getTitle(Bool_t appendUnit=kFALSE) const
Return this variable's title string.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooArgSet * snapshot(bool deepCopy=true) const
Use RooAbsCollection::snapshot(), but return as RooArgSet.
A RooCurve is a one-dimensional graphical representation of a real-valued function.
Double_t chiSquare(const RooHist &hist, int nFitParam) const
Calculate the chi^2/NDOF of this curve with respect to the histogram 'hist' accounting nFitParam floa...
A RooHist is a graphical representation of binned data based on the TGraphAsymmErrors class.
RooHist * makeResidHist(const RooCurve &curve, bool normalize=false, bool useAverage=false) const
Create and return RooHist containing residuals w.r.t to given curve.
TObjOptLink * findLink(const char *name, const char *caller=0) const
Find the link corresponding to the named object in this list.
Bool_t moveAfter(const char *after, const char *target, const char *caller=0)
Move the target object immediately after the specified object, preserving any Option_t associated wit...
Bool_t moveBefore(const char *before, const char *target, const char *caller=0)
Move the target object immediately before the specified object, preserving any Option_t associated wi...
void initialize(const char *_rawOpt)
Initialize the DrawOpt helper class.
const char * rawOpt() const
Return the raw draw options.
A RooPlot is a plot frame and a container for graphics objects within that frame.
RooPlot()
Default constructor coverity[UNINIT_CTOR].
void SetAxisColor(Color_t color=1, Option_t *axis="X")
static Bool_t setAddDirectoryStatus(Bool_t flag)
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 aft...
void SetMarkerSize(Size_t msize=1)
RooHist * residHist(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'.
Double_t _defYmin
non-persistent
const RooPlotable * _normObj
RooAbsRealLValue * _plotVarClone
virtual void printTitle(std::ostream &os) const
Print frame title.
virtual Int_t defaultPrintContents(Option_t *opt) const
Define default print options, for a given print style.
static Bool_t _addDirStatus
non-persistent
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 bef...
void SetMarkerColor(Color_t tcolor=1)
Double_t chiSquare(int nFitParam=0) const
Shortcut for RooPlot::chiSquare(const char* pdfname, const char* histname, int nFitParam=0)
virtual void printClassName(std::ostream &os) const
Print frame class name.
void SetContourLevel(Int_t level, Double_t value)
void SetXTitle(const char *title)
void SetFillColor(Color_t fcolor)
TAttMarker * 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 obje...
void SetStats(Bool_t stats=kTRUE)
void SetNdivisions(Int_t n=510, Option_t *axis="X")
TString histName() const
Construct automatic name of internal TH1.
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).
void SetMarkerStyle(Style_t mstyle=1)
void addObject(TObject *obj, Option_t *drawOptions="", Bool_t invisible=kFALSE)
Add a generic object to this plot.
TString getDrawOptions(const char *name) const
Return the Draw() options registered for the named object.
virtual void printArgs(std::ostream &os) const
Interface for printing of object arguments.
void SetDrawOption(Option_t *option="")
Set drawing option for object.
void SetZTitle(const char *title)
Double_t GetMinimum(Double_t minval=-FLT_MAX) const
void SetContour(Int_t nlevels, const Double_t *levels=0)
Double_t getFitRangeNEvt() const
Return the number of events in the fit range.
Double_t getPadFactor() const
TAttFill * 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...
void SetTitle(const char *name)
Set the title of the RooPlot to 'title'.
virtual void printName(std::ostream &os) const
Print frame name.
void SetLabelOffset(Float_t offset=0.005, Option_t *axis="X")
void SetLineWidth(Width_t lwidth)
void SetTickLength(Float_t length=0.02, Option_t *axis="X")
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.
Double_t _normNumEvts
Pointer to normalization object ;.
TAttText * 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...
void SetLabelSize(Float_t size=0.02, Option_t *axis="X")
virtual void SetMinimum(Double_t minimum=-1111)
Set minimum value of Y axis.
void SetOption(Option_t *option=" ")
TObject * getObject(Int_t idx) const
Return the name of the object at slot 'idx' in this RooPlot.
void SetNameTitle(const char *name, const char *title)
Set the name and title of the RooPlot to 'name' and 'title'.
void SetName(const char *name)
Set the name of the RooPlot to 'name'.
void SetLabelFont(Style_t font=62, Option_t *axis="X")
void SetLineStyle(Style_t lstyle)
void setPadFactor(Double_t factor)
TAttLine * 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...
void SetTitleFont(Style_t font=62, Option_t *axis="X")
void SetLineColor(Color_t lcolor)
void SetFillStyle(Style_t fstyle)
const char * nameOf(Int_t idx) const
Return the name of the object at slot 'idx' in this RooPlot.
Bool_t getInvisible(const char *name) const
Returns true of object with given name is set to be invisible.
void updateNormVars(const RooArgSet &vars)
Install the given set of observables are reference normalization variables for this frame.
RooPlot * emptyClone(const char *name)
Return empty clone of current RooPlot.
void SetMarkerAttributes()
Double_t GetMaximum(Double_t maxval=FLT_MAX) const
static RooPlot * frame(const RooAbsRealLValue &var, Double_t xmin, Double_t xmax, Int_t nBins)
Create a new frame for a given variable in x.
virtual ~RooPlot()
Destructor.
Bool_t setDrawOptions(const char *name, TString options)
Register the specified drawing options for the named object.
void SetLabelColor(Color_t color=1, Option_t *axis="X")
void addPlotable(RooPlotable *plotable, Option_t *drawOptions="", Bool_t invisible=kFALSE, Bool_t refreshNorm=kFALSE)
Add the specified plotable object to our plot.
void setInvisible(const char *name, Bool_t flag=kTRUE)
If flag is true object with 'name' is set to be invisible i.e.
void addTH1(TH1 *hist, Option_t *drawOptions="", Bool_t invisible=kFALSE)
Add a TH1 histogram object to this plot.
virtual void SetMaximum(Double_t maximum=-1111)
Set maximum value of Y axis.
void SetYTitle(const char *title)
TObject * findObject(const char *name, const TClass *clas=0) const
Find the named object in our list of items and return a pointer to it.
void Browse(TBrowser *b)
Plot RooPlot when double-clicked in browser.
virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const
Frame detailed printing.
std::unique_ptr< TLegend > BuildLegend() const
Build a legend that contains all objects that have been drawn on the plot.
void updateFitRangeNorm(const TH1 *hist)
Update our plot normalization over our plot variable's fit range, which will be determined by the fir...
RooCurve * 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 exis...
void SetTitleSize(Float_t size=0.02, Option_t *axis="X")
static Bool_t addDirectoryStatus()
virtual void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.
void SetBarOffset(Float_t offset=0.25)
void SetBarWidth(Float_t width=0.5)
Int_t GetNdivisions(Option_t *axis="X") const
void SetAxisRange(Double_t xmin, Double_t xmax, Option_t *axis="X")
TString caller(const char *method) const
Utility function.
void initialize()
Perform initialization that is common to all constructors.
static RooPlot * frameWithLabels(const RooAbsRealLValue &var)
Create a new frame for a given variable in x, adding bin labels.
void remove(const char *name=0, Bool_t deleteToo=kTRUE)
Remove object with given name, or last object added if no name is given.
void SetTitleOffset(Float_t offset=1, Option_t *axis="X")
RooHist * 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 exis...
virtual void printValue(std::ostream &os) const
Print frame arguments.
Class RooPotable is a base class for objects that can be inserted into RooPlots and take advantage of...
Double_t getYAxisMin() const
virtual Double_t getFitRangeNEvt() const =0
Double_t getYAxisMax() const
virtual Double_t getFitRangeBinW() const =0
TObject * crossCast()
Return cast of RooPlotable as TObject.
const char * getYAxisLabel() const
RooPlotable is a 'mix-in' base class that define the standard RooFit plotting and printing methods.
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,...
void Set(Int_t n)
Set size of this array to n doubles.
Fill Area Attributes class.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetFillAttributes()
Invoke the DialogCanvas Fill attributes.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual void SetLineAttributes()
Invoke the DialogCanvas Line attributes.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetMarkerAttributes()
Invoke the DialogCanvas Marker attributes.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Class to manage histogram axis.
virtual void SetBinLabel(Int_t bin, const char *label)
Set label for bin.
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
const char * GetBinLabel(Int_t bin) const
Return label for bin.
const char * GetTitle() const
Returns title of object.
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
Using a TBrowser one can browse all ROOT objects.
Buffer base class used for serializing objects.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
TClass instances represent classes, structs and namespaces in the ROOT type system.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
virtual TList * GetList() const
virtual void Append(TObject *obj, Bool_t replace=kFALSE)
Append object to this directory.
virtual TObject * Remove(TObject *)
Remove an object from the in-memory list.
TGraph with asymmetric error bars.
A Graph is a graphics object made of two arrays X and Y with npoints each.
@ kIsSortedX
graph is sorted in X points
1-D histogram with a double per channel (see TH1 documentation)}
1-D histogram with a float per channel (see TH1 documentation)}
virtual void SetLabelFont(Style_t font=62, Option_t *axis="X")
Set font number used to draw axis labels.
virtual void SetTitle(const char *title)
See GetStatOverflows for more information.
virtual void SetTitleSize(Float_t size=0.02, Option_t *axis="X")
Set the axis' title size.
virtual void SetLabelOffset(Float_t offset=0.005, Option_t *axis="X")
Set offset between axis and axis' labels.
virtual void SetXTitle(const char *title)
virtual Int_t GetDimension() const
static void AddDirectory(Bool_t add=kTRUE)
Sets the flag controlling the automatic add of histograms in memory.
virtual void SetContourLevel(Int_t level, Double_t value)
Set value for one contour level.
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
virtual void SetNdivisions(Int_t n=510, Option_t *axis="X")
Set the number of divisions to draw an axis.
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
Return maximum value smaller than maxval of bins in the range, unless the value has been overridden b...
virtual Int_t GetNbinsX() const
virtual void SetMaximum(Double_t maximum=-1111)
virtual void SetContour(Int_t nlevels, const Double_t *levels=0)
Set the number and values of contour levels.
virtual Int_t GetNdivisions(Option_t *axis="X") const
Return the number of divisions for "axis".
virtual void SetMinimum(Double_t minimum=-1111)
virtual void SetBarWidth(Float_t width=0.5)
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
virtual Double_t GetEntries() const
Return the current number of entries.
virtual void SetZTitle(const char *title)
virtual void Draw(Option_t *option="")
Draw this histogram with options.
virtual void SetBarOffset(Float_t offset=0.25)
virtual TArrayD * GetSumw2()
virtual void SetTitleOffset(Float_t offset=1, Option_t *axis="X")
Specify a parameter offset to control the distance between the axis and the axis' title.
virtual void SetLabelColor(Color_t color=1, Option_t *axis="X")
Set axis labels color.
virtual void SetAxisColor(Color_t color=1, Option_t *axis="X")
Set color to draw the axis line and tick marks.
virtual void SetOption(Option_t *option=" ")
virtual void SetAxisRange(Double_t xmin, Double_t xmax, Option_t *axis="X")
Set the "axis" range.
virtual void SetYTitle(const char *title)
virtual void SetTitleFont(Style_t font=62, Option_t *axis="X")
Set the axis' title font.
virtual Double_t GetMinimum(Double_t minval=-FLT_MAX) const
Return minimum value larger than minval of bins in the range, unless the value has been overridden by...
virtual void SetLabelSize(Float_t size=0.02, Option_t *axis="X")
Set size of axis' labels.
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
static Bool_t AddDirectoryStatus()
Static function: cannot be inlined on Windows/NT.
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
virtual void SetTickLength(Float_t length=0.02, Option_t *axis="X")
Set the axis' tick marks length.
Iterator abstract base class.
virtual TObject * Next()=0
virtual Option_t * GetOption() const
This class displays a legend box (TPaveText) containing several legend entries.
virtual void Add(TObject *obj)
virtual TObject * Remove(TObject *obj)
Remove object from the list.
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
virtual void RecursiveRemove(TObject *obj)
Remove object from this collection and recursively remove the object from all other objects (and coll...
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const
Return a list iterator.
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
virtual void SetNameTitle(const char *name, const char *title)
Set all the TNamed parameters (name and title).
Option_t * GetOption() const
void SetOption(Option_t *option)
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void SetDrawOption(Option_t *option="")
Set drawing option for object.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
void ToLower()
Change string to lower-case.
const char * Data() const
void ToUpper()
Change string to upper case.
TString & Append(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
static constexpr double s