KAHIBARO
Discord Login Register

13.4 Track Status

Alive tracks

During tracking, each particle in Geant4 is represented by a G4Track object. At any moment, Geant4 assigns a track status that describes what should happen next to that particle. For beginners, the practical question is usually: will this particle continue to be transported, or is it finished?

A track is considered "alive" when Geant4 will still propagate it further through the geometry. While a track is alive, Geant4 keeps calling your stepping-related code, such as UserSteppingAction, for every G4Step taken by the particle. The particle continues to lose energy, change direction, create secondaries, or possibly leave the geometry entirely while its status remains alive.

Alive tracks are the only ones that can generate new steps. If you want to apply logic to all ongoing particle motion, for example to check if a track has entered a specific region or to record energy deposition per step, you will often test whether the track is still active. You usually get access to the current status through the G4Track object in user actions, for example by calling its GetTrackStatus() method.

Important rule: Only tracks with an "alive" status continue to be transported and can produce further steps and secondaries. Once a track changes to a non‑alive status, it will not be stepped any further.

For most user applications, you do not need to set an "alive" status explicitly. Geant4 sets it internally and you simply react to steps of alive tracks. The transition away from alive status happens automatically, either because the particle has no more energy, has left the world, has decayed, or because your user code has asked Geant4 to terminate the track early.

Stopped tracks

A track is "stopped" when Geant4 decides that the particle should no longer move, but can still have a physical meaning in the simulation. This often corresponds to a particle that has come to rest in matter after losing all of its kinetic energy.

A typical example is a proton beam in a water phantom. As each proton slows down through ionization and other processes, eventually its kinetic energy becomes too small for further transport. Geant4 then marks this track as stopped. From the point of view of stepping, no further steps will be generated for this proton. However, the final stopping location and time can still be important for physics such as nuclear capture or delayed processes that might be handled by other parts of the physics list.

Stopped tracks are useful for analysis. For instance, if you are interested in where particles finally come to rest, you can check in a stepping or tracking action when a track transitions to the stopped status and record its last position and time. This is a common approach when studying ranges of charged particles or accumulation of implanted ions.

From the user perspective, you typically do not need to set a stopped status yourself. It is controlled by the physics processes. Your code can observe that a track has stopped and then perform any bookkeeping that you need.

Key point: A stopped track no longer moves or generates steps, but its final position and time can still be used for analysis or for subsequent physics such as capture or decay at rest.

Killed tracks

A "killed" track is one that has been explicitly terminated and removed from further consideration. In this case, Geant4 stops not only the motion of the particle, but also any possibility for further interactions from that track. After a track is killed, Geant4 will not create new steps for it, and your stepping-related code will not see that track again.

Killing tracks can happen for several reasons. Some physics processes may kill a track when a reaction is completed or when the particle is absorbed. More importantly for user applications, you can deliberately kill tracks in user code to enforce cuts or to keep the simulation efficient. For example, in your SteppingAction, you might inspect the particle type, position, or energy and decide that you are no longer interested in it. In that case you can set the track status to a killed state using the appropriate Geant4 enum value through the G4Track object.

Typical uses for killing tracks include discarding low energy particles that cannot reach your detector, terminating particles that have left a region of interest, or removing particles that would only contribute negligible effects but would cost significant CPU time to track further.

Important rule: Once a track is killed, Geant4 will never transport it again and it will generate no more steps or secondaries. Killing tracks is a powerful way to control simulation scope and performance, so apply it only when you are sure the discarded tracks are not needed for your physics or analysis.

In practice, you often distinguish between stopped and killed tracks in your analysis. Stopped tracks usually represent a physically complete history where the particle ended naturally, while killed tracks may have been removed early for efficiency or technical cuts. Keeping this distinction clear helps avoid misinterpreting your simulation results.

Views: 9

Comments

Please login to add a comment.

Don't have an account? Register now!