58 _x(
"x",
"Dependent", this,
x),
59 _coefList(
"coefList",
"List of coefficients", this),
60 _expList(
"expList",
"List of exponents", this)
64 <<
") ERROR: coefficient list and exponent list must be of same length" << std::endl;
69 coutE(InputArguments) <<
"RooPower::ctor(" <<
GetName() <<
") ERROR: coefficient " << coef->
GetName()
70 <<
" is not of type RooAbsReal" << std::endl;
77 coutE(InputArguments) <<
"RooPower::ctor(" <<
GetName() <<
") ERROR: coefficient " << exp->GetName()
78 <<
" is not of type RooAbsReal" << std::endl;
90 _x(
"x", this, other._x),
91 _coefList(
"coefList", this, other._coefList),
92 _expList(
"expList", this, other._expList)
103 vars.push_back(dataMap.
at(
_x));
129 std::vector<double> coefs;
130 std::vector<double> exps;
142 for (
unsigned int i = 0; i < sz; ++i) {
143 retval += coefs[i] * std::pow(
x, exps[i]);
168 std::vector<double> coefs;
169 std::vector<double> exps;
181 for (
unsigned int i = 0; i < sz; ++i) {
183 retval += coefs[i] * (log(
xmax) - log(
xmin));
185 retval += coefs[i] / (exps[i] + 1) * (pow(
xmax, (exps[i] + 1)) - pow(
xmin, (exps[i] + 1)));
193 std::stringstream ss;
198 ss << static_cast<RooAbsReal *>(
_coefList.
at(i))->getVal();
203 ss << static_cast<RooAbsReal *>(
_expList.
at(i))->getVal();
Storage_t::size_type size() const
const RooArgSet * nset() const
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
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.
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
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...
RooBatchCompute::Config config(RooAbsArg const *arg) const
std::span< const double > at(RooAbsArg const *arg, RooAbsArg const *caller=nullptr)
RooPower implements a power law PDF of the form.
std::string getFormulaExpression(bool expand) const
void computeBatch(double *output, size_t size, RooFit::Detail::DataMap const &) const override
do not persist
RooArgList const & coefList() const
Get the list of coefficients.
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().
double evaluate() const override
Evaluation.
RooArgList const & expList() const
Get the list of exponents.
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.
std::vector< std::span< const double > > VarVector
std::vector< double > ArgVector
void compute(Config cfg, Computer comp, RestrictArr output, size_t size, const VarVector &vars, ArgVector &extraArgs)