I checked it printing
if (track->GetCreatorProcess()) {
G4cout <<"Creator process is " << track->GetCreatorProcess() << G4endl;
}
else {
G4cout << "No creator process type "<< G4endl;
}
and the track->GetCreatorProcess() works as you can see in the attached file
creator process.txt (109.1 KB)
Then the problem is related to the `GetProcessName() function.
EDIT
I just found this @mkelsey post
in which he says to check both the creatorProcess and the GetProcessName…then I tried to print
if (track->GetCreatorProcess()) {
G4cout <<"Creator process is " << track->GetCreatorProcess() << G4endl;
if (track->GetCreatorProcess()->GetProcessName()){
G4cout <<"Process Name is is " << track->GetCreatorProcess()->GetProcessName() << G4endl;
}
else {
G4cout << "No process name "<< G4endl;
}
}
else {
G4cout << "No creator process type "<< G4endl;
}
and it works without crashing…
G4WT0 > Process Name is is phot
G4WT1 > Creator process is 000001DA0A0B8030
G4WT0 > Creator process is 000001DA0C585450
G4WT1 > Process Name is is RadioactiveDecayBase
G4WT0 > Process Name is is phot
G4WT1 > Creator process is 000001DA0A0B8030
G4WT0 > Creator process is 000001DA0C585450
G4WT1 > Process Name is is RadioactiveDecayBase
G4WT0 > Process Name is is phot
G4WT1 > Creator process is 000001DA0A0B8030
G4WT0 > Creator process is 000001DA0C585450
G4WT0 > Process Name is is phot
G4WT1 > Process Name is is RadioactiveDecayBase
G4WT0 > No creator process type
but it prints "RadioactiveDecayBase " instead of “RadioactiveDecay”
Are there differences between "RadioactiveDecayBase " and “RadioactiveDecay”?
`