47 mean("mean","
Mean",this,_mean),
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)
108 if (!TString(
"exp(-@0/@1)").CompareTo(name))
return expBasisPlus ;
109 if (!TString(
"exp(@0/@1)").CompareTo(name))
return expBasisMinus ;
110 if (!TString(
"exp(-abs(@0)/@1)").CompareTo(name))
return expBasisSum ;
111 if (!TString(
"exp(-@0/@1)*sin(@0*@2)").CompareTo(name))
return sinBasisPlus ;
112 if (!TString(
"exp(@0/@1)*sin(@0*@2)").CompareTo(name))
return sinBasisMinus ;
113 if (!TString(
"exp(-abs(@0)/@1)*sin(@0*@2)").CompareTo(name))
return sinBasisSum ;
114 if (!TString(
"exp(-@0/@1)*cos(@0*@2)").CompareTo(name))
return cosBasisPlus ;
115 if (!TString(
"exp(@0/@1)*cos(@0*@2)").CompareTo(name))
return cosBasisMinus ;
116 if (!TString(
"exp(-abs(@0)/@1)*cos(@0*@2)").CompareTo(name))
return cosBasisSum ;
117 if (!TString(
"(@0/@1)*exp(-@0/@1)").CompareTo(name))
return linBasisPlus ;
118 if (!TString(
"(@0/@1)*(@0/@1)*exp(-@0/@1)").CompareTo(name))
return quadBasisPlus ;
119 if (!TString(
"exp(-@0/@1)*cosh(@0*@2/2)").CompareTo(name))
return coshBasisPlus;
120 if (!TString(
"exp(@0/@1)*cosh(@0*@2/2)").CompareTo(name))
return coshBasisMinus;
121 if (!TString(
"exp(-abs(@0)/@1)*cosh(@0*@2/2)").CompareTo(name))
return coshBasisSum;
122 if (!TString(
"exp(-@0/@1)*sinh(@0*@2/2)").CompareTo(name))
return sinhBasisPlus;
123 if (!TString(
"exp(@0/@1)*sinh(@0*@2/2)").CompareTo(name))
return sinhBasisMinus;
124 if (!TString(
"exp(-abs(@0)/@1)*sinh(@0*@2/2)").CompareTo(name))
return sinhBasisSum;
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 ;
185 if (basisSign!=
Plus) result += -
evalCerf( _x, u,c).imag();
192 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 5th form omega = " << omega <<
", tau = " << tau << endl ;
195 if (basisSign!=
Plus) result +=
evalCerf( _x, u,c).real();
202 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 8th form tau = " << tau << endl ;
204 int sgn = ( basisType ==
coshBasis ? +1 : -1 );
205 if (basisSign!=
Minus) result += 0.5*(
evalCerf(0,-u,c*(1-_y)).real()+sgn*
evalCerf(0,-u,c*(1+_y)).real()) ;
206 if (basisSign!=
Plus) result += 0.5*(sgn*
evalCerf(0, u,c*(1-_y)).real()+
evalCerf(0, u,c*(1+_y)).real()) ;
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 ;
350 if (basisSign!=
Plus) result +=
evalCerfInt(-1,0,tau, umin, umax,c).real();
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 ;
363 if (basisSign!=
Minus) result += -1*
evalCerfInt(+1,-_x,tau,-umin,-umax,c).imag();
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 ;
373 if (basisSign!=
Minus) result +=
evalCerfInt(+1,-_x,tau,-umin,-umax,c).real();
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 ;
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) {
virtual const char * GetName() const
Returns name of object.
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...
Bool_t matchArgs(const RooArgSet &allDeps, RooArgSet &numDeps, const RooArgProxy &a) const
Utility function for use in getAnalyticalIntegral().
Double_t getVal(const RooArgSet *set=0) const
RooRealVar & convVar() const
Return the convolution variable of the resolution model.
static std::complex< Double_t > evalCerf(Double_t swt, Double_t u, Double_t c)
RooRealConstant provides static functions to create and keep track of RooRealVar constants.
static int verboseEval()
Return global level of verbosity for p.d.f. evaluations.
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*...
const RooFormulaVar & basis() const
std::complex< Double_t > evalCerfInt(Double_t sign, Double_t wt, Double_t tau, Double_t umin, Double_t umax, Double_t c) const
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t tau
This is the base class for the ROOT Random number generators.
virtual Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported...
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
virtual Double_t analyticalIntegral(Int_t code, const char *rangeName) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral. ...
virtual ~RooGaussModel()
Destructor.
RooRealVar represents a fundamental (non-derived) real valued object.
void generateEvent(Int_t code)
Interface for generation of anan event using the algorithm corresponding to the specified code...
Double_t Mean(Long64_t n, const T *a, const Double_t *w=0)
virtual Int_t basisCode(const char *name) const
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...
static std::complex< double > erfc(const std::complex< double > z)
complex erfc function
Double_t min(const char *rname=0) const
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
double atan2(double, double)
you should not use this method at all Int_t Int_t z
Double_t max(const char *rname=0) const
double f2(const double *x)
virtual Double_t evaluate() const
static std::complex< double > erf(const std::complex< double > z)
complex erf function
constexpr Double_t Sigma()
const RooAbsReal & arg() const
Class RooGaussModel implements a RooResolutionModel that models a Gaussian distribution.