loading...
Counting rate against simulated time: true event rate n (grey) and recorded rate m after dead time (orange)
Each button runs real simulations for the current crystal and resolution (a few seconds).
Press an experiment.
running...
How to use
Pick a preset or choose a source, distance and crystal. Each gamma the source sends toward the crystal is traced through it: yellow = incoming, blue = scattered, red / cyan / magenta dots = photoelectric / Compton / pair interactions. The crystal glows blue (scintillation) and the analyser screen on the right fills with the spectrum, shown larger in the panel. Markers: orange dashed = gamma line, blue dotted CE = Compton edge, green BS = backscatter peak, violet SE / DE = escape peaks, pink = sum peak. Try Co-60 at 2 cm and at 40 cm to see the sum peak vanish, raise the dead time with a hot source, and run the two experiments below. Drag to orbit, wheel or pinch to zoom, Space pauses, R resets. The bench, detector and electronics were modelled in Blender with baked PBR textures; all physics runs in JavaScript.
The science
What the detector does. A gamma photon entering a NaI(Tl) crystal gives up energy to electrons. The crystal turns each keV of deposited energy into about 38 blue photons, a photomultiplier tube (PMT) turns that light into an electrical pulse, and the multichannel analyser (MCA) sorts pulses by height into 1024 channels. The pulse height is therefore proportional to the energy deposited, not necessarily to the energy of the photon.
Three ways a photon interacts.
photoelectric: all of E is deposited (mu_pe falls roughly as E^-3)
Compton: E' = E / (1 + k (1 - cos theta)), k = E / 511 keV, deposit T = E - E'
pair production (E > 1022 keV): deposit E - 1022 keV locally, two 511 keV annihilation photons are emitted
The Compton angle follows the Klein-Nishina cross-section. In this simulator every photon is tracked through the crystal, so a photon that Compton scatters can scatter again, be absorbed, or leave. Full absorption gives the photopeak.
Compton edge and backscatter. The largest possible Compton deposit is at theta = 180 degrees:
T_max = E 2k / (1 + 2k) (Cs-137: 477.3 keV) E'_min = E / (1 + 2k) (Cs-137: 184.3 keV)
So the Compton continuum ends at a sharp Compton edge. A photon that passes through the crystal and scatters back from material behind it (lead shielding, the PMT) can return and be absorbed, giving a backscatter peak near E'_min. Above 1022 keV one or both 511 keV annihilation photons can escape: single escape (E - 511) and double escape (E - 1022) peaks. A radionuclide that emits two gammas at once (Co-60, Na-22) also gives a sum peak when both hit the crystal in the same event; its size falls as the square of the solid angle.
Resolution. The number of photoelectrons at the PMT is Poisson distributed, so the relative width falls as 1/sqrt(E):
FWHM(E) = R662 sqrt(662 keV x E), sigma = FWHM / 2.3548
A good 3 inch crystal has R662 of about 7 %. Photopeak width and the 12 % and 4 % extremes of the slider are shown live.
Geometry and counting. A point source on the axis at distance d from a disc of radius R sees the solid-angle fraction
Omega / 4 pi = (1 - d / sqrt(d^2 + R^2)) / 2
A narrow beam is attenuated as 1 - exp(-mu H). The MCA is busy for a dead time tau after each pulse; for a non-paralysable counter the recorded rate is
m = n / (1 + n tau)
Honest simplifications. (1) Attenuation of NaI uses log-log tables of approximate values, within about 10 to 15 % of tabulated data, not the full NIST XCOM set. (2) Rayleigh scattering, atomic binding in Compton scattering, X-ray fluorescence (the iodine K-escape peak) and bremsstrahlung from the secondary electrons are not modelled. (3) The source is a point on the crystal axis, the housing and the reflector are transparent to gamma rays, and there is no room background. (4) The lead behind the crystal is a toy model: a photon leaving through the rear face is scattered back with a probability set by the slider, at a Klein-Nishina angle beyond 107 degrees. (5) Na-22 annihilation photons are treated as independent back-to-back photons from the source and Co-60 gamma emission as isotropic and uncorrelated in direction. (6) The resolution law is the ideal 1/sqrt(E) and the detector response is linear. (7) Pile-up is ignored; only dead time loses counts. (8) The simulation runs far faster than a real 100 ms count so that a spectrum builds in seconds.
Checks run in the page. The Klein-Nishina sampler against a numerical integral of the differential cross-section; the maximum sampled recoil energy against the Compton-edge formula and the minimum scattered energy against the backscatter formula; the Simpson integral of the Klein-Nishina cross-section against its closed form; the fraction of random rays that strike the crystal against the solid-angle formula; the interacting fraction of a narrow beam against the Beer-Lambert law; energy conservation (deposited plus escaped equals incident) with pair production and backscatter switched on; the width and position of the photopeak measured in the spectrum against the resolution you set; and the recorded rate against n / (1 + n tau).