#include <DoubleCrystalBallGenerator.h>
DoubleCrystalBallGenerator::DoubleCrystalBallGenerator |
( |
| ) |
|
|
inline |
virtual DoubleCrystalBallGenerator::~DoubleCrystalBallGenerator |
( |
| ) |
|
|
inlinevirtual |
double DoubleCrystalBallGenerator::shoot |
( |
double |
mu, |
|
|
double |
sigma, |
|
|
double |
aL, |
|
|
double |
nL, |
|
|
double |
aR, |
|
|
double |
nR, |
|
|
RandomEngineAndDistribution const * |
random |
|
) |
| |
Definition at line 11 of file DoubleCrystalBallGenerator.cc.
References PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, RandomEngineAndDistribution::flatShoot(), N, Pi, x, and y.
13 if(nL<=1 || nR<=1)
return 0;
17 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)));
28 double AL = dL/(nL-1)*Exp(-aL*aL/2);
29 double CL = Sqrt(
Pi()/2)*Erf(aL/Sqrt(2));
30 double CR = Sqrt(
Pi()/2)*Erf(aR/Sqrt(2));
32 double BL = dL/(nL-1)*Exp(-aL*aL/2);
33 x =
mu + sigma*(-dL*Power(y/(sigma*N*BL),1/(-nL+1)) - aL + dL);
35 else if(y > sigma*N*(AL+CL+CR)){
36 double AR = dR/(nR-1)*Exp(-aR*aR/2);
37 double BR = dR/(1-nR)*Exp(-aR*aR/2);
38 double D = (y/(sigma*
N)-AL-CL-CR-AR)/BR;
39 x =
mu + sigma*(dR*Power(D,1/(-nR+1)) + aR -
dR);
42 double D = 1 - Sqrt(2/
Pi())*(y/(sigma*
N)-AL-CL);
43 x =
mu + sigma*Sqrt(2)*ErfcInverse(D);
DecomposeProduct< arg, typename Div::arg > D