What is track ID?

What is the track ID? When is it incremented? I’ve looked around but couldn’t find much information on it. Thanks in advance!

Track ID is just a counter. For each event, the first track created (usually a primary from your PrimaryGeneratorAction) gets TrackID = 1. It’s assigned by the TrackingManager, I believe, but that assignment is internal to the G4 code, not under user control.

You can use TrackID as a unique identifier within an event (which the track pointer is NOT). When secondaries are created, their ParentID is set equal to the track ID from which they were created.