-
Notifications
You must be signed in to change notification settings - Fork 3
Installation and run
The petalosim source can be downloaded from the git repository:
git clone [email protected]/petalo-project/petalosim.git
This command will create a folder names petalosim. To get a particular tag, just enter the petalosim folder and type:
git checkout name_of_tag
petalosim depends on the following third-party libraries:
- Geant4
- nexus
- hdf5
- NEST
petalosim is based on Geant4. To install it, see the Geant4 page. The recommended version is geant4.11.0. A petalosim tag >= v1_00_00 is needed to run with this Geant4 release. A summary of the installation instructions can be found here.
Once Geant4 is installed, make sure to have the G4INSTALL environment variable pointing to the Geant4 installation directory.
Download the data files from the Geant4 web page and place them in the $G4INSTALL/share/Geant4-11.0.0/data
directory (you have to create it), if it wasn't done during the compilation step.
Now do
cd $G4INSTALL/bin; source geant4.sh
This script will do the following:
-
Add
G4INSTALL/bin
path to the PATH environment variable. -
Assign the path of the PhotonEvaporation data file to the G4LEVELGAMMADATA environment variable.
-
Assign the path of the G4EMLOW data file to the G4LEDATA environment variable.
-
Assign the path of the RadioactiveDecay data file to the G4RADIOACTIVEDATA environment variable.
-
Assign the path of the G4ENSDFSTATE data file to the G4ENSDFSTATEDATA environment variable.
-
Assign the path of the G4SAIDDATA data file to the G4SAIDXSDATA environment variable.
-
Assign the path of the G4PARTICLEXS data file to the G4PARTICLEXSDATA environment variable.
-
Assign the path of the G4NDL data file to the G4NEUTRONHPDATA environment variable.
-
Assign the path of the G4INCL data file to the G4INCLDATA environment variable.
Finally, add the G4INSTALL/lib
path to the LD_LIBRARY_PATH (or DYLD_LIBRARY_PATH for macOS) variable.
petalosim depends on NEXUS for basic class management. You can download NEXUS from here. Once NEXUS is installed, make sure to have
- The nexus bin directory in your PATH variable.
- The nexus lib directory in your LD_LIBRARY_PATH (or DYLD_LIBRARY_PATH for macOS systems) variable.
petalosim writes its output in hdf5 files, therefore depends on the hdf5 library. You can download it from here.
After the installation, you need to have the following environment variables defined:
- hdf5 installation directory in your HDF5_DIR variable.
- hdf5 lib directory in your HDF5_LIB variable.
- hdf5 include directory in your HDF5_INC variable.
- hdf5 lib directory added to the LD_LIBRARY_PATH (or DYLD_LIBRARY_PATH for macOS) variable.
The NEST code simulates charge and scintillation yields in noble gases. You can download the version adapted to petalosim
doing:
git clone [email protected]:petalo-project/nest.git
and changing to the petalo
branch:
git checkout petalo
Once you have installed NEST, make sure to have the following environment variables defined:
- NEST include directory in your NEST_INC variable.
- NEST library directory (lib or lib64) in your NEST_LIB variable.
petalosim uses SCons for building. Detailed information on SCons can be found here. To install SCons on your computer:
- You must have Python3 installed on your system.
- Download the latest stable version of SCons and uncompress the file.
- Move to the resulting folder and type (you may need super-user privileges for this to work):
python setup.py install
To build petalosim just type: scons
inside the top-level directory. The building script (SConstruct) tries to locate the headers and libraries of all dependencies using pkg-config scripts, the environment variables previously defined or examining common system-paths (/usr/local
, for instance). Alternatively to defining environment variables, it is possible to pass the locations of the third-party libraries via command line, in the following way:
scons GEANT4_BINDIR=/path/to/Geant4/bin-directory ROOT_BINDIR=/path/to/root/bin-directory HDF5_DIR=/path/to/hdf5/installation-directory
You can speed up the build using scons -jN
where N is the number of available cores.
To silence excessive verbosity you can use scons -s
.
In order to run petalosim, be sure to execute the setup script, placed in the scripts
folder.
- If you use a macOS more recent than Mojave (version >= 10.15), you should execute:
source /path/to/scripts/petalosim_setup.zsh
- For the rest of operative systems:
source /path/to/scripts/petalosim_setup.sh
It will set the PETALODIR
variable to the top level directory of the installation.
To run petalosim, just type
bin/petalo -b -n numb_of_events init_macro_filename
Welcome to the petalosim Wiki!