KAHIBARO
Discord Login Register

6.4. Physical Volumes

Positioning objects

A physical volume represents one concrete copy of a logical volume placed at a specific position and orientation inside another volume. In practical terms, it answers the question: “Where is this piece of detector located in the world or inside its mother volume?” While logical volumes describe shape and material, physical volumes describe placement.

Every physical volume has a mother volume. The mother is always a logical volume, and the placement defines how the daughter logical volume is embedded inside this mother. The coordinates of the placement are given in the coordinate system of the mother volume, not in global coordinates. This relative placement is the basic rule that builds geometric hierarchies in Geant4.

Geant4 uses a right handed Cartesian coordinate system. When you place a volume, you specify a translation vector and, optionally, a rotation. The translation defines the origin of the daughter’s local coordinate system relative to the mother’s local origin. The rotation defines how the daughter’s local axes are oriented relative to the mother’s axes. If you do not provide a rotation, the daughter shares the same orientation as the mother.

It is very important that a physical volume lies entirely inside its mother volume. Its solid must be fully contained within the mother’s solid, with no part extending outside. Volumes that touch or nearly touch the mother’s boundaries can cause numerical issues, so a small safety margin is usually maintained between daughter edges and mother boundaries.

All daughter physical volumes must be completely contained within their mother volume, without extending outside, and must not overlap each other.

When you build a world volume, you place it with a null mother pointer, so it defines the top of the hierarchy. All other volumes must have a mother, directly or indirectly, that ultimately belongs to this world.

The combination of many placements creates complex detectors. For instance, you may define one logical volume for a detector element and then create many physical volumes of that logical volume at different positions, forming an array. Each physical volume represents one concrete copy, but they all share the same shape and material definition. This reuse of logical volumes is both memory efficient and conceptually clean.

Because coordinates are always relative to the mother, transformations are nested. The global position of a point inside a daughter volume is obtained by applying the daughter transformation, then the mother transformation, and so on up to the world. Geant4 performs this transformation chain internally during tracking, so you normally specify only the local placement and let Geant4 handle global coordinates.

`G4PVPlacement`

The main class for placing a single copy of a volume is G4PVPlacement. It connects a logical volume to a mother logical volume and defines how it is located and oriented.

Conceptually, a G4PVPlacement object stores:
the rotation of the daughter relative to the mother,
the translation of the daughter origin in the mother coordinate system,
a pointer to the logical volume being placed,
a name that identifies this specific physical volume,
and a pointer to the mother logical volume.

The most commonly used constructor has the following structure, simplified here to highlight the essential parameters:

cpp
new G4PVPlacement(
    rotation,           // G4RotationMatrix* (or nullptr)
    translation,        // G4ThreeVector
    logicalDaughter,    // G4LogicalVolume*
    name,               // G4String
    logicalMother,      // G4LogicalVolume*
    false,              // pMany (obsolete in most simple uses)
    copyNo,             // G4int
    checkOverlaps       // G4bool
);

The rotation is usually a pointer to a G4RotationMatrix. If you pass nullptr, no rotation is applied and the daughter is aligned with the mother. The translation is a G4ThreeVector that sets the daughter’s origin relative to the mother’s origin. For example, G4ThreeVector(0, 0, 5*cm) shifts the volume 5 cm along the mother’s +z axis.

The logicalDaughter parameter is the logical volume you want to place. The logicalMother is the logical volume that will contain the daughter. The name is a label for this physical volume instance, and appears in visualization and in some debugging outputs.

The copy number is an integer that uniquely identifies this instance among other copies of the same logical volume inside the same mother. Geant4 uses this copy number when you want to know which specific detector element a step occurred in. For arrays or repeated structures, you normally assign each placement a distinct copy number, such as 0, 1, 2, and so on.

The last argument, checkOverlaps, controls an internal overlap check. If it is set to true, Geant4 will perform a basic test to detect whether the new placement overlaps with other volumes. This is very helpful during geometry development and debugging.

Use unique copy numbers for different physical instances of the same logical volume in the same mother, and enable overlap checking during development to detect geometry problems.

Typical usage in the Construct() method of your detector construction class looks like this:

cpp
auto rotation = nullptr;  // no rotation
G4ThreeVector position(0., 0., 2.0*cm);
new G4PVPlacement(
    rotation,
    position,
    logicDetector,        // daughter
    "DetectorPV",         // name
    logicWorld,           // mother
    false,
    0,                    // copy number
    true                  // check overlaps
);

In this example, the detector logical volume logicDetector is placed 2 cm along the z axis inside the world logical volume logicWorld, without rotation. Its physical volume is called "DetectorPV", and its copy number is 0.

If you want to place several identical detector elements, you can call G4PVPlacement multiple times with different translations and copy numbers, while reusing the same logical volume. This pattern is common when building simple arrays without using more advanced replication or parameterization features, which are covered elsewhere.

G4PVPlacement is the simplest bridge between your abstract geometry description and the concrete layout in space. Once placements are defined, Geant4 uses them internally to locate particles, navigate between volumes, and evaluate interactions within your detector.

Views: 9

Comments

Please login to add a comment.

Don't have an account? Register now!