80 twoln10(2.0*
G4Log(10.0)),
110 if(isInitialised) {
return; }
112 isInitialised =
true;
129 tmax = std::min(maxEnergy, tmax);
132 if(cutEnergy < tmax) {
134 G4double xmin = cutEnergy/kineticEnergy;
136 G4double tau = kineticEnergy/electron_mass_c2;
139 G4double beta2 = tau*(tau + 2)/gamma2;
144 G4double gg = (2.0*gam - 1.0)/gamma2;
145 cross = ((xmax - xmin)*(1.0 - gg + 1.0/(xmin*xmax)
146 + 1.0/((1.0-xmin)*(1.0 - xmax)))
147 - gg*
G4Log( xmax*(1.0 - xmin)/(xmin*(1.0 - xmax)) ) ) / beta2;
161 cross = (xmax - xmin)*(1.0/(beta2*xmin*xmax) + b2
162 - 0.5*b3*(xmin + xmax)
163 + b4*(xmin*xmin + xmin*xmax + xmax*xmax)/3.0)
164 - b1*
G4Log(xmax/xmin);
167 cross *= twopi_mc2_rcl2/kineticEnergy;
212 G4double tkin = std::max(kineticEnergy, th);
214 G4double tau = tkin/electron_mass_c2;
221 eexc /= electron_mass_c2;
230 dedx =
G4Log(2.0*(tau + 2.0)/eexc2) - 1.0 - beta2
231 +
G4Log((tau-d)*d) + tau/(tau-d)
232 + (0.5*d*d + (2.0*tau + 1.)*
G4Log(1. - d/tau))/gamma2;
241 dedx =
G4Log(2.0*(tau + 2.0)/eexc2) +
G4Log(tau*d)
242 - beta2*(tau + 2.0*d - y*(3.0*d2
243 + y*(d - d3 + y*(d2 - tau*d3 + d4))))/tau;
251 dedx *= twopi_mc2_rcl2*electronDensity/beta2;
252 if (dedx < 0.0) { dedx = 0.0; }
256 if (kineticEnergy < th) {
257 x = kineticEnergy/th;
258 if(x > 0.25) { dedx /= sqrt(x); }
259 else { dedx *= 1.4*sqrt(x)/(0.1 + x); }
279 tmax = 0.5*kineticEnergy;
281 tmax = kineticEnergy;
283 if(maxEnergy < tmax) { tmax = maxEnergy; }
284 if(tmin >= tmax) {
return; }
286 G4double energy = kineticEnergy + electron_mass_c2;
289 G4double gam = energy/electron_mass_c2;
299 G4double gg = (2.0*gam - 1.0)/gamma2;
301 grej = 1.0 - gg*xmax + xmax*xmax*(1.0 - gg + (1.0 - gg*y)/(y*y));
305 x = xmin*xmax/(xmin*(1.0 - rndm[0]) + xmax*rndm[0]);
307 z = 1.0 - gg*x + x*x*(1.0 - gg + (1.0 - gg*y)/(y*y));
318 }
while(grej * rndm[1] > z);
333 grej = 1.0 + (y*y*b4 - xmin*xmin*xmin*b3 + y*b2 - xmin*b1)*beta2;
336 x = xmin*xmax/(xmin*(1.0 - rndm[0]) + xmax*rndm[0]);
338 z = 1.0 + (y*y*b4 - x*y*b3 + y*b2 - x*b1)*beta2;
349 }
while(grej * rndm[1] > z);
352 G4double deltaKinEnergy = x * kineticEnergy;
366 sqrt(deltaKinEnergy * (deltaKinEnergy + 2.0*electron_mass_c2));
367 G4double cost = deltaKinEnergy * (energy + electron_mass_c2) /
369 if(cost > 1.0) { cost = 1.0; }
370 G4double sint = sqrt((1.0 - cost)*(1.0 + cost));
374 deltaDirection.
set(sint*cos(phi),sint*sin(phi), cost) ;
380 vdp->push_back(delta);
383 kineticEnergy -= deltaKinEnergy;
385 finalP = finalP.
unit();
G4double G4Log(G4double x)
void set(double x, double y, double z)
Hep3Vector & rotateUz(const Hep3Vector &)
virtual void flatArray(const int size, double *vect)=0
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
G4ThreeVector GetMomentum() const
G4double GetTotalMomentum() const
static G4Electron * Electron()
G4double DensityCorrection(G4double x) const
G4double GetMeanExcitationEnergy() const
G4double GetZeffective() const
const G4Material * GetMaterial() const
G4IonisParamMat * GetIonisation() const
G4double GetElectronDensity() const
const G4ParticleDefinition * particle
void SetParticle(const G4ParticleDefinition *p)
G4ParticleChangeForLoss * fParticleChange
G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kineticEnergy, G4double Z, G4double A, G4double cutEnergy, G4double maxEnergy) override
G4MollerBhabhaModel(const G4ParticleDefinition *p=nullptr, const G4String &nam="MollerBhabha")
G4ParticleDefinition * theElectron
~G4MollerBhabhaModel() override
void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
G4double ComputeDEDXPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy) override
virtual G4double ComputeCrossSectionPerElectron(const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy)
G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kinEnergy) final
void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy) override
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void SetProposedMomentumDirection(const G4ThreeVector &dir)
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
G4VEmAngularDistribution * GetAngularDistribution()
G4int SelectRandomAtomNumber(const G4Material *) const
void SetAngularDistribution(G4VEmAngularDistribution *)
G4bool UseAngularGeneratorFlag() const
G4ParticleChangeForLoss * GetParticleChangeForLoss()