musrSim simulation
Contents
This is the C++ source code for the musrSim simulation software which is intended to be a general tool to design and simulate µSR spectrometer with very high accuracy. To compile and run musrSim, the user must have a recent Geant4 (tested with v11.0.3) and Root (tested with v6-22-06) installed (Root version is not critical).
- The code is specifically tuned to simulate muon spin spectrometers.
- The code is maintained by the Laboratory for Muon Spin Spectroscopy at PSI.
Supported platforms
- Linux and any other decent OS that can run Root and GEANT4.
Installation
Compile and install Geant4, we recommend the use of the following cmake flags
cmake -DCMAKE_INSTALL_PREFIX=/path/to/installation /path/to/source -DGEANT4_USE_QT=ON -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_OPENGL_X11=ON
Set the correct environment variable for Geant4. We recommend that you add the following to your .bashrc
export G4INSTALL="/path/to/installation"
export G4NEUTRONHPDATA="$G4INSTALL/share/Geant4-11.0.3/data/G4NDL4.6"
export G4LEDATA="$G4INSTALL/share/Geant4-11.0.3/data/G4EMLOW8.0"
export G4LEVELGAMMADATA="$G4INSTALL/share/Geant4-11.0.3/data/PhotonEvaporation5.7"
export G4RADIOACTIVEDATA="$G4INSTALL/share/Geant4-11.0.3/data/RadioactiveDecay5.6"
export G4PARTICLEXSDATA="$G4INSTALL/share/Geant4-11.0.3/data/G4PARTICLEXS4.0"
export G4PIIDATA="$G4INSTALL/share/Geant4-11.0.3/data/G4PII1.3"
export G4REALSURFACEDATA="$G4INSTALL/share/Geant4-11.0.3/data/RealSurface2.2"
export G4SAIDXSDATA="$G4INSTALL/share/Geant4-11.0.3/data/G4SAIDDATA2.0"
export G4ABLADATA="$G4INSTALL/share/Geant4-11.0.3/data/G4ABLA3.1"
export G4INCLDATA="$G4INSTALL/share/Geant4-11.0.3/data/G4INCL1.0"
export G4ENSDFSTATEDATA="$G4INSTALL/share/Geant4-11.0.3/data/G4ENSDFSTATE2.3"
export G4VRMLFILE_VIEWER="/path/to/your/vrmlviewer";
Clone the musrSim repository
git clone https://zaher-salman@bitbucket.org/zaher-salman/musrsim.git
then (see below for RedHat or other old systems)
cd musrsim
mkdir build
cd build
cmake ../
make -j8
make install
This will install the musrSim
binary in /usr/local/bin
, but it can be moved to any other directory in your PATH
.
Running the simulations
Prepare a file, finlename.mac
, with your beamline and spectrometer design following the instruction in the musrSim manual.
musrSim filename.mac
RedHat and old systems
Compilation on RedHat systems that has an old defaul GCC compiler should be done using the follwoing command. Make sure that the gcc-toolset-13
package is installed.
scl enable gcc-toolset-13 'make -j8'
Contact
Zaher Salman zaher.salman@psi.ch