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.

Hi,

Let me put another question in the same line (although I suspect will likely have a similar answer…).
Is it possible to compute in the PreUserTrackingAction() the angle between a Cherenkov emitted optical photon and its parent charged particle ? If yes how ? If not, is there some way ?
Thanks !

Not in the tracking action, there’s no easy way to get back to the parent track from the daughter. A better method, I think would be to use either SteppingAction or an SD attached to your volume: Look for a step where the parent charged particle emitted a Cherenkov photon. That photon will be available as a secondary (the last secondary) in the step. Since here you have both the parent track and the secondary, you can extract the emission angle.