KAHIBARO
Discord Login Register

10.4. Particle Position

Point sources

When you define primary particles in Geant4, the position you assign to them describes where they are created at the start of their track. For absolute beginners, the simplest and most common choice is a point source. A point source places every primary particle at exactly the same position in space, for example the center of your detector or a specific location in the world.

In a typical Geant4 application that uses G4ParticleGun, you configure the source position in your PrimaryGeneratorAction class. Inside GeneratePrimaries, you call the particle gun method for position and pass a G4ThreeVector with coordinates that already include Geant4 units. A common pattern is:
SetParticlePosition(G4ThreeVector(x mm, y mm, z * mm)); where x, y, and z are numbers in your chosen units.

Always include explicit units in positions, for example 0.mm or 10.cm. Never pass raw unitless numbers, or your geometry scale and physics will be wrong.

A point source is ideal when you want to approximate a very small source region compared with the detector size, or when you want to study an idealized response at a specific location. Because every event starts from the same position, it also simplifies later analysis, for example when you look at energy deposition patterns or angular distributions.

There are two coordinate systems you should keep in mind when choosing the point source position. The first is the global coordinate system, defined at the level of the world volume. Positions you set in the primary generator are given in this global system. The second is the local coordinate system of a specific volume. If you want your point source to be at the center of a particular detector element, you must know that element’s global coordinates. A common workflow is to design your geometry so that the detector is conveniently placed, for example with its center at the origin, and then set the point source to (0, 0, 0) in global coordinates.

You can easily move the point source in space to explore different irradiation conditions. For example, you can place it upstream of a detector by setting a negative or positive z coordinate. You can scan across a detector surface by changing the x or y coordinate between runs, either in C++ or through macro-controlled parameters if your application is written to accept them.

Although a point source has zero spatial extent in the simulation, it does not imply a physical point of zero size in reality. Instead, it is an idealization and is often a good approximation for small sealed sources or pencil beams. When your real experimental source is not negligible in size, you should consider a distributed source.

Distributed sources

Distributed sources describe particles that are created over a region of space instead of a single point. This is necessary when your physical source has a finite size or when particles are emitted from an extended object, such as a large target, a uniform beam spot, or a volume source inside tissue.

In Geant4, a distributed source is implemented by choosing the particle position randomly inside a defined region for each event. At the most basic level, even with G4ParticleGun, you can compute random coordinates using the Geant4 random number generator and then pass those positions to SetParticlePosition. For example, you might choose a uniform distribution in a square or circular area to model a finite beam spot, or in a box or cylinder to model a volume source. Every call to GeneratePrimaries then produces a different starting position, and the collection of events represents the spatial distribution of your source.

A frequent use of distributed sources is surface or volume irradiation. For a flat detector, a surface source can simulate a beam that covers the detector area. In that case you generate x and y uniformly over the detector face and keep z fixed just in front of the surface. For an internal source, such as radioactivity distributed in water or tissue, you generate all three coordinates inside the desired volume, often with a uniform probability density.

When implementing a distributed source, make sure the random positions always lie inside the intended region and do not fall outside the world or into unintended geometry gaps. Incorrect bounds or units will produce unphysical starting positions.

Although this chapter focuses on the concept of position, not specific tools, it is important to understand that Geant4 provides higher level helpers in other components of the toolkit that can generate spatial distributions automatically. Whether you use a particle gun with your own random logic or a more flexible source tool, the idea is the same: the primary particle position is sampled from a distribution that represents your physical source.

Distributed sources strongly influence how particles interact with your geometry. For example, a volume source inside a detector may produce nearly uniform energy deposition throughout the volume, while a surface source mainly deposits energy near the entrance face. When you analyze quantities such as deposited energy per event or position of interactions, always remember that the spatial distribution of the primary particles is part of the physical model you are simulating.

For beginners, a good practice is to start from a simple point source, understand the detector response, then gradually move to distributed sources with well defined shapes and ranges. By doing so, you build intuition about how source position and spatial extent affect the results of your Geant4 simulations.

Views: 8

Comments

Please login to add a comment.

Don't have an account? Register now!