79 setRange(boundaries[0], boundaries[nbins]);
88 _ownBoundLo(
other._ownBoundLo), _ownBoundHi(
other._ownBoundHi),
89 _nbins(
other._nbins), _boundaries(
other._boundaries),
160 for (
Int_t i = 0; i <= nbins; ++i) {
161 addBoundary((
double(nbins - i) /
double(nbins)) * xlo + (
double(i) /
double(nbins)) * xhi);
172 for (std::size_t i = 0; i <
n; ++i) {
185 return (std::abs(
xl -
x) < std::abs(
xh -
x)) ?
xl :
xh;
208 coutE(InputArguments) <<
"RooBinning::setRange: ERROR low bound > high bound" << std::endl;
244 if (0 > bin || bin >=
_nbins) {
245 coutE(InputArguments) <<
"RooBinning::binEdges ERROR: bin number must be in range (0," <<
_nbins <<
")" << std::endl;
259 if (
binEdges(bin, xlo, xhi))
return 0;
260 return 0.5 * (xlo + xhi);
270 if (
binEdges(bin, xlo, xhi))
return 0;
281 if (
binEdges(bin, xlo, xhi))
return 0;
292 if (
binEdges(bin, xlo, xhi))
return 0;
301 if (
R__b.IsReading()) {
337 throw std::string(
"Unknown class version!");
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Abstract base class for RooRealVar binning definitions.
int binNumber(double x) const
Returns the bin number corresponding to the value x.
void Streamer(TBuffer &) override
Custom streamer implementing schema evolution between V1 and V2 persistent binnings.
Implements a RooAbsBinning in terms of an array of boundary values, posing no constraints on the choi...
double binLow(Int_t bin) const override
Return the lower bound of the requested bin.
double * array() const override
Return array of boundary values.
void updateBinCount()
Update the internal bin counter.
TClass * IsA() const override
Int_t _blo
! bin number for _xlo
std::vector< double > _boundaries
Boundaries.
Int_t numBoundaries() const override
Return the number boundaries.
~RooBinning() override
Destructor.
bool addBoundary(double boundary)
Add bin boundary at given value.
void binNumbers(double const *x, int *bins, std::size_t n, int coef) const override
Return sequential bin number that contains value x where bin zero is the first bin with an upper boun...
RooBinning(double xlo=-RooNumber::infinity(), double xhi=RooNumber::infinity(), const char *name=nullptr)
Constructor for an initially empty binning defining the range [xlo,xhi].
void addUniform(Int_t nBins, double xlo, double xhi)
Add array of nbins uniformly sized bins in range [xlo,xhi].
double binCenter(Int_t bin) const override
Return the position of the center of bin 'bin'.
std::string translateBinNumber(RooFit::Experimental::CodegenContext &ctx, RooAbsArg const &var, int coef) const override
double binHigh(Int_t bin) const override
Return the upper bound of the requested bin.
void Streamer(TBuffer &) override
Custom streamer that provides backward compatibility to read v1 data.
bool _ownBoundHi
Does the upper bound coincide with a bin boundary.
double * _array
! Array of boundaries
double binWidth(Int_t bin) const override
Return the width of the requested bin.
Int_t _nbins
Number of bins.
void addBoundaryPair(double boundary, double mirrorPoint=0)
Add pair of boundaries: one at 'boundary' and one at 2*mirrorPoint-boundary.
bool _ownBoundLo
Does the lower bound coincide with a bin boundary.
bool removeBoundary(double boundary)
Remove boundary at given value.
virtual double nearestBoundary(double x) const
Return the value of the nearest boundary to x.
bool binEdges(Int_t bin, double &xlo, double &xhi) const
Return upper and lower bound of bin 'bin'.
void setRange(double xlo, double xhi) override
Change the defined range associated with this binning.
A class to maintain the context for squashing of RooFit models into code.
std::string buildCall(std::string const &funcname, Args_t const &...args)
Build the code to call the function with name funcname, passing some arguments.
Buffer base class used for serializing objects.
unsigned int binNumber(double x, double coef, double const *boundaries, unsigned int nBoundaries, int nbins, int blo)
unsigned int rawBinNumber(double x, double const *boundaries, std::size_t nBoundaries)