Adding a Particle Source
Table of Contents
Particle type
In your first GATE simulation, the particle source is the object that creates particles and injects them into the world. In OpenGATE with Python, you typically start with a simulation object, then add a source through one of its source-management methods. The exact function names can vary by version, so you should always check the OpenGATE documentation or example scripts, but the overall logic is similar in all cases: you create a source, give it a name, and then configure its properties.
The first key property is the particle type. In GATE this is almost always specified using Geant4 particle names, for example "gamma", "e-" for electrons, "e+" for positrons, "proton", "neutron", or the name of an ion defined through ion support. When you are starting, you will usually choose photons or electrons because they are common in imaging and simple dose examples.
Configuring the particle type in code usually looks like assigning a string to a property of the source object. Conceptually, it means you tell GATE what physical particle definition to use from the Geant4 particle table. The choice of particle type must be consistent with the physics list that you configure later in the physics chapters. For example, if you choose protons, you must enable proton and hadronic physics so that interactions are handled correctly.
If you select a charged particle, such as an electron or proton, you should expect curved tracks and continuous energy loss in matter. If you select a neutral particle, such as a gamma, you will see point-like interactions where the particle disappears or changes direction in discrete events. This is important when you later interpret hits, dose, and detector signals.
Always choose a particle type that is compatible with the physics list used in your simulation, and use standard Geant4 particle names like "gamma", "e-", "e+", or "proton" when defining the source.
Energy
After selecting the particle type, you must define its energy. In a first simple simulation, you often use a monoenergetic source, where every particle has the same kinetic energy. In GATE, you specify this as a numerical value multiplied by a unit from the GATE unit system, which is described in detail in the units chapter. For example, a 511 keV gamma source commonly used in PET examples is set with a numeric value corresponding to 511 and the keV unit.
The energy is always the kinetic energy of the particle, not the total energy including rest mass. For photons, kinetic energy and total energy are the same, but for massive particles such as protons or electrons, you set the energy that they carry as motion. In OpenGATE Python, this is usually a property like source.energy.m or a similar field, depending on the version, which you set once for monoenergetic beams.
The choice of energy controls how far particles travel and how they interact. For example, low-energy photons are strongly attenuated in dense materials and may not reach your detector, while high-energy photons can penetrate more deeply. For charged particles, higher energy leads to longer range in matter, which is essential in proton therapy or electron dose simulations.
Later, you will learn how to define energy distributions and spectra. Those let you approximate realistic X-ray tubes, radionuclide emissions, or broad proton beams. For now, focus on understanding that every time you assign an energy, you must include the unit object, and you must be consistent with geometry sizes and material thicknesses so that the energies make physical sense in your setup.
When defining source energy, always multiply the numeric value by a GATE energy unit, such as keV or MeV, for example $511 \times keV$ for a PET gamma or $6 \times MeV$ for a megavoltage photon beam.
Position
The next step is to decide where in the world your particles start. The source position determines the spatial origin of particles and is always expressed in the same coordinate system as your geometry. By default, the world origin is at $(0, 0, 0)$, and positions are given in Cartesian coordinates $(x, y, z)$.
In GATE, the position is generally specified as a three-component vector multiplied by a length unit, such as mm or cm. A simple point source at the center of the world uses position $(0, 0, 0)$. If you want to place it above a phantom, you increase the z coordinate. If your phantom is, for example, a 10 cm cube centered at the origin, then its top surface is at $z = 5 \times cm$. Placing a source at $(0, 0, 7 \times cm)$ would put it 2 cm above the phantom.
The position can be a single point, but it can also be distributed within a region. GATE supports different spatial source shapes, such as points, boxes, and spheres. For a first simulation, you usually create a point source, which means every particle originates from exactly the same position, controlled by a simple vector parameter. Later, you can extend this to boxes or spheres so that the particles are sampled from a volume, which is important for extended phantoms and activity distributions.
Whatever position you choose, it must lie inside the world volume. If you accidentally place the source outside the world or inside a volume that is not what you intended, you may see no interactions in your detector or phantom. Visualization can help you confirm that the source is where you expect it to be relative to your geometry.
Always express source positions as three-component vectors multiplied by a length unit, such as $(x, y, z) \times mm$, and ensure the source lies inside the world and at a physically meaningful location relative to your geometry.
Direction
Finally, you must define in which direction the particles are emitted. In GATE, particle direction is a unit vector in 3D, typically written as $(d_x, d_y, d_z)$, where the length of the vector is 1. This vector tells GATE how to point particles when they are created. For example, $(0, 0, 1)$ corresponds to particles moving along the positive z axis, while $(0, 0, -1)$ corresponds to the negative z direction.
There are two common types of directional configuration for a basic simulation. The first is a fixed direction, where every particle travels in exactly the same direction. This is useful for beam-like simulations, such as a pencil beam aimed at a water phantom or a collimated X-ray beam. You simply assign one vector and GATE uses it for all generated particles.
The second is isotropic emission, where particles are emitted with random directions that are uniformly distributed over the sphere. This is typical for modeling uncollimated radioactive sources, such as a point source in air for detector calibration or a radionuclide distributed in tissue. In that case, GATE samples random directions at generation time instead of using a single fixed vector. The configuration of isotropic emission is usually controlled through a specific flag or angular distribution setting of the source.
Directional choices have a strong impact on where particles travel and how often they reach your regions of interest. For a collimated beam, you aim the direction vector from the source center toward the target center. If your world origin is at the center of a phantom and your source is placed at $(0, 0, -d)$, then a direction vector of $(0, 0, 1)$ will send particles straight toward the phantom. If you rotate your detector or phantom, you must adjust the direction accordingly so that the beam still hits the correct region.
Define source direction as a normalized vector, such as $(0, 0, 1)$, for fixed beams, or enable an isotropic angular distribution when you need particles emitted uniformly in all directions.
Views: 13
KAHIBARO