Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Geant4 and CLHEP

What is Geant4?

Geant4 is the core Monte Carlo simulator used by all ILC detector simulations programs. It tracks the passage of particles through matter and simulates the particle interactions.

How do I build Geant4?

FirstBefore installing Geant4, you need to build CLHEPdownload and build http://proj-clhep.web.cern.ch/proj-clhep/.

Then download the Geant4 sources from the distribution page.

Here are condensed build instructions once the sources have been obtained.

Once you have obtained the sources, please read the Installation Guide carefully.

The following sequence of commands should get you up and running on Linux (using bash shell).

No Format

export CLHEP_BASE_DIR=/your/path/to/clhep
No Format
tar -zxvf geant4.x.tar.gz
cd geant4.x
export G4INSTALL=$(pwd)
export G4WORKDIR=$(pwd)
export CLHEP_BASE_DIR=/your/path/to/clhepG4SYSTEM=Linux-g++
cd geant4.x/source
make
make includes
cd ../physics_lists/hadronic
make

This will take up to several hours depending on the speed of your machine.

Next, try to build an example application.

No Format
cd geant4.x/examples/novice/N03
export G4WORKDIR=`pwd`$(pwd)
make all

Now you should have the ./bin/Linux-g++/N03 binary.

How do I rebuild just the Geant4 visualization libraries?

After reconfiguring your environment using the G4VIS variables, rebuild the Geant4 visualization as follows.

No Format
cd $G4INSTALL/source/visualization
gmake clean
gmake
cd $G4INSTALL/source/interfaces
gmake clean
gmake
cd $G4INSTALL/source
gmake libmap

...