308{
309 if (verboseLevel > 3)
310 G4cout <<
"Calling SampleSecondaries() of G4DNACPA100IonisationModel" <<
G4endl;
311
313
315
317 {
320 G4double totalEnergy = k + particleMass;
321 G4double pSquare = k * (totalEnergy + particleMass);
322 G4double totalMomentum = std::sqrt(pSquare);
323
324 G4int ionizationShell = -1;
325
326 ionizationShell = RandomSelect(k,particleName);
327
328
330
333
335
336 if (useDcs && !fasterCode)
337 secondaryKinetic = RandomizeEjectedElectronEnergy(particle->
GetDefinition(),k,ionizationShell);
338
339 if (useDcs && fasterCode)
340 secondaryKinetic = RandomizeEjectedElectronEnergyFromCumulatedDcs(particle->
GetDefinition(),k,ionizationShell);
341
342 if (!useDcs)
343 secondaryKinetic = RandomizeEjectedElectronEnergyFromCompositionSampling(particle->
GetDefinition(),k,ionizationShell);
344
345
346
347
348
349
350
351
352
355 RandomizeEjectedElectronDirection(particle->
GetDefinition(), k,secondaryKinetic, cosTheta, phi);
356
357 G4double sinTheta = std::sqrt(1.-cosTheta*cosTheta);
358 G4double dirX = sinTheta*std::cos(phi);
359 G4double dirY = sinTheta*std::sin(phi);
362 deltaDirection.rotateUz(primaryDirection);
363
364
365 if (secondaryKinetic>0)
366 {
368 fvect->push_back(dp);
369 }
370
371
373 {
374 G4double deltaTotalMomentum = std::sqrt(secondaryKinetic*(secondaryKinetic + 2.*electron_mass_c2 ));
375
376 G4double finalPx = totalMomentum*primaryDirection.
x() - deltaTotalMomentum*deltaDirection.x();
377 G4double finalPy = totalMomentum*primaryDirection.
y() - deltaTotalMomentum*deltaDirection.y();
378 G4double finalPz = totalMomentum*primaryDirection.
z() - deltaTotalMomentum*deltaDirection.z();
379 G4double finalMomentum = std::sqrt(finalPx*finalPx + finalPy*finalPy + finalPz*finalPz);
380 finalPx /= finalMomentum;
381 finalPy /= finalMomentum;
382 finalPz /= finalMomentum;
383
385 direction.
set(finalPx,finalPy,finalPz);
386
388 }
389
391
392
393
394
395
396
397
398 std::size_t secNumberInit = 0;
399 std::size_t secNumberFinal = 0;
400
402
403
404 if(fAtomDeexcitation && ionizationShell == 4)
405 {
409 secNumberInit = fvect->size();
411 secNumberFinal = fvect->size();
412
413 if(secNumberFinal > secNumberInit)
414 {
415 for (std::size_t i=secNumberInit; i<secNumberFinal; ++i)
416 {
417
418 if (bindingEnergy >= ((*fvect)[i])->GetKineticEnergy())
419 {
420
422 }
423 else
424 {
425
426
427 delete (*fvect)[i];
428 (*fvect)[i]=0;
429 }
430 }
431 }
432
433 }
434
435
436 if(bindingEnergy < 0.0)
437 G4Exception(
"G4DNACPA100IonisatioModel1::SampleSecondaries()",
439
440
441
442
443 if (!statCode)
444 {
447 }
448 else
449 {
452 }
453
454
455
456
457
458
459
460
463 ionizationShell,
464 theIncomingTrack);
465 }
466
467}
void set(double x, double y, double z)
static G4DNAChemistryManager * Instance()
void CreateWaterMolecule(ElectronicModification, G4int, const G4Track *)
const G4ThreeVector & GetMomentumDirection() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
static G4Electron * Electron()
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(const G4ThreeVector &Pfinal)
G4double GetPDGMass() const
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)=0
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
const G4Track * GetCurrentTrack() const
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4double bindingEnergy(G4int A, G4int Z)