Introduction to GEANT4
From UCL HEP PBT Wiki
m |
m |
||
Line 32: | Line 32: | ||
The function <span style="color:#ff0000"> main() </span> defines the skeleton of your simulation code. Inside the function you instantiate <span style="color:#ff0000"> G4RunManager </span> and notify it of your mandatory and optional classes. This is example <span style="color:#ff0000"> main() </span> function, where <span style="color:#ff0000"> MyDetectorConstruction </span>, <span style="color:#ff0000"> MyPhysicsList </span>, <span style="color:#ff0000"> MyPrimaryGeneratorAction </span>, <span style="color:#ff0000"> MyEventAction </span> and <span style="color:#ff0000"> MyRunAction </span> are derived classes from the GEANT4 base classes: | The function <span style="color:#ff0000"> main() </span> defines the skeleton of your simulation code. Inside the function you instantiate <span style="color:#ff0000"> G4RunManager </span> and notify it of your mandatory and optional classes. This is example <span style="color:#ff0000"> main() </span> function, where <span style="color:#ff0000"> MyDetectorConstruction </span>, <span style="color:#ff0000"> MyPhysicsList </span>, <span style="color:#ff0000"> MyPrimaryGeneratorAction </span>, <span style="color:#ff0000"> MyEventAction </span> and <span style="color:#ff0000"> MyRunAction </span> are derived classes from the GEANT4 base classes: | ||
+ | |||
<span style="color:#800000"> int main() { </span> | <span style="color:#800000"> int main() { </span> | ||
Line 58: | Line 59: | ||
<span style="color:#800000"> runManager->SetUserAction(new MyRunAction); </span> | <span style="color:#800000"> runManager->SetUserAction(new MyRunAction); </span> | ||
- | <span style="color:#800000"> ... </span> | + | <span style="color:#800000"> ... } </span> |
- | |||
== <span style="color:#000080"> Experimental setup </span> == | == <span style="color:#000080"> Experimental setup </span> == |