66 _x(
"x",
"Dependent", this,
x),
67 _coefList(
"coefList",
"List of coefficients",this),
68 _lowestOrder(lowestOrder)
72 coutE(InputArguments) <<
"RooPolynomial::ctor(" <<
GetName()
73 <<
") WARNING: lowestOrder must be >=0, setting value to 0" << std::endl;
79 coutE(InputArguments) <<
"RooPolynomial::ctor(" <<
GetName() <<
") ERROR: coefficient " << coef->GetName()
80 <<
" is not of type RooAbsReal" << std::endl;
92 _x(
"x",
"Dependent", this,
x),
93 _coefList(
"coefList",
"List of coefficients",this),
102 _x(
"x", this, other._x),
103 _coefList(
"coefList",this,other._coefList),
104 _lowestOrder(other._lowestOrder)
120 for (
auto *
c : static_range_cast<RooAbsReal *>(
_coefList)) {
121 _wksp.push_back(
c->getVal(nset));
125 double retVal =
_wksp[sz - 1];
126 for (
unsigned i = sz - 1; i--; ) retVal =
_wksp[i] +
x * retVal;
160 for (
auto *
c : static_range_cast<RooAbsReal *>(
_coefList)) {
165 double min =
_wksp[sz - 1], max =
_wksp[sz - 1];
166 for (
unsigned i = sz - 1; i--; )
Int_t getSize() const
Return the number of elements in the collection.
const RooArgSet * nset() const
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
bool matchArgs(const RooArgSet &allDeps, RooArgSet &numDeps, const RooArgProxy &a) const
Utility function for use in getAnalyticalIntegral().
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
bool add(const RooAbsArg &var, bool valueServer, bool shapeServer, bool silent)
Overloaded RooCollection_t::add() method insert object into set and registers object as server to own...
static void computeBatchImpl(cudaStream_t *, double *output, size_t nEvents, RooFit::Detail::DataMap const &, RooAbsReal const &x, RooArgList const &coefs, int lowestOrder)
RooPolynomial implements a polynomial p.d.f of the form.
double evaluate() const override
do not persist
std::vector< double > _wksp
RooAbsReal const & x() const
Get the x variable.
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Do the analytical integral according to the code that was returned by getAnalyticalIntegral().
int lowestOrder() const
Return the order for the first coefficient in the list.
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Advertise to RooFit that this function can be analytically integrated.
RooArgList const & coefList() const
Get the coefficient list.
void computeBatch(cudaStream_t *, double *output, size_t nEvents, RooFit::Detail::DataMap const &) const override
Compute multiple values of Polynomial.
double max(const char *rname=nullptr) const
Query upper limit of range. This requires the payload to be RooAbsRealLValue or derived.
const T & arg() const
Return reference to object held in proxy.
double min(const char *rname=nullptr) const
Query lower limit of range. This requires the payload to be RooAbsRealLValue or derived.
const char * GetName() const override
Returns name of object.