53 _xlo(0), _xhi(0), _ownBoundLo(
kTRUE), _ownBoundHi(
kTRUE),
64 _xlo(0), _xhi(0), _ownBoundLo(
kTRUE), _ownBoundHi(
kTRUE),
78 _xlo(0), _xhi(0), _ownBoundLo(
kTRUE), _ownBoundHi(
kTRUE),
83 setRange(boundaries[0], boundaries[nbins]);
92 _ownBoundLo(other._ownBoundLo), _ownBoundHi(other._ownBoundHi),
93 _nbins(other._nbins), _boundaries(other._boundaries), _array(0),
111 std::vector<Double_t>::iterator it =
140 std::vector<Double_t>::iterator it = std::lower_bound(
_boundaries.begin(),
174 for (
Int_t i = 0; i <= nbins; ++i)
175 addBoundary((
double(nbins - i) /
double(nbins)) * xlo +
176 (
double(i) /
double(nbins)) * xhi);
196 std::vector<Double_t>::const_iterator it = std::lower_bound(
258 std::vector<Double_t>::const_iterator it = std::lower_bound(
271 if (0 > bin || bin >=
_nbins) {
285 if (
binEdges(bin, xlo, xhi))
return 0;
286 return 0.5 * (xlo + xhi);
295 if (
binEdges(bin, xlo, xhi))
return 0;
305 if (
binEdges(bin, xlo, xhi))
return 0;
315 if (
binEdges(bin, xlo, xhi))
return 0;
359 throw std::string(
"Unknown class version!");
RooAbsBinning is the abstract base class for RooRealVar binning definitions.
void Streamer(TBuffer &) override
Custom streamer implementing schema evolution between V1 and V2 persistent binnings.
Class RooBinning is an implements RooAbsBinning in terms of an array of boundary values,...
Bool_t hasBoundary(Double_t boundary)
Check if boundary exists at given value.
Int_t rawBinNumber(Double_t x) const override
Return sequential bin number that contains value x where bin zero is the first bin that is defined,...
void setRange(Double_t xlo, Double_t xhi) override
Change the defined range associated with this binning.
void updateBinCount()
Update the internal bin counter.
Double_t binHigh(Int_t bin) const override
Return the upper bound of the requested bin.
Double_t binLow(Int_t bin) const override
Return the lower bound of the requested bin.
Double_t binWidth(Int_t bin) const override
Return the width of the requested bin.
TClass * IsA() const override
Double_t * _array
! Array of boundaries
Double_t _xlo
Lower bound.
Bool_t _ownBoundLo
Does the lower bound coincide with a bin boundary.
Int_t _blo
! bin number for _xlo
Bool_t _ownBoundHi
Does the upper bound coincide with a bin boundary.
Bool_t binEdges(Int_t bin, Double_t &xlo, Double_t &xhi) const
Return upper and lower bound of bin 'bin'.
void addUniform(Int_t nBins, Double_t xlo, Double_t xhi)
Add array of nbins uniformly sized bins in range [xlo,xhi].
Bool_t addBoundary(Double_t boundary)
Add bin boundary at given value.
void addBoundaryPair(Double_t boundary, Double_t mirrorPoint=0)
Add pair of boundaries: one at 'boundary' and one at 2*mirrorPoint-boundary.
Int_t numBoundaries() const override
Return the number boundaries.
Bool_t removeBoundary(Double_t boundary)
Remove boundary at given value.
~RooBinning() override
Destructor.
RooBinning(Double_t xlo=-RooNumber::infinity(), Double_t xhi=RooNumber::infinity(), const char *name=0)
Constructor for an initially empty binning defining the range [xlo,xhi].
Double_t * array() const override
Return array of boundary values.
void Streamer(TBuffer &) override
Custom streamer that provides backward compatibility to read v1 data.
Int_t _nbins
Numer of bins.
virtual Double_t nearestBoundary(Double_t x) const
Return the value of the nearest boundary to x.
Double_t binCenter(Int_t bin) const override
Return the position of the center of bin 'bin'.
Int_t binNumber(Double_t x) const override
Return sequential bin number that contains value x where bin zero is the first bin with an upper boun...
Double_t _xhi
Upper bound.
std::vector< Double_t > _boundaries
Boundaries.
RooDouble is a minimal implementation of a TObject holding a Double_t value.
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
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Iterator abstract base class.
virtual TObject * Next()=0
void Streamer(TBuffer &) override
Stream all objects in the collection to or from the I/O buffer.
TIterator * MakeIterator(Bool_t dir=kIterForward) const override
Return a list iterator.
RVec< PromoteType< T > > abs(const RVec< T > &v)