16.1. Energy Deposition
Table of Contents
`GetTotalEnergyDeposit()`
Energy deposition is the central quantity for many detector simulations. Whenever a charged particle passes through matter, it transfers part of its kinetic energy to the material. In Geant4 this energy transfer is recorded at each step, and user code can read it to build detector signals such as pulse height, dose, or spectra.
In Geant4, a step is represented by the G4Step class. Each step contains detailed information about what happened between the pre step point and the post step point. One of the most commonly used methods of G4Step is GetTotalEnergyDeposit(), which returns the energy deposited in the material during that single step.
The method is called as
G4double edep = step->GetTotalEnergyDeposit();
where step is a pointer to a G4Step object, for example inside a SteppingAction or a sensitive detector. The returned value has units of energy, so you will typically see it used together with Geant4 units, for example:
if (edep > 0.) {
G4cout << "Edep in this step: " << edep/keV << " keV" << G4endl;
}
Internally, Geant4 may split the total step energy loss into continuous processes and discrete interactions. The method GetTotalEnergyDeposit() already sums all contributions for that step that represent real energy given to the material. For example, ionization, excitation, and absorption of low energy secondaries are included. Energy carried away by explicit secondary particles, such as delta electrons or gammas that are tracked, is not counted as deposited in that step, because it still leaves the current particle and continues through the geometry.
It is important to distinguish between total energy loss and total energy deposit. The total energy that the primary particle loses in a step, which can be accessed by other methods of G4Step, includes energy carried away by secondaries. GetTotalEnergyDeposit() only counts the part that actually remains locally in the material as heat, scintillation excitation, or similar. For detector modeling, this is usually the quantity you want.
You will often see GetTotalEnergyDeposit() used inside a sensitive detector implementation to create hits. A typical pattern is to check the energy deposited in the current step, possibly apply a threshold, and then add it to a hit object or accumulate it within the event:
G4bool MySD::ProcessHits(G4Step* step, G4TouchableHistory*)
{
G4double edep = step->GetTotalEnergyDeposit();
if (edep <= 0.) return false;
// Use edep, for example:
// - add to an existing hit for this cell
// - create a new hit with edep, position, and time
// - accumulate edep in a per event variable
return true;
}
When you accumulate energy deposition over many steps and many events, you obtain quantities such as per event energy deposit in a detector volume, depth dose in a phantom, or absorbed dose. For absolute beginners it is enough to remember that every time a track makes a step in a sensitive volume, you can extract the deposited energy using GetTotalEnergyDeposit() and add it where it is relevant for your analysis.
For convenience, you can relate energy deposition to absorbed dose, which is defined as energy per unit mass:
$$
D = \frac{E_{\text{dep}}}{m}
$$
with $D$ in gray (Gy), $E_{\text{dep}}$ in joule, and $m$ in kilogram. In Geant4 you will typically work in MeV and grams or kilograms, so you may need to convert units using the Geant4 unit system before calculating a dose from the accumulated GetTotalEnergyDeposit().
GetTotalEnergyDeposit() returns the energy deposited in the material during a single step, not the total energy lost by the particle and not a sum over an entire event. To obtain event level or detector level quantities, you must accumulate the returned value over all relevant steps and then, if needed, convert units and normalize to mass or number of particles.
Views: 10
KAHIBARO