47 mean(
"mean",
"Mean",this,_mean),
48 sigma(
"sigma",
"Width",this,_sigma),
62 mean(
"mean",
"Mean",this,_mean),
63 sigma(
"sigma",
"Width",this,_sigma),
64 msf(
"msf",
"Mean Scale Factor",this,_msSF),
65 ssf(
"ssf",
"Sigma Scale Factor",this,_msSF)
77 mean(
"mean",
"Mean",this,_mean),
78 sigma(
"sigma",
"Width",this,_sigma),
79 msf(
"msf",
"Mean Scale Factor",this,_meanSF),
80 ssf(
"ssf",
"Sigma Scale Factor",this,_sigmaSF)
88 _flatSFInt(other._flatSFInt),
89 _asympInt(other._asympInt),
90 mean(
"mean",this,other.mean),
92 msf(
"msf",this,other.msf),
93 ssf(
"ssf",this,other.ssf)
143 if (dGamma==0) basisType =
expBasis;
148 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 1st form" << endl ;
157 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 2nd form" << endl ;
171 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 3d form tau=" << tau << endl ;
181 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 4th form omega = " << omega <<
", tau = " << tau << endl ;
183 if (_x==0.)
return result ;
192 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 5th form omega = " << omega <<
", tau = " << tau << endl ;
202 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 8th form tau = " << tau << endl ;
204 int sgn = ( basisType ==
coshBasis ? +1 : -1 );
213 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 6th form tau = " << tau << endl ;
218 return (xprime - 2*
c*
c)*f0 + (2*
c/rootpi)*
f1 ;
223 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 7th form tau = " << tau << endl ;
229 return ( x2c2*x2c2*f0 + (2*
c/rootpi)*x2c2*
f1 + 2*
c*
c*f0 );
298 if (code==2) ssfInt = (
ssf.
max(rangeName)-
ssf.
min(rangeName)) ;
307 if (dGamma==0) basisType =
expBasis;
311 if (
verboseEval()>0) cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 1st form" << endl ;
326 return result*ssfInt ;
335 if (
verboseEval()>0) cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 2nd form" << endl ;
347 if (
verboseEval()>0) cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 3d form tau=" << tau << endl ;
352 return result*ssfInt ;
360 if (
verboseEval()>0) cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 4th form omega = " << omega <<
", tau = " << tau << endl ;
362 if (_x==0)
return result*ssfInt ;
364 if (basisSign!=
Plus) result += -1*
evalCerfInt(-1, _x,tau, umin, umax,
c).imag();
366 return result*ssfInt ;
371 if (
verboseEval()>0) cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 5th form omega = " << omega <<
", tau = " << tau << endl ;
374 if (basisSign!=
Plus) result +=
evalCerfInt(-1, _x,tau, umin, umax,
c).real();
376 return result*ssfInt ;
382 if (
verboseEval()>0) {cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 8th form tau=" << tau << endl ; }
384 int sgn = ( basisType ==
coshBasis ? +1 : -1 );
385 if (basisSign!=
Minus) result += 0.5*(
evalCerfInt(+1,0,tau/(1-_y),-umin,-umax,
c*(1-_y)).real()+ sgn*
evalCerfInt(+1,0,tau/(1+_y),-umin,-umax,
c*(1+_y)).real());
386 if (basisSign!=
Plus) result += 0.5*(sgn*
evalCerfInt(-1,0,tau/(1-_y), umin, umax,
c*(1-_y)).real()+
evalCerfInt(-1,0,tau/(1+_y), umin, umax,
c*(1+_y)).real());
388 return result*ssfInt ;
393 if (
verboseEval()>0) cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 6th form tau=" << tau << endl ;
402 Double_t f3 = xpmax*tmp1 - xpmin*tmp2;
408 (1 - 2*
c*
c)*expc2*f2 +
415 if (
verboseEval()>0) cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 7th form tau=" << tau << endl ;
423 Double_t f2 = umax*tmpA1 - umin*tmpA2;
429 Double_t f4 = xpmax*tmpB1 - xpmin*tmpB2;
430 Double_t f5 = xpmax*xpmax*tmpB1 - xpmin*xpmin*tmpB2;
435 (4*
c/rootpi)*((1-
c*
c)*
f1 +
c*f2) +
436 (2*
c*
c*(2*
c*
c-1) + 2)*expc2*f3 - (4*
c*
c-2)*expc2*f4 + expc2*f5
451 const std::complex<Double_t> z(_x *
c, u +
c);
452 const std::complex<Double_t> zc(u +
c, - _x *
c);
453 const std::complex<Double_t> zsq((z.real() + z.imag()) * (z.real() - z.imag()),
454 2. * z.real() * z.imag());
455 const std::complex<Double_t>
v(-zsq.real() - u*u, -zsq.imag());
456 const std::complex<Double_t> ev =
std::exp(
v);
457 const std::complex<Double_t> mez2zcrootpi = -
std::exp(zsq)/(zc*rootpi);
459 return 2. * (ev * (mez2zcrootpi + 1.));
466 std::complex<Double_t> diff(2., 0.);
473 diff *= std::complex<Double_t>(1., _x);
474 diff *= tau / (1.+_x*_x);
482 if (
matchArgs(directVars,generateVars,
x))
return 1 ;
496 if (xgen<xmax && xgen>
xmin) {
double atan2(double, double)
static int verboseEval()
Return global level of verbosity for p.d.f. evaluations.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Bool_t matchArgs(const RooArgSet &allDeps, RooArgSet &numDeps, const RooArgProxy &a) const
Utility function for use in getAnalyticalIntegral().
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Class RooGaussModel implements a RooResolutionModel that models a Gaussian distribution.
virtual ~RooGaussModel()
Destructor.
std::complex< Double_t > evalCerfInt(Double_t sign, Double_t wt, Double_t tau, Double_t umin, Double_t umax, Double_t c) const
static std::complex< Double_t > evalCerf(Double_t swt, Double_t u, Double_t c)
static std::complex< Double_t > evalCerfApprox(Double_t swt, Double_t u, Double_t c)
use the approximation: erf(z) = exp(-z*z)/(std::sqrt(pi)*z) to explicitly cancel the divergent exp(y*...
virtual Double_t analyticalIntegral(Int_t code, const char *rangeName) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
Int_t getGenerator(const RooArgSet &directVars, RooArgSet &generateVars, Bool_t staticInitOK=kTRUE) const
Load generatedVars with the subset of directVars that we can generate events for, and return a code t...
virtual Double_t evaluate() const
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
void generateEvent(Int_t code)
Interface for generation of an event using the algorithm corresponding to the specified code.
virtual Int_t basisCode(const char *name) const
virtual Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
static std::complex< double > erfc(const std::complex< double > z)
complex erfc function
static std::complex< double > erf(const std::complex< double > z)
complex erf function
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
RooRealConstant provides static functions to create and keep track of RooRealVar constants.
Double_t min(const char *rname=0) const
const RooAbsReal & arg() const
Double_t max(const char *rname=0) const
RooRealVar represents a fundamental (non-derived) real valued object.
RooRealVar & convVar() const
Return the convolution variable of the resolution model.
const RooFormulaVar & basis() const
virtual const char * GetName() const
Returns name of object.
This is the base class for the ROOT Random number generators.
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...