The geometry of each object in Geant4 consists of three components:
- The solid,
- The logical volume,
- The physical volume.
The solid defines the shape of the object, box or sphere, for instance. A comprehensive list of these and their usage can be found on the Geant4 website. For example B1, the shape of the simulation space is defined as:
G4Box* solidWorld = new G4Box("World", //its name 0.5*world_sizeXY, 0.5*world_sizeXY, 0.5*world_sizeZ); //its size
G4Box defines the shape, the argument “World” defines its name, and the size is defined on the final line, where the variables world_sizeXY and world_sizeZ were defined earlier.
The logical volume is defined next:
G4LogicalVolume* logicWorld = new G4LogicalVolume(solidWorld, //its solid world_mat, //its material "World"); //its name
Here, the first argument defines which solid the logical volume is related to, the second defines the material (as described in the last post), and the final line names the volume.
Finally, the physical volume is defined:
G4VPhysicalVolume* physWorld =new G4PVPlacement( 0, //no rotation G4ThreeVector(), //at (0,0,0) logicWorld, //its logical volume "World", //its name 0, //its mother volume false, //no boolean operation 0, //copy number checkOverlaps); //overlaps checking
The first argument defines the rotation of the physical volume; in this case, none. Next, the position is defined, and for this volume it is centred at the origin. Then the name of the logical volume to which the physical volume is connected is given, followed by the name of the physical volume. Since this volume is the extent of the model, it has no mother volume (which is the volume in which it is contained). The boolean operation is a method by which solids can be combined within Geant4, and is not used here. Copy numbers are used if the volume is repeated, and the final argument is used to ensure that no volumes overlap.