Introduction to GEANT4

From UCL HEP PBT Wiki

Jump to: navigation, search
m
m
Line 71: Line 71:
For example if you want to make an experiment using a water box detector it ca be defined in the following way:
For example if you want to make an experiment using a water box detector it ca be defined in the following way:
 +
<span style="color:#800000"> G4VSolid* pBoxSolid = new G4Box(“WaterBox”, 1.*m, 2.*m, 3.*m); </span>  
<span style="color:#800000"> G4VSolid* pBoxSolid = new G4Box(“WaterBox”, 1.*m, 2.*m, 3.*m); </span>  
Line 78: Line 79:
<span style="color:#800000"> G4VPhysicalVolume* aBoxPhys = new G4PVPlacement( pRotation, G4ThreeVector(posX, posY, posZ), pBoxLog, “WaterBox”, pWorldLog,
<span style="color:#800000"> G4VPhysicalVolume* aBoxPhys = new G4PVPlacement( pRotation, G4ThreeVector(posX, posY, posZ), pBoxLog, “WaterBox”, pWorldLog,
false, copyNo); </span>  
false, copyNo); </span>  
 +
    
    
Your detector is always placed in a mother volume called a world volume.   
Your detector is always placed in a mother volume called a world volume.   
The world volume is defined in a similar way:
The world volume is defined in a similar way:
 +
<span style="color:#800000"> G4VSolid* pWorld = new G4Box("World",5*m,5*m,5*m); </span>
<span style="color:#800000"> G4VSolid* pWorld = new G4Box("World",5*m,5*m,5*m); </span>
Line 87: Line 90:
                                                                            
                                                                            
<span style="color:#800000"> G4VPhysicalVolume* pWorldPhys = new G4PVPlacement(0,G4ThreeVector(),pWorldLog,"World",0,false,0); </span>  
<span style="color:#800000"> G4VPhysicalVolume* pWorldPhys = new G4PVPlacement(0,G4ThreeVector(),pWorldLog,"World",0,false,0); </span>  
 +
The elements and materials used in the experiment are defined using classes G4Element and G4Material.
The elements and materials used in the experiment are defined using classes G4Element and G4Material.
For example water is defined as:
For example water is defined as:
 +
<span style="color:#800000"> G4Element* H = new G4Element("Hydrogen","H",z=1.,a= 1.01*g/mole); </span>
<span style="color:#800000"> G4Element* H = new G4Element("Hydrogen","H",z=1.,a= 1.01*g/mole); </span>

Revision as of 11:15, 6 July 2014

Personal tools