Proton beam with realistic geometry
From UCL HEP PBT Wiki
for
Proton beam with realistic geometry
Jump to:
navigation
,
search
== <span style="color:#000080"> Introduction </span> == This example shows the dose distribution in water along the incident proton beam. The difference with the monoenergetic proton pencil beam example is that the beam is defined with realistic geometry. Instead of particle gun, we use general particle source for the generation of the proton beam. For more details on general particle source look [https://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/ch02s07.html here]. == <span style="color:#000080"> Setting up the environment </span> == ; Connect to HEP cluster and create folder ProtonGBFolder in your area <pre style="color: #800000; background-color: #dcdcdc"> ssh -X username@plus1.hep.ucl.ac.uk password: type your password here cd /home/username/ mkdir ProtonGBFolder cd ProtonGBFolder </pre> ; Setup your environment <pre style="color: #800000; background-color: #dcdcdc"> source /unix/pbt/software/dev/bin/pbt-dev.sh </pre> == <span style="color:#000080"> How to get the code </span> == ; Copy the code to your working directory and rename it <pre style="color: #800000; background-color: #dcdcdc"> cp -r /unix/pbt/tutorials/basic/ProtonGB . mv ProtonGB ProtonGB_source </pre> == <span style="color:#000080"> How to run the code </span> == ; Inside /home/username/ProtonGBFolder/ create a directory <pre style="color: #800000; background-color: #dcdcdc"> mkdir ProtonGB_build </pre> ; To compile the code enter this directory and run cmake and make <pre style="color: #800000; background-color: #dcdcdc"> cd ProtonGB_build cmake -DGeant4_DIR=/unix/pbt/software/dev /home/username/ProtonGBFolder/ProtonGB_source make </pre> ; Run macro proton.mac. <pre style="color: #800000; background-color: #dcdcdc"> ./protonGB proton.mac </pre> == <span style="color:#000080"> How to analyze data </span> == The macro produces a root file '''Proton.root''' with two histograms. The first histogram shows the energy deposition in water box along the beam line, the second histogram shows zoomed Bragg peak. The macro also produces two text files '''DoseFile.txt''' and '''PlotDose.txt'''. The file '''DoseFile.txt''' contains energy and dose deposition at each water box layer. The file '''PlotDose.txt''' contains depth vs dose values. These values can be imported in matlab. This is an example output for '''DoseFile.txt''' with physics process '''QGSP_BIC_EMY''' and incident proton energy of '''62 MeV'''. <pre style="color: #800000; background-color: #dcdcdc"> Layers x[mm] Edep Edep/Ebeam[%] Dose Dose/MaxDose[%] layer 1: 1.33333 8.83908 GeV 2.376 1.062e-05 Gy 21.88 layer 2: 2.667 8.928 GeV 2.4 1.073e-05 Gy 22.11 layer 3: 4 9.214 GeV 2.477 1.107e-05 Gy 22.81 layer 4: 5.333 9.468 GeV 2.545 1.138e-05 Gy 23.44 layer 5: 6.667 9.577 GeV 2.575 1.151e-05 Gy 23.71 layer 6: 8 9.767 GeV 2.626 1.174e-05 Gy 24.18 layer 7: 9.333 10 GeV 2.689 1.202e-05 Gy 24.77 layer 8: 10.67 10.27 GeV 2.761 1.234e-05 Gy 25.43 layer 9: 12 10.48 GeV 2.817 1.259e-05 Gy 25.94 layer 10: 13.33 10.79 GeV 2.901 1.297e-05 Gy 26.72 layer 11: 14.67 11.11 GeV 2.986 1.335e-05 Gy 27.5 layer 12: 16 11.58 GeV 3.114 1.392e-05 Gy 28.68 layer 13: 17.33 12.04 GeV 3.236 1.447e-05 Gy 29.81 layer 14: 18.67 12.4 GeV 3.334 1.49e-05 Gy 30.7 layer 15: 20 12.98 GeV 3.489 1.56e-05 Gy 32.14 layer 16: 21.33 13.67 GeV 3.675 1.643e-05 Gy 33.84 layer 17: 22.67 14.39 GeV 3.868 1.729e-05 Gy 35.63 layer 18: 24 15.4 GeV 4.139 1.85e-05 Gy 38.12 layer 19: 25.33 16.57 GeV 4.454 1.991e-05 Gy 41.02 layer 20: 26.67 18.19 GeV 4.89 2.186e-05 Gy 45.04 layer 21: 28 20.69 GeV 5.562 2.486e-05 Gy 51.22 layer 22: 29.33 24.52 GeV 6.592 2.946e-05 Gy 60.71 layer 23: 30.67 33.19 GeV 8.922 3.988e-05 Gy 82.17 layer 24: 32 40.39 GeV 10.86 4.853e-05 Gy 100 layer 25: 33.33 3.536 GeV 0.9507 4.249e-06 Gy 8.756 layer 26: 34.67 1.466 MeV 0.0003942 1.762e-09 Gy 0.00363 layer 27: 36 10.16 MeV 0.002731 1.221e-08 Gy 0.02515 layer 28: 37.33 126 keV 3.387e-05 1.514e-10 Gy 0.0003119 layer 29: 38.67 18.63 keV 5.009e-06 2.239e-11 Gy 4.613e-05 layer 30: 40 0 eV 0 0 Gy 0 The run consists of 6000 protons of 62 MeV through 4 cm of Water (density: 1 g/cm3 ) divided into 30 slices. Edep is the deposited energy in every slice. Total incident energy(Ebeam)= 372 GeV Total energy deposit= 366.6 GeV Dose is the deposited dose in every slice. MaxDose is the highest dose value from all slices. </pre> The corresponding '''PlotDose.txt''' is <pre style="color: #800000; background-color: #dcdcdc"> 1.33333 21.8846 2.66667 22.106 4 22.8118 5.33333 23.4411 6.66667 23.7111 8 24.1827 9.33333 24.7673 10.6667 25.4289 12 25.9402 13.3333 26.7199 14.6667 27.4969 16 28.681 17.3333 29.8068 18.6667 30.704 20 32.136 21.3333 33.8436 22.6667 35.6258 24 38.1195 25.3333 41.0227 26.6667 45.0388 28 51.2228 29.3333 60.709 30.6667 82.172 32 100 33.3333 8.75568 34.6667 0.00363025 36 0.0251539 37.3333 0.000311934 38.6667 4.61342e-05 40 0 </pre> You can open Proton.root file in the following way: <pre style="color: #800000; background-color: #dcdcdc"> root -l Proton.root new TBrowser Select ROOT Files and Proton.root </pre> This is the energy deposition along the beam in the absorber: http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/ProtonGB/BraggPeak_GB.png This is the energy deposition along the beam in the absorber, zoomed around the peak: http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/ProtonGB/BraggPeak_GBzoom.png You can change the physics process, incident proton energy and number of slices by modifying the macro proton.mac. In addition, you can configure the particle source by using the '''/gps/''' commands. The beam characteristics are similar to the ones used at the Laboratori Nazionali del Sud (INFN) in Catania, Italy. The proton beam has Guassian energy distribution. Have a look [https://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/ch02s07.html here] to find out the meaning of the /gps/ commands. Now, use your favorite editor '''pico''', '''vi''', '''emacs''' etc. to open the macro proton.mac: <pre style="color: #800000; background-color: #dcdcdc"> pico proton.mac </pre> You will see: <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 /protonGB/det/setSizeX 4 cm /protonGB/det/setSizeYZ 4 cm /protonGB/det/setSliceSizeYZ 1 cm /protonGB/det/sliceNumber 30 # # set physics process /protonGB/phys/addPhysics QGSP_BIC_EMY #/protonGB/phys/addPhysics emlivermore #/protonGB/phys/addPhysics empenelope # # production tresholds (recommended range #cut off not bigger than 10% of slice thickness) /protonGB/phys/setCuts 0.2 mm #/protonGB/phys/setGCut 1 um #/protonGB/phys/setECut 1 um #/protonGB/phys/setPCut 1 um # # initialize /run/initialize # # General particle source # proton circle source /gps/pos/shape Circle /gps/pos/centre -4. 0. 0. cm /gps/pos/radius 0. mm /gps/pos/sigma_r 2. mm /gps/particle proton /gps/pos/type Beam # # the incident surface is in the y-z plane /gps/pos/rot1 0 1 0 /gps/pos/rot2 0 0 1 # # the beam is travelling along the x-axis without any angular #dispersion (angular despersion set to 0.0) /gps/ang/rot1 0 0 1 /gps/ang/rot2 0 1 0 /gps/ang/type beam1d /gps/ang/sigma_r 0. deg # # the beam energy is in gaussian profile /gps/ene/type Gauss /gps/ene/mono 62 MeV /gps/ene/sigma 0.3 MeV # # step limit (recommended not bigger than 5% of # slice thickness) /protonGB/stepMax 0.1 mm # /protonGB/event/printModulo 50 # # output file /analysis/setFileName Proton # /analysis/h1/set 2 50 25 35 mm # number of events /run/beamOn 6000 # </pre> == <span style="color:#000080"> Files </span> == [[List of files with brief description]]
Return to
Proton beam with realistic geometry
.
Views
Page
Discussion
View source
History
Personal tools
Log in
Navigation
Main page
Community portal
Current events
Recent changes
Random page
Help
Search
Toolbox
What links here
Related changes
Special pages