13.3. Energy Deposition
Table of Contents
Deposited energy
When a particle moves through matter in Geant4, it is transported in discrete steps. For each step, Geant4 calculates how much energy the particle loses and where that energy goes. The key quantity you will use in C++ is the total energy deposited in the medium during that single step.
From inside a SteppingAction or any code where you have access to a G4Step*, you can retrieve the deposited energy with
G4double edep = step->GetTotalEnergyDeposit();.
This value is given in internal Geant4 energy units, typically eV, but in most analyses you will store or print it converted to something like keV or MeV using the unit constants. For example, you might write $edep / keV$ to obtain the energy deposition in keV.
It is important to understand what this energy deposit represents. Geant4 separates the energy lost by the particle into different channels. Some fraction of the energy is actually deposited in the material and is available to create a detector signal, for instance ionization or excitation in a scintillator. Another fraction may be carried away by newly created secondary particles. The method GetTotalEnergyDeposit() reports only the energy that stays locally in the current step’s volume, not the kinetic energy carried away by secondaries.
In many detector simulations, you will use the step energy deposit as the basic building block for quantities like energy per event or energy in a particular detector element. A typical pattern is to access GetTotalEnergyDeposit() in a SteppingAction or in a sensitive detector’s ProcessHits() method and accumulate it into a hit object or into an analysis variable.
Important rule: GetTotalEnergyDeposit() returns the energy that is left in the material in that step, not the total kinetic energy lost by the track, and not the energy carried by secondary particles leaving the step.
You should also be aware that not every step has a nonzero deposited energy. Steps that are purely geometrical, for instance a step that ends because the track crosses a volume boundary without undergoing an interaction, can have GetTotalEnergyDeposit() equal to zero. Therefore, analysis code must always be prepared to handle steps with zero deposit and usually accumulates only positive values.
Total energy loss
The total energy loss of a particle track is the sum of the energy the particle has transferred out of its own kinetic energy. This includes both the energy that is locally deposited and the energy that is given to secondary particles. For detailed detector response, the deposited energy is usually the main focus, but for physics checks such as energy conservation or balance studies, it is often useful to compare deposited energy with total energy loss.
On a single step, these two quantities are related qualitatively as
$$
E_{\text{loss}} = E_{\text{deposit}} + E_{\text{to secondaries}},
$$
where $E_{\text{loss}}$ is the total energy lost by the primary particle during that step, $E_{\text{deposit}}$ is what you obtain from GetTotalEnergyDeposit(), and $E_{\text{to secondaries}}$ is the kinetic energy assigned to new secondary tracks. Geant4 provides different ways to inspect these contributions.
To estimate the total energy lost in a step, you can compare the kinetic energies at the pre step and post step points of the track. Given a G4Step* step, this looks conceptually like
$$
E_{\text{loss, step}} = E_{\text{kin, pre}} - E_{\text{kin, post}},
$$
where you access the two values through the step’s pre step and post step points. This expression includes both local deposition and the energy taken away by secondaries and therefore is usually larger than or equal to GetTotalEnergyDeposit().
If you are interested in how much energy goes into new particles, you can also inspect the secondary tracks generated in that step and sum their kinetic energies. By doing so, you can explicitly verify that the total energy lost by the primary is balanced by deposited energy plus secondary energies, up to numerical precision.
From an analysis point of view, the distinction is crucial. The detector signal is driven by deposited energy, while the total energy loss reflects the full interaction history of the particle, including particles that may escape the sensitive part of your detector. When checking your simulation’s energy balance, you typically accumulate over many steps and many tracks both the sum of GetTotalEnergyDeposit() over all steps and the initial kinetic energy of all primaries, and then account for energy that leaves the system with escaping particles.
Key statement: For detector response studies, use the sum of deposited energy over steps. For physics balance and consistency checks, compare the total energy loss of all tracks with the sum of deposited energy plus the energy carried away by particles that leave your geometry.
As you build more complex simulations, you will combine these ideas. You might calculate per event the total deposited energy in a chosen volume, while at the same time monitoring the difference between initial beam energy and the sum of all deposits in all volumes. This helps you detect configuration mistakes, such as missing sensitive regions or inappropriate production cuts, that could hide part of the energy flow in your simulation.
Views: 8
KAHIBARO