Monoenergetic proton pencil beam
From UCL HEP PBT Wiki
m |
m |
||
Line 283: | Line 283: | ||
/protonPB/det/setSizeX 4 cm | /protonPB/det/setSizeX 4 cm | ||
/protonPB/det/setSizeYZ 4 cm | /protonPB/det/setSizeYZ 4 cm | ||
- | /protonPB/det/setSliceSizeYZ | + | /protonPB/det/setSliceSizeYZ 4 cm |
- | /protonPB/det/sliceNumber | + | /protonPB/det/sliceNumber 50 |
# | # | ||
# define longitudinal scoring mesh | # define longitudinal scoring mesh | ||
Line 290: | Line 290: | ||
/score/create/boxMesh waterMeshlongitudinal | /score/create/boxMesh waterMeshlongitudinal | ||
/score/mesh/boxSize 2. 2. 2. cm | /score/mesh/boxSize 2. 2. 2. cm | ||
- | /score/mesh/nBin | + | /score/mesh/nBin 50 1 1 |
/score/mesh/translate/xyz 0. 0. 0. cm | /score/mesh/translate/xyz 0. 0. 0. cm | ||
/score/quantity/energyDeposit energyDeposit | /score/quantity/energyDeposit energyDeposit | ||
Line 299: | Line 299: | ||
# centered at the Bragg peak | # centered at the Bragg peak | ||
/score/create/boxMesh waterMeshlateral | /score/create/boxMesh waterMeshlateral | ||
- | /score/mesh/boxSize | + | /score/mesh/boxSize 0.1 2. 2. cm |
- | /score/mesh/nBin 1 | + | /score/mesh/nBin 1 1 50 |
/score/mesh/translate/xyz 1.2 0. 0. cm | /score/mesh/translate/xyz 1.2 0. 0. cm | ||
/score/quantity/energyDeposit energyDeposit | /score/quantity/energyDeposit energyDeposit | ||
Line 320: | Line 320: | ||
# initialize | # initialize | ||
/run/initialize | /run/initialize | ||
+ | # | ||
+ | # visualisation | ||
+ | #/control/execute visualisation.mac | ||
# | # | ||
/gun/particle proton | /gun/particle proton | ||
Line 341: | Line 344: | ||
# number of events | # number of events | ||
/run/beamOn 6000 | /run/beamOn 6000 | ||
+ | # | ||
+ | # drawing projections | ||
+ | #/score/drawProjection waterMeshlongitudinal doseDeposit | ||
+ | #/score/drawProjection waterMeshlateral doseDeposit | ||
+ | # | ||
# dump scores to a file | # dump scores to a file | ||
/score/dumpQuantityToFile waterMeshlongitudinal doseDeposit DoseLongitudinalMesh.txt | /score/dumpQuantityToFile waterMeshlongitudinal doseDeposit DoseLongitudinalMesh.txt | ||
Line 395: | Line 403: | ||
'''Change the number of slices''' | '''Change the number of slices''' | ||
- | You can change the number of slices. The default number is | + | You can change the number of slices. The default number is 50. Keep in mind that |
if you want to increase the number of slices you need to modify the file DetectorConstruction.hh in | if you want to increase the number of slices you need to modify the file DetectorConstruction.hh in | ||
/ProtonPB_source/include/. | /ProtonPB_source/include/. | ||
- | In DetectorConstruction.hh set MaxLayer to value bigger than the number of your slices. The default value is MaxLayer= | + | In DetectorConstruction.hh set MaxLayer to value bigger than the number of your slices. The default value is MaxLayer=60. For example, if you want to have 55 slices you do not need to modify MaxLayer. Then, only in proton.mac change the number of slices |
<pre style="color: #800000; background-color: #dcdcdc"> | <pre style="color: #800000; background-color: #dcdcdc"> | ||
- | /protonPB/det/sliceNumber | + | /protonPB/det/sliceNumber 55 |
</pre> | </pre> | ||
'''Modify the mesh''' | '''Modify the mesh''' | ||
- | You can change the size of the mesh and the number of voxels by modifying | + | You can change the size of the mesh (longitudinal and lateral) and the number of voxels by modifying their corresponding lines |
<pre style="color: #800000; background-color: #dcdcdc"> | <pre style="color: #800000; background-color: #dcdcdc"> | ||
Line 432: | Line 440: | ||
=== <span style="color:#000080"> Visualisation </span> === | === <span style="color:#000080"> Visualisation </span> === | ||
- | + | If you want to use visualisation, in macro '''proton.mac''' uncomment the line '''/control/execute visualisation.mac'''. This will run macro '''visualisation.mac''' with a specific visualisation settup. | |
+ | If you uncomment the lines '''/score/drawProjection waterMeshlongitudinal doseDeposit''' and '''/score/drawProjection waterMeshlateral doseDeposit''' you will draw the dose projections. In this example, we use the '''DAWN''' event display. Before running the visualisation | ||
+ | have a look at this [http://geant4.slac.stanford.edu/Presentations/vis/G4DAWNTutorial/G4DAWNTutorial.html DAWN tutorial]. | ||
+ | |||
+ | To run the visualisation, first uncomment lines '''/control/execute visualisation.mac''' and '''/score/drawProjection waterMeshlongitudinal doseDeposit'''. Then, run the proton.mac | ||
+ | |||
+ | <pre style="color: #800000; background-color: #dcdcdc"> | ||
+ | ./protonPB proton.mac | ||
+ | </pre> | ||
+ | |||
+ | In addition to the text files it will create two .prim files, g4_00.prim and g4_01.prim. The first one with geometry and particle interactions and the second with dose projections. While running the proton.mac it will ask you to open g4_00.prim in DAWN. In the opened window press OK. This will create your first visualisation: | ||
+ | |||
+ | http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/ProtonPB/g4_00_6000e.eps | ||
+ | |||
+ | The second file g4_01.prim will not open automatically. Open it in the following way: | ||
+ | |||
+ | <pre style="color: #800000; background-color: #dcdcdc"> | ||
+ | dawn g4_01.prim | ||
+ | </pre> | ||
+ | |||
+ | In the opened window press OK and this will create the image: | ||
+ | |||
+ | http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/ProtonPB/g4_02_6000e.eps | ||
+ | |||
+ | You can modify the .prim files in DAWN. For example, change the polar and azimuthal angles: (polar angle, azimuthal angle) = (0,90) will create this image | ||
+ | |||
+ | http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/ProtonPB/g4_01_6000e.eps | ||
+ | |||
+ | (polar angle, azimuthal angle) = (90,0) will create this image | ||
+ | |||
+ | http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/ProtonPB/g4_04_6000e.eps | ||
+ | |||
+ | Now, in proton.mac macro uncomment '''/score/drawProjection waterMeshlateral doseDeposit''' and comment '''/score/drawProjection waterMeshlongitudinal doseDeposit'''. Run the proton.mac with the new settings. The file with the lateral dose projections will look like that: | ||
+ | |||
+ | http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/ProtonPB/g4_03_6000e.eps | ||
== <span style="color:#000080"> Data from The Clatterbridge Cancer Centre </span> == | == <span style="color:#000080"> Data from The Clatterbridge Cancer Centre </span> == |