67 _x(
"x",
"Dependent",
this,
x),
68 _coefList(
"coefList",
"List of coefficients",
this),
69 _lowestOrder(lowestOrder)
73 coutE(InputArguments) <<
"RooLegacyExpPoly::ctor(" <<
GetName()
74 <<
") WARNING: lowestOrder must be >=0, setting value to 0" << std::endl;
87 _coefList(
"coefList",
this,
other._coefList),
88 _lowestOrder(
other._lowestOrder)
102 std::vector<double> coefs;
112 for (
size_t i = 0; i <
sz; ++i) {
117 if (std::numeric_limits<double>::max_exponent <
retval) {
118 coutE(InputArguments) <<
"RooLegacyExpPoly::evaluateLog(" <<
GetName() <<
") ERROR: exponent at " <<
x
119 <<
" larger than allowed maximum, result will be infinite! " <<
retval <<
" > "
131 std::vector<std::span<const double>> vars;
133 vars.push_back(ctx.
at(
_x));
137 vars.push_back(ctx.
at(coef));
152 double max = std::numeric_limits<double>::max_exponent /
sz;
154 std::vector<double> coefs;
159 const double xmax =
x->getMax();
161 for (
size_t i = 0; i <
sz; ++i) {
180 const double val = std::exp(
logval);
181 if (std::isinf(val)) {
182 coutE(InputArguments) <<
"RooLegacyExpPoly::evaluate(" <<
GetName()
183 <<
") ERROR: result of exponentiation is infinite! exponent was " <<
logval << std::endl;
212#define PI TMath::Pi()
221 double y2 =
x1 > 0 ? erfc(
x1) : -erfc(-
x1);
222 double y1 =
x2 > 0 ? erfc(
x2) : -erfc(-
x2);
224 std::cout <<
"WARNING in calculation of analytical integral limited by numerical precision" << std::endl;
225 std::cout <<
"x: " <<
x1 <<
" , " <<
x2 << std::endl;
226 std::cout <<
"y: " <<
y1 <<
" , " <<
y2 << std::endl;
233 std::complex<double>
u1 = {
x1, 0.};
234 std::complex<double>
u2 = {
x2, 0.};
239 std::cout <<
"WARNING in calculation of analytical integral limited by numerical precision" << std::endl;
240 std::cout <<
"x: " <<
x1 <<
" , " <<
x2 << std::endl;
241 std::cout <<
"y: " <<
y1 <<
" , " <<
y2 << std::endl;
243 return y1.imag() -
y2.imag();
255 std::vector<double> coefs;
276 const double absa = std::abs(
a);
287 return 1. /
b * (std::exp(
b *
xmax) - exp(
b *
xmin)) * exp(
c);
300 std::stringstream
ss;
309 ss << coef->GetName();
311 ss <<
"*pow(" <<
_x.
GetName() <<
"," << order <<
")";
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char y1
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 interface for all probability density functions.
virtual double getLogVal(const RooArgSet *set=nullptr) const
Return the log of the current value with given normalization An error message is printed if the argum...
const RooArgSet * nset() const
Abstract base class for objects that represent a real value and implements functionality common to al...
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.
std::span< const double > at(RooAbsArg const *arg, RooAbsArg const *caller=nullptr)
std::span< double > output()
RooBatchCompute::Config config(RooAbsArg const *arg) const
RooLegacyExpPoly implements a polynomial PDF of the form.
int getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
double evaluateLog() const
RooArgList const & coefList() const
Get the coefficient list.
RooAbsReal const & x() const
Get the x variable.
double getLogVal(const RooArgSet *nset) const override
Return the log of the current value with given normalization An error message is printed if the argum...
std::string getFormulaExpression(bool expand) const
double evaluate() const override
Evaluation.
void doEval(RooFit::EvalContext &) const override
Compute multiple values of ExpPoly distribution.
double analyticalIntegral(int code, const char *rangeName=nullptr) const override
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
int lowestOrder() const
Return the order for the first coefficient in the list.
static std::complex< double > faddeeva(std::complex< double > z)
evaluate Faddeeva function for complex argument
Variable that can be changed from the outside.
void setVal(double value) override
Set value of variable to 'value'.
void setMax(const char *name, double value)
Set maximum of name range to given value.
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.
void compute(Config cfg, Computer comp, std::span< double > output, VarSpan vars, ArgSpan extraArgs={})