Using GDML with the SLAC Installation of the Geant4 Toolkit

Last modified :


Introduction

A recipe for building and running a simulation executable using the Geant4 toolkit and the Geometry Description Markup Language is provided. Libraries for both of these packages are installed and maintained by the SLAC Geant4 group so that users need only link their applications to them. As a starting point for new users, a Geant4 extended example N03GDML has been provided.

Current Installation


Accessing the SLAC installations

To compile and link a simulation executable using the current Geant4 toolkit and the GDML package, several environment variables must first be set. This can be done as follows: The essential variables set by g4setup.env file are: The essential variables set by xerces.env file are:

Building and Running the Executable

The following steps will lead you to a working executable of the extended example N03gdml :
  1. go to your work directory: cd $G4WORKDIR
  2. from the G4-SLAC installation copy the code for example N03gdml:
  3. from the G4-SLAC installation copy the default namespace schema directory. This directory must be located just above the N03gdml directory.
  4. cd to N03gdml
  5. gmake clean
  6. gmake
  7. while in directory N03gdml, run the executable:
  8. if all goes well, the same detector as novice example N03 will be constructed by GDML. If you use visualization, an OpenGL window will appear containing a side view of the detector.
At this point you are ready to add to and modify the code in your copy of N03gdml. To learn more about developing your own simulation code using Geant4, see the Application Developer's Guide .
Tatsumi Koi
Dennis Wright