Jump to content

Geant4 Detector Geometry

From Luter 345 Experiments

A detector geometry in Geant4 is made of a number of volumes. The largest of these volumes is called the world volume.

World Volume[edit | edit source]

This world volume must contain all other volumes within the detector geometry. Other volumes that are created, must be included inside the world volume. The most simple and efficient shape to describe this world volume would be a box. Each volume is created by describing its shape and its physical characteristics, and then placing it inside a containing volume. When a volume is placed within another volume, we call the former volume the daughter volume and the latter the mother volume. The coordinate system used to specify where the daughter volume is placed, is the coordinate system of the mother volume.

  • To describe a volume's shape, we use the concept of a solid. A solid is a geometrical object that has a shape and specific values for each of that shape's dimensions. A cube with a side of 10 centimeters and a cylinder of radius 30 cm and length 75 cm are examples of solids.
  • To describe a volume's full properties, we use a logical volume. It includes the geometrical properties of the solid, and adds physical characteristics: the material of the volume; whether it contains any sensitive detector elements; the magnetic field; etc.
  • To position the volume. To do this you create a physical volume, which places a copy of the logical volume inside a larger, containing, volume.

Our code to create the World volume:

G4double world_sizeXY = 1.2*env_sizeXY;
 G4double world_sizeZ  = 1.2*env_sizeZ;
 G4Material* world_mat = nist->FindOrBuildMaterial("G4_AIR");
 
 G4Box* solidWorld =    
   new G4Box("World",                       //its name
      0.5*world_sizeXY, 0.5*world_sizeXY, 0.5*world_sizeZ);     //its size
     
 G4LogicalVolume* logicWorld =                         
   new G4LogicalVolume(solidWorld,          //its solid
                       world_mat,           //its material
                       "World");            //its name
                                  
 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 Envelope (The world within the world)[edit | edit source]

The Envelope is a smaller volume that exists within the world volume. While the world volume is created to house all inner volumes, the envelope is where the experiment occurs. The envelope can be thought of as a box within a box, as it is essentially a smaller box within the world box. Within the envelope, other volumes (including materials) can be placed, and particles can be allowed to pass through. Although the volumes are described as a box, they can be other shapes as well, such as a cylinder. The code for creating boxes and cylinders can be found here.

The code for creating the envelope is near identical to the code for creating the world. The only difference is that the volume is given a different name, and the dimensions should be small enough to fit inside the world. Inside the envelope, other volumes and even materials with varying properties can be placed. This will be discussed in the next section.

Creating the Geometry inside the Envelope[edit | edit source]

Inside the envelope you can conduct many types of experiments. For our experiment we have placed two scoring volumes inside our envelope. Remember, each volume is created by describing its shape and its physical characteristics, and then placing it inside a containing volume; Please Refer to The Envelope (The world within the world) A sample code of someone creating the envelope: A shape In this section of code we are defining the shape in our chosen coordinate system, which is Cartesian. Follow the comments throughout the code for a better understanding:

G4Material* shape1_mat = nist->FindOrBuildMaterial("MATERIAL");
 G4ThreeVector pos1 = G4ThreeVector(x, y ,z);
 // whatever shape you want     
 G4double shape1_dya = cm, shape1_dyb = cm;
 G4double shape1_dxa = cm, shape1_dxb = cm;
 G4double shape1_dz  = cm;      
 G4Trd* solidShape1 =    
   new G4Trd("Shape1",                      //its name
             0.5*shape1_dxa, 0.5*shape1_dxb, 
             0.5*shape1_dya, 0.5*shape1_dyb, 0.5*shape1_dz); //its size
               
 G4LogicalVolume* logicShape1 =                         
   new G4LogicalVolume(solidShape1,         //its solid
                       shape1_mat,          //its material
                       "Shape1");           //its name
              
 new G4PVPlacement(0,                       //no rotation
                   pos1,                    //at position
                   logicShape1,             //its logical volume
                   "Shape1",                //its name
                   logicEnv,                //its mother  volume
                   false,                   //no boolean operation
                   0,                       //copy number
                   checkOverlaps);          //overlaps checking
               

Next is the creation of the scintillators

How to Specify the Material in the Detector Geometry[edit | edit source]

So within the Envelope we constructed these volumes, volumes however can be filled with a material. Geant4 does a great job in allowing the user extreme customization. I say this because, I can literally fill up these volumes with whatever I would like as long as it is in the G4Material class. The G4Material class describes the macroscopic properties of matter:

  • density,
  • state,
  • temperature,
  • pressure,
  • as well as macroscopic quantities like radiation length, mean free path, dE/dx, etc

The G4Material class is the one which is visible to the rest of the toolkit, and is used by the tracking, the geometry, and the physics. It contains all the information relative to the eventual elements and isotopes of which it is made, at the same time hiding the implementation details. We defined our volumes within our envelope and then went on to tell the program what material we would like in each volume. This is the section of code we used:

G4Material* shape1_mat = nist->FindOrBuildMaterial("G4_POLYETHYLENE");
G4Material* shape2_mat = nist->FindOrBuildMaterial("G4_POLYETHYLENE");
//"nist" is calling the data from the National Institute of Technology

This is a list of elements, compounds, space ISS materials, bio-chemical materials, HEP, and nuclear materials here