How to get a secondary particle's parent particle's name?

Now, in an event, there are many secondary particles. I want to know a specific particle’s parent particle’s name? How can i get it?

Is there anyone know the answer?

Did you find out the answer of this problem? and how to know a specific particle’s parent particle’s name

Hi !

what I think you need to know the number of sec. particles and primary details.

ParentID == 0 means primary particle
ParentID > 0 means all secondary.

In the macro you can use tracking/verbose 1.
it will print track information.

What I feel your case(question) seems close to what I am thinking,
Say a reaction d(d,p)3H where 3H and p are products, ‘d’ is primary particle.
For your knowledge, as soon ‘d’ experience any interaction it changed to sec. . e.g., elastic, inelastic, nuclear processes, etc. or any physics process.
In order to validate what you need, you can extend your code in hits or stepping

say if (parentID == 0 && stepID == 1)
{
check secondaries;
}
use same method to know what you need.
For the step ID you can use

G4int stepID = track->GetCurrentStepNumber();

VRS