Main Page
From UCL HEP PBT Wiki
m |
m |
||
Line 22: | Line 22: | ||
GEANT4 is a toolkit for simulating the passage of particles through matter. The user creates his/her own simulation application using GEANT4 tools. The tools are base classes. There are eight base classes: | GEANT4 is a toolkit for simulating the passage of particles through matter. The user creates his/her own simulation application using GEANT4 tools. The tools are base classes. There are eight base classes: | ||
- | * Three classes are mandatory | + | * Three classes are mandatory |
; G4VUserDetectorConstruction | ; G4VUserDetectorConstruction | ||
Line 31: | Line 31: | ||
: Describe particle source, source dimensions, initial position, energy spectrum, angular distributions | : Describe particle source, source dimensions, initial position, energy spectrum, angular distributions | ||
- | * The rest are optional | + | * The rest are optional |
; G4UserRunAction | ; G4UserRunAction | ||
Line 57: | Line 57: | ||
* Setting up the environment | * Setting up the environment | ||
- | + | ; 1. Connect to plus1 cluster and create a folder PhotonPencilBeam in your local area | |
<blockquote> | <blockquote> | ||
- | <span style="color:# | + | <span style="color:#800000"> ssh username@plus1.hep.ucl.ac.uk </span> |
- | <span style="color:# | + | <span style="color:#800000"> mkdir PhotonPencilBeam </span> |
- | <span style="color:# | + | <span style="color:#800000"> cd PhotonPencilBeam </span> |
</blockquote> | </blockquote> | ||
- | + | ; 2. Setup GEANT4 environment | |
<blockquote> | <blockquote> | ||
- | <span style="color:# | + | <span style="color:#800000"> source ... (GEANT4 script) </span> |
</blockquote> | </blockquote> | ||
* How to get the code | * How to get the code | ||
- | + | ; Copy the code to your area | |
<blockquote> | <blockquote> | ||
- | <span style="color:# | + | <span style="color:#800000"> cp /vasileva/BasicExamples/PhotonPencilBeam_source /username/PhotonPencilBeam/ </span> |
</blockquote> | </blockquote> | ||
* How to run the code | * How to run the code | ||
- | + | ; 1. Inside /username/PhotonPencilBeam/ create a folder: | |
<blockquote> | <blockquote> | ||
- | <span style="color:# | + | <span style="color:#800000"> mkdir PhotonPencilBeam_build </span> |
</blockquote> | </blockquote> | ||
- | + | ; 2. Change to this directory and run cmake and make to build the PhotonPencilBeam example: | |
<blockquote> | <blockquote> | ||
- | <span style="color:# | + | <span style="color:#800000"> cd PhotonPencilBeam_build </span> |
- | <span style="color:# | + | <span style="color:#800000"> cmake -DGeant4_DIR=/unix/pbt/Software/..../ /username/PhotonPencilBeam_source/ </span> |
- | <span style="color:# | + | <span style="color:#800000"> make </span> |
</blockquote> | </blockquote> | ||
Revision as of 13:42, 2 July 2014
Contents |
Introduction
This is a tutorial about applications of GEANT4 to medical physics. The GEANT4 is installed on the HEP Linux cluster at UCL. You will need an account on that cluster to be able to use this software, run example tutorials and create your own applications.
Accounts and Registration
Getting a computing account
Apply for a computing account on the HEP Linux cluster by sending e-mail to HEPComputingSupport. In your e-mail you have to state the reason for your application (i.e. medical physics student who will use the GEANT4 software on the HEP cluster).
You will receive an e-mail from the HEP computing support with your username and password. Now you can log in to the HEP cluster “plus1” via ssh username@plus1.hep.ucl.ac.uk.
Where to get help
You can send e-mail to the GEANT4 support at GEANT4Support or write to the forum.
The basics of GEANT4
GEANT4 is a toolkit for simulating the passage of particles through matter. The user creates his/her own simulation application using GEANT4 tools. The tools are base classes. There are eight base classes:
- Three classes are mandatory
- G4VUserDetectorConstruction
- Describe the experimental setup, geometry and materials
- G4VUserPhysicsList
- Define particles, physics processes and range cuts
- G4UserPrimaryGeneratorAction
- Describe particle source, source dimensions, initial position, energy spectrum, angular distributions
- The rest are optional
- G4UserRunAction
- Define and store histograms
- G4UserEventAction
- Event selection and analysis of simulation data
- G4UserStackingAction
- Customize priority of tracks
- G4UserTrackingAction
- Decide whether a trajectory should be stored or not
- G4UserSteppingAction
- Kill, suspend, postpone a track
You can create your own classes which are derived from the base classes. All of them should be registered with the G4RunManager. In function main() which is the skeleton of the user simulation code you instantiate G4RunManager and notify it of your mandatory and optional classes.
Basic examples
Monoenergetic photon pencil beam incident on a water cube
- Introduction
This example shows the dose distribution in water along the incident photon beam. The beam hits the water cube surface and deposits a dose under the surface of the water. The volume of the water cube is divided into voxels. At each voxel the dose contribution from the pencil beams is summed up and yields the total dose along the beam axis.
- Setting up the environment
- 1. Connect to plus1 cluster and create a folder PhotonPencilBeam in your local area
ssh username@plus1.hep.ucl.ac.uk mkdir PhotonPencilBeam cd PhotonPencilBeam
- 2. Setup GEANT4 environment
source ... (GEANT4 script)
- How to get the code
- Copy the code to your area
cp /vasileva/BasicExamples/PhotonPencilBeam_source /username/PhotonPencilBeam/
- How to run the code
- 1. Inside /username/PhotonPencilBeam/ create a folder
mkdir PhotonPencilBeam_build
- 2. Change to this directory and run cmake and make to build the PhotonPencilBeam example
cd PhotonPencilBeam_build cmake -DGeant4_DIR=/unix/pbt/Software/..../ /username/PhotonPencilBeam_source/ make
- How to analyze data
Monoenergetic proton pencil beam incident on a water cube
- Introduction
- Setting up the environment
- How to get the code
- How to run the code
- How to analyze data
- Comparison with data from The Clatterbridge Cancer Centre
Proton beam with realistic geometry incident on a water cube
- Introduction
- Setting up the environment
- How to get the code
- How to run the code
- How to analyze data
- Comparison with data from The Clatterbridge Cancer Centre
Several proton beams with spread out Bragg peaks
- Introduction
- Setting up the environment
- How to get the code
- How to run the code
- How to analyze data
Advanced examples
Cherenkov simulation
- Introduction
- Setting up the environment
- How to get the code
- How to run the code
- How to analyze data
Computed tomography
- Introduction
- Setting up the environment
- How to get the code
- How to run the code
- How to analyze data
High-precision dosimetry
- Introduction
- Setting up the environment
- How to get the code
- How to run the code
- How to analyze data