/// Callback to construct particle decays void Geant4PhysicsListActionSequence::constructDecays(G4VUserPhysicsList* physics_pointer) { G4ParticleTable* pt = G4ParticleTable::GetParticleTable(); G4ParticleTable::G4PTblDicIterator* iter = pt->GetIterator(); // Add Decay Process G4Decay* decay = new G4Decay(); info("ConstructDecays %p",physics_pointer); iter->reset(); while ((*iter)()) { G4ParticleDefinition* p = iter->value(); G4ProcessManager* mgr = p->GetProcessManager(); if (decay->IsApplicable(*p)) { mgr->AddProcess(decay); // set ordering for PostStepDoIt and AtRestDoIt mgr->SetProcessOrdering(decay, idxPostStep); mgr->SetProcessOrdering(decay, idxAtRest); } } }
void PhysicsList::AddDecay() { // Add Decay Process G4Decay* fDecayProcess = new G4Decay(); theParticleIterator->reset(); while( (*theParticleIterator)() ){ G4ParticleDefinition* particle = theParticleIterator->value(); G4ProcessManager* pmanager = particle->GetProcessManager(); if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) { pmanager->AddProcess(fDecayProcess); // set ordering for PostStepDoIt and AtRestDoIt pmanager->SetProcessOrdering(fDecayProcess, idxPostStep); pmanager->SetProcessOrdering(fDecayProcess, idxAtRest); } } }