28.4. Comparing with Analytical Calculations
Table of Contents
Why Compare with Analytical Calculations
Analytical calculations provide a simple, transparent reference to check whether your Geant4 simulation behaves reasonably. They are often based on textbook formulas or simplified models that you can evaluate by hand or with a calculator.
For beginners, it is important to understand that you are not trying to reproduce every detail of Geant4 with an analytical model. Instead, you use analytical results to check limiting cases, approximate trends, orders of magnitude, and simple geometries where the physics is well understood.
Analytical checks are especially useful early in a project, when your geometry, materials, and source definition might still contain mistakes. If your simulation disagrees with a clean analytical prediction by a large factor, it often points to a conceptual or implementation problem instead of a subtle physics issue.
Use analytical calculations to test simple, controlled situations. Large, unexplained discrepancies usually indicate bugs in geometry, materials, source, or scoring, not “new physics.”
Choosing Suitable Analytical Benchmarks
Not every simulation has a convenient analytical solution. Your first task is to identify parts of the setup that can be simplified into a standard textbook problem.
Typical examples include straight beams in uniform materials, simple slab geometries, and point sources in infinite or semi infinite media. When your real detector is complex, you can often extract sub problems that are simple enough to compare with formulas, such as a single layer of material or a simplified homogeneous detector volume.
A useful strategy is to define minimal test geometries specifically for validation. For example, instead of immediately simulating a full PET scanner ring, start with a single crystal block and compare an energy spectrum or attenuation curve to an analytical expectation.
Common Analytical Models
Several simple analytical models appear again and again in radiation physics and detector simulations. Learning to recognize when they apply makes validation much easier.
The following table lists some common models:
| Situation | Typical analytical model |
|---|---|
| Monoenergetic photons through a slab | Exponential attenuation |
| Charged particles slowing in matter | Continuous slowing down approximation, range tables |
| Dose in a uniform infinite medium | Energy per mass, simple scaling relations |
| Point source in vacuum | Inverse square law for fluence or intensity |
| Simple scattering angles (low Z, low E) | Rutherford or Mott scattering (for charged particles) |
| Thin target energy loss | Bethe Bloch stopping power, small thickness limit |
For an educational course, the most accessible models are exponential attenuation, inverse square law, and simple stopping power and range estimates. More sophisticated models, such as detailed multiple scattering distributions or build up factors, are usually not necessary for basic validation.
When using an analytical model, write down its assumptions. Only compare Geant4 results in regimes where those assumptions are approximately valid.
Example: Exponential Attenuation of Gamma Rays
One of the most useful comparisons for beginners is the attenuation of monoenergetic gamma rays in a simple shield. This connects directly to many Geant4 exercises, such as a radiation shielding example or a simple gamma detector with a front layer of material.
Analytical formula
For a narrow, monoenergetic photon beam of initial intensity $I_0$ passing through a slab of uniform material with thickness $x$, the analytical model for unscattered beam intensity is:
$$
I(x) = I_0 \, e^{-\mu x},
$$
where $\mu$ is the linear attenuation coefficient of the material, in units of $\text{length}^{-1}$ (for example, $\text{cm}^{-1}$).
Sometimes you know the mass attenuation coefficient $\mu_\text{m}$, in $\text{cm}^2/\text{g}$, and the density $\rho$ of the material. Then
$$
\mu = \mu_\text{m} \, \rho.
$$
From the exponential law you also get the transmission fraction
$$
T(x) = \frac{I(x)}{I_0} = e^{-\mu x}
$$
and the attenuation fraction
$$
A(x) = 1 - T(x) = 1 - e^{-\mu x}.
$$
For monoenergetic photons in a uniform slab, the unscattered beam transmission is
$$
T(x) = e^{-\mu x}.
$$
This is the key reference formula for simple shielding validation.
Matching the simulation to the model
To compare Geant4 with this formula, you must construct a simulation that respects the assumptions of the model as closely as possible:
- Use a monoenergetic, collimated gamma source, such as a pencil beam of photons perpendicular to the slab.
- Use a homogeneous slab with known density and composition.
- Place a detector immediately behind the slab, with an area large enough to collect the transmitted beam.
- Count only photons that pass through the slab without interactions if you want to match the narrow beam attenuation exactly. If you cannot easily distinguish scattered photons, note that you will measure a slightly larger transmission due to scattered contributions.
By varying the slab thickness and recording the fraction of photons that reach the detector, you can build up an empirical transmission curve from Geant4 and compare it to $T(x) = e^{-\mu x}$.
Example: Stopping Power and Range
Charged particle beams, such as protons in water, are another classic case where analytical or semi empirical models are available. Textbooks and databases provide stopping power curves and ranges that you can use as external reference.
Simplified range estimate
If $S(E)$ is the stopping power, or the mean energy loss per path length, then in the continuous slowing down approximation the range $R$ of a particle with initial energy $E_0$ in a material is
$$
R(E_0) = \int_{0}^{E_0} \frac{1}{S(E)} \, dE.
$$
In practice, you often use tabulated values or an approximate formula instead of performing this integral yourself.
For a basic check, you do not need the exact integral. You can look up a range value from reliable data, such as ICRU or NIST PSTAR tables, and compare the position of the Bragg peak in your Geant4 depth dose curve.
Use tabulated stopping power and range data as external references. The position of the Bragg peak in your simulation should agree with the tabulated range within a small percentage if physics and geometry are correct.
Practical comparison
To compare with an analytical or tabulated range:
- Simulate a monoenergetic, narrow proton beam entering a homogeneous water phantom.
- Score the energy deposition as a function of depth along the beam axis.
- Construct the depth dose curve and identify the depth of maximum dose (Bragg peak).
- Compare this depth with the expected range from tables for the same initial energy.
Small differences can result from production cuts, step size limitations, or slightly different physics models. Large differences often signal unit mistakes, wrong material density, or incorrect source energy.
Example: Inverse Square Law
For a point source in vacuum, or in air with negligible attenuation, the fluence or intensity on a detector at distance $r$ follows an inverse square law:
$$
I(r) \propto \frac{1}{r^{2}}.
$$
This is a very simple but powerful sanity check. To compare Geant4 with this law:
- Place a pointlike isotropic source in vacuum.
- Use a small detector area at different distances $r$ along one axis, keeping the detector orientation fixed and perpendicular to the source direction.
- Record the number of particles per unit time or per event reaching the detector at each distance.
You should find that the product $I(r) \, r^{2}$ is approximately constant, within statistical uncertainties.
For a pointlike isotropic source in vacuum,
$$
I(r) \, r^{2} = \text{constant}.
$$
If this fails by a large factor, suspect geometry, source definition, or scoring errors.
Setting Up Comparable Geant4 Scenarios
To obtain a meaningful comparison, you must control as many variables as possible and ensure that the simulation conditions match the analytical model.
First, use simple geometries. Analytical formulas usually assume infinite planes, uniform slabs, or points. In Geant4, approximate these with large enough shapes that boundary effects are negligible in the region you measure.
Second, define the particle source carefully. If the analytical calculation assumes monoenergetic particles, ensure that your Geant4 source uses a fixed energy rather than a distribution. If it assumes a narrow beam, use a small beam size and well defined direction.
Third, set materials and densities explicitly, and confirm that they match the values used in the analytical model or reference data. If you use NIST materials, check the density printed by Geant4 and use the same density in your manual calculation.
Fourth, decide what you will score, such as transmission fraction, fluence, deposited energy, or dose, and choose a scoring method in Geant4 that corresponds to the analytical quantity. For example, if the formula describes uncollided beam intensity, your scoring should count surviving primary particles rather than all particles including scattered ones.
Finally, run enough events to reduce statistical noise to a level where differences between simulation and analytical prediction are visible. For a simple exponential attenuation check, you typically want statistical uncertainties below a few percent for each thickness value.
Interpreting Differences and Uncertainties
Differences between Geant4 and an analytical result always contain at least two contributions: the Monte Carlo statistical uncertainty and the mismatch between the real physics and the simplified analytical model.
Statistical uncertainty arises because Geant4 uses Monte Carlo sampling. If $N$ particles contribute to your measured quantity, and you count them as independent events, the relative statistical uncertainty is roughly
$$
\frac{\sigma}{N} \approx \frac{1}{\sqrt{N}}.
$$
For example, with 10 000 transmitted photons, the relative statistical uncertainty is about 1 percent. You should always estimate this uncertainty so that you do not over interpret small deviations.
Model mismatch occurs because analytical formulas are idealizations. For instance, exponential attenuation is exact only for unscattered photons in a narrow beam with no build up from scattered photons. If your detector collects scattered photons, or if your beam is broad, you will see small systematic deviations from the simple exponential law.
A practical way to interpret differences is:
- Quantify the statistical uncertainty of your simulation points.
- Plot the analytical curve and the simulation data with error bars.
- Check whether the data points lie within the combined band defined by statistical errors and expected model approximation error.
- If deviations are significantly larger, systematically check geometry, materials, source, physics list, and scoring implementation.
Always compare Geant4 results to analytical calculations with uncertainties in mind. A difference smaller than a few times the statistical error plus the model approximation error is usually acceptable.
By combining simple, transparent analytical checks with careful simulation setup, you can quickly gain confidence that your Geant4 application is correctly implemented before moving on to more complex and realistic scenarios.
Views: 10
KAHIBARO