Record number of steps in a track

Hi All,
How can I get the number of steps performed at the end of each track? This is intended for debug and model statistics purposes.


A way that you could go about doing this is with a UserSteppingAction and a UserEventAction. For each step of the track in the stepping action you would increment a counter. Then, once the track is complete the EndOfEventAction will be called, which will read the number of steps for that track and reset the counter in your stepping action.

The method I proposed above assumes by the number of steps performed per track, you mean the number of steps of the primary particle and all secondary particles produced from it.


A slightly simpler method with a SteppingAction might be to look for the track’s final step (status = fStopAndKill), and just get the step number.

Thank you Michael. The solution with the step status is elegant. This is exactly what I was looking for.