Introduction to GEANT4
From UCL HEP PBT Wiki
m  | 
		m  | 
		||
| Line 64: | Line 64: | ||
== Experimental setup ==  | == Experimental setup ==  | ||
| + | You can define your experiment by using three base classes:  | ||
| + | |||
| + | * Describing the shape and the size of your detector: <span style="color:#ff0000"> G4VSolid </span>   | ||
| + | * Adding properties - material and electromagnetic field: <span style="color:#ff0000"> G4VLogical Volume </span>   | ||
| + | * Placing it in another volume - in one or many positions: <span style="color:#ff0000"> G4Physical Volume </span>   | ||
| + | |||
| + | 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"> G4VLogicalVolume* pBoxLog = new G4LogicalVolume( pBoxSolid, water, “WaterBox”); </span>   | ||
| + | |||
| + | <span style="color:#800000"> G4VPhysicalVolume* aBoxPhys = new G4PVPlacement( pRotation, G4ThreeVector(posX, posY, posZ), pBoxLog, “WaterBox”, pWorldLog,  | ||
| + | false, copyNo); </span>   | ||
| + | |||
| + | Your detector is always placed in a mother volume called a world volume.    | ||
| + | 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"> G4LogicalVolume* pWorldLog = new G4LogicalVolume(pWorld,vacuum, "World"); </span>     | ||
| + | |||
| + | <span style="color:#800000"> G4VPhysicalVolume* pWorldPhys = new G4PVPlacement(0,G4ThreeVector(),pWorldLog,"World",0,false,0); </span>   | ||
| + | |||
| + | |||
== Physics processes ==    | == Physics processes ==    | ||