59 _x(
"x",
"Dependent", this,
x),
60 _coefList(
"coefList",
"List of coefficients",this),
61 _lowestOrder(lowestOrder)
66 <<
") WARNING: lowestOrder must be >=0, setting value to 0" << endl ;
73 <<
" is not of type RooAbsReal" << endl ;
87 _x(
"x",
"Dependent", this,
x),
88 _coefList(
"coefList",
"List of coefficients",this),
99 _x(
"x", this, other._x),
100 _coefList(
"coefList",this,other._coefList),
101 _lowestOrder(other._lowestOrder)
123 if (!sz)
return lowestOrder ? 1. : 0.;
130 _wksp.push_back(
c->getVal(nset));
134 double retVal =
_wksp[sz - 1];
135 for (
unsigned i = sz - 1; i--; ) retVal =
_wksp[i] +
x * retVal;
136 return retVal *
std::pow(
x, lowestOrder);
167 unsigned i = 1 + lowestOrder;
168 for(
auto *
c : static_range_cast<RooAbsReal*>(
_coefList)) {
169 _wksp.push_back(
c->getVal(nset) /
double(i));
173 double min =
_wksp[sz - 1], max =
_wksp[sz - 1];
174 for (
unsigned i = sz - 1; i--; )
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
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...
Class RooPolyVar is a RooAbsReal implementing a polynomial in terms of a list of RooAbsReal coefficie...
RooPolyVar()
Default constructor.
double evaluate() const override
Calculate and return value of polynomial.
~RooPolyVar() override
Destructor.
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Advertise that we can internally integrate over x.
std::vector< double > _wksp
! do not persist
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Calculate and return analytical integral over x.
double max(const char *rname=nullptr) const
Query upper limit of range. This requires the payload to be RooAbsRealLValue or derived.
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.
RVec< PromoteTypes< T0, T1 > > pow(const T0 &x, const RVec< T1 > &v)