21 _x(
"x",
"x", this,
x),
22 _x0(
"x0",
"x0", this,
x0),
24 _kL(
"kL",
"kL", this,
kL),
25 _kH(
"kH",
"kH", this,
kH)
32 _x(
"x", this, other.
_x),
33 _x0(
"x0", this, other.
_x0),
35 _kL(
"kL", this, other.
_kL),
44inline double gaussianIntegral(
double tmin,
double tmax)
46 constexpr double m_sqrt_2_pi = 2.50662827463;
50inline double tailIntegral(
double tmin,
double tmax,
double k)
52 double a = std::exp(0.5 * k * k) / k;
53 return a * (std::exp(k * tmax) - std::exp(k * tmin));
64 return std::exp(0.5 *
_kL *
_kL +
_kL * t);
66 return std::exp(0.5 *
_kH *
_kH -
_kH * t);
68 return std::exp(-0.5 * t * t);
87 double tmin = (
_x.min(rangeName) -
_x0) / sig;
88 double tmax = (
_x.max(rangeName) -
_x0) / sig;
91 result += tailIntegral(tmin, std::min(tmax, -
_kL),
_kL);
92 if (tmin <= _kH && tmax > -
_kL)
93 result += gaussianIntegral(std::max(tmin, -
_kL), std::min(tmax, +
_kH));
95 result += tailIntegral(std::max(tmin, +
_kH), tmax, -
_kH);
int Int_t
Signed integer 4 bytes (int).
double Double_t
Double 8 bytes.
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
RooAbsPdf()
Default constructor.
A RooAbsReal::Ref can be constructed from a RooAbsReal& or a double that will be implicitly converted...
bool matchArgs(const RooArgSet &allDeps, RooArgSet &analDeps, const RooArgProxy &a, const Proxies &... proxies) const
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooAbsReal const & kH() const
RooAbsReal const & kL() const
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
RooAbsReal const & x() const
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
RooAbsReal const & x0() const
RooAbsReal const & sigma() const
double gaussian_cdf(double x, double sigma=1, double x0=0)
Alternative name for same function.