Get target nucleus name responsible of secondary gamma creation process

Hello Geant4 users I would like to know if it is possible to get the name of the nucleus responsible of the secondary gamma creation process after a neutron interaction ?
I have a neutron primary wich encounter a medium composed of carbon, oxygen and calcium. I would like to know if we can get the name of nucleus which gives gamma secondary but during the gamma secondary step and not during the neutron primary step.
I found this below, it can gives the name of the target nucleus during the neutron step

const auto process = step->GetPostStepPoint()->GetProcessDefinedStep();
if ( (process->GetProcessName() == "neutronInelastic") || (process->GetProcessName() == "nCapture") )
    {
        auto hadronicProcess = dynamic_cast<const G4HadronicProcess*>(process);
        G4Nucleus nucleus = *(hadronicProcess->GetTargetNucleus());
        auto name = nucleus.GetIsotope()->GetName();
        G4cout << name << G4endl;
    }

But how to acces to the name of the nucleus responsible of the gamma secondary creation process during the gamma secondary step ?
I would like something similar to this below but for the name of the nucleus, a function wich could send back “C” or “Ca” or “O”.

if (  (PrimaryName == "gamma")  )
{
	procName = track->GetCreatorProcess()->GetProcessName();  
}

Thank you very much for your help !

1 Like