Several proton beams with spread out Bragg peaks

From UCL HEP PBT Wiki

Jump to: navigation, search
m
m
 
Line 1: Line 1:
== <span style="color:#000080"> Introduction </span> ==
== <span style="color:#000080"> Introduction </span> ==
-
This tutorial is based on the [[Monoenergetic proton pencil beam]] example.   
+
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.
 +
 
 +
http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/ProtonSB/g4_00.png
 +
 
 +
This image shows only one proton beam energy. The water box is divided into slices using class '''G4PVReplica'''. Photons are in green, protons are in blue, neutrons are in yellow.
== <span style="color:#000080"> How to run the tutorial </span> ==
== <span style="color:#000080"> How to run the tutorial </span> ==
Line 47: Line 53:
</pre>
</pre>
-
; Run macro proton.mac with several beam energies.
+
; Run macro proton.mac  
<pre style="color: #800000; background-color: #dcdcdc">
<pre style="color: #800000; background-color: #dcdcdc">
Line 55: Line 61:
== <span style="color:#000080"> How to analyze data </span> ==
== <span style="color:#000080"> How to analyze data </span> ==
 +
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.
 +
 +
=== <span style="color:#000080"> Text files </span> ===
 +
 +
This is the [http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/ProtonSB/DoseFile.txt content] of '''DoseFile.txt''' with proton beam energies 50, 52, 54 and 56 MeV. This is the [http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/ProtonSB/PlotDose.txt content] of the '''PlotDose.txt'''.
 +
 +
=== <span style="color:#000080"> Root file </span> ===
 +
 +
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:
 +
 +
<pre style="color: #800000; background-color: #dcdcdc">
 +
cp /home/username/ProtonSBFolder/ProtonSB_source/PlotSimulation.C .
 +
</pre>
 +
 +
Then, run the script:
 +
 +
<pre style="color: #800000; background-color: #dcdcdc">
 +
[username@plus1 ProtonSB_build]$ root -l
 +
 +
root [1] .x PlotSimulation.C
 +
</pre>
 +
 +
This will create '''SOBP.root''' file with the following plot:
 +
 +
http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/ProtonSB/SOBP.png   
 +
 +
=== <span style="color:#000080"> Run with different settings </span> ===
 +
 +
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:
 +
 +
<pre style="color: #800000; background-color: #dcdcdc">
 +
# 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
 +
</pre>
 +
 +
This is the content of protonLoop.mac:
 +
 +
<pre style="color: #800000; background-color: #dcdcdc">
 +
# 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
 +
#
 +
</pre>
 +
 +
'''Change of the beam energies'''
 +
 +
You can change the proton beam energies by modifying this line in proton.mac
 +
 +
<pre style="color: #800000; background-color: #dcdcdc">
 +
/control/loop protonLoop.mac ene 50 56 2
 +
</pre>
 +
 +
where "50" is the initial value, "56" is the final value and "2" is the step size in MeV.
 +
 +
=== <span style="color:#000080"> Visualisation </span> ===
 +
 +
If you want to use visualisation (with DAWN), in macro proton.mac uncomment line '''#/control/execute visualisation.mac'''. Then, run the code.
 +
You will have four images from the four proton beams.
 +
 +
For proton energy of 50 MeV: http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/ProtonSB/g4_00.eps
 +
 +
For proton energy of 52 MeV: http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/ProtonSB/g4_01.eps
 +
 +
For proton energy of 54 MeV: http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/ProtonSB/g4_02.eps
 +
 +
For proton energy of 56 MeV: http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/ProtonSB/g4_03.eps
 +
 +
Protons are in blue, neutrons are in yellow, photons are in green.
 +
== <span style="color:#000080"> Files </span> ==
== <span style="color:#000080"> Files </span> ==
 +
 +
[[List of spread out Bragg peaks files with brief description]]

Latest revision as of 19:06, 3 September 2014

Personal tools