1.  How to Install, Compile, and Run the Simulation

1.1  Preliminaries: Installing Geant4 with Coin3D and ROOT

This simulation package requires a LINUX operating system (MAC should work, Windows only via Cygwin) with the ROOT libraries and programs installed. In addition, you need the OpenGL (or mesa) libraries and source code (including the development libraries). Your search path should contain the directory with the correct ROOT installation.

For example, for the \textit{bash} shell you should have the following statements in your \textit{.bashrc} file:

export ROOTSYS=/usr/local/root
export PATH=$ROOTSYS/bin:$PATH

You should also have defined the correct library path, as in:

export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH

But if ROOT is currently running on your system, these should be already defined somwhere.

Also, the successful installation of Geant4 itself will have required that the following switches are in your search path (this is for LINUX only), with the directories changed accordingly:

ROOT

export ROOTSYS=/usr/local/root
export PATH=$ROOTSYS/bin:$PATH
export PATH=/usr/local/root/hbook:$PATH
export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH
export OPENGL=/usr
export MYSQL=/usr

OpenInventor and Coin3D

export COIN=/usr/local/Coin3D
export PATH=$COIN/bin:$PATH
export OIVHOME=$COIN
export SOXT=/usr/local/SoXt
export OIVFLAGS="-I$COIN/include -DINVENTOR2_1-I$SOXT/include"
export OIVLIBS="-L$COIN/lib -lCoin -L$SOXT/lib -lSoXt"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$COIN/lib:$SOXT/lib
export COIN_FULL_INDIRECT_RENDERING=1

GEANT4

export G4SYSTEM="Linux-g++"
export G4INSTALL=/usr/local/geant4.8.2
export G4INCLUDE=/usr/local/geant4.8.2/include
export G4LIB=/usr/local/geant4.8.2/lib
export G4LEVELGAMMADATA=/usr/local/geant4.8.2/data/PhotonEvaporation2.0
export G4RADIOACTIVEDATA=/usr/local/geant4.8.2/data/RadiativeDecay3.1
export G4LEDATA=/usr/local/geant4.8.2/data/G4EMLOW4.2
export NeutronHPCrossSections=/usr/local/geant4.8.2/data/G4NDL3.10
export G4ELASTICDATA=/usr/local/geant4.8.2/data/G4ELASTIC1.1
export CLHEP_BASE_DIR=/usr/local
export CLHEP_INCLUDE_DIR=/usr/local/include
export CLHEP_LIB_DIR=/usr/local/lib
export CLHEP_LIB=CLHEP
export G4LISTS_BASE=$G4LIB
export G4VIS_BUILD_OIX_DRIVER=1
export G4VIS_USE_OIX=1
export G4VIS_BUILD_DAWN_DRIVER=1
export G4VIS_USE_DAWN=1
export G4VIS_BUILD_OPENGLX_DRIVER=1
export G4VIS_USE_OPENGLX=1
export OGLHOME=/usr
export OGLFLAGS="-I$OGLHOME/include/GL"
export OGLFLAGS="-I$OGLHOME/lib"
export G4VIS_BUILD_OGLIX_DRIVER=1
export G4VIS_USE_OGLIX=1
export G4UI_USE_XM=1
export G4UI_BUILD_XM_SESSION=1
export G4VIS_BUILD_VRML_DRIVER=1
export G4VIS_USE_VRML=1
export G4LIB_BUILD_SHARED=1
export G4LIB_USE_GRANULAR=1
export G4UI_USE_TCSH=1
export G4ANALYSIS_USE=1
export G4LIB_BUILD_G3TOG4=1
export G4LIB_USE_G3TOG4=1
export G4LIB_USE_ZLIB=1
export LD_LIBRARY_PATH=$CLHEP_BASE_DIR/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$G4LIB:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$G4LIB/$G4SYSTEM:$LD_LIBRARY_PATH$

For visualization, the installation of Coin3D is desired. While there are other forms of visualization that can be used, this appears to be the most versatile and is relatively easy to use. The process to install Geant4 with Coin3D is outlined below.

  1. Go to http://www.coin3d.org and follow the Download link of Coin3D
  2. Copy and unpack into some source directory, like
    \textit{/usr/local/src/Coin3D/Coin-2.4.5}
    or whatever current version it is.
  3. Run: \textit{./configure --prefix=/usr/local/Coin3D/Coin-2.4.5}
    and note that the installation directory should be
    different from the source directory.
  4. Run: \textit{make install}
    which compiles Coin3D and generates includes,
    binaries, and libraries in
    \textit{/usr/local/Coin3D/Coin-2.4.5}
  5. Download the SoXt package from the Coin3D site.
  6. Copy and unpack into the source directory
    \textit{/usr/local/src/Coin3D/SoXt-1.2.2}
    or whatever current version it is.
  7. Run: \textit{./configure --prefix=/usr/local/Coin3D/SoXt-1.2.2}
    and note that the installation directory should be
    different from the source directory.
  8. Run: \textit{make install}
    which compiles SoXt and generates includes,
    binaries, and libraries in
    \textit{/usr/local/Coin3D/SoXt-1.2.2}
  9. Update your environment (see above).
  10. Compile (or recompile) Geant4.
    Be sure that your xterm window (in which you will compile
    Geant4) knows about the updated environment settings
    (e.g. do a "source ~/.bashrc")

    Important: Before compiling Geant4, modify the following Geant4 file:
    \textit{G4INSTALL/config/sys/Linux-g++.gmk}

    remove "-pedantic"

    It should look now like this:
    # CXXFLAGS := -W -Wall -ansi -pedantic -Wno-non-virtual-dtor-Wno-long-long
    CXXFLAGS := -W -Wall -ansi -Wno-non-virtual-dtor-Wno-long-long

1.2  Compiling QweakSim

The source code is availabe as an archive (a gzipped \textit{tar} file) from the Qweak simulation logbook1 or via CVS (put info here). Upon downloading the archive and placing it in a directory of your choice, unload the archive by typing at the LINUX terminal prompt:

tar -xvzf qweaksim.tar.gz

This should create the directories:

  • \textit{./include},
  • \textit{./src}, and
  • \textit{./Documentation}.

Create a directiry called \textit{tmp}:

mkdir tmp

Set your current working directory:

export G4WORKDIR=`pwd`
export G4TMP=`pwd`/tmp

Compile the simulation:

make clean
make

 

1 http://dilbert.physics.wm.edu/elog/Software/

1.3  Compiling QweakSim

The source code is availabe as an archive (a gzipped \textit{tar} file) from the Qweak simulation logbook1 or via CVS (put info here). Upon downloading the archive and placing it in a directory of your choice, unload the archive by typing at the LINUX terminal prompt:

tar -xvzf qweaksim.tar.gz

This should create the directories:

  • \textit{./include},
  • \textit{./src}, and
  • \textit{./Documentation}.

Create a directiry called \textit{tmp}:

mkdir tmp

Set your current working directory:

export G4WORKDIR=`pwd`
export G4TMP=`pwd`/tmp

Compile the simulation:

make clean
make

 

1 http://dilbert.physics.wm.edu/elog/Software/