Stack Pos vs Track Vertex

Is the unpropagated position of a seconday particle accessed through G4Track in stacking action, the same as the vertex position in tracking action?

Not exactly sure what you mean by “unpropagated”. G4Track has poststep and prestep attributes which are conventionally accessed in the SteppingAction (for one of many examples). If you want to know where the secondary was first “created” you’d still use the TrackingAction, specifically PreUserTrackingAction.

Indeed that is what I am doing, but I was unsure about this aspect. Aren’t all tracks on the stack unpropagated, by definition? Doesn’t the function GetPosVertex() give you the generation coordinates in either pre or post step if you decide to access it from there?

Both the PreUserTrackingAction and StackingAction would work, it just depends on what you do with the information. If it is just reading the position, the PreUserTrackingAction is nice since it is unambiguously tied to the current SteppingAction.