GEANT4

From HPC users
Jump to navigationJump to search

Introduction

Geant4 is a toolkit for the simulation of the passage of particles through matter. Its areas of application include high energy, nuclear and accelerator physics, as well as studies in medical and space science. For more information refer to the official web page of GEANT4.

Basic Use on the Cluster

You can see the available GEANT4 modules on the cluster by typing

 module av geant4

Choose the version you would like to use by typing

 module load geant4/<version>

which set the environment variables as needed. Now you can start building your own applications using the GEANT4 libraries and tools, see the GEANT4 documentation for details.

Running GEANT4 applications requires you to write a SGE job script, the details depend on your application. Don't forget to load the GEANT4 module in job script as well.

GRAS

The Geant4 Radiation Analysis for Space (GRAS) tool is a Geant4-based application that deals with common analyses types in 3D geometry models. More information and the download of the GRAS package are found on the GRAS web page (login required). In order to use GRAS on the cluster the following steps need to be done:

  1. download the GRAS-package version 3.3 (this is the tested version, other versions may or may not work)
  2. unpack the tar-file in your home-directory on the cluster (or another location of your choice, the following steps assume you use $HOME)
  3. change into the directory gras-03-03
  4. load the module geant4/9.6
  5. now execute the following commands
 mkdir build
 cd build
 cmake -DWITH_ROOT="OFF" -DWITH_AIDA="OFF" -DGRAS_INSTALL_PREFIX=$HOME/gras-03-03 -DXERCESC_LIBRARY=$XERCESC/lib \
 -DXERCESC_INCLUDE_DIR=$XERCESC/include -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ ..
 make
 make install

This should run through with only a few warnings that can be ignored. Alternatively, you modify the script configure_and_install.sh (only the cmake-line) and use it for installation.

After that the GRAS package is installed and ready to use. The package comes with a few examples, to test if everything work you could:

 cd $HOME/gras-03-03
 . bin/gras-env.sh         # this adds GRAS to your environment
 cd examples/magfield/example1/
 module load python
 python launch_example.py  # before you need to apply the patch below
 python plot_results.py

After this you see a number of new files, namely txt-, log-, and png-files (and some more). You need to copy these files to your local machine to view them.

In order to have the example above working you need to change a path in launch_example.py:

 os.chdir("../../../bin/Linux-g++")

should be

 os.chdir("../../../bin")