64 const G4double PositronMass = CLHEP::electron_mass_c2;
73 G4int mPos =
static_cast<G4int>(std::floor(3.0 * rndmEngine->
flat()) - 1.0);
91 else if (mPos == -1) {
111 rndmv1 = rndmEngine->
flat();
120 r3 = 2.0 - (r1 + r2);
122 cos12 = (r3 * r3 - r1 * r1 - r2 * r2) / (2 * r1 * r2);
123 cos13 = (r2 * r2 - r1 * r1 - r3 * r3) / (2 * r1 * r3);
125 }
while (std::abs(cos12) > 1 || std::abs(cos13) > 1);
127 G4double sin12 = std::sqrt((1 + cos12)*(1 - cos12));
128 G4double sin13 = -std::sqrt((1 + cos13)*(1 - cos13));
131 PhotonDir1 = {0., 0., 1.};
132 PhotonDir2 = {0., sin12, cos12};
133 PhotonDir3 = {0., sin13, cos13};
146 PhotonPol1 = std::cos(eta1) * PhotonPerp1 + std::sin(eta1) * xDir;
149 PhotonPol2 = std::cos(eta2) * PhotonPerp2 + std::sin(eta2) * xDir;
152 PhotonPol3 = std::cos(eta3) * PhotonPerp3 + std::sin(eta3) * xDir;
161 + PhotonPol1 * (PhotonPrime2.
dot(PhotonPrime3))
162 - PhotonPrime2 * (PhotonPrime3.
dot(PhotonPol1))
163 - PhotonPrime3 * (PhotonPol1.
dot(PhotonPrime2)));
165 + PhotonPol2 * (PhotonPrime3.
dot(PhotonPrime1))
166 - PhotonPrime3 * (PhotonPrime1.
dot(PhotonPol2))
167 - PhotonPrime1 * (PhotonPol2.
dot(PhotonPrime3)));
169 + PhotonPol3 * (PhotonPrime1.
dot(PhotonPrime2))
170 - PhotonPrime1 * (PhotonPrime2.
dot(PhotonPol3))
171 - PhotonPrime2 * (PhotonPol3.
dot(PhotonPrime1)));
187 G4complex H = t(0) * ux + t(1) * uy + t(2) * uz;
188 pdf = std::abs(conj(H) * H);
189 }
while (pdf < ymax * rndmv1);
201 aGamma1->SetPolarization(PhotonPol1);
202 secParticles.push_back(aGamma1);
205 aGamma2->SetPolarization(PhotonPol2);
206 secParticles.push_back(aGamma2);
209 aGamma3->SetPolarization(PhotonPol3);
210 secParticles.push_back(aGamma3);