MCPcopy Create free account
hub / github.com/Geant4/geant4 / PostStepDoIt

Method PostStepDoIt

source/processes/electromagnetic/utils/src/G4VEmProcess.cc:472–649  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

470//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
471
472G4VParticleChange* G4VEmProcess::PostStepDoIt(const G4Track& track,
473 const G4Step& step)
474{
475 // clear number of interaction lengths in any case
476 theNumberOfInteractionLengthLeft = -1.0;
477 mfpKinEnergy = DBL_MAX;
478
479 fParticleChange.InitializeForPostStep(track);
480
481 // Do not make anything if particle is stopped, the annihilation then
482 // should be performed by the AtRestDoIt!
483 if (track.GetTrackStatus() == fStopButAlive) { return &fParticleChange; }
484
485 const G4double finalT = track.GetKineticEnergy();
486
487 // forced process - should happen only once per track
488 if(biasFlag) {
489 if(biasManager->ForcedInteractionRegion((G4int)currentCoupleIndex)) {
490 biasFlag = false;
491 }
492 }
493
494 // check active and select model
495 const G4double scaledEnergy = finalT*massRatio;
496 SelectModel(scaledEnergy, currentCoupleIndex);
497 if(!currentModel->IsActive(scaledEnergy)) { return &fParticleChange; }
498
499 // Integral approach
500 if (fXSType != fEmNoIntegral) {
501 const G4double logFinalT =
502 track.GetDynamicParticle()->GetLogKineticEnergy();
503 const G4double lx = std::max(GetCurrentLambda(finalT, logFinalT), 0.0);
504#ifdef G4VERBOSE
505 if(preStepLambda < lx && 1 < verboseLevel) {
506 G4cout << "WARNING: for " << currentParticle->GetParticleName()
507 << " and " << GetProcessName() << " E(MeV)= " << finalT/MeV
508 << " preLambda= " << preStepLambda
509 << " < " << lx << " (postLambda) " << G4endl;
510 }
511#endif
512 // if false interaction then use new cross section value
513 // if both values are zero - no interaction
514 if(preStepLambda*G4UniformRand() >= lx) {
515 return &fParticleChange;
516 }
517 }
518
519 // define new weight for primary and secondaries
520 G4double weight = fParticleChange.GetParentWeight();
521 if(weightFlag) {
522 weight /= biasFactor;
523 fParticleChange.ProposeWeight(weight);
524 }
525
526#ifdef G4VERBOSE
527 if(1 < verboseLevel) {
528 G4cout << "G4VEmProcess::PostStepDoIt: Sample secondary; E= "
529 << finalT/MeV

Callers

nothing calls this directly

Calls 15

maxFunction · 0.85
G4UniformRandFunction · 0.85
GetTrackStatusMethod · 0.80
ApplySecondaryBiasingMethod · 0.80
GetLocalEnergyDepositMethod · 0.80
GetTouchableHandleMethod · 0.80
InitializeForPostStepMethod · 0.45
GetKineticEnergyMethod · 0.45
IsActiveMethod · 0.45

Tested by

no test coverage detected