51 mean(
"mean",
"Mean",this,_mean),
52 sigma(
"sigma",
"Width",this,_sigma),
68 mean(
"mean",
"Mean",this,_mean),
69 sigma(
"sigma",
"Width",this,_sigma),
70 msf(
"msf",
"Mean Scale Factor",this,_msSF),
71 ssf(
"ssf",
"Sigma Scale Factor",this,_msSF)
85 mean(
"mean",
"Mean",this,_mean),
86 sigma(
"sigma",
"Width",this,_sigma),
87 msf(
"msf",
"Mean Scale Factor",this,_meanSF),
88 ssf(
"ssf",
"Sigma Scale Factor",this,_sigmaSF)
98 _flatSFInt(other._flatSFInt),
99 _asympInt(other._asympInt),
100 mean(
"mean",this,other.mean),
101 sigma(
"sigma",this,other.sigma),
102 msf(
"msf",this,other.msf),
103 ssf(
"ssf",this,other.ssf)
160 if (dGamma==0) basisType =
expBasis;
165 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 1st form" << endl ;
174 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 2nd form" << endl ;
188 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 3d form tau=" << tau << endl ;
198 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 4th form omega = " << omega <<
", tau = " << tau << endl ;
200 if (_x==0.)
return result ;
202 if (basisSign!=
Plus) result += -
evalCerf( _x, u,c).imag();
209 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 5th form omega = " << omega <<
", tau = " << tau << endl ;
212 if (basisSign!=
Plus) result +=
evalCerf( _x, u,c).real();
219 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 8th form tau = " << tau << endl ;
221 int sgn = ( basisType ==
coshBasis ? +1 : -1 );
222 if (basisSign!=
Minus) result += 0.5*(
evalCerf(0,-u,c*(1-_y)).real()+sgn*
evalCerf(0,-u,c*(1+_y)).real()) ;
223 if (basisSign!=
Plus) result += 0.5*(sgn*
evalCerf(0, u,c*(1-_y)).real()+
evalCerf(0, u,c*(1+_y)).real()) ;
230 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 6th form tau = " << tau << endl ;
235 return (xprime - 2*c*c)*f0 + (2*c/rootpi)*f1 ;
240 if (
verboseEval()>2) cout <<
"RooGaussModel::evaluate(" <<
GetName() <<
") 7th form tau = " << tau << endl ;
246 return ( x2c2*x2c2*f0 + (2*c/rootpi)*x2c2*f1 + 2*c*c*f0 );
319 if (code==2) ssfInt = (
ssf.
max(rangeName)-
ssf.
min(rangeName)) ;
328 if (dGamma==0) basisType =
expBasis;
332 if (
verboseEval()>0) cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 1st form" << endl ;
347 return result*ssfInt ;
356 if (
verboseEval()>0) cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 2nd form" << endl ;
368 if (
verboseEval()>0) cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 3d form tau=" << tau << endl ;
371 if (basisSign!=
Plus) result +=
evalCerfInt(-1,0,tau, umin, umax,c).real();
373 return result*ssfInt ;
381 if (
verboseEval()>0) cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 4th form omega = " << omega <<
", tau = " << tau << endl ;
383 if (_x==0)
return result*ssfInt ;
384 if (basisSign!=
Minus) result += -1*
evalCerfInt(+1,-_x,tau,-umin,-umax,c).imag();
385 if (basisSign!=
Plus) result += -1*
evalCerfInt(-1, _x,tau, umin, umax,c).imag();
387 return result*ssfInt ;
392 if (
verboseEval()>0) cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 5th form omega = " << omega <<
", tau = " << tau << endl ;
394 if (basisSign!=
Minus) result +=
evalCerfInt(+1,-_x,tau,-umin,-umax,c).real();
395 if (basisSign!=
Plus) result +=
evalCerfInt(-1, _x,tau, umin, umax,c).real();
397 return result*ssfInt ;
403 if (
verboseEval()>0) {cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 8th form tau=" << tau << endl ; }
405 int sgn = ( basisType ==
coshBasis ? +1 : -1 );
406 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());
407 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());
409 return result*ssfInt ;
414 if (
verboseEval()>0) cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 6th form tau=" << tau << endl ;
423 Double_t f3 = xpmax*tmp1 - xpmin*tmp2;
429 (1 - 2*c*c)*expc2*f2 +
436 if (
verboseEval()>0) cout <<
"RooGaussModel::analyticalIntegral(" <<
GetName() <<
") 7th form tau=" << tau << endl ;
450 Double_t f4 = xpmax*tmpB1 - xpmin*tmpB2;
451 Double_t f5 = xpmax*xpmax*tmpB1 - xpmin*xpmin*tmpB2;
456 (4*c/rootpi)*((1-c*c)*f1 + c*
f2) +
457 (2*c*c*(2*c*c-1) + 2)*expc2*f3 - (4*c*c-2)*expc2*f4 + expc2*f5
472 const std::complex<Double_t> z(_x * c, u + c);
473 const std::complex<Double_t> zc(u + c, - _x * c);
474 const std::complex<Double_t> zsq((z.real() + z.imag()) * (z.real() - z.imag()),
475 2. * z.real() * z.imag());
476 const std::complex<Double_t>
v(-zsq.real() - u*u, -zsq.imag());
477 const std::complex<Double_t> ev =
std::exp(
v);
478 const std::complex<Double_t> mez2zcrootpi = -
std::exp(zsq)/(zc*rootpi);
480 return 2. * (ev * (mez2zcrootpi + 1.));
487 std::complex<Double_t> diff(2., 0.);
494 diff *= std::complex<Double_t>(1., _x);
495 diff *= tau / (1.+_x*_x);
503 if (
matchArgs(directVars,generateVars,
x))
return 1 ;
517 if (xgen<xmax && xgen>xmin) {
virtual Double_t analyticalIntegral(Int_t code, const char *rangeName) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral. ...
virtual Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported...
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...
static std::complex< Double_t > evalCerf(Double_t swt, Double_t u, Double_t c)
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 RooAbsReal & arg() const
This is the base class for the ROOT Random number generators.
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
Double_t getVal(const RooArgSet *set=0) const
virtual ~RooGaussModel()
Destructor.
virtual Int_t basisCode(const char *name) const
void generateEvent(Int_t code)
Interface for generation of anan event using the algorithm corresponding to the specified code...
RooRealVar & convVar() const
Return the convolution variable of the resolution model.
return fString CompareTo(((TObjString *) obj) ->fString)
virtual const char * GetName() const
Returns name of object.
static std::complex< double > erfc(const std::complex< double > z)
complex erfc function
virtual Double_t evaluate() const
cout << "RooGaussModel::evaluate(" << GetName() << ") basisCode = " << _basisCode << endl ; ...
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
const RooFormulaVar & basis() const
double atan2(double, double)
Double_t min(const char *rname=0) const
double f2(const double *x)
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 > erf(const std::complex< double > z)
complex erf function
std::complex< Double_t > evalCerfInt(Double_t sign, Double_t wt, Double_t tau, Double_t umin, Double_t umax, Double_t c) const
Bool_t matchArgs(const RooArgSet &allDeps, RooArgSet &numDeps, const RooArgProxy &a) const
Utility function for use in getAnalyticalIntegral().
Double_t max(const char *rname=0) const