How can get energy deposit of each particle separately?

Hi everybody…
I have a problem with example of TestEm4 : How can we get just energy deposit of neutron when we run example with a neutron beam?
I want to get energy deposit of neutron and secondary particles separately but this example gives me total energy deposit…

I really appreciate any help you can provide…


I am a beginner so excuse me if I am not correct. I believe you can use particle filters along with primitive scorers to get this kind of results.


I’ve not looked at TestEm4 in particular (I could do) but here is a general comment.

Neutrons of themselves do not deposit energy in a step because they do not carry electric charge. When they interact, they produce secondaries, some of which are charged and deposit energy. So to get what you want, just add up the energy deposited for all steps of all tracks.

Geant4 allows you to determine if a particular track originated with a neutron, if that’s what you want.

1 Like

Many thanks for your reply.
You are right, I had forgotten this point !!
However I was using steppingAction and in this way my problem was in GetTotalEnergyDeposit function and filtering of particles…
But thanks you again. I will try your suggestion…