how can we know the name of a special interaction has been take place in Geant4? in my simulation program I have low energy protons (< 10 MeV) as incident particles which they interact with silicon in a bulk. due to different isotopes of silicons elastic or inelastic scattering may take place. how can I understand which one of these two interactions has been occurred?
You can retrieve the Process Name using the Stepping Verbose. It should be possible to distinguish between elastic and inelastic scattering process.
A specific solution would be to obtain the end point of the step in your
UserSteppingAction and see what process occurred there. Then get the name of this process like so:
void SteppingAction::UserSteppingAction(const G4Step* step)
const G4StepPoint* endPoint = step->GetPostStepPoint();
const G4VProcess* process = endPoint->GetProcessDefinedStep();
G4cout << process->GetProcessName() << G4endl;
/* ... more code ... */