(Code for simulating TPC experiments with custom geometries and sources in Geant4)
- Custom Geometry - Custom geometries can be built by constructing DetectorComponent objects which can be built from radiological materials that LArGeant will automatically simulate as backgrounds in events according to certain run-time parameters.
- Multithreading - LArGeant is built with multithreading in mind, ...
- NEST - Scintillation and ionization is simulated using the NEST software package which can operate in both a liquid/gas phase for argon and xenon.
- Data Products - Several data products are generated at the event level which the user can export to custom analysis code and also save to ROOT files.
There are several scripts included with the git respository that will automate the installation process. Once downloaded, go to the scripts folder
git clone https://github.com/infophysics/LArGeant.git
cd LArGeant/scriptsthen run the Geant4 preprocessing step, which will install required packages such as cmake, gcc, g++, expat, qt5, xmu and motif:
source prepare_geant4_installation.shit will also download a version of geant4 and install it in the directory /home/$USER/physics/geant4/. The next step is to actually install geant4, which can be done with:
source install_geant4.shFinally, to compile the largeant code you can run the following script:
source install_largeant.shIf for some reason the installation scripts do not work, or you wish to install Geant4 manually, the following list of steps should work on Ubuntu 20.XX.
- Install Dependencies - First you will need a few packages, such as QT in order to use the visualization tools,
sudo apt-get install cmake gcc g++ libexpat1-dev qt5-default libxmu-dev libmotif-dev
- Get the code - Now choose a place in which you want to download the Geant4 code. The following should work:
wget "http://cern.ch/geant4-data/releases/geat4.10.07.p02.tar.gz" tar xvfz geant4.10.07.p02.tar.gz rm geant4.10.07.p02.tar.gz - Install Geant4 - The easiest way to install geant4 once you have it downloaded, is to use ccmake, which you may have to download using
Next, you should create a build directory inside of the folder where the source code is for building the code:
sudo apt-get install cmake-curses-gui
Then just run ccmake, which will bring up a cmake GUIcd geant4.10.07.p02 mkdir build && cd build
From here, there are several things that you need to enable, such as GEANT4_INTALL_DATA=ON, GEANT4_USE_QT=ON and GEANT4_USE_SYSTEM_EXPAT=ON. You also need to specify the installation directory, which in the scripts is set to /home/$USER/physics/geant4.10.07.p02-install/. If you are not using ccmake, but instead just running cmake from the build directory, you can do this with the following:ccmake ..
If cmake is successful, you can then build the project by issuingcmake -DCMAKE_INSTALL_PREFIX=<install_dir> -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_QT=ON -DGEANT4_USE_SYSTEM_EXPAT=ON ..
where N is the number of cores you want to use to build.make -j N make install
- Post-insallation - Once installed, you will need to run a setup script to export the right environment variables. This can be found in the folder <install_dir>/share/Geant4*/geant4make/:
source <install_dir>/share/Geant4\*/geant4make/geant4make.sh