60 _x(
"x",
"Dependent", this,
x),
61 _coefList(
"coefficients",
"List of coefficients",this)
67 cout <<
"RooBernstein::ctor(" <<
GetName() <<
") ERROR: coefficient " << coef->
GetName()
68 <<
" is not of type RooAbsReal" << endl ;
80 _x(
"x", this, other._x),
81 _coefList(
"coefList",this,other._coefList)
121 return (a2 *
x + a1) *
x + a0;
147void compute(
size_t batchSize,
double xmax,
double xmin,
148 double * __restrict
output,
149 const double * __restrict
const xData,
152 constexpr size_t block = 128;
153 const int nCoef = coefList.
size();
154 const int degree = nCoef-1;
156 double *
Binomial =
new double[nCoef+5];
160 for (
int i=1; i<=
degree; i++) {
164 for (
size_t i=0; i<batchSize; i+=
block) {
165 const size_t stop = (i+
block > batchSize) ? batchSize-i :
block;
168 for (
size_t j=0; j<stop; j++) {
169 powX[j] = pow_1_X[j] = 1.0;
176 for (
int k=2; k<=
degree; k+=2)
177 for (
size_t j=0; j<stop; j++)
178 pow_1_X[j] *= _1_X[j]*_1_X[j];
181 for (
size_t j=0; j<stop; j++)
182 pow_1_X[j] *= _1_X[j];
185 for (
size_t j=0; j<stop; j++)
188 for (
int k=0; k<nCoef; k++) {
189 double coef =
static_cast<RooAbsReal&
>(coefList[k]).getVal();
190 for (
size_t j=0; j<stop; j++) {
195 pow_1_X[j] *= _1_X[j];
211 batchSize = xData.size();
244 for (
int i=0; i<=
degree; ++i){
249 for (
int j=i; j<=
degree; ++j){
double pow(double, double)
RooSpan< double > makeWritableBatchUnInit(std::size_t begin, std::size_t batchSize, const RooArgSet *const normSet=nullptr, Tag_t ownerTag=kUnspecified)
Make a batch and return a span pointing to the pdf-local memory.
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
RooFIter fwdIterator() const
One-time forward iterator.
Storage_t::size_type size() const
TIterator * createIterator(Bool_t dir=kIterForward) const
TIterator-style iteration over contained elements.
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
std::pair< double, double > getRange(const char *name=0) const
Get low and high bound of the variable.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Bool_t matchArgs(const RooArgSet &allDeps, RooArgSet &numDeps, const RooArgProxy &a) const
Utility function for use in getAnalyticalIntegral().
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
BatchHelpers::BatchData _batchData
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Bernstein basis polynomials are positive-definite in the range [0,1].
Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
std::string _refRangeName
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
RooSpan< double > evaluateBatch(std::size_t begin, std::size_t batchSize) const
Evaluate function for a batch of input data points.
RooTemplateProxy< RooAbsRealLValue > _x
void selectNormalizationRange(const char *rangeName=0, Bool_t force=kFALSE)
Force use of a given normalisation range.
Double_t evaluate() const
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
A one-time forward iterator working on RooLinkedList or RooAbsCollection.
RooAbsArg * next()
Return next element or nullptr if at end.
RooListProxy is the concrete proxy for RooArgList objects.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Reimplementation of standard RooArgList::add()
A simple container to hold a batch of data values.
double min(const char *rname=0) const
Query lower limit of range. This requires the payload to be RooAbsRealLValue or derived.
double max(const char *rname=0) const
Query upper limit of range. This requires the payload to be RooAbsRealLValue or derived.
RooSpan< const typename T::value_type > getValBatch(std::size_t begin, std::size_t batchSize) const
Retrieve a batch of real or category data.
Iterator abstract base class.
virtual TObject * Next()=0
virtual const char * GetName() const
Returns name of object.
static constexpr double s
static constexpr double degree
Double_t Binomial(Int_t n, Int_t k)
Calculate the binomial coefficient n over k.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Double_t SignalingNaN()
Returns a signaling NaN as defined by IEEE 754](http://en.wikipedia.org/wiki/NaN#Signaling_NaN)
static void output(int code)