Angle of landing for a particle

Hi
For a particle that is emitted from a source and moves in a straight path to reach a surface, how can we have the angle of landing of that particle with respect to the vertical axis

You can add this computation in the SteppingAction, by taking the particle momentum vector at the pre-step point when the step is touching the target surface.

here you could find inspiration: geant4/G4PSFlatSurfaceFlux.cc at v11.0.3 · Geant4/geant4 · GitHub