235{
237
238
239 if (fPrimaryEnergy <= fAbsorptionEnergy) {
243 return;
244 }
245
246 fSelectedShell = SelectShell();
248
249
250 if (fPrimaryEnergy < bindingEnergy) { return; }
251
252
253 if (isElectron) {
255 } else {
256 G4double tau = fPrimaryEnergy/fMass;
257 fMaxEnergy = 2.0*CLHEP::electron_mass_c2*tau*(tau + 2.0);
258 }
259
260
261
262
263
264
265 if (fasterCode && isElectron && 2 == fSelectedShell && fPrimaryEnergy < feLimitEnergy) {
266 do {
267 fSelectedShell = SelectShell();
268 } while (2 == fSelectedShell);
269 }
270
271 G4double esec = fasterCode ? SampleCumulative() : SampleDifferential();
273
274
275
276
280 fSelectedShell,
282
283
284 if (fAtomDeexcitation != nullptr && fSelectedShell == 4) {
286 auto ashell = fAtomDeexcitation->GetAtomicShell(Z, as);
287 fAtomDeexcitation->GenerateParticles(fvect, ashell, Z, 0, 0);
288
289
290 for (auto const & ptr : *fvect) {
291 esum += ptr->GetKineticEnergy();
292 }
293 }
294
295
296 G4double exc = std::max(bindingEnergy - esum, 0.0);
297
298
300 if (scatteredEnergy < -tolerance || exc < -tolerance) {
301 G4cout <<
"G4DNABornIonisationModel::SampleSecondaries: "
302 << "final E(keV)=" << scatteredEnergy/CLHEP::keV << " Ein(keV)="
303 << fPrimaryEnergy/CLHEP::keV << " " << fParticle->GetParticleName()
304 << " Edelta(keV)=" << esec/CLHEP::keV << " MeV, Exc(keV)=" << exc/CLHEP::keV
306 }
307 scatteredEnergy = std::max(scatteredEnergy, 0.0);
308
309
310 if (!statCode) {
313 } else {
316 }
317
318
320 fvect->push_back(dp);
321
322
323 if (nullptr != fChemistry) {
325 }
326}
CLHEP::Hep3Vector G4ThreeVector
G4double GetKineticEnergy() const
const G4Material * GetMaterial() const
virtual G4ThreeVector & SampleDirectionForShell(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, G4int shellID, const G4Material *)
G4VEmAngularDistribution * GetAngularDistribution()
G4double bindingEnergy(G4int A, G4int Z)