57 _x(
"x",
"Dependent", this,
x),
58 _coefList(
"coefList",
"List of coefficients", this),
59 _expList(
"expList",
"List of exponents", this)
63 <<
") ERROR: coefficient list and exponent list must be of same length" << std::endl;
68 coutE(InputArguments) <<
"RooPower::ctor(" <<
GetName() <<
") ERROR: coefficient " << coef->GetName()
69 <<
" is not of type RooAbsReal" << std::endl;
76 coutE(InputArguments) <<
"RooPower::ctor(" <<
GetName() <<
") ERROR: coefficient " << exp->GetName()
77 <<
" is not of type RooAbsReal" << std::endl;
89 _x(
"x", this, other._x),
90 _coefList(
"coefList", this, other._coefList),
91 _expList(
"expList", this, other._expList)
106 std::vector<double> coefs;
107 std::vector<double> exps;
119 for (
unsigned int i = 0; i < sz; ++i) {
120 retval += coefs[i] * pow(
x, exps[i]);
145 std::vector<double> coefs;
146 std::vector<double> exps;
158 for (
unsigned int i = 0; i < sz; ++i) {
160 retval += coefs[i] * (log(
xmax) - log(
xmin));
162 retval += coefs[i] / (exps[i] + 1) * (pow(
xmax, (exps[i] + 1)) - pow(
xmin, (exps[i] + 1)));
170 std::stringstream ss;
175 ss << static_cast<RooAbsReal *>(
_coefList.
at(i))->getVal();
180 ss << static_cast<RooAbsReal *>(
_expList.
at(i))->getVal();
185 return ss.str().c_str();
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...
RooPower implements a power law PDF of the form.
std::string getFormulaExpression(bool expand) const
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
do not persist
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.