Using the SLAC Installation of the Geant4 Toolkit

Last modified :


Current Installation


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: The essential variables set by this file are:

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:
  1. go to your work directory (in the above example, mytestdir)
  2. from the Geant4 installation copy the code for example 3:
  3. cd to N03
  4. gmake
  5. while in directory N03, run the executable:
  6. 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.
  7. 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