Geant4-11
Public Member Functions
G4DecayKineticTracks Class Reference

#include <G4DecayKineticTracks.hh>

Public Member Functions

void Decay (G4KineticTrackVector *tracks) const
 
 G4DecayKineticTracks (G4KineticTrackVector *tracks=0)
 

Detailed Description

Definition at line 38 of file G4DecayKineticTracks.hh.

Constructor & Destructor Documentation

◆ G4DecayKineticTracks()

G4DecayKineticTracks::G4DecayKineticTracks ( G4KineticTrackVector tracks = 0)

Definition at line 39 of file G4DecayKineticTracks.cc.

39 {
40
41 if (tracks) Decay(tracks);
42}
void Decay(G4KineticTrackVector *tracks) const

References Decay().

Member Function Documentation

◆ Decay()

void G4DecayKineticTracks::Decay ( G4KineticTrackVector tracks) const

Definition at line 44 of file G4DecayKineticTracks.cc.

44 {
45
46 if (!tracks) return;
47
48 G4KineticTrackVector* daughters = 0;
49 for (size_t i=0; i<tracks->size(); ++i) {
50 G4KineticTrack* track = (*tracks)[i];
51 if (!track) continue;
52
53 // Select decay of current track, put daughters at end of vector
54 daughters = track->GetDefinition()->IsShortLived() ? track->Decay() : 0;
55
56 if (daughters) {
57 // Assign to the daughters the creator model ID of their parent
58 for (size_t k=0; k<daughters->size(); ++k) {
59 G4KineticTrack* aDaughter = (*daughters)[k];
60 if (aDaughter) aDaughter->SetCreatorModelID(track->GetCreatorModelID());
61 }
62
63 tracks->insert(tracks->end(), daughters->begin(), daughters->end());
64 delete track; // Remove parent track
65 delete daughters;
66 (*tracks)[i] = NULL; // Flag parent's slot for removal
67 }
68 }
69
70 // Find and remove null pointers created by decays above
71 for (int j=tracks->size()-1; j>=0; --j) {
72 if (NULL == (*tracks)[j]) tracks->erase(tracks->begin()+j);
73 }
74}
G4KineticTrackVector * Decay()
void SetCreatorModelID(G4int id)
G4int GetCreatorModelID() const
const G4ParticleDefinition * GetDefinition() const

References G4KineticTrack::Decay(), G4KineticTrack::GetCreatorModelID(), G4KineticTrack::GetDefinition(), G4ParticleDefinition::IsShortLived(), and G4KineticTrack::SetCreatorModelID().

Referenced by G4BinaryCascade::FillVoidNucleusProducts(), and G4DecayKineticTracks().


The documentation for this class was generated from the following files: