Geant4 Tutorial
Lyra
Department of Astronomy and Theoretical Physics

GEANT4 (http://geant4.web.cern.ch/) is a toolkit for simulating the passage of particles through matter. It is the reference simulation engine in many areas. GEANT4 covers all relevant physics processes, electromagnetic, hadronic, decay, optical, for long and short lived particles, for energy range spanning from tens of eV to TeV scale. The transport of low energy neutrons down to thermal energies is also be handled. The software can also simulate remnants of hadronic interactions, including atomic de-excitation and provides extension to low energies down to the DNA scale for biological modelling. The software is based on a sound object-oriented design which favours a variety of application development by the community, like for example the propagation of acoustic phonons in cryogenic crystals, the Geant4 Application for Tomographic Emission (GATE), the beam line simulation (G4BEAMLINE) and others
Register for the course following the link below but please also fill out the COMPUTE course registration form, which can be downloaded from the following website http://cbbp.thep.lu.se/compute/index.php.
-
-
Tutorial Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund-
1
Welcome
-
2
Tutorial introduction- Network, logistics - Tutorial structure - Lecturer introductionSpeaker: Luis Sarmiento Pico (Lunds universitet)
- 3
- 4
-
1
-
10:30
break Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund -
Tutorial Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund-
5
User documents and examples- Installation Guide - Application developer’s manual - Toolkit developer’s manual - Physics reference manual - Novice examples in Geant4 distribution - Extended and advanced examples in Geant4 distribution - LXR source code browser - HyperNewsSpeaker: Dennis Wright
- 6
- 7
-
5
-
12:20
lunch break Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund -
Tutorial Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund- 8
- 9
-
15:00
break Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund -
Hands-on Lundmarksalen
Lundmarksalen
Department of Astronomy and Theoretical Physics
-
10
Hands-on I- Complete Geant4 installation and execute a few examples to confirm the installation -->
Hands-on instruction--> Hands-on instruction - Additional links --> Installation guide --> Troubleshooting: Installation and Configuration thread of Hypernews# this bit of code should be included in your ~/.bashrc.
# If not running interactively, don't do anything
[[ $- != *i* ]] && return#########################################################################
#########################################################################
## ##
## LCG and LCG-inspired configuration ##
## ##
## (http://lcginfo.cern.ch/) ##
## ##
#########################################################################
#########################################################################export LCG_REPO=/cvmfs/sft.cern.ch/lcg/views
### for latest Geant4 this is the one you need
export LCG_RELEASE=94rc1
export LCG_PLATFORM=x86_64-slc6-gcc62-opt## for production this is the current tested one
#export LCG_RELEASE=93
#export LCG_PLATFORM=x86_64-slc6-gcc62-opt##
source $LCG_REPO/LCG_$LCG_RELEASE/$LCG_PLATFORM/setup.sh
export QT_QPA_FONTDIR=$LCG_REPO/LCG_$LCG_RELEASE/$LCG_PLATFORM/fontscat <<EOF
#########################################################################
#########################################################################Current Software setup is
LCG version : $LCG_RELEASE
platform : $LCG_PLATFORMG4examples : $LCG_REPO/LCG_$LCG_RELEASE/$LCG_PLATFORM/share/Geant4-*/examples
#########################################################################
#########################################################################
EOFreturn
-
10
-
-
-
Tutorial Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund- 11
- 12
-
10:30
Break Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund -
Tutorial Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund- 13
- 14
-
12:20
lunch break Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund -
Tutorial Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund- 15
- 16
-
15:00
Break Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund -
Hands-on Lundmarksalen
Lundmarksalen
Department of Astronomy and Theoretical Physics
-
17
Hands-on II- Material and a simple geometry - Visualization of geometry - Command-based scoring -->
Hands-on instruction--> Hands-on instructionwhen working on the HandsOn2 you will see that the notes for the tutorial are hosted at SLAC with rather "generic" instructions. I have translated them into 'iridium-able' commands ;-)
======================================================================================
BLOCK 1 getting the exercise code
======================================================================================$ mkdir ~/HandsOn2 # make new working directory
$ cd ~/HandsOn2 # change to your new working directory
$ wget http://geant4.slac.stanford.edu/SLACG4TutorialHandsOn/HandsOn2/HandsOn2.tar.gz
$ wget http://geant4.slac.stanford.edu/SLACG4TutorialHandsOn/HandsOn2/HandsOn2-solution.tar.gz
$ tar xzf HandsOn2.tar.gz # extract source code
# optionally extract in a similar way the solution. But please give the exercise a try first ;-)
$ cd HandsOn2 # change to newly extracted code
$ ls # have a look at the files
$ cd .. # let's go back to '~/HandsOn2' working directory===================================================================================
and
===================================================================================
BLOCK 2 OPTION: SEPARATE build and source directory
===================================================================================$ mkdir build-HandsOn2
$ cd build-HandsOn2
$ cmake ../HandsOn2
$ make
$ ./SLACtut===================================================================================
RINSE AND REPEAT
===================================================================================
# ... modify files located under '~/HandsOn2/HandsOn2'
# compile the code at ~/HandsOn2/build-HandsOn2
$ make
# when you issued 'cmake ../HandsOn2' those two folders got linked. It would just work
===================================================================================OR
===================================================================================
BLOCK 2 OPTION: SAME build and source directory
===================================================================================$ cd HandsOn2
$ cmake .
$ make -f Makefile
$ ./SLACtut===================================================================================
RINSE AND REPEAT
===================================================================================
# ... modify files located under '~/HandsOn2/HandsOn2'
# compile the code directly at ~/HandsOn2/HandsOn2
$ make -f Makefile
===================================================================================Happy coding ;-)
-
17
-
-
-
10:30
break Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund -
Tutorial Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund- 20
- 21
-
12:20
lunch break Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund -
Tutorial Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund- 22
- 23
-
15:00
break Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund -
Hands-on Lundmarksalen
Lundmarksalen
Department of Astronomy and Theoretical Physics
-
24
Hands-on III- Complete geometry - Define scorers - User Actions I: printing information on the screen -->
Hands-on instruction--> Hands-on instructionwhen working on the HandsOn3 you will see that the notes for the tutorial are hosted at SLAC with rather "generic" instructions. I have translated them into 'iridium-able' commands ;-)
===================================================================================
BLOCK 1 OPTION: SEPARATE build and source directory - getting the exercise code and compile
===================================================================================$ mkdir ~/HandsOn3 # make new working directory
$ cd ~/HandsOn3 # change to your new working directory
$ wget http://geant4.slac.stanford.edu/SLACG4TutorialHandsOn/HandsOn3/HandsOn3.tar.gz
$ wget http://geant4.slac.stanford.edu/SLACG4TutorialHandsOn/HandsOn3/HandsOn3-solution.tar.gz
$ tar xzf HandsOn3.tar.gz # extract source code
# optionally extract in a similar way the solution. But please give the exercise a try first ;-)
$ mkdir build-HandsOn3
$ cd build-HandsOn3
$ cmake ../HandsOn3
$ make
$ ./SLACtut# If at the time of quitting the execution you do not return to the prompt, you can try
# to 'kill' the process by pressing 'C-c' (Control key + c key)===================================================================================
RINSE AND REPEAT
===================================================================================# ... modify files located under '~/HandsOn3/HandsOn3'
# compile the code at ~/HandsOn3/build-HandsOn3
$ make
# when you issued 'cmake ../HandsOn3' those two folders got linked. It would just work# If at the time of quitting the execution you do not return to the prompt, you can try
# to 'kill' the process by pressing 'C-c' (Control key + c key)===================================================================================
OR
===================================================================================
BLOCK 1 OPTION: SAME build and source directory - getting the exercise code and compile
===================================================================================$ mkdir ~/HandsOn3 # make new working directory
$ cd ~/HandsOn3 # change to your new working directory
$ wget http://geant4.slac.stanford.edu/SLACG4TutorialHandsOn/HandsOn3/HandsOn3.tar.gz
$ wget http://geant4.slac.stanford.edu/SLACG4TutorialHandsOn/HandsOn3/HandsOn3-solution.tar.gz
$ tar xzf HandsOn3.tar.gz # extract source code
# optionally extract in a similar way the solution. But please give the exercise a try first ;-)
$ cd HandsOn3
$ cmake .
$ make -f Makefile
$ ./SLACtut# If at the time of quitting the execution you do not return to the prompt, you can try
# to 'kill' the process by pressung 'C-c' (Control key + c key)===================================================================================
RINSE AND REPEAT
===================================================================================# ... modify files located under '~/HandsOn3/HandsOn3'
# compile the code directly at ~/HandsOn3/HandsOn3
$ make -f Makefile# If at the time of quitting the execution you do not return to the prompt, you can try
# to 'kill' the process by pressung 'C-c' (Control key + c key)==================================================================================
-
24
-
-
Tutorial Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund- 25
- 26
-
10:30
break Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund -
Tutorial Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund- 27
- 28
- 29
-
12:20
lunch break Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund -
Tutorial Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund- 30
- 31
- 32
-
15:00
break Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund -
Hands-on Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund-
33
Hands-on IV- User Actions II: Accumulating information from a run - Use g4tools to create histograms and output ntuple files -->
Hands-on instruction--> Hands-on instructionwhen working on the HandsOn4 you will see that the notes for the tutorial are hosted at SLAC with rather "generic" instructions. I have translated them into 'iridium-able' commands ;-)
===================================================================================
BLOCK 1 OPTION: SEPARATE build and source directory - getting the exercise code and compile
===================================================================================$ mkdir ~/HandsOn4 # make new working directory
$ cd ~/HandsOn4 # change to your new working directory
$ wget http://geant4.slac.stanford.edu/SLACG4TutorialHandsOn/HandsOn4/HandsOn4.tar.gz
$ wget http://geant4.slac.stanford.edu/SLACG4TutorialHandsOn/HandsOn4/HandsOn4-solution.tar.gz
$ tar xzf HandsOn4.tar.gz # extract source code
# optionally extract in a similar way the solution. But please give the exercise a try first ;-)
$ mkdir build-HandsOn4
$ cd build-HandsOn4
$ cmake ../HandsOn4
$ make
$ ./SLACtut# If at the time of quitting the execution you do not return to the prompt, you can try
# to 'kill' the process by pressing 'C-c' (Control key + c key)===================================================================================
RINSE AND REPEAT
===================================================================================# ... modify files located under '~/HandsOn4/HandsOn4'
# compile the code at ~/HandsOn4/build-HandsOn4
$ make
# when you issued 'cmake ../HandsOn4' those two folders got linked. It would just work# If at the time of quitting the execution you do not return to the prompt, you can try
# to 'kill' the process by pressing 'C-c' (Control key + c key)===================================================================================
OR
===================================================================================
BLOCK 1 OPTION: SAME build and source directory - getting the exercise code and compile
===================================================================================$ mkdir ~/HandsOn4 # make new working directory
$ cd ~/HandsOn4 # change to your new working directory
$ wget http://geant4.slac.stanford.edu/SLACG4TutorialHandsOn/HandsOn4/HandsOn4.tar.gz
$ wget http://geant4.slac.stanford.edu/SLACG4TutorialHandsOn/HandsOn4/HandsOn4-solution.tar.gz
$ tar xzf HandsOn4.tar.gz # extract source code
# optionally extract in a similar way the solution. But please give the exercise a try first ;-)
$ cd HandsOn4
$ cmake .
$ make -f Makefile
$ ./SLACtut# If at the time of quitting the execution you do not return to the prompt, you can try
# to 'kill' the process by pressung 'C-c' (Control key + c key)===================================================================================
RINSE AND REPEAT
===================================================================================# ... modify files located under '~/HandsOn4/HandsOn4'
# compile the code directly at ~/HandsOn4/HandsOn4
$ make -f Makefile# If at the time of quitting the execution you do not return to the prompt, you can try
# to 'kill' the process by pressung 'C-c' (Control key + c key)==================================================================================
-
33
-
-
-
Tutorial Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund- 34
- 35
-
10:30
break Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund -
Tutorial Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund- 36
- 37
-
12:20
lunch break Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund -
Adjourn Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 Lund -
Submission: Project submission Lyra
Lyra
Department of Astronomy and Theoretical Physics
Sölvegatan 27, 223 62 LundThis is the place to upload the reports
- 41
- 42
- 43
- 44
- 45
- 46
- 47
-
48
Ander Gray
-
