183{
186
187 if(rndmEngine->
flat() < f3GProbability->
Value(posiKinEnergy)) {
189 /(posiKinEnergy + electron_mass_c2);
190
191 if(cutd > fDelta) {
195 if(rndmEngine->
flat()*cs30 < cs3) {
197 return;
198 }
199 } else {
201 return;
202 }
203 }
204
206
207
208 if(posiKinEnergy == 0.0) {
210 G4double sint = sqrt((1. - cost)*(1. + cost));
213 phi = twopi * rndmEngine->
flat();
217 pol.rotateUz(dir);
221 pol.set(-sinphi, cosphi, 0.0);
222 pol.rotateUz(dir);
224
225 } else {
226
228
229 G4double tau = posiKinEnergy/electron_mass_c2;
232 G4double sqgrate = sqrt(tau/tau2)*0.5;
234
235
238 G4double epsilqot = epsilmax/epsilmin;
239
240
241
242
244
245 do {
247 greject = 1. - epsil + (2.*
gam*epsil-1.)/(epsil*tau2*tau2);
248
249 }
while( greject < rndmEngine->
flat());
250
251
252
253
254
255 G4double cost = (epsil*tau2-1.)/(epsil*sqg2m1);
256 if(std::abs(cost) > 1.0) {
257 G4cout <<
"### G4eplusTo2GammaOKVIModel WARNING cost= " << cost
258 << " positron Ekin(MeV)= " << posiKinEnergy
259 << " gamma epsil= " << epsil
261 if(cost > 1.0) cost = 1.0;
262 else cost = -1.0;
263 }
264 G4double sint = sqrt((1.+cost)*(1.-cost));
266
267
268
269
270
271 G4double TotalAvailableEnergy = posiKinEnergy + 2.0*electron_mass_c2;
272 G4double phot1Energy = epsil*TotalAvailableEnergy;
273
274 G4ThreeVector phot1Direction(sint*cos(phi), sint*sin(phi), cost);
275 phot1Direction.rotateUz(posiDirection);
277 phi = twopi * rndmEngine->
flat();
281 pol.rotateUz(phot1Direction);
283
284 G4double phot2Energy =(1.-epsil)*TotalAvailableEnergy;
285 G4double posiP= sqrt(posiKinEnergy*(posiKinEnergy+2.*electron_mass_c2));
286 G4ThreeVector dir = posiDirection*posiP - phot1Direction*phot1Energy;
288
289
291
292
293 pol.set(-sinphi, cosphi, 0.0);
294 pol.rotateUz(phot1Direction);
295 cost = pol*phot2Direction;
296 pol -= cost*phot2Direction;
299 }
300
301
302
303
304
305
306
307
308
309 vdp->push_back(aGamma1);
310 vdp->push_back(aGamma2);
311
312
315}
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4GLOB_DLL std::ostream G4cout
void SetPolarization(const G4ThreeVector &)
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeTrackStatus(G4TrackStatus status)
void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin=0.0, G4double maxEnergy=DBL_MAX) final