Is it can be accessed about parent track special step number from current G4Step?

Can parent track special step number be accessed from current G4Step where the current track produced ?
_Geant4 Version:_11.01
_Operating System:_Ubuntu 20.04
_Compiler/Version:_GCC 9.4.0
_CMake Version:_3.16

Hello @siyuan1979 ,

In general the only accessible part of a particle history is the ID of its parent particle. I’ m not sure what you mean by “special step number” of the parent track. Could you clarify what do you want to achieve?


@pico , in my case, the Xenon element velocity by the neutron first elastic scatter need to be tallied, so,
in the neutron track, which step number the nuclear reaction takes place can be recorded,
in the Xenon element track, the step number need to be accessed for recording the Xenon element velocity.

Hi again,

Depending on the interaction, the Xenon may or may not be a trackable particle. It could be that the neutron scatters with “Xenon” as a material but not with an individual Xenon atom.

In any case, the step number is a well define quantity. You can check with an stepping action what processes defined the step (in this case the scattering you are interested on) and use that for your tallies. Is this is only interesting on a specific volume you can do with a SensitiveDetector class