66 prob.resize(nprob,0.0);
88 G4int idx = fShellIdx;
91 if(idx < 0 || idx >= nShells) {
94 prob.resize(nprob,0.0);
97 for(idx=0; idx<nShells; ++idx) {
103 for(idx=0; idx<nShells; ++idx) {
104 if(sum <= prob[idx]) {
break; }
122 G4double ePotEnergy = bindingEnergy*(1.0 +
x);
124 G4double p = sqrt((e + electron_mass_c2)*(e - electron_mass_c2));
129 totEnergy += ePotEnergy;
130 totMomentum = sqrt((totEnergy + electron_mass_c2)
131 *(totEnergy - electron_mass_c2));
135 G4double eTotMomentum = sqrt(eKinEnergy*(eTotEnergy + electron_mass_c2));
137 G4double sintet = sqrt((1 - costet)*(1 + costet));
152 if(0.0 == bindingEnergy) { isOK =
true; }
156 G4double x0 = p*(totMomentum + eTotMomentum*costet);
164 G4double x1 = p*eTotMomentum*sintet;
165 G4double x2 = totEnergy*(eTotEnergy - e) - e*eTotEnergy
166 - totMomentum*eTotMomentum*costet + electron_mass_c2*electron_mass_c2;
168 if(std::abs(y) <= 1.0) {
169 cost = -(x2 + x1*sqrt(1. - y*y))/x0;
170 if(std::abs(cost) <= 1.0) { isOK =
true; }
187 G4double sint = sqrt((1 - cost)*(1 + cost));
void set(double x, double y, double z)
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double kinEnergyFinal, G4int Z, const G4Material *mat=nullptr) final
virtual G4ThreeVector & SampleDirectionForShell(const G4DynamicParticle *dp, G4double kinEnergyFinal, G4int Z, G4int shellIdx, const G4Material *mat=nullptr) final
virtual void PrintGeneratorInformation() const final
G4DeltaAngle(const G4String &name="")
G4double GetTotalEnergy() const
static constexpr double twopi
G4double GetTotalMomentum() const
static G4double GetBindingEnergy(G4int Z, G4int SubshellNb)
const G4ThreeVector & GetMomentumDirection() const
Hep3Vector & rotateUz(const Hep3Vector &)
const G4ParticleDefinition * GetParticleDefinition() const
G4double G4Log(G4double x)
static G4int GetNumberOfElectrons(G4int Z, G4int SubshellNb)
static G4Electron * Electron()
G4ThreeVector fLocalDirection
G4double bindingEnergy(G4int A, G4int Z)
static G4int GetNumberOfShells(G4int Z)