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)
109 return (a2 *
x + a1) *
x + a0;
135void compute(
size_t batchSize,
double xmax,
double xmin,
136 double * __restrict
output,
137 const double * __restrict
const xData,
140 constexpr size_t block = 128;
141 const int nCoef = coefList.
size();
142 const int degree = nCoef-1;
144 double *
Binomial =
new double[nCoef+5];
148 for (
int i=1; i<=
degree; i++) {
152 for (
size_t i=0; i<batchSize; i+=
block) {
153 const size_t stop = (i+
block > batchSize) ? batchSize-i :
block;
156 for (
size_t j=0; j<stop; j++) {
157 powX[j] = pow_1_X[j] = 1.0;
164 for (
int k=2; k<=
degree; k+=2)
165 for (
size_t j=0; j<stop; j++)
166 pow_1_X[j] *= _1_X[j]*_1_X[j];
169 for (
size_t j=0; j<stop; j++)
170 pow_1_X[j] *= _1_X[j];
173 for (
size_t j=0; j<stop; j++)
176 for (
int k=0; k<nCoef; k++) {
177 double coef =
static_cast<RooAbsReal&
>(coefList[k]).getVal();
178 for (
size_t j=0; j<stop; j++) {
183 pow_1_X[j] *= _1_X[j];
199 batchSize = xData.size();
212 if (rangeName && strlen(rangeName)) {
231 for (
int i=0; i<=
degree; ++i){
236 for (
int j=i; j<=
degree; ++j){
double pow(double, double)
RooSpan< double > makeWritableBatchUnInit(std::size_t begin, std::size_t batchSize)
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 R__SUGGEST_ALTERNATIVE("begin()
One-time forward iterator.
Storage_t::size_type size() const
TIterator * createIterator(Bool_t dir=kIterForward) const R__SUGGEST_ALTERNATIVE("begin()
TIterator-style iteration over contained elements.
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.
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
No analytical calculation available (yet) of integrals over subranges.
RooSpan< double > evaluateBatch(std::size_t begin, std::size_t batchSize) const
Evaluate function for a batch of input data points.
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_t min(const char *rname=0) const
Query lower limit of range. This requires the payload to be RooAbsRealLValue or derived.
RooSpan< const double > getValBatch(std::size_t begin, std::size_t batchSize) const
Double_t max(const char *rname=0) const
Query upper limit of range. This requires the payload to be RooAbsRealLValue or derived.
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.
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)