Using the SLAC Installation of the Geant4 Toolkit with the JAIDA-G4 Analysis Package
Last modified :
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.
The latest Geant4 libraries are centrally maintained and installed so that users
may build and link their applications to them, rather than build and maintain
their own libraries.
Geant4 9.3 (patch 01) is now installed on the 32-bit and 64-bit Linux machines:
Access to older libraries is available upon request.
Various data files required for optional Geant4 processes and models are also
centrally maintained and automatically accessed by the setup scripts.
This analysis example requires the JAIDA-G4 package. This 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. JAIDA-G4 is supported on the platforms listed above.
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:
The essential variables set by g4setup.env file are:
- choose a work directory, for example, mytestdir
- copy to it the files
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 aida.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
- 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
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:
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 .
- 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 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:
- which will bring up the interactive prompt:
- to run 10 events you can now enter
- if all goes well, a JAS window will appear containing two histograms
and three scatterplots.
- to terminate the job, at the prompt enter
- currently you must also close the JAS-AIDA window to get the job to
- in the A01 directory will be a file A01.aida which contains the plots.
To examine them
- /usr/local.bin/jas3 & or jas3 &