88G4bool G4eeToTwoGammaModel::fSampleAtomicPDF =
false;
93 pi_rcl2(pi*classic_electr_radius*classic_electr_radius)
96 fParticleChange =
nullptr;
111 fSampleAtomicPDF =
false;
113 for (
const auto& material: *materialTable) {
114 const G4double meanEnergyPerIonPair = material->GetIonisation()->GetMeanEnergyPerIonPair();
115 if (meanEnergyPerIonPair > 0.) {
116 fSampleAtomicPDF =
true;
118 G4cout <<
"### G4eeToTwoGammaModel: for " << material->GetName() <<
" mean energy per ion pair is "
119 << meanEnergyPerIonPair/CLHEP::eV <<
" eV" <<
G4endl;
128 if(fParticleChange) {
return; }
140 G4double ekin = std::max(eV,kineticEnergy);
142 G4double tau = ekin/electron_mass_c2;
148 G4double cross = pi_rcl2*((gamma2+4*gam+1.)*
G4Log(gam+bg) - (gam+3.)*bg)
193 if(posiKinEnergy == 0.0) {
195 const G4double eGamma = electron_mass_c2;
233 if(fSampleAtomicPDF) {
236 const G4double& meanKE = meanEnergyPerIonPair;
239 const G4double mass = 2.*electron_mass_c2;
243 const G4double sigmav = std::sqrt(2.*meanKE/(3.*mass));
245 const G4double vx = G4RandGauss::shoot(0.,sigmav);
246 const G4double vy = G4RandGauss::shoot(0.,sigmav);
247 const G4double vz = G4RandGauss::shoot(0.,sigmav);
259 const G4double& angle1 = std::acos(dir1*newDir1);
260 const G4double& angle2 = std::acos(dir2*newDir2);
272 G4double tau = posiKinEnergy/electron_mass_c2;
275 G4double sqgrate = sqrt(tau/tau2)*0.5;
281 G4double epsilqot = epsilmax/epsilmin;
290 greject = 1. - epsil + (2.*gam*epsil-1.)/(epsil*tau2*tau2);
292 }
while( greject < rndmEngine->flat());
298 G4double cost = (epsil*tau2-1.)/(epsil*sqg2m1);
299 if(std::abs(cost) > 1.0) {
300 G4cout <<
"### G4eeToTwoGammaModel WARNING cost= " << cost
301 <<
" positron Ekin(MeV)= " << posiKinEnergy
302 <<
" gamma epsil= " << epsil
304 if(cost > 1.0) cost = 1.0;
307 G4double sint = sqrt((1.+cost)*(1.-cost));
314 G4double totalEnergy = posiKinEnergy + 2.0*electron_mass_c2;
315 G4double phot1Energy = epsil*totalEnergy;
317 G4ThreeVector phot1Direction(sint*cos(phi), sint*sin(phi), cost);
318 phot1Direction.
rotateUz(posiDirection);
320 phi = twopi * rndmEngine->
flat();
327 G4double phot2Energy =(1.-epsil)*totalEnergy;
328 G4double posiP= sqrt(posiKinEnergy*(posiKinEnergy+2.*electron_mass_c2));
329 G4ThreeVector dir = posiDirection*posiP - phot1Direction*phot1Energy;
336 pol.
set(-sinphi, cosphi, 0.0);
338 cost = pol*phot2Direction;
339 pol -= cost*phot2Direction;
352 vdp->push_back(aGamma1);
353 vdp->push_back(aGamma2);
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double G4Log(G4double x)
G4ThreeVector G4RandomDirection()
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
Hep3Vector cross(const Hep3Vector &) const
void set(double x, double y, double z)
Hep3Vector & rotateUz(const Hep3Vector &)
Hep3Vector & rotate(double, const Hep3Vector &)
HepLorentzVector & boost(double, double, double)
void SetPolarization(const G4ThreeVector &)
const G4ThreeVector & GetMomentumDirection() const
G4LorentzVector Get4Momentum() const
G4double GetKineticEnergy() const
void Set4Momentum(const G4LorentzVector &momentum)
static G4EmParameters * Instance()
G4double GetMeanEnergyPerIonPair() const
const G4Material * GetMaterial() const
G4IonisParamMat * GetIonisation() const
G4double GetElectronDensity() const
static G4MaterialTable * GetMaterialTable()
void SetProposedKineticEnergy(G4double proposedKinEnergy)
G4ParticleChangeForGamma * GetParticleChangeForGamma()
void ProposeTrackStatus(G4TrackStatus status)
virtual G4double ComputeCrossSectionPerElectron(G4double kinEnergy)
G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0., G4double maxEnergy=DBL_MAX) override
void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
G4eeToTwoGammaModel(const G4ParticleDefinition *p=nullptr, const G4String &nam="eplus2gg")
void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX) override
~G4eeToTwoGammaModel() override