52 mean(
"mean",
"Mean",this,_mean),
53 sigma(
"sigma",
"Width",this,_sigma),
69 mean(
"mean",
"Mean",this,_mean),
70 sigma(
"sigma",
"Width",this,_sigma),
71 msf(
"msf",
"Mean Scale Factor",this,_msSF),
72 ssf(
"ssf",
"Sigma Scale Factor",this,_msSF)
86 mean(
"mean",
"Mean",this,_mean),
87 sigma(
"sigma",
"Width",this,_sigma),
88 msf(
"msf",
"Mean Scale Factor",this,_meanSF),
89 ssf(
"ssf",
"Sigma Scale Factor",this,_sigmaSF)
103 msf(
"msf",this,other.
msf),
123 if (!TString(
"exp(-@0/@1)").CompareTo(name))
return expBasisPlus ;
124 if (!TString(
"exp(@0/@1)").CompareTo(name))
return expBasisMinus ;
125 if (!TString(
"exp(-abs(@0)/@1)").CompareTo(name))
return expBasisSum ;
126 if (!TString(
"exp(-@0/@1)*sin(@0*@2)").CompareTo(name))
return sinBasisPlus ;
127 if (!TString(
"exp(@0/@1)*sin(@0*@2)").CompareTo(name))
return sinBasisMinus ;
128 if (!TString(
"exp(-abs(@0)/@1)*sin(@0*@2)").CompareTo(name))
return sinBasisSum ;
129 if (!TString(
"exp(-@0/@1)*cos(@0*@2)").CompareTo(name))
return cosBasisPlus ;
130 if (!TString(
"exp(@0/@1)*cos(@0*@2)").CompareTo(name))
return cosBasisMinus ;
131 if (!TString(
"exp(-abs(@0)/@1)*cos(@0*@2)").CompareTo(name))
return cosBasisSum ;
132 if (!TString(
"(@0/@1)*exp(-@0/@1)").CompareTo(name))
return linBasisPlus ;
133 if (!TString(
"(@0/@1)*(@0/@1)*exp(-@0/@1)").CompareTo(name))
return quadBasisPlus ;
134 if (!TString(
"exp(-@0/@1)*cosh(@0*@2/2)").CompareTo(name))
return coshBasisPlus;
135 if (!TString(
"exp(@0/@1)*cosh(@0*@2/2)").CompareTo(name))
return coshBasisMinus;
136 if (!TString(
"exp(-abs(@0)/@1)*cosh(@0*@2/2)").CompareTo(name))
return coshBasisSum;
137 if (!TString(
"exp(-@0/@1)*sinh(@0*@2/2)").CompareTo(name))
return sinhBasisPlus;
138 if (!TString(
"exp(@0/@1)*sinh(@0*@2/2)").CompareTo(name))
return sinhBasisMinus;
139 if (!TString(
"exp(-abs(@0)/@1)*sinh(@0*@2/2)").CompareTo(name))
return sinhBasisSum;
161 if (dGamma==0) basisType =
expBasis;
166 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 1st form" << endl ;
175 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 2nd form" << endl ;
189 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 3d form tau=" << tau << endl ;
199 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 4th form omega = " << omega <<
", tau = " << tau << endl ;
201 if (_x==0.)
return result ;
203 if (basisSign!=
Plus) result += -
evalCerf( _x, u,c).imag();
210 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 5th form omega = " << omega <<
", tau = " << tau << endl ;
213 if (basisSign!=
Plus) result +=
evalCerf( _x, u,c).real();
220 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 8th form tau = " << tau << endl ;
222 int sgn = ( basisType ==
coshBasis ? +1 : -1 );
223 if (basisSign!=
Minus) result += 0.5*(
evalCerf(0,-u,c*(1-_y)).real()+sgn*
evalCerf(0,-u,c*(1+_y)).real()) ;
224 if (basisSign!=
Plus) result += 0.5*(sgn*
evalCerf(0, u,c*(1-_y)).real()+
evalCerf(0, u,c*(1+_y)).real()) ;
231 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 6th form tau = " << tau << endl ;
236 return (xprime - 2*c*c)*f0 + (2*c/rootpi)*f1 ;
241 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 7th form tau = " << tau << endl ;
247 return ( x2c2*x2c2*f0 + (2*c/rootpi)*x2c2*f1 + 2*c*c*f0 );
320 if (code==2) ssfInt = (
ssf.
max(rangeName)-
ssf.
min(rangeName)) ;
329 if (dGamma==0) basisType =
expBasis;
333 if (
verboseEval()>0) cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 1st form" << endl ;
348 return result*ssfInt ;
357 if (
verboseEval()>0) cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 2nd form" << endl ;
369 if (
verboseEval()>0) cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 3d form tau=" << tau << endl ;
372 if (basisSign!=
Plus) result +=
evalCerfInt(-1,0,tau, umin, umax,c).real();
374 return result*ssfInt ;
382 if (
verboseEval()>0) cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 4th form omega = " << omega <<
", tau = " << tau << endl ;
384 if (_x==0)
return result*ssfInt ;
385 if (basisSign!=
Minus) result += -1*
evalCerfInt(+1,-_x,tau,-umin,-umax,c).imag();
386 if (basisSign!=
Plus) result += -1*
evalCerfInt(-1, _x,tau, umin, umax,c).imag();
388 return result*ssfInt ;
393 if (
verboseEval()>0) cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 5th form omega = " << omega <<
", tau = " << tau << endl ;
395 if (basisSign!=
Minus) result +=
evalCerfInt(+1,-_x,tau,-umin,-umax,c).real();
396 if (basisSign!=
Plus) result +=
evalCerfInt(-1, _x,tau, umin, umax,c).real();
398 return result*ssfInt ;
404 if (
verboseEval()>0) {cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 8th form tau=" << tau << endl ; }
406 int sgn = ( basisType ==
coshBasis ? +1 : -1 );
407 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());
408 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());
410 return result*ssfInt ;
415 if (
verboseEval()>0) cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 6th form tau=" << tau << endl ;
424 Double_t f3 = xpmax*tmp1 - xpmin*tmp2;
430 (1 - 2*c*c)*expc2*f2 +
437 if (
verboseEval()>0) cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 7th form tau=" << tau << endl ;
451 Double_t f4 = xpmax*tmpB1 - xpmin*tmpB2;
452 Double_t f5 = xpmax*xpmax*tmpB1 - xpmin*xpmin*tmpB2;
457 (4*c/rootpi)*((1-c*c)*f1 + c*
f2) +
458 (2*c*c*(2*c*c-1) + 2)*expc2*f3 - (4*c*c-2)*expc2*f4 + expc2*f5
473 const std::complex<Double_t>
z(_x * c, u + c);
474 const std::complex<Double_t> zc(u + c, - _x * c);
475 const std::complex<Double_t> zsq((z.real() + z.imag()) * (z.real() - z.imag()),
476 2. * z.real() * z.imag());
477 const std::complex<Double_t>
v(-zsq.real() - u*u, -zsq.imag());
478 const std::complex<Double_t> ev =
std::exp(
v);
479 const std::complex<Double_t> mez2zcrootpi = -
std::exp(zsq)/(zc*rootpi);
481 return 2. * (ev * (mez2zcrootpi + 1.));
488 std::complex<Double_t> diff(2., 0.);
495 diff *= std::complex<Double_t>(1., _x);
496 diff *= tau / (1.+_x*_x);
504 if (
matchArgs(directVars,generateVars,
x))
return 1 ;
518 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...
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
cout << "RooGaussModel::evaluate(" << GetName() << ") basisCode = " << _basisCode << endl ; ...
static std::complex< double > erf(const std::complex< double > z)
complex erf function
const RooAbsReal & arg() const
Class RooGaussModel implements a RooResolutionModel that models a Gaussian distribution.