10 #include <Math/RotationY.h>
11 #include <Math/RotationZ.h>
48 std::vector<std::unique_ptr<fastsim::Particle> >& secondaries,
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;
128 double pPositron =
std::sqrt((ePositron + eMass) * tPositron);
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;
static std::vector< std::string > checklist log
Implementation of a generic detector layer (base class for forward/barrel layers).
const math::XYZTLorentzVector & position() const
Return position of the particle.
virtual const double getThickness(const math::XYZTLorentzVector &position) const =0
Return thickness of the layer at a given position.
double flatShoot(double xmin=0.0, double xmax=1.0) const
Sin< T >::type sin(const T &t)
double Z_
Atomic number of material (usually silicon Z=14)
int pdgId() const
Return pdgId of the particle.
static double constexpr eMass
Electron mass[GeV].
constexpr std::array< uint8_t, layerIndexSize > layer
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Base class for any interaction model between a particle and a tracker layer.
Cos< T >::type cos(const T &t)
Computes the probability for photons to convert into an e+e- pair in the tracker layer.
PairProduction(const std::string &name, const edm::ParameterSet &cfg)
Constructor.
T getParameter(std::string const &) const
double minPhotonEnergy_
Cut on minimum energy of photons.
const math::XYZTLorentzVector & momentum() const
Return momentum of the particle.
~PairProduction() override
Default destructor.
#define DEFINE_EDM_PLUGIN(factory, type, name)
void interact(fastsim::Particle &particle, const SimplifiedGeometry &layer, std::vector< std::unique_ptr< fastsim::Particle > > &secondaries, const RandomEngineAndDistribution &random) override
Perform the interaction.
Definition of a generic FastSim Particle which can be propagated through the detector (formerly Parti...
double gbteth(double ener, double partm, double efrac, const RandomEngineAndDistribution &random) const
A universal angular distribution.