KAHIBARO
Discord Login Register

45.9. Analyzing the Spectrum

Understanding the Simulated Spectrum

Once you have created the energy spectrum from your gamma ray detector simulation, the next step is to interpret what the spectrum contains and what it tells you about your detector and source. This chapter focuses on the basic analysis you can perform as a beginner, using the output from the previous steps in this practical example.

A typical spectrum from a monoenergetic gamma source shows a main photopeak, lower energy counts from scattered photons, and sometimes features related to detector limitations. By analyzing these components, you can check if your simulation behaves as expected and compare it with experimental data or theory.

Checking the Photopeak

The most important feature in a simple gamma ray spectrum is the photopeak. For a monoenergetic gamma source, this peak appears around the gamma energy, for example near 511 keV for annihilation photons or 140 keV for Tc 99m.

You usually start from the binned spectrum that you created, for instance using NumPy and Matplotlib. The photopeak appears as the highest peak in the spectrum. First, you identify the bin with the maximum number of counts and read its central energy. This gives an estimate of the measured peak position.

The peak position tells you whether your detector calibration in the simulation is correct. If you simulated a 511 keV source and the peak appears near 511 keV, then your basic energy handling and unit usage are consistent. A clear shift of the peak to lower or higher energy indicates that something might be wrong in how you process or blur the energy, or possibly in your binning or units.

It is useful to verify that the peak width looks reasonable compared to the energy resolution you configured. A narrower peak corresponds to better energy resolution, while a broader one corresponds to poorer resolution.

Peak Fitting and Energy Resolution

To quantify how good your energy measurement is, you can fit the photopeak with a Gaussian function and extract two key quantities: the peak mean and the peak width. The mean should be close to the true gamma energy, and the width describes the detector energy resolution.

A simple Gaussian model for the peak is

$$
f(E) = A \exp\left( -\frac{(E - \mu)^2}{2\sigma^2} \right)
$$

where $E$ is energy, $A$ is the peak amplitude, $\mu$ is the peak position and $\sigma$ is the standard deviation of the peak.

The energy resolution is typically expressed as a full width at half maximum (FWHM). For a Gaussian peak, you can convert $\sigma$ to FWHM with

$$
\text{FWHM} = 2.355 \, \sigma
$$

You then define the relative energy resolution as

$$
R = \frac{\text{FWHM}}{\mu}
$$

and often express it as a percentage.

For a Gaussian peak:
$\text{FWHM} = 2.355 \, \sigma$
Relative energy resolution:
$R = \dfrac{\text{FWHM}}{\mu} \times 100\,\%$

By fitting the simulated spectrum and computing $R$, you can check if the energy resolution matches the value you configured in the digitizer. For example, if you aimed for 10 percent resolution at 511 keV, your measured $R$ should be close to 10 percent. If it is very different, verify your blurring parameters and how you constructed the spectrum.

A typical practical procedure is to select an energy range around the peak, such as from 80 percent to 120 percent of the nominal energy, fit a Gaussian plus a small constant background, and then compute the resolution from the fit parameters.

Identifying Compton and Other Features

Below the photopeak, your spectrum will contain counts at lower energies. These usually come from photons that lost part of their energy through Compton scattering before depositing energy in the detector or leaving it. This region is called the Compton continuum.

You can recognize the Compton continuum as a broad distribution from near zero energy up to some cutoff below the photopeak. The exact shape depends on the source energy, the detector material and geometry, and the amount of scattering in the surrounding environment or phantom.

In simulations of thick, high Z scintillators and monoenergetic gamma sources, you may also notice a Compton edge. This is a sharper drop in counts at the maximum energy that an electron can receive in a single Compton scatter. The position of this edge can be predicted analytically from Compton kinematics, using the maximum energy transfer to the electron. You can then compare the simulated edge position to this expected value as a qualitative validation.

Sometimes you will see additional features. Escape peaks can appear in some detectors when characteristic X rays escape the crystal after a high energy interaction. A backscatter peak may be visible at lower energy if photons scatter in the surrounding materials and then interact in the detector. For this introductory example, it is enough to recognize that any structure below the main photopeak indicates scattered processes that are correctly handled by the physics list.

Applying and Evaluating Energy Windows

Energy windows are simple selection rules that keep events within a certain energy range and reject the others. They are often applied in the digitizer, but you can also apply them at the analysis stage by selecting only counts in a chosen energy interval.

To choose an energy window, you look at your spectrum and decide what fraction of the peak and surrounding continuum you want to accept. For instance, in a spectrum with a clear photopeak, you may select a symmetric window around the peak energy, such as 20 percent full width at half maximum, or a fixed relative range around the nominal gamma energy, for example from 350 keV to 650 keV for 511 keV photons.

You can implement this in analysis by counting events whose energy $E$ satisfies

$$
E_{\text{low}} \le E \le E_{\text{high}}
$$

where $E_{\text{low}}$ and $E_{\text{high}}$ define the window. The choice of these limits affects the tradeoff between sensitivity and scatter rejection.

You can evaluate the effect of a window by recomputing the spectrum with only accepted events or by computing the total number of counts inside and outside the window. For PET like examples, you often define a relatively narrow window around the 511 keV peak to reduce scattered events, while for some other applications a wider window might be acceptable.

By systematically varying the energy window and observing the changes in total counts and in the shape of the accepted spectrum, you gain intuition about how energy selection improves image quality or measurement accuracy in real detectors.

Comparing with Expectations and Experiment

Analysis of the simulated spectrum is most useful when you compare the results with something external, either analytical expectations or experimental data.

For a monoenergetic source, you can start with basic checks. Confirm that the peak appears at the correct energy within a small deviation. Confirm that the measured energy resolution from the fit matches the input resolution. Check that the total number of counts scales roughly with the simulated activity, acquisition time, and the solid angle covered by the detector.

If you have experimental data for the same detector and source, you can overlay the simulated and measured spectra after normalization. Look at the peak position, width, and the relative height of the Compton continuum. Good agreement indicates that your geometry, materials, physics list and digitizer parameters are reasonably realistic. Significant discrepancies highlight areas to refine in your model.

A simple way to organize this comparison is shown in the following table.

AspectWhat to check in simulationTypical action if mismatch
Peak positionClose to nominal gamma energyCheck units, binning, and energy calibration
Peak width and resolutionSimilar to desired or measured energy resolutionAdjust blurring parameters in the digitizer
Continuum shapeQualitative match to experimental continuumRevisit geometry, materials, and scattering environment
Relative peak heightComparable ratio of peak to total countsVerify source activity, acquisition time, and window choice

By completing these steps for your gamma ray detector example, you learn how to move from raw simulation output to meaningful performance metrics. This same style of spectrum analysis, focusing on peak position, resolution, scattered contributions, and energy selection, will be reused in more advanced examples throughout the course.

Views: 11

Comments

Please login to add a comment.

Don't have an account? Register now!