How to obtain scattered position of parent track within daughter track?

Dear all,

I’m a newbie in this field and trying to get used to this awesome MC simulation program.

The information that I wish to obtain is, “a scattered position of parent track” while running a stepping action in a secondary electron track(steps).

As described in a picture above,
following the red arrows, not the generated position of daughter electron but a previously scattered position (blue and green highlighted circles).

What can I do to get exact position or a geometry name of scattered position?

I’d greatly appreciate any help you can offer.

Best regards,

You can’t. Once the parent track is finished with, it is deleted from memory. If you’re in a stepping action with the daughter, you can get the daughter’s own production point (via G4Track::GetVertexPosition(), as you already know), but not parent positions. The best you could do would be to collect and save the G4Trajectory for each track in a list, and in your stepping action, interrogate that when you’re processing the daughter.

Note that even if you are using a customized physics process, which suspends the parent track while the daughter is processed, that won’t help you. With the parent track suspended, it will not yet have taken it’s next step until after the daughter is completely tracked and killed.