Aegis GEANT4 Simulation Environment

The AEgIS MC is based on Geant4 and on ROOT (geant_vmc - virtual MonteCarlo). You can thus inspect easily the geometry with the ROOT utilities.

*NOTE: PLEASE CONSIDER THAT THE VERSIONS OF THE PACKAGES MAY CHANGE WITH TIME. CHANGE THE SETUP PROCEDURE ACCORDINGLY.*

Basic directory: /home/user/aegis

ROOT

Code requires ROOT6. Use one of the following ways.

INSTALLING ROOT [OLD WAY]

#Get the latest stable ROOT version (http://root.cern.ch)

 cd /home/user/aegis
 tar xvzf root.....tgz
 cd root-....
 ./configure
 make -j4
 make install

INSTALLING ROOT [NEW WAY - with cmake]

N.B. On MacOSX this is the suggested way to install VGM (otherwise the ROOT libImt library may not be compiled) Get the latest stable ROOT version (http://root.cern.ch)

Follow official instructions: https://root.cern/install/ preferably from source files https://root.cern/install/build_from_source/

(as su or with sudo)

 cd /home/user/aegis
 git clone --branch v6-22-00-patches https://github.com/root-project/root.git root_src
 mkdir root_build root_install && cd root_build
 cmake -DCMAKE_INSTALL_PREFIX=../root_install ../root_src # && check cmake configuration output for warnings or errors
 cmake --build . -- install -j4 # if you have 4 cores available for compilation
 source ../root_install/bin/thisroot.sh # or thisroot.{fish,csh}
(now the root is installed in /home/user/aegis/root-6.24.02/root_install, so that your .bashrc or .bash_profile should point to it)

INSTALLING ROOT [ALICE way]

Only if you didn't install Geant4 with your AliRoot, otherwise there will be some library crashes later.

Full aliroot installation:

If you have (want to have) Aliroot with ROOT5 and ROOT6:

INSTALLING GEANT4

Get the latest stable GEANT4 version (http://geant4.cern.ch) and put it in /home/user/aegis

(as su or with sudo)

 cd /home/user/aegis
 tar zxvf geant4....tar.gz
 mv geant4.10.07.p02 geant4_source  (example with geant4 version 10.07.p02)
 mkdir geant4_build
 cd geant4_build 
 cmake -DCMAKE_INSTALL_PREFIX=/home/user/aegis/geant4_install -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_G3TOG4=ON -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_BUILD_TLS_MODEL=global-dynamic /home/user/aegis/geant4_source
 make -j4
 make install

INSTALLING VGM

Download information on https://vmc-project.github.io/vgm-documentation/download/

(as su or with sudo)

 cd /home/user/aegis
 git clone http://github.com/vmc-project/vgm.git
 cd vgm
 mkdir build_dir
 mkdir install_dir
 cd build_dir/
Source environmental variables for ROOT and GEANT4 before VGM installation:
  • source /home/user/aegis/geant_install/bin/geant4.sh
  • source /home/user/aegis/root_install/bin/thisroot.sh
    • (or after alienv enter AliPhysics/latest-aliroot6-user-next-root6 make sure thisroot.sh is sourced, e.g. source $ROOTSYS/bin/thisroot.sh )
 cmake -DCMAKE_INSTALL_PREFIX=/home/user/aegis/vgm/install_dir /home/user/aegis/vgm
 make -j4
 make install
(if it fails with with the error like "RStringView.hxx:32:37: error: \u2018experimental\u2019 in namespace \u2018std\u2019 does not name a type" -> this means it is compiled with non matching C++ version, add to the cmake line above the following: -DCMAKE_CXX_STANDARD=14)

INSTALLING GEANT4_VMC

Information on VMC project: https://vmc-project.github.io/

INSTALLING STANDALONE VMC (if ROOT compiled without VMC)

cd /home/user/aegis
git clone http://github.com/vmc-project/vmc.git
cd vmc
git checkout v1-0-p3
cd /home/user/aegis
mkdir vmc_build
cd /home/user/aegis/vmc_build
cmake -DCMAKE_INSTALL_PREFIX= /home/user/aegis/vmc_install  /home/user/aegis/vmc
make -j4
make install

GEANT4_VMC installation

(as su or with sudo)
 cd /home/user/aegis
 git clone http://root.cern.ch/git/geant4_vmc.git
  • (or tar xvzf geant4_vmc....tgz)
 mkdir geant4_vmc_build
 mkdir geant4_vmc_install
 cd geant4_vmc_build

Source environmental variables for ROOT and GEANT4 before VMC installation:

  • source /home/user/aegis/geant4_install/bin/geant4.sh
  • source /home/user/aegis/root_install/bin/thisroot.sh
    • (or after alienv load AliPhysics/latest-aliroot6-user-next-root6 make sure thisroot.sh is sourced, e.g. source $ROOTSYS/bin/thisroot.sh )

Use cmake. DVGM_DIR may include "lib" instead of "lib64", depending on the system :

  • [ubuntu and MacOSX] cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/home/user/aegis/geant4_vmc_install -DGeant4VMC_USE_VGM=ON -DVGM_DIR=/home/user/aegis/vgm/install_dir/lib/VGM-4.9.0 /home/user/aegis/geant4_vmc
  • cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=/home/user/aegis/geant4_vmc_install -DGeant4VMC_USE_VGM=ON -DVGM_DIR=/home/user/aegis/vgm/install_dir/lib64/VGM-4.9.0 /home/user/aegis/geant4_vmc
    • Remember to check if your version is VGM-4.9.0, change accordingly.
 
 make -j4
 make install

SETTING ENVIRONMENTAL VARIABLES

You may want to include following exports in your .bashrc or equivalent.

root

source /home/user/root/bin/thisroot.sh
    • (or after alienv enter AliPhysics/latest-aliroot6-user-next-root6 make sure thisroot.sh is sourceed, e.g. source $ROOTSYS/bin/thisroot.sh )

geant4

source /home/user/geant4_install/bin/geant4.sh

geant4_vmc

  • For linux
 
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:”/home/user/aegis/geant4_vmc_install/lib64”
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/user/aegis/vgm.4.6/install_dir/lib64/"
export PATH=$PATH:”/home/user/aegis/geant4_vmc_install/include/geant4vmc”
export G4VMC=”/home/user/aegis/geant4_vmc”

 
export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/home/user/aegis/geant4_vmc_install/lib" 
export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/home/user/aegis/vgm.4.6/install_dir/lib/"
export PATH="$PATH:/home/user/aegis/geant4_vmc_install/include/geant4vmc"
export G4VMC="/home/user/aegis/geant4_vmc"

INSTALLING gMC

The code is available through GitLab (https://gitlab.cern.ch/aegis-mc/gMC.git).
You should activate your account on the CERN GitLab.
 
 cd /home/user/aegis
 git clone -b official https://gitlab.cern.ch/aegis-mc/gMC.git
 cd gMC

make_Makefile.sh

Change make_Makefile.sh (or make_Makefile_macosx.sh accordingly with your packages versions). make_Makefile.sh file:
 
VMCINST=geant4_vmc_install     # Geant4_VMC version installed
VGMINST=vgm/install_dir
VGMVER=                       # VGM version installed

CWD=/home/user/aegis  #YOUR USER NAME *** !!! ***
LIB=lib

VGMLIBPATH=$(ls $CWD/$VMCINST/$LIB/ | grep Geant4VMC-)
MTLIBPATH=$(ls $CWD/$VMCINST/$LIB/ | grep MTRoot-)
G4RootLIBPATH=$(ls $CWD/$VMCINST/$LIB/ | grep G4Root-)

rm -rf CMakeFiles
rm -ff CMakeCache.txt 
rm -rf Makefile
cmake -Wno-dev -DVMC_WITH_Geant4=ON -DGeant4VMC_DIR=$CWD/$VMCINST/$LIB/$VGMLIBPATH -DMTRoot_DIR=$CWD/$VMCINST/$LIB/$MTLIBPATH -DG4Root_DIR=$CWD/$VMCINST/$LIB/$G4RootLIBPATH -DVGM_DIR=$CWD/$VGMINST/$LIB/VGM-$VGMVER .

Source newly modified script:

source make_Makefile.sh (or make_Makefile_macosx.sh)

Directory structure:

This will take care to create the necessary directory structure:
root setup.C

Compilation:

cd geant4_pbar_patch
make -j4
cd .. 
make -j4

Possible errors

  • 1
CMake Error at /home/wfpw/aegis/vgm/build_dir/VGMConfig.cmake:37 Change: include("${_prefix}/lib/VGM-4.9.0/VGMTargets.cmake") To: include("${_prefix}/vgm/install_dir/lib/VGM-4.9.0/VGMTargets.cmake")

  • 2
(if g2c is missing install → you cannot really install g2c now, it’s to old; it was replaced by -lgfortran In my case I changed L 76 /home/wfpw/alice/sw/ubuntu1804_x86-64/ROOT/v6-20-08-alice1-1/etc/vmc/Makefile.linuxx8664gcc file, which came from root-config --etcdir/vmc $(ROOT_ETCDIR)/Makefile.[platform] Where [platform] comes from: root-config --arch )

  • 3
g++ -lpthread -W -Wall -pedantic -Wno-non-virtual-dtor -Wno-long-long -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wno-variadic-macros -Wshadow -pipe -std=c++11   -std=c++11 -pipe -fsigned-char -pthread -O2 -g -O2 -g -DNDEBUG    -rdynamic CMakeFiles/g4vmc_aegis.dir/aegis.cxx.o  -o g4vmc_aegis  -I  /home/wfpw/aegis/geant4.10.07.p01_install/include/Geant4 -I/home/wfpw/aegis/CLHEP/CLHEP_install -I/home/wfpw/aegis/vgm/install_dir/lib -I/home/wfpw/aegis/gMC/gMC -L/home/wfpw/alice/sw/ubuntu1804_x86-64/ROOT/v6-20-08-alice1-1/lib  -L/home/wfpw/aegis/gMC/gMC/geant4_pbar_patch/lib -Wl,-rpath,/home/wfpw/alice/sw/ubuntu1804_x86-64/ROOT/v6-20-08-alice1-1/lib:/home/wfpw/aegis/gMC/gMC/geant4_pbar_patch/lib:/home/wfpw/aegis/gMC/gMC libvmc_aegis.so -lgeant4_pbar_patch -lVMC -L/home/wfpw/aegis/CLHEP/CLHEP_install/lib -l CLHEP -l CLHEP-2.4.4.2 -L/home/wfpw/aegis/geant4.10.07.p01_install/lib -l G4global -l G4tracking -l G4run -l G4materials -l G4geometry -l G4particles -l G4processes -l G4event -l G4RayTracer -l G4digits_hits -l G4interfaces -l G4intercoms -l G4graphics_reps -l G4vis_management -l G4OpenGL -l G4modeling -l G4Tree -l G4FR -l G4VRML -l G4visHepRep -l G4GMocren -L/home/wfpw/aegis/geant4_vmc_install/lib -Wl,-rpath-link,/home/wfpw/aegis/vgm/install_dir/lib -l g4root -l geant4vmc  `root-config --glibs`

  • 4
g++ -lpthread -W -Wall -pedantic -Wno-non-virtual-dtor -Wno-long-long -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wno-variadic-macros -Wshadow -pipe -std=c++11   -std=c++11 -pipe -fsigned-char -pthread -O2 -g -O2 -g -DNDEBUG    -rdynamic CMakeFiles/g4vmc_aegis.dir/aegis.cxx.o  -o g4vmc_aegis  -I  /home/wfpw/aegis/geant4.10.07.p01_install/include/Geant4 -I/home/wfpw/aegis/CLHEP/CLHEP_install -I/home/wfpw/aegis/vgm/install_dir/lib -I/home/wfpw/aegis/gMC/gMC -L/home/wfpw/alice/sw/ubuntu1804_x86-64/ROOT/v6-20-08-alice1-1/lib  -L/home/wfpw/aegis/gMC/gMC/geant4_pbar_patch/lib -Wl,-rpath,/home/wfpw/alice/sw/ubuntu1804_x86-64/ROOT/v6-20-08-alice1-1/lib:/home/wfpw/aegis/gMC/gMC/geant4_pbar_patch/lib:/home/wfpw/aegis/gMC/gMC libvmc_aegis.so -lgeant4_pbar_patch -lVMC -L/home/wfpw/aegis/CLHEP/CLHEP_install/lib -l CLHEP -l CLHEP-2.4.4.2 -L/home/wfpw/aegis/geant4.10.07.p01_install/lib -l G4global -l G4tracking -l G4run -l G4materials -l G4geometry -l G4particles -l G4processes -l G4event -l G4RayTracer -l G4digits_hits -l G4interfaces -l G4intercoms -l G4graphics_reps -l G4vis_management -l G4OpenGL -l G4modeling -l G4Tree -l G4FR -l G4VRML -l G4visHepRep -l G4GMocren -L/home/wfpw/aegis/geant4_vmc_install/lib -Wl,-rpath-link,/home/wfpw/aegis/vgm/install_dir/lib -l g4root -l geant4vmc  `root-config --glibs`
Topic attachments
I Attachment History Action Size Date Who Comment
Unix shell scriptsh make_Makefile.sh r1 manage 0.6 K 2021-07-16 - 10:42 MalgorzataJanik make_Makefile file for preparing the gMC environment
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r4 - 2021-07-26 - MalgorzataJanik
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback