Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4DecayKineticTracks Class Reference

#include <G4DecayKineticTracks.hh>

Public Member Functions

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

Detailed Description

Definition at line 38 of file G4DecayKineticTracks.hh.

Constructor & Destructor Documentation

G4DecayKineticTracks::G4DecayKineticTracks ( G4KineticTrackVector tracks = 0)

Definition at line 39 of file G4DecayKineticTracks.cc.

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

Here is the call graph for this function:

Member Function Documentation

void G4DecayKineticTracks::Decay ( G4KineticTrackVector tracks) const

Definition at line 43 of file G4DecayKineticTracks.cc.

43  {
44  if (!tracks) return;
45 
46  G4KineticTrackVector* daughters = 0;
47  for (size_t i=0; i<tracks->size(); ++i) {
48  G4KineticTrack* track = (*tracks)[i];
49  if (!track) continue;
50 
51  // Select decay of current track, put daughters at end of vector
52  daughters = track->GetDefinition()->IsShortLived() ? track->Decay() : 0;
53 
54  if (daughters) {
55  tracks->insert(tracks->end(), daughters->begin(), daughters->end());
56  delete track; // Remove parent track
57  delete daughters;
58  (*tracks)[i] = NULL; // Flag parent's slot for removal
59  }
60  }
61 
62  // Find and remove null pointers created by decays above
63  for (int j=tracks->size()-1; j>=0; --j) {
64  if (NULL == (*tracks)[j]) tracks->erase(tracks->begin()+j);
65  }
66 }
G4KineticTrackVector * Decay()
const G4ParticleDefinition * GetDefinition() const

Here is the call graph for this function:

Here is the caller graph for this function:


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