How to get information about the atom on which ionization occurs

hi
everyone. Now I’m studying about heavy ions acrossing in olivine crytal in geant4.And I want to know how to get information about the atom on which ionization occurs.
with best regards,
Than Naing Soe

Hello,
If you work with “standard” PhysicsLists (not DNA), then ionisation is coplicate process responsible for continues energy loss and delta-electron production. If you have interest to delta-electron production, then step of interest should be limited by the ionisation process.
Inside G4UserSteppingAction you may have:

G4StepPoint* postStep = step->GetPostStepPoint();
const G4ionIonisationptr = (G4ionIonisation) postStep->GeProcessDefinedStep();

if ptr is not nullptr, this means that the delta-electron is produced by ion ionisation, in that case:

const G4Element* elm = ptr->GetCurrentElement();

VI

hello
Dear Vladimir Ivantchenko

       Thanks for your advices sir. I'll try.

with best regards,
TNS

hello
Dear Vladimir Ivantchenko

I already done what you said but i have some problem.


and my problem is show in below.
May be version of geant4 .Now i’m using geant4.10.01. please give me some advice sir. with best regards,
TNS

You need to cast to (G4ionIoniziation*), or better, to (const G4ionIonization*). As written, you’re trying to cast a pointer to an object.