#include <DoubleCrystalBallGenerator.h>
DoubleCrystalBallGenerator::DoubleCrystalBallGenerator |
( |
const RandomEngine * |
engine | ) |
|
|
inline |
virtual DoubleCrystalBallGenerator::~DoubleCrystalBallGenerator |
( |
| ) |
|
|
inlinevirtual |
double DoubleCrystalBallGenerator::shoot |
( |
double |
mu, |
|
|
double |
sigma, |
|
|
double |
aL, |
|
|
double |
nL, |
|
|
double |
aR, |
|
|
double |
nR |
|
) |
| |
Definition at line 11 of file DoubleCrystalBallGenerator.cc.
References PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, N, Pi, random, x, and detailsBasic3DVector::y.
Referenced by HCALResponse::cballShootNoNegative().
12 if(nL<=1 || nR<=1)
return 0;
16 double N = 1/(sigma*(nL/aL*1/(nL-1)*Exp(-aL*aL/2) + Sqrt(
Pi()/2)*(Erf(aL/Sqrt(2))+Erf(aR/Sqrt(2))) + nR/aR*1/(nR-1)*Exp(-aR*aR/2)));
27 double AL = dL/(nL-1)*Exp(-aL*aL/2);
28 double CL = Sqrt(
Pi()/2)*Erf(aL/Sqrt(2));
29 double CR = Sqrt(
Pi()/2)*Erf(aR/Sqrt(2));
31 double BL = dL/(nL-1)*Exp(-aL*aL/2);
32 x =
mu + sigma*(-dL*Power(y/(sigma*N*BL),1/(-nL+1)) - aL + dL);
34 else if(y > sigma*N*(AL+CL+CR)){
35 double AR = dR/(nR-1)*Exp(-aR*aR/2);
36 double BR = dR/(1-nR)*Exp(-aR*aR/2);
37 double D = (y/(sigma*
N)-AL-CL-CR-AR)/BR;
38 x =
mu + sigma*(dR*Power(D,1/(-nR+1)) + aR -
dR);
41 double D = 1 - Sqrt(2/
Pi())*(y/(sigma*
N)-AL-CL);
42 x =
mu + sigma*Sqrt(2)*ErfcInverse(D);
48 }
const RandomEngine * random
double flatShoot(double xmin=0.0, double xmax=1.0) const
DecomposeProduct< arg, typename Div::arg > D