Hello everyone,
I’m doing a simulation that fast neutrons (10-20 MeV) are impinging on a polythene (PE) sample. I’m interested in the elastic scattering that happed between the incident neutrons and the hydrogen in the PE sample. I want to retrieve this hadElastic process in the TrackingAction but I failed.
I think the elastic scattering process did happen since I saw it when I set the tracking verbose as 1. You may see it in the below picture.
When I try to access and print the physics process name in the PE sample with following codes in TrackingAction:
void EDTrackingAction::PostUserTrackingAction(const G4Track* aTrack)
{
const G4StepPoint* endPoint = aTrack->GetStep()->GetPostStepPoint() ;
const G4VProcess* process = endPoint->GetProcessDefinedStep() ;
G4String ProcessName = process->GetProcessName() ;
if(process && process->GetProcessType()==fHadronic)
{
if(endPoint->GetPhysicalVolume()->GetName()==“PE”)
{
G4cout << "ProcessName: " << ProcessName << G4endl ;
}
}
}
It only printed “neutronInelastic” process, but the “hadElastic” process was not printed at all. I do not understand this.
Anybody know the reason of this? Any help or advice will be much appreciated! Thank you.