91 if(idx < 0 || idx >= nShells) {
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);
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)
Float_t x1[n_points_granero]
const G4ThreeVector & GetMomentumDirection() const
G4DeltaAngle(const G4String &name="")
Hep3Vector & rotateUz(const Hep3Vector &)
G4double G4Log(G4double x)
std::vector< G4double > prob
virtual G4ThreeVector & SampleDirectionForShell(const G4DynamicParticle *dp, G4double kinEnergyFinal, G4int Z, G4int shellIdx, const G4Material *mat=nullptr) final
static constexpr double electron_mass_c2
static constexpr double twopi
static G4int GetNumberOfShells(G4int Z)
static G4int GetNumberOfElectrons(G4int Z, G4int SubshellNb)
static G4Electron * Electron()
G4ThreeVector fLocalDirection
virtual void PrintGeneratorInformation() const final
static G4double GetBindingEnergy(G4int Z, G4int SubshellNb)
G4double GetTotalMomentum() const
G4double GetTotalEnergy() const
const G4ParticleDefinition * GetParticleDefinition() const
Float_t x2[n_points_geant4]
G4double bindingEnergy(G4int A, G4int Z)
const G4ParticleDefinition * fElectron
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double kinEnergyFinal, G4int Z, const G4Material *mat=nullptr) final