Using the SLAC Installation of the Geant4 Toolkit
Last modified :
Current Installation
- Release Tag - the release tag of the current installation is
geant4-09-01-p01-patch-00. This is a local patch of Geant4 9.1 p01
- Previous releases still available:
- /afs/slac/package/geant4/vol2/G4Home/geant4-09-00-ref-00-patch-00
- /afs/slac/package/geant4/vol1/G4Home/geant4-08-02-ref-00-patch-00
- /afs/slac/package/geant4/vol4/G4Home/geant4-08-00-p01-patch-00
- Supported Platforms:
- Data files for optional Geant4 processes and models are centrally
located at /afs/slac/package/geant4/vol29. If these processes are
used, environment variables must be set which point to one or more of
the following directories:
- G4EMLOW4.3: for low energy electromagnetic processes
- G4NDL3.11: neutron data files for high-precision neutron models
which include thermal cross sections
- PhotonEvaporation2.0: photon evaporation
- RadioactiveDecay3.2: radioactive decay for hadronic processes
Accessing the SLAC installation
To compile and link a simulation executable using the current Geant4 toolkit,
several environment variables must first be set. A script which does this is
found in
/afs/slac/package/geant4/vol3/G4Home/g4setup.env
To begin:
- choose a work directory, for example, mytestdir
- copy the above g4setup.env file to it
- modify the line in the file which sets the G4WORKDIR environment
variable so that it reads: setenv G4WORKDIR $HOME/mytestdir
- source g4setup.env
The essential variables set by this file are:
- G4WORKDIR - working directory which will contain your specific code and the binary application
- G4INSTALL - location of the installed code and libraries
- G4SYSTEM - G4 code for the system architecture
- CLHEP_BASE_DIR - base directory of the CLHEP libraries against which the toolkitis linked and
against which your code should be linked
- CLHEP_LIB - location in the SLAC directory structure of CLHEP libraries built for a given platform
Visualization
Interfaces for several visualization drivers have been compiled into the toolkit libraries. The user must
choose which one to use and set the appropriate environment variable before building the executable. A list
of the available drivers is given in g4setup.env. In this example OPENGL is chosen.
Building and Running the Executable
The following steps will lead you to a working executable with visualization using OPENGL:
- go to your work directory (in the above example, mytestdir)
- from the Geant4 installation copy the code for example 3:
- cp -r $G4INSTALL/examples/novice/N03 N03
- cd to N03
- gmake
- gmake will create tmp and bin directories in your work directory. The executable, named exampleN03, will be in /bin/$G4SYSTEM/
- while in directory N03, run the executable:
- ../bin/$G4SYSTEM/exampleN03
- if everything goes according to plan, you should see the Idle> prompt on your screen (after some preliminary output). From this prompt type
to see an event displayed. Repeat until you get tired or bored.
- when finished type
at the Idle> prompt.
At this point you are ready to add to and modify the code in your copy of N03.
For more information about developing your own simulation code using Geant4, see
the Application Developer's Guide .
Dennis Wright