10 #include <Math/RotationY.h>
11 #include <Math/RotationZ.h>
48 std::vector<std::unique_ptr<fastsim::Particle> >& secondaries,
72 Z_ =
cfg.getParameter<
double>(
"Z");
77 std::vector<std::unique_ptr<fastsim::Particle> >& secondaries,
79 double eGamma = particle.
momentum().e();
83 if (particle.
pdgId() != 22) {
91 if (radLengths < 1E-10) {
98 if (eGamma < minPhotonEnergy_) {
111 double xm =
eMass / eGamma;
116 xe = random.
flatShoot() * (1. - 2. * xm) + xm;
117 weight = 1. - 4. / 3. * xe * (1. - xe);
121 double eElectron = xe * eGamma;
122 double tElectron = eElectron -
eMass;
126 double ePositron = eGamma - eElectron;
127 double tPositron = ePositron -
eMass;
135 double stheta1, stheta2, ctheta1, ctheta2;
137 if (eElectron > ePositron) {
138 double theta1 = gbteth(eElectron,
eMass, xe, random) *
eMass / eElectron;
141 stheta2 = stheta1 * pElectron / pPositron;
144 double theta2 = gbteth(ePositron,
eMass, xe, random) *
eMass / ePositron;
147 stheta1 = stheta2 * pPositron / pElectron;
152 double thetaLab = particle.
momentum().Theta();
153 double phiLab = particle.
momentum().Phi();
159 math::XYZTLorentzVector(pElectron * stheta1 * cphi, pElectron * stheta1 * sphi, pElectron * ctheta1, eElectron)));
160 secondaries.back()->momentum() =
161 ROOT::Math::RotationZ(phiLab) * (ROOT::Math::RotationY(thetaLab) * secondaries.back()->momentum());
168 -pPositron * stheta2 * cphi, -pPositron * stheta2 * sphi, pPositron * ctheta2, ePositron)));
169 secondaries.back()->momentum() =
170 ROOT::Math::RotationZ(phiLab) * (ROOT::Math::RotationY(thetaLab) * secondaries.back()->momentum());
173 particle.
momentum().SetXYZT(0., 0., 0., 0.);
184 const double alfa = 0.625;
186 const double d = 0.13 * (0.8 + 1.3 / Z_) * (100.0 + (1.0 / ener)) * (1.0 + efrac);
187 const double w1 = 9.0 / (9.0 +
d);
188 const double umax = ener *
M_PI / partm;
192 double beta = (random.
flatShoot() <= w1) ? alfa : 3.0 * alfa;