Software/Geant4/Tutorials/PBTCVMFS/B1 Basic Example: Difference between revisions
Jump to navigation
Jump to search
Compile the Code with
Run Macro
Run Macro
Line 38: | Line 38: | ||
<pre> | <pre> | ||
[username@ | [username@pc### B1Folder]$ cp -rv /cvmfs/geant4.cern.ch/geant4/11.2/share/examples/basic/B1 . | ||
[username@ | [username@pc### B1Folder]$ mv B1 B1_source | ||
</pre> | </pre> | ||
Revision as of 14:46, 25 November 2024
B1 Basic Example
This example demonstrates a very simple application where an energy deposit is accounted in user actions and their associated objects and a dose in a selected volume is calculated (from https://github.com/alisw/geant4/tree/master/examples/basic/B1).
Running the Tutorial
All the source files for the tutorial can be found in https://github.com/alisw/geant4/tree/master/examples/basic/B1.
Create folder ProtonPBFolder
ssh -X username@plus1.hep.ucl.ac.uk username@plus1.hep.ucl.ac.uk's password: type your password here ssh -X username@pc###.hep.ucl.ac.uk (where ### is the number of the PC you want to connect to) or ssh -X username@pcpool.hep.ucl.ac.uk (are unsure, or don't care, which PC you want to connect to) username@pc###.hep.ucl.ac.uk's password: type your password here [username@pc### ~]$ mkdir B1Folder [username@pc### ~]$ cd B1Folder
Setup Your Environment
[username@pc### B1Folder]$ source /unix/pbt/software/scripts/pbt.sh
Copy the Code to Your Working Directory and Rename It
[username@pc### B1Folder]$ cp -rv /cvmfs/geant4.cern.ch/geant4/11.2/share/examples/basic/B1 . [username@pc### B1Folder]$ mv B1 B1_source
Create the Build Directory
[username@plus1 B1Folder]$ mkdir B1_build
Compile the Code with Make
and Cmake
[username@plus1 B1Folder]$ cd B1_build [username@plus1 B1_build]$ cmake -DCMAKE_CXX_STANDARD=17 -DCMAKE_BUILD_TYPE=Release -DGEANT4_USE_QT=ON -DGeant4_DIR=/cvmfs/geant4.cern.ch/geant4/11.2/x86_64-centos7-gcc10-optdeb-MT /home/username/B1Folder/B1_source [username@plus1 B1_build]$ make
Run Macro run1.mac
[username@plus1 B1_build]$ ./exampleB1 run1.mac
If run is completed successful, output will show:
G4Allocator objects are deleted. UImanager deleted. StateManager deleted. RunManagerKernel is deleted. Good bye :) RunManager is deleted.
Run Macro run2.mac
[username@plus1 B1_build]$ ./exampleB1 run2.mac