24.8. Calculating Attenuation
Table of Contents
Understanding Attenuation in a Simulation
In a radiation shielding simulation you are usually interested not only in how many particles pass through a shield, but in how strongly the shield attenuates the radiation. In Geant4 you can obtain attenuation quantities directly from the numbers of primary particles that reach a detector placed behind the shield. This section explains how to turn those counts into attenuation factors and attenuation coefficients, and how to do it in a way that is consistent across different materials and thicknesses.
Transmission and Attenuation Factor
The basic observable in a shielding study is the transmission. Suppose you shoot a known number of primary gamma rays at a shield of a given material and thickness, and count how many are detected behind the shield. Let $N_0$ be the number of incident primary particles and $N$ be the number that reach your detector according to some selection criteria, for example particles that deposit nonzero energy in a detector volume behind the shield.
You can define the transmission $T$ as
$$
T = \frac{N}{N_0}.
$$
This is a dimensionless number between 0 and 1 that represents the fraction of particles that pass through the shield. Often you are interested in the attenuation factor, which is simply $1/T$, or you quote the percentage attenuation $(1 - T)\times 100\%$.
In a Geant4 simulation you usually know $N_0$ because you set the number of primaries per run with /run/beamOn. You then obtain $N$ by counting relevant events or tracks in your sensitive detector or in your user actions. For a basic shielding study it is common to define that an event is "transmitted" if at least one gamma deposits any energy in a small detector region placed immediately after the shield.
For a simple shielding study, define transmission as
$$T = \frac{\text{number of events with detected particles behind the shield}}{\text{total number of primary events}}.$$
This definition is flexible. You can adjust what counts as "detected" by applying cuts on deposited energy or on position, depending on the level of realism you want.
Exponential Attenuation Law
For a broad range of photon energies and absorber materials the intensity of a narrow, monoenergetic beam passing through matter can be approximated by an exponential attenuation law. If $I_0$ is the initial intensity and $I(x)$ is the intensity after traveling a thickness $x$ of material, then
$$
I(x) = I_0 e^{-\mu x},
$$
where $\mu$ is the linear attenuation coefficient. In a simulation that uses a pencil beam with a fixed cross section, the ratio $I(x)/I_0$ can be replaced by your transmission $T$, because both are proportional to the number of particles per unit time or per event.
You can therefore write
$$
T = \frac{I(x)}{I_0} = e^{-\mu x}.
$$
This connects your simulated transmission to a material property, the linear attenuation coefficient. If you know $x$ and $T$ from the simulation you can solve for $\mu$.
The exponential attenuation law used in most shielding studies is
$$T = e^{-\mu x},$$
where $T$ is the transmission, $x$ is the shield thickness, and $\mu$ is the linear attenuation coefficient.
This law is approximate and assumes a simple geometry and a narrow beam that is not significantly scattered back into the detector. In a Geant4 simulation, if the geometry and scoring definition are kept simple, the simulated data often follow this form well enough that you can fit for $\mu$.
Calculating the Linear Attenuation Coefficient
To extract the linear attenuation coefficient from your simulation, you need the transmission for a known thickness. If you simulate a shield with thickness $x$ and obtain a transmission $T$, you can write
$$
T = e^{-\mu x}.
$$
Taking the natural logarithm of both sides gives
$$
\ln T = -\mu x.
$$
Solving for $\mu$ yields
$$
\mu = -\frac{1}{x}\ln T.
$$
You can perform this calculation after the simulation by reading the total number of primary events and transmitted events from your output, or you can compute it directly in your RunAction at the end of the run and print the value to the console or store it in a file.
Given shield thickness $x$ and transmission $T$, compute the linear attenuation coefficient as
$$\mu = -\frac{1}{x}\ln T.$$
The unit of $\mu$ depends on the unit of $x$. If $x$ is in centimeters, then $\mu$ will be in $\text{cm}^{-1}$. In Geant4 you might define $x$ in terms of the built in unit cm; when you print or store results, convert to a consistent unit system to compare different materials and to reference data from tables.
In practice you often simulate several thicknesses of the same material, obtain $T(x)$ for each, and then make a semi logarithmic plot of $\ln T$ versus $x$. The data should approximately form a straight line with slope $- \mu$. Fitting a straight line gives you an estimate of $\mu$ along with an uncertainty.
Mass Attenuation Coefficient
The linear attenuation coefficient $\mu$ depends both on the material composition and on its density. To compare shielding power in a way that separates these two effects, it is useful to work with the mass attenuation coefficient $\mu/\rho$, which has units of area per mass, for example $\text{cm}^2/\text{g}$.
If you know $\mu$ from your simulation and the material density $\rho$, which you used when you defined the Geant4 material, you can compute
$$
\frac{\mu}{\rho} = \frac{\mu}{\rho}.
$$
Here $\rho$ must be in consistent units, for example $\text{g}/\text{cm}^3$ if you want $\mu/\rho$ in $\text{cm}^2/\text{g}$. Geant4 materials can be created with densities in different units, so when you write the value to an output file convert it explicitly to the unit you want.
The mass attenuation coefficient is obtained from the linear coefficient and density:
$$\frac{\mu}{\rho} = \frac{\mu}{\rho},$$
typically expressed in $\text{cm}^2/\text{g}$ when $\mu$ is in $\text{cm}^{-1}$ and $\rho$ in $\text{g}/\text{cm}^3$.
Mass attenuation coefficients for many materials and energies are tabulated and can be used later in validation, where you will compare your simulated values to reference databases.
Implementing Attenuation Calculations from Simulation Data
To calculate attenuation in a Geant4 radiation shielding example you first need to design how you will count incident and transmitted events. In a simple setup, you can define a narrow collimated beam of gamma rays that hits the center of a shield slab. Immediately behind the shield you place a thin detector volume, for example a G4Box, configured as a sensitive detector that records when any energy is deposited.
In your sensitive detector code you can create a hit or increment a counter when energy deposition occurs in an event. At the end of each event, in your EventAction, you can check whether the detector recorded at least one hit. If it did, you mark the event as transmitted. You also keep a separate counter of the total number of events, which is simply the number of primaries generated.
After the run is finished, in your RunAction you will know $N_0$ from the number of processed events and $N$ from the number of transmitted events. You can then compute the transmission, its statistical uncertainty, and the attenuation coefficients.
A typical procedure is:
- Run the simulation with a fixed shield thickness and material, and a known number of primary events.
- Count the number of events with at least one hit in the detector behind the shield.
- Compute $T = N / N_0$.
- Compute $\mu$ from $T$ using the thickness $x$.
- Optionally, convert $\mu$ to a mass attenuation coefficient with the material density.
If you repeat this for different shield thicknesses you can cross check the stability of your estimated $\mu$. If your results fit the exponential law well, the extracted values for different thicknesses should be consistent within the statistical uncertainties.
Statistical Uncertainties in Attenuation
Every Geant4 simulation is a Monte Carlo calculation, so your counts $N$ and $N_0$ have statistical fluctuations. To interpret attenuation properly you should attach uncertainties to $T$ and to the derived coefficients. If $N_0$ is fixed and large, the uncertainty is dominated by the fluctuation in $N$, which is approximately Poissonian for independent events.
If $N$ follows a Poisson distribution with mean $\lambda$, the variance is $\sigma_N^2 \approx N$. Therefore, an approximate standard deviation for the transmission is
$$
\sigma_T = \sqrt{\frac{N}{N_0^2}} = \frac{\sqrt{N}}{N_0}.
$$
Using standard error propagation for $\mu = -\frac{1}{x}\ln T$, the uncertainty in $\mu$ can be approximated as
$$
\sigma_\mu = \frac{1}{x}\,\frac{\sigma_T}{T}.
$$
Substituting the expressions for $T$ and $\sigma_T$ gives
$$
\sigma_\mu = \frac{1}{x}\,\frac{\sqrt{N}}{N}.
$$
These formulas assume that $N_0$ is large and exactly known and that $N$ is not extremely close to zero. If the shield is very thick so that only a few events transmit, you need many more primary events to obtain a reliable and statistically stable estimate of $T$. When designing your runs you should choose the number of events so that you have a useful statistical precision on the smallest transmission values you care about.
When $N$ events transmit out of $N_0$ incident events, a simple estimate of the uncertainty in the transmission is
$$\sigma_T \approx \frac{\sqrt{N}}{N_0},$$
and the uncertainty in $\mu$ from one thickness $x$ is approximately
$$\sigma_\mu \approx \frac{1}{x}\,\frac{\sigma_T}{T}.$$
In many introductory shielding studies you may not need to calculate these uncertainties explicitly, but they become important if you plan to compare different materials quantitatively or to validate your simulation against reference data.
Comparing Attenuation across Materials and Thicknesses
Once you can compute attenuation from your Geant4 outputs, you can perform meaningful comparisons. For a fixed photon energy and a fixed shield thickness $x$, you can compute $T$ and $\mu$ for several materials, for example lead, aluminum, and concrete. A simple table might look like the following, where all shields have the same thickness:
| Material | Density $\rho$ ($\text{g}/\text{cm}^3$) | Thickness $x$ (cm) | Transmission $T$ | $\mu$ ($\text{cm}^{-1}$) | $\mu/\rho$ ($\text{cm}^2/\text{g}$) |
|---|---|---|---|---|---|
| Lead | 11.34 | 2.0 | 0.05 | 1.50 | 0.132 |
| Aluminum | 2.70 | 2.0 | 0.60 | 0.26 | 0.097 |
| Concrete | 2.30 | 2.0 | 0.40 | 0.46 | 0.200 |
The numbers here are illustrative, not precise. This type of table lets you see which material attenuates more strongly per unit length and per unit mass. The mass attenuation coefficient helps you compare efficiency in terms of weight, which can be important in engineering designs.
If you simulate several thicknesses for each material, you can also plot $T$ as a function of $x$, or $\ln T$ vs $x$, and examine how well the results follow the exponential law. This gives additional confidence that your counting definition and geometry are appropriate and that your attenuation calculations are reliable.
By systematically extracting attenuation factors, linear coefficients, and mass attenuation coefficients from your simulation, you turn raw Geant4 particle counts into physically meaningful shielding properties that you can interpret, compare, and eventually validate against external data.
Views: 8
KAHIBARO