Updated instructions.

This commit is contained in:
2024-02-06 19:09:11 +01:00
parent 4f8f291728
commit 1e452e161c

View File

@ -2,7 +2,7 @@
### Contents ### ### 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). 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 v11.2.0) and Root installed (tested with v6-22-06 and v6-30-02, but the version should not be critical).
* The code is specifically tuned to simulate muon spin spectrometers. * The code is specifically tuned to simulate muon spin spectrometers.
* The code is maintained by the Laboratory for Muon Spin Spectroscopy at PSI. * The code is maintained by the Laboratory for Muon Spin Spectroscopy at PSI.
@ -15,25 +15,29 @@ This is the C++ source code for the musrSim simulation software which is intende
Compile and install Geant4, we recommend the use of the following cmake flags 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 cmake -DCMAKE_INSTALL_PREFIX=/path/to/G4installation /path/to/G4source -DGEANT4_USE_QT=ON -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_OPENGL_X11=ON
We also recommend that you use `view3dscene` as a VRML viewer. This can be downloaded from here: `https://castle-engine.io/view3dscene.php`. We also recommend that you use `view3dscene` as a VRML viewer. This can be downloaded from here: `https://castle-engine.io/view3dscene.php`.
Following the installation of Gean4, set the correct environment variable. We recommend that you add the following to your `.bashrc` file. Following the installation of Gean4, set the correct environment variables. This can be done easily by editing `/path/to/G4installation/bin/geant4.sh` to uncomment the lines defining Geant4 data location:
export G4INSTALL="/path/to/installation" export G4NEUTRONHPDATA=$GEANT4_DATA_DIR/G4NDL4.7
export G4NEUTRONHPDATA="$G4INSTALL/share/Geant4-11.0.3/data/G4NDL4.6" export G4LEDATA=$GEANT4_DATA_DIR/G4EMLOW8.5
export G4LEDATA="$G4INSTALL/share/Geant4-11.0.3/data/G4EMLOW8.0" export G4LEVELGAMMADATA=$GEANT4_DATA_DIR/PhotonEvaporation5.7
export G4LEVELGAMMADATA="$G4INSTALL/share/Geant4-11.0.3/data/PhotonEvaporation5.7" export G4RADIOACTIVEDATA=$GEANT4_DATA_DIR/RadioactiveDecay5.6
export G4RADIOACTIVEDATA="$G4INSTALL/share/Geant4-11.0.3/data/RadioactiveDecay5.6" export G4PARTICLEXSDATA=$GEANT4_DATA_DIR/G4PARTICLEXS4.0
export G4PARTICLEXSDATA="$G4INSTALL/share/Geant4-11.0.3/data/G4PARTICLEXS4.0" export G4PIIDATA=$GEANT4_DATA_DIR/G4PII1.3
export G4PIIDATA="$G4INSTALL/share/Geant4-11.0.3/data/G4PII1.3" export G4REALSURFACEDATA=$GEANT4_DATA_DIR/RealSurface2.2
export G4REALSURFACEDATA="$G4INSTALL/share/Geant4-11.0.3/data/RealSurface2.2" export G4SAIDXSDATA=$GEANT4_DATA_DIR/G4SAIDDATA2.0
export G4SAIDXSDATA="$G4INSTALL/share/Geant4-11.0.3/data/G4SAIDDATA2.0" export G4ABLADATA=$GEANT4_DATA_DIR/G4ABLA3.3
export G4ABLADATA="$G4INSTALL/share/Geant4-11.0.3/data/G4ABLA3.1" export G4INCLDATA=$GEANT4_DATA_DIR/G4INCL1.2
export G4INCLDATA="$G4INSTALL/share/Geant4-11.0.3/data/G4INCL1.0" export G4ENSDFSTATEDATA=$GEANT4_DATA_DIR/G4ENSDFSTATE2.3
export G4ENSDFSTATEDATA="$G4INSTALL/share/Geant4-11.0.3/data/G4ENSDFSTATE2.3"
export G4VRMLFILE_VIEWER="/path/to/your/view3dscene"; Then run the following to setup the correct variables
. /path/to/G4installation/bin/geant4.sh
You will probably need to do that everytime you want to run the simulation or add the line above to your `.bashrc`.
Clone the musrSim repository Clone the musrSim repository
@ -52,7 +56,7 @@ This will install the `musrSim` binary in `/usr/local/bin`, but it can be moved
### Running the simulations ### ### Running the simulations ###
Prepare a file, `finlename.mac`, with your beamline and spectrometer design following the instruction in the [musrSim manual](https://bitbucket.org/zaher-salman/musrsim/src/master/doc/musrSim.pdf). Prepare a file, `finlename.mac`, with your beamline and spectrometer design following the instruction in the [musrSim manual](https://bitbucket.org/zaher-salman/musrsim/src/master/doc/musrSim.pdf). Create a folder `data` and then run the simulation
musrSim filename.mac musrSim filename.mac