58 _x(
"x",
"Dependent", this,
x),
59 _coefList(
"coefList",
"List of coefficients", this),
60 _expList(
"expList",
"List of exponents", this)
63 coutE(InputArguments) <<
"RooPowerSum::ctor(" << GetName()
64 <<
") ERROR: coefficient list and exponent list must be of same length" << std::endl;
76 _x(
"x", this, other.
_x),
87 std::vector<std::span<const double>> vars;
89 vars.push_back(ctx.
at(
_x));
93 for (std::size_t i = 0; i <
_coefList.size(); ++i) {
98 std::array<double, 1> args{
static_cast<double>(
_coefList.size())};
114 std::vector<double> coefs;
115 std::vector<double> exps;
127 for (
unsigned int i = 0; i < sz; ++i) {
128 retval += coefs[i] * std::pow(
x, exps[i]);
146 const double xmin =
_x.min(rangeName);
147 const double xmax =
_x.max(rangeName);
153 std::vector<double> coefs;
154 std::vector<double> exps;
166 for (
unsigned int i = 0; i < sz; ++i) {
168 retval += coefs[i] * (log(
xmax) - log(
xmin));
170 retval += coefs[i] / (exps[i] + 1) * (pow(
xmax, (exps[i] + 1)) - pow(
xmin, (exps[i] + 1)));
178 std::stringstream ss;
179 for (std::size_t i = 0; i <
_coefList.size(); ++i) {
183 ss << static_cast<RooAbsReal *>(
_coefList.at(i))->getVal();
187 ss <<
"*pow(" <<
_x.GetName() <<
",";
189 ss << static_cast<RooAbsReal *>(
_expList.at(i))->getVal();
RooAbsPdf()
Default constructor.
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
bool matchArgs(const RooArgSet &allDeps, RooArgSet &analDeps, const RooArgProxy &a, const Proxies &... proxies) const
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
RooArgList const & coefList() const
Get the list of coefficients.
double evaluate() const override
Evaluation.
int getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Advertise to RooFit that this function can be analytically integrated.
double analyticalIntegral(int code, const char *rangeName=nullptr) const override
Do the analytical integral according to the code that was returned by getAnalyticalIntegral().
void doEval(RooFit::EvalContext &) const override
Compute multiple values of Power distribution.
RooArgList const & expList() const
Get the list of exponents.
std::string getFormulaExpression(bool expand) const
void compute(Config cfg, Computer comp, std::span< double > output, VarSpan vars, ArgSpan extraArgs={})