47.8. Creating Singles
Table of Contents
Understanding Singles in the PET Example
In the PET example, singles are the bridge between raw detector interactions and PET coincidences. You already record hits in the detector crystals; now you will convert these hits into processed detector events that look more like what a real PET scanner would output.
A single corresponds to one detection event in a crystal, with a single time, a single energy value, and an associated detector identifier. The digitizer will take many raw energy deposits in a crystal and combine them into one single reconstructed event.
From Hits to Singles in the Digitizer Chain
The singles are produced by a digitizer chain that you configure in the simulation. You already have an actor that records hits in the detector crystals. These hits contain detailed interaction information, including position and deposited energy per step.
To obtain singles, you attach a digitizer to the simulation and connect it to the hit collection. In a typical OpenGATE PET example, you create a digitizer object, select the input hits collection, and then add processing modules that transform hits into singles.
Conceptually, the chain steps are as follows. First, all hits in a given crystal that belong to the same event are grouped together in time. Second, the energy deposits of those hits are summed so that one interaction with multiple steps becomes one energy value. Third, the result is stored as a single entry that carries energy, time, and detector identification. Later steps in the PET example, such as energy blurring, thresholds, and coincidence sorting, will all act on this singles data.
Configuring Singles Creation in the PET Example
In your PET scanner example script, you usually start from something like a digitizer = sim.addDigitizer(name="PETDigitizer"). When you create the digitizer, you also specify which hit collection it will process, for instance the hits from the PET crystals.
Inside this digitizer, you now add a singles module. The singles module is responsible for grouping and summing hits to produce one single per detection event. The configuration includes which attributes from the hits are propagated to the singles and how the grouping is done in time.
A key parameter is the time window used for grouping hits into a single event. If secondary particles produce multiple hits in the same crystal within this time window, they will be merged into one single. The choice of this window should reflect the typical scintillation and readout times of your PET detector model. In the PET example, you will start with a simple configuration that merges all hits that share the same event ID and crystal ID, using a fixed integration time.
The digitizer then outputs a singles collection, often written to a ROOT file. Later in the PET example, you apply energy blurring and an energy window to these singles, and then sort them into coincidences.
Defining the Information Stored in Singles
For PET, the content of each single is crucial for later analysis. A single usually stores at least the deposited energy, the detection time, and the detector identifier.
The energy is obtained by summing all energy deposits of the grouped hits. In many examples, the singles energy is in keV and later used to select events around the 511 keV photopeak. The detection time is typically the time of the earliest or energy-weighted mean of the hits that belong to the single. Time is used later to form coincidences and, in TOF PET configurations, to estimate positions along the line of response.
The detector identification is often encoded as several indices. In your PET example, the detector ID is usually split into ring, module, and crystal indices. When configuring the singles creation, you specify which hit attributes should be copied to the singles. This allows you to preserve the detector hierarchy so that each single knows exactly which crystal recorded it.
You can also choose to keep the event ID and other useful tags that help you, for example, distinguish true, scattered, and random events during analysis. At this stage, singles still retain a clear link to the original simulated event, which will be used later in the example when identifying true coincidences.
Practical Steps in the PET Example Script
In practice, the PET example script will contain a section where the digitizer and singles are configured. The process follows a simple pattern. First, you create the digitizer and connect it to the crystal hits. Second, you add the singles module that groups and sums hits. Third, you specify the output file and collection name so that the singles are written to disk.
You keep this configuration relatively simple in the first PET example. More advanced processing, such as energy blurring and thresholds, is added in later sections. For now, the important point is that the singles you create here will be the basic PET events from which coincidences and lines of response are constructed in the subsequent steps of the PET scanner example.
Views: 10
KAHIBARO