47 width(
"width",
"width",this,_width),
48 peak(
"peak",
"peak",this,_peak),
49 tail(
"tail",
"tail",this,_tail)
59 peak(
"peak",this,other.peak),
60 tail(
"tail",this,other.tail)
69 if (std::abs(
tail) < 1.e-7) {
70 return std::exp( -0.5 * std::pow( ( (
x -
peak) /
width ), 2 ));
80 double log = std::log(arg);
81 static const double xi = 2.3548200450309494;
84 double width_zero2 = width_zero * width_zero;
85 double exponent = ( -0.5 / (width_zero2) * log * log ) - ( width_zero2 * 0.5 );
87 return std::exp(exponent) ;
94 {ctx.at(x), ctx.at(peak), ctx.at(width), ctx.at(tail)});
113 assert(code==1 || code==2) ;
118 static const double sqrt2 = 1.4142135623730950;
119 static const double sqlog2 = 0.832554611157697756;
120 static const double sqlog4 = 1.17741002251547469;
121 static const double log4 = 1.38629436111989062;
122 static const double rootpiby2 = 1.2533141373155003;
123 static const double sqpibylog2 = 2.12893403886245236;
126 double A =
x.
min(rangeName);
127 double B =
x.
max(rangeName);
133 if (std::abs(
tail) < 1.e-7) {
135 double xscale = sqrt2*
width;
148 if ( log_argument_A < 1.e-7) {
149 log_argument_A = 1.e-7;
153 if ( log_argument_B < 1.e-7) {
154 log_argument_B = 1.e-7;
158 double term1_2 = term1 * term1;
161 double erf_termA = ( term1_2 - log4 * std::log( log_argument_A ) ) / ( 2 * term1 * sqlog2 );
162 double erf_termB = ( term1_2 - log4 * std::log( log_argument_B ) ) / ( 2 * term1 * sqlog2 );
164 result = 0.5 /
tail *
width * term1 * ( std::erf(erf_termB) - std::erf(erf_termA)) * sqpibylog2;
168 }
else if (code==2) {
169 double A =
x.
min(rangeName);
170 double B =
x.
max(rangeName);
176 if (std::abs(
tail) < 1.e-7) {
178 double xscale = sqrt2*
width;
180 result = rootpiby2*
width*(std::erf((B-
x)/xscale)-std::erf((A-
x)/xscale));
191 if ( log_argument_A < 1.e-7) {
192 log_argument_A = 1.e-7;
196 if ( log_argument_B < 1.e-7) {
197 log_argument_B = 1.e-7;
201 double term1_2 = term1 * term1;
204 double erf_termA = ( term1_2 - log4 * std::log( log_argument_A ) ) / ( 2 * term1 * sqlog2 );
205 double erf_termB = ( term1_2 - log4 * std::log( log_argument_B ) ) / ( 2 * term1 * sqlog2 );
207 result = 0.5 /
tail *
width * term1 * ( std::erf(erf_termB) - std::erf(erf_termA)) * sqpibylog2;
214 coutF(Eval) <<
"Error in RooNovosibirsk::analyticalIntegral" << std::endl;
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.
std::span< double > output()
RooBatchCompute::Config config(RooAbsArg const *arg) const
RooNovosibirsk implements the Novosibirsk function.
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
double evaluate() const override
If tail=eta=0 the Belle distribution becomes gaussian.
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
void doEval(RooFit::EvalContext &) const override
Compute multiple values of Novosibirsk distribution.
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, std::span< double > output, VarSpan vars, ArgSpan extraArgs={})
Double_t ASinH(Double_t)
Returns the area hyperbolic sine of x.