Access information about interaction nucleus of material in step


I would like to know how to access information about the nucleus name of a particular interaction (from a G4Step). I know I can access the material via G4Step::GetPreStepPoint()->GetMaterial() but when it is a compound material I don’t know how to access the nucleus.

I want to do this in order to compute the quenching factor in my analysis process, which depends on the nucleus of interaction.


I have figured out myself how to access this information.

This information is in G4HadronicProcess (Geant4: G4HadronicProcess Class Reference) and you can access it via:

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

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.