41 static const double erflim = 5.0;
56 m(
"m",
"Dependent", this, _m),
57 m0(
"m0",
"M0", this, _m0),
58 sigma(
"sigma",
"Sigma", this, _sigma),
59 alpha(
"alpha",
"Alpha", this, _alpha),
60 n(
"n",
"Order", this, _n)
67 RooAbsPdf(other,
name),
m(
"m", this, other.
m), m0(
"m0", this, other.m0),
68 sigma(
"sigma", this, other.
sigma), alpha(
"alpha", this, other.alpha),
77 if (
alpha < 0) t = -t;
79 double absAlpha = std::abs((
double)
alpha);
86 double b=
n/absAlpha - absAlpha;
97 {dataMap.at(m), dataMap.at(m0), dataMap.at(sigma), dataMap.at(alpha), dataMap.at(n)});
114 static const double sqrtPiOver2 = 1.2533141373;
115 static const double sqrt2 = 1.4142135624;
121 if( std::abs(
n-1.0) < 1.0e-05 )
124 double sig = std::abs((
double)
sigma);
126 double tmin = (
m.
min(rangeName)-
m0)/sig;
127 double tmax = (
m.
max(rangeName)-
m0)/sig;
135 double absAlpha = std::abs((
double)
alpha);
137 if( tmin >= -absAlpha ) {
141 else if( tmax <= -absAlpha ) {
143 double b =
n/absAlpha - absAlpha;
146 result +=
a*sig*( log(
b-tmin) - log(
b-tmax) );
155 double b =
n/absAlpha - absAlpha;
159 term1 =
a*sig*( log(
b-tmin) - log(
n/absAlpha));
166 double term2 = sig*sqrtPiOver2*(
ApproxErf(tmax/sqrt2)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Abstract interface for all probability density functions.
Abstract base class for objects that represent a real value and implements functionality common to al...
bool matchArgs(const RooArgSet &allDeps, RooArgSet &numDeps, const RooArgProxy &a) const
Utility function for use in getAnalyticalIntegral().
RooArgSet is a container object that can hold multiple RooAbsArg objects.
PDF implementing the Crystal Ball line shape.
double ApproxErf(double arg) const
void computeBatch(double *output, size_t nEvents, RooFit::Detail::DataMap const &) const override
Compute multiple values of Crystal ball Shape distribution.
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
Int_t getMaxVal(const RooArgSet &vars) const override
Advertise that we know the maximum of self for given (m0,alpha,n,sigma)
double maxVal(Int_t code) const override
Return maximum value for set of observables identified by code assigned in getMaxVal.
RooBatchCompute::Config config(RooAbsArg const *arg) const
static std::complex< double > erf(const std::complex< double > z)
complex erf function
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.
void compute(Config cfg, Computer comp, RestrictArr output, size_t size, const VarVector &vars, ArgVector &extraArgs)
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.