|
|
|
|
|
Introduction to Geant4
Lectures by Andrea dell'Acqua (CERN)
From the Ann Arbor Workshop on Geant4 26 February to 2 March, 2001.
|
|
Exercise N02
This exercise comes from Lecture 3, Getting Started, and starts on slide number 16.
Steps ExN02
Very basic example, depicting some kind of fixed target experimental setup.
- Change directory to geant4/N02 which contains:
- a GNUmakefile
very basic, essentially defining the name of the executable and running binmake.gmk
- the main program (exampleN02.cc)
- a macro file (prerun.g4mac)
- an include directory
class header files
- a src directory
implementation of all methods
- Create the executable with gmake
- Run the executable by typing
$G4WORKDIR/bin/$G4SYSTEM/exampleN02
- A macro file should initialize graphics for you. This is run automatically.
- Draw the experimental setup and get the GUI by
/vis/show/view
- Tell the tracking of storing all track segments by
/tracking/storeTrajectory 1
- And run one event
/run/beamOn 1
- You can change the beam condition by using the /gun commands
/gun/List //to have a list of all possible particles
/gun/particle e+
/gun/energy 10 GeV
/gun/position 0 10 30 cm
/gun/direction .3 .3 .1- Have a look at the online help to see what you can do...
Definitions
- The G4RunManager is the only manager class in the Geant4 kernel, the root class of the Geant4 hierarchy. It is used in the main program to specify:
- How the detector geometry should be built
- Which physics processes are preferred
- How the primary particles in an event should be produced
- Additional requests during the simulation procedures
Helpful Links
Checklist
- Remember that Geant4 does not contain a main() file. You must supply your own in order to build the simulation program.
- Make sure that all three user defined classes are implemented. Start with slide 8 if you think that one of the following might have been forgotten.
- setting up the geometry
- event kinematics
- physics processes
Back to the Geant4 Lectures
![]()
For information: wlap@umich.edu http://www.umich.edu/~wlap Last modified: syscmd(date)