I’ve got a slightly peculiar situation in our simulation, and could use some advice. I want to make use of TrackingAction to catch stopped electrons, and convert them into new particles (specifically,
G4CMPDriftElectron) to be tracked in a different way.
I know how to catch the stopped particles in
PostUserTrackingAction() and how to test whether they need conversion (only electron primaries or secondaries from RadioactiveDecay, and only in specific detector volumes).
I see that
G4TrackingManager is non-const, and it gives me non-const access to
G4SteppingManager, which gives me non-const access to the latest
G4Step (which I presume will match the last step pointed to by the
[ EDIT: Ignore the following ]
My question is whether I’m allowed to add secondaries to the step at this stage of the tracking.
G4TrackingManager::GimmeSecondaries() returns the list of tracks from the step, so that vector still exists. But if I add a new track (via
G4Step::AddSecondary()) will it be seen and processed as a new real track, or has that ship sailed?