How we can calculate energy deposition of secondary particles?

Hi guys,
I want to calculate energy deposition and dose of secondary particles. I know that I can calculate kinetic energy for secondary particles in stepping action. but for dose or Edep what can I do?

Thank you
mohaddeseh

Hi,

From a step you can get the total energy deposited during this one with the method GetTotalEnergyDeposit. To get the energy deposition from secondary particles you can apply a filter on the TrackID. Primary particle has a TrackID equal to 0. So all particles which have a TrackID equal to 1 can be considered as secondary particles.

Alexandre

1 Like

Thanks. I have tried this, and it works.
but I want to calculate energy deposition or dose for specific secondary particles, for instance, edep of the secondary electron. Now what should I do?

One way to do that would be, for instance, to check the track’s Particle Definition:

G4ParticleDefinition* trackParticleDef = step->GetTrack()->GetDynamicParticle()->GetParticleDefinition();

You can also previously store in a variable the particle definition of the particle you are interested in, for example:

fElectronDefinition = G4ParticleTable::GetParticleTable()->FindParticle("e-");

And then execute your code with the condition:

if(trackParticleDef==fElectronDefinition){
...
}
1 Like

yeah, you are right. thanks for your suggestion.
I tried it. but I’m not sure I should use your terms inside this one:
if(step-> GetTrack () → GetTrackID() == 1);
{

}
or I can use your terms individually?
because in every case I get different values.

It is also questionable to me that you used “e-” for electron, Is there a special model for writing the names of particles?