How to score only gamma particles

Hello everyone,
I have recorded all particles go to the ScoringVolume (as Basic/Example1).
But I only want to score gamma particles. So how can I do it?
Thanks in advance.

1 Like

in your SteppingAction class you can use a simple if condition:
if(step->GetTrack()->GetDynamicParticle()->GetDefinition()->GetParticleName() == "gamma"))

Thank you so much. I have implemented done.