59 _x(
"x",
"Dependent", this,
x),
60 _coefList(
"coefList",
"List of coefficients", this),
61 _expList(
"expList",
"List of exponents", this)
64 coutE(InputArguments) <<
"RooPowerSum::ctor(" << GetName()
65 <<
") ERROR: coefficient list and exponent list must be of same length" << std::endl;
77 _x(
"x", this, other.
_x),
88 std::vector<std::span<const double>> vars;
90 vars.push_back(ctx.
at(
_x));
99 std::array<double, 1> args{
static_cast<double>(
_coefList.size())};
115 std::vector<double> coefs;
116 std::vector<double> exps;
128 for (
unsigned int i = 0;
i < sz; ++
i) {
129 retval += coefs[
i] * std::pow(
x, exps[
i]);
147 const double xmin =
_x.min(rangeName);
148 const double xmax =
_x.max(rangeName);
154 std::vector<double> coefs;
155 std::vector<double> exps;
167 for (
unsigned int i = 0;
i < sz; ++
i) {
169 retval += coefs[
i] * (log(
xmax) - log(
xmin));
171 retval += coefs[
i] / (exps[
i] + 1) * (pow(
xmax, (exps[
i] + 1)) - pow(
xmin, (exps[
i] + 1)));
179 std::stringstream ss;
184 ss << static_cast<RooAbsReal *>(
_coefList.at(
i))->getVal();
188 ss <<
"*pow(" <<
_x.GetName() <<
",";
190 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 &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
RooPowerSum implements a power law PDF of the form.
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
do not persist
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={})