hello. everyone!
I study the interaction between gamma photons and NaI.
In my SteppingAction I want to print the physical process of gamma and the source of electrons.
auto particleName = fParticleDef->GetParticleName();
if (fParticleDef == G4Gamma::GammaDefinition())
{
const G4VProcess* process = step->GetPostStepPoint()->GetProcessDefinedStep();
G4String processName = " UserLimit";
if (process) { processName = process->GetProcessName(); }
in the print results of "Gamma - Process " there are Transportation, compt, Rayl, but without “phot”.
However, in the print results of " - ElectronProcess: " there are “phot”, “compt” and “eIoni”.
The photoelectric effect does happen, why can’t I get it through the physical process of gamma photon.
in particular, these two are in the same thread and right after another (so it presumably is the electron originating from the photoelectric effect, where the gamma is destroyed):
Thank you for your reply!
I just tried changing the particle gun energy, changing the physics list, but “phot” still did not appear.
Maybe I should take another look at Geant4’s example and compare the difference between my project and the Geant4 example.
I noticed that you filter for gamma by comparing fParticleDef == G4Gamma::GammaDefinition() but the electron with particleName == "e-"…
→ could it be that fParticleDef was changed to be the electron already when the snippet is executet? In my tests I obtained the ParticleDefinition from the track directly!