villano-lab / k100Sim

Geant4 simulation for the K100 cryogenic setup at UMN
MIT License
0 stars 2 forks source link

k100Sim -- Geant4 simulation for the K100 cryogenic setup at UMN

This code was previously used with Geant4 v10.1.2 but not documented very well. We have migrated to v10.7.4 and ROOT 6.24.2; both substantially advanced versions from what we started with, but still not cutting edge (G4 is up to v11.1.1 and ROOT is up to v6.28.0 as of this writing).

Installing with G4 v10.7.4, ROOT 6.24.2, Ubuntu 20, gcc 9.4.0, standard=cxx14.

Geant4 Install:

cmake -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_INSTALL_DATA=ON -DCMAKE_CXX_STANDARD=14 -DCMAKE_PREFIX_PATH="/home/villaa/install/geant4/geant4-v10.7.4-install/lib/cmake/Geant4/" -DCMAKE_INSTALL_PREFIX=/home/villaa/install/geant4/geant4-v10.7.4-install /home/villaa/install/geant4/geant4-v10.7.4

Note the flags, if you miss the visualization, it will not be able to do visualization, if you miss the install data flag it won't install the data (this happens at the make install step). If you miss the forcing of the cxx14 standard it will compile with a standard that might be inconsistent with ROOT. The compilation will fail, hard.

source /home/villaa/install/geant4/geant4-v10.7.4-install/bin/geant4.sh
export G4WORKDIR=/home/userrname/geant4bin

The last one is to ensure that the make install process puts the binaries in a central location. It's not strictly needed and could be a different directory.

Installing ROOT:

wget https://root.cern/download/root_v6.26.10.Linux-centos8-x86_64-gcc8.5.tar.gz
tar -xzvf root_v6.26.10.Linux-centos8-x86_64-gcc8.5.tar.gz
source root/bin/thisroot.sh # also available: thisroot.{csh,fish,bat}

Compiling/installing k100Sim:

cmake -DG4VIS_USE=ON -DCMAKE_CXX_STANDARD=14 -DGeant4_DIR=/home/villaa/install/geant4/geant4-v10.7.4/lib/Geant4-10.7.4/ /home/villaa/k100Sim/

export G4WORKDIR=/home/userrname/geant4bin