A halide scintillator crystal (NaI, CsI, CaF₂ doped with a small amount of Tl or Eu "activator" ions) absorbs an incoming gamma photon by the photoelectric effect at a random depth in the lattice. The absorbed energy kicks thousands of electrons into the conduction band; each electron-hole pair migrates to a nearby activator site and recombines there, emitting one visible-light photon. The mean number of scintillation photons is proportional to the deposited energy:
N̄ = LY × E_deposited
LY = light yield (photons/MeV), material-dependent
QE ≈ 0.25 = photomultiplier quantum efficiency
The actual photon count in any single event is a genuine Poisson-distributed random draw around that mean — this simulator samples a real Poisson variate for both emission and detection, event by event, rather than injecting synthetic noise. Because a Poisson distribution has standard deviation √N̄, the statistical energy resolution is:
R (FWHM, %) = 2.35 / √N_detected × 100
Repeating many events at the same energy builds a photopeak in the pulse-height spectrum whose relative width narrows as 1/√N — exactly how a real gamma-ray spectrometer (NaI(Tl) probe, CsI(Tl) detector in a PET/CT scanner) identifies an isotope by its characteristic gamma-line energy.
- Material — sets the light yield, so higher-yield crystals (CsI(Tl)) give sharper peaks than lower-yield ones (CaF₂(Eu)) at the same energy.
- Gamma energy — more deposited energy means more scintillation photons and a narrower relative resolution (√N grows slower than N).
- Light yield scale — lets you dial the light-yield constant itself up or down to see resolution improve/worsen independent of material choice, confirming the 1/√N scaling.
- Fire gamma photon — sends one photon into the lattice at a random entry column and interaction depth (deeper penetration on average at higher energy), spawning the visible cascade and adding one Poisson-sampled count to the spectrum.