52 _x(
"x",
"Dependent", this,
x),
53 _coefList(
"coefList",
"List of coefficients", this),
54 _lowestOrder(lowestOrder)
58 coutE(InputArguments) <<
"RooPolyVar::ctor(" <<
GetName()
59 <<
") WARNING: lowestOrder must be >=0, setting value to 0" << std::endl;
71 _x(
"x",
"Dependent", this,
x),
72 _coefList(
"coefList",
"List of coefficients", this),
82 _x(
"x", this, other._x),
83 _coefList(
"coefList", this, other._coefList),
84 _lowestOrder(other._lowestOrder)
96 wksp.push_back(
c->getVal(nset));
124 std::vector<std::span<const double>> vars;
125 vars.reserve(coefs.
size() + 2);
130 std::array<double, RooBatchCompute::bufferSize> zeros;
131 std::array<double, RooBatchCompute::bufferSize> ones;
132 std::fill_n(zeros.data(), zeros.size(), 0.0);
133 std::fill_n(ones.data(), ones.size(), 1.0);
134 std::span<const double> zerosSpan{zeros.data(), 1};
135 std::span<const double> onesSpan{ones.data(), 1};
137 vars.push_back(i == 0 ? onesSpan : zerosSpan);
141 vars.push_back(ctx.
at(coef));
143 vars.push_back(ctx.
at(&
x));
144 std::array<double, 1> extraArgs{
double(vars.size() - 1)};
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Storage_t::size_type size() const
bool addTyped(const RooAbsCollection &list, bool silent=false)
Adds elements of a given RooAbsCollection to the container if they match the specified type.
Abstract base class for objects that represent a real value and implements functionality common to al...
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.
std::span< const double > at(RooAbsArg const *arg, RooAbsArg const *caller=nullptr)
std::span< double > output()
RooBatchCompute::Config config(RooAbsArg const *arg) const
A RooAbsReal implementing a polynomial in terms of a list of RooAbsReal coefficients.
static void fillCoeffValues(std::vector< double > &wksp, RooListProxy const &coefList)
void doEval(RooFit::EvalContext &) const override
Compute multiple values of Polynomial.
double evaluate() const override
Calculate and return value of polynomial.
RooRealProxy const & x() const
RooArgList const & coefList() const
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
static void doEvalImpl(RooAbsArg const *caller, RooFit::EvalContext &, RooAbsReal const &x, RooArgList const &coefs, int lowestOrder)
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.
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.
void compute(Config cfg, Computer comp, std::span< double > output, VarSpan vars, ArgSpan extraArgs={})
double polynomial(double const *coeffs, int nCoeffs, int lowestOrder, double x)
In pdfMode, a coefficient for the constant term of 1.0 is implied if lowestOrder > 0.
double polynomialIntegral(double const *coeffs, int nCoeffs, int lowestOrder, double xMin, double xMax)
In pdfMode, a coefficient for the constant term of 1.0 is implied if lowestOrder > 0.