Using the SLAC Installation of the Geant4 Toolkit with the JAIDA-G4 Analysis Package
Last modified :
Introduction
A recipe for building and running a simulation executable using the Geant4
toolkit and the JAIDA-G4 analysis package 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 example with histogramming has been provided.
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 now 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
- The JAIDA-G4 package and its examples were originally prepared for the SLAC Geant4 Workshop of
February 2002. The file names, tree configuration and setup scripts have been modified in the
current SLAC installation.
- Supported Platforms:
Accessing the SLAC installations
To compile and link a simulation executable using the current Geant4 toolkit and the JAIDA analysis package,
several environment variables must first be set. This can be done as follows:
- choose a work directory, for example, mytestdir
- copy to it the files
/afs/slac/package/geant4/vol3/G4Home/g4setup.env
and
/afs/slac/package/geant4/vol0/analysis/jaida.env
Important Notice: the current example requires JAIDA Version 3. A fresh
download of jaida.env is required in order to get the latest libraries.
- in g4setup.env modify the line in the file which sets the G4WORKDIR environment variable so that it reads:
setenv G4WORKDIR $HOME/mytestdir
- source g4setup.env
- source jaida.env (g4setup.env must be sourced first)
The essential variables set by g4setup.env 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
The essential variables set by aida.env file are:
- JDK_HOME - Java home directory
- G4ANALYSIS_USE - enables Geant4 analysis packages
- JAIDA_HOME - base directory for the JAIDA (ver.3.2.1) package
- AIDAJNI_HOME - base directory for the JAIDAJNI (ver.3.2.1) package
Visualization
Currently, OPENGLX and JAS cannot run simultaneously, so the environment variable G4VIS_USE_OPENGLX is unset in the script.
Building and Running the Executable
The following steps will lead you to a working executable with histogramming:
- go to your work directory: cd $G4WORKDIR
- from the G4-JAIDA installation copy the code for example A01:
- cp -pr $G4INSTALL/examples/extended/analysis/A01 A01
- cd to A01
- gmake clean
- gmake
- gmake will create tmp and bin directories in your work directory. The executable, named A01app, will be in /bin/$G4SYSTEM/
- while in directory A01, run the executable:
- ../bin/$G4SYSTEM/A01app
- which will bring up the interactive prompt:
Idle>
- to run 10 events you can now enter
/run/beamOn 10
- if all goes well, a JAS window will appear containing two histograms
and three scatterplots.
- to terminate the job, at the prompt enter
exit
- currently you must also close the JAS-AIDA window to get the job to
stop.
- in the A01 directory will be a file A01.aida which contains the plots.
To examine them
- /usr/local.bin/jas3 & or jas3 &
At this point you are ready to add to and modify the code in your copy of A01.
To learn more about developing your own simulation code using Geant4, see the
Application Developer's Guide .
Tatsumi Koi
Dennis Wright