Get the process responsible for a step?

How can I get the name of the process that is responsible for a particular step? For example, if G4Step had a method like “GetProcessName”. I have read that the tracking procedure takes the smallest step size from all the proposed steps from the processes. How do I see which one was chosen and what process it came from?

I am using Geant4.10.06.p01, and I have modified the extended/exoticphysics/ucn example to track ultracold neutrons. These experience a gravitational field, bulk loss, absorption, and multiscattering, and boundary processes like reflection and transmission. I have a bug where UCNs are occasionally taking very large steps (10s of mm as opposed to 100s of um) that I think is coming from my geometry. (I am importing large CAD models with the GDML parser.) I would like to see which process is responsible for these large steps.

Thank you.

aStep->GetPostStepPoint()->GetProcessDefinedStep()

Hello, thank you. That is exactly what I was looking for.