Several proton beams with spread out Bragg peaks

From UCL HEP PBT Wiki

Revision as of 17:19, 3 September 2014 by IlinaMediaWiki (Talk | contribs)
Jump to: navigation, search

Contents

Introduction

This tutorial is based on the Monoenergetic proton pencil beam example. The code run with several beam energies to produce spread out Bragg peak.

The water cube is divided into slices using class G4PVReplica. At each slice the deposited dose and energy for every energy beam is computed. The energy and the dose are scored using classes G4UserSteppingAction and G4UserRunAction. The proton beams are simulated using G4ParticleGun class. There is an option to chose among several EM and the QGSP_BIC_EMY physics lists.

How to run the tutorial

Connect to the HEP cluster and create folder ProtonSBFolder in your area
ssh -X username@plus1.hep.ucl.ac.uk 

username@plus1.hep.ucl.ac.uk's password: type your password here

[username@plus1 ~]$ mkdir ProtonSBFolder 

[username@plus1 ~]$ cd ProtonSBFolder  
Setup your environment
[username@plus1 PhotonSBFolder]$ source /unix/pbt/software/dev/bin/pbt-dev.sh  
Copy the code to your working directory and rename it
[username@plus1 PhotonSBFolder]$ cp -r /unix/pbt/tutorials/basic/ProtonSB .
  
[username@plus1 PhotonSBFolder]$ mv ProtonSB ProtonSB_source
Inside /home/username/ProtonSBFolder/ create a directory
[username@plus1 PhotonSBFolder]$ mkdir ProtonSB_build  
To compile the code enter this directory and run cmake and make
[username@plus1 PhotonSBFolder]$ cd ProtonSB_build 

[username@plus1 ProtonSB_build]$ cmake -DGeant4_DIR=/unix/pbt/software/dev /home/username/ProtonSBFolder/ProtonSB_source 

[username@plus1 ProtonSB_build]$ make  
Run macro proton.mac
[username@plus1 ProtonSB_build]$ ./protonSB proton.mac

How to analyze data

The code produces two text files DoseFile.txt and PlotDose.txt. The file DoseFile.txt contains energy and dose deposition for every layer and for every beam energy. The file PlotDose.txt contains only depth vs dose for each layer for every beam energy. These text files can be analyzed with MATLAB or ROOT.

Text files

This is the content of DoseFile.txt with proton beam energies 50, 52, 54 and 56 MeV. This is the content of the PlotDose.txt.

Root file

You can use script PlotSimulation.C to plot the spread out Bragg peak. The script uses PlotDose.txt. Copy the script to your current ProtonSB_build directory:

cp /home/username/ProtonSBFolder/ProtonSB_source/PlotSimulation.C .

Then, run the script in the following way:

[username@plus1 ProtonSB_build]$ root -l 

root [1] .x PlotSimulation.C

This will create SOBP.root file with the following plot:

SOBP.png

Run with different settings

You can change the physics process, incident proton beam energies, number of slices etc. by modifying macros proton.mac and protonLoop.mac. This is the content of proton.mac:

# proton.mac
#
/control/verbose 2
/run/verbose 2
/tracking/verbose 0
/run/particle/verbose 1
/run/particle/dumpList
#
# set geometry
/protonSB/det/setSizeX  4 cm
/protonSB/det/setSizeYZ 4 cm
/protonSB/det/setSliceSizeYZ 4 cm
/protonSB/det/sliceNumber 50
#
# set physics process
/protonSB/phys/addPhysics QGSP_BIC_EMY
#/protonSB/phys/addPhysics emlivermore
#/protonSB/phys/addPhysics empenelope
#
# production tresholds (recommended range
#cut off not bigger than 10% of slice thickness)
/protonSB/phys/setCuts 0.2 mm
#/protonSB/phys/setGCut 1 um
#/protonSB/phys/setECut 1 um
#/protonSB/phys/setPCut 1 um
#
# initialize
/run/initialize
#
# visualisation
#/control/execute visualisation.mac
#
/control/loop protonLoop.mac ene 50 56 2

This is the content of protonLoop.mac:

# protonLoop.mac
#
/gun/particle proton
# particle energy
/gun/energy {ene} MeV
#
# beam size
#/photonSB/gun/rndm 3 mm
#
# step limit (recommended not bigger than 5% of
# slice thickness)
/protonSB/stepMax 0.1 mm
#
/protonSB/event/printModulo 50
#
# number of events
/run/beamOn 6000
#

Change of the beam energies

You can change the proton beam energies by modifying this line in proton.mac

/control/loop protonLoop.mac ene 50 56 2

where "50" is the initial value, "56" is the final value and "2" is the step size in MeV.

Files

List of spread out Bragg peaks files with brief description

 Layers :        x[mm]          Edep    Edep/Ebeam[%]   Dose    Dose/MaxDose[%]
 layer 1:       0.8     6.14782 GeV     2.04927 7.69522e-07 Gy  17.9921
 layer 2:       1.6     6.3146 GeV      2.10487 7.90399e-07 Gy  18.4802
 layer 3:       2.4     6.408 GeV       2.136   8.02089e-07 Gy  18.7536
 layer 4:       3.2     6.57863 GeV     2.19288 8.23447e-07 Gy  19.2529
 layer 5:       4       6.67038 GeV     2.22346 8.34932e-07 Gy  19.5214
 layer 6:       4.8     6.83438 GeV     2.27813 8.55459e-07 Gy  20.0014
 layer 7:       5.6     7.01613 GeV     2.33871 8.78209e-07 Gy  20.5333
 layer 8:       6.4     7.13427 GeV     2.37809 8.92996e-07 Gy  20.879
 layer 9:       7.2     7.27016 GeV     2.42339 9.10006e-07 Gy  21.2768
 layer 10:      8       7.45719 GeV     2.48573 9.33417e-07 Gy  21.8241
 layer 11:      8.8     7.68621 GeV     2.56207 9.62083e-07 Gy  22.4943
 layer 12:      9.6     7.85903 GeV     2.61968 9.83715e-07 Gy  23.0001
 layer 13:      10.4    8.0806 GeV      2.69353 1.01145e-06 Gy  23.6486
 layer 14:      11.2    8.33342 GeV     2.77781 1.04309e-06 Gy  24.3885
 layer 15:      12      8.71141 GeV     2.9038  1.09041e-06 Gy  25.4947
 layer 16:      12.8    8.93703 GeV     2.97901 1.11865e-06 Gy  26.155
 layer 17:      13.6    9.3526 GeV      3.11753 1.17067e-06 Gy  27.3712
 layer 18:      14.4    9.6102 GeV      3.2034  1.20291e-06 Gy  28.1251
 layer 19:      15.2    10.1115 GeV     3.3705  1.26566e-06 Gy  29.5922
0.8     17.9921
1.6     18.4802
2.4     18.7536
3.2     19.2529
4       19.5214
4.8     20.0014
5.6     20.5333
6.4     20.879
7.2     21.2768
8       21.8241
8.8     22.4943
9.6     23.0001
10.4    23.6486
11.2    24.3885
12      25.4947
12.8    26.155
13.6    27.3712
14.4    28.1251
15.2    29.5922
16      31.5189
Personal tools