Several proton beams with spread out Bragg peaks

From UCL HEP PBT Wiki

(Difference between revisions)
Jump to: navigation, search
m
m
Line 57: Line 57:
== <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 in the following way:
 +
 +
<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/SOPB.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
 +
 +
<pre style="color: #800000; background-color: #dcdcdc">
 +
/control/loop protonLoop.mac ene 50 56 2
 +
</pre>
== <span style="color:#000080"> Files </span> ==
== <span style="color:#000080"> Files </span> ==

Revision as of 16:54, 3 September 2014

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:

SOPB.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

/control/loop protonLoop.mac ene 50 56 2

Files

Personal tools