Monoenergetic proton pencil beam

From UCL HEP PBT Wiki

Jump to: navigation, search
m
Line 3: Line 3:
This example shows the dose distribution in water along the incident proton beam. The beam hits the water cube surface and deposits a dose under the surface of the water. The volume of the water cube is divided into slices perpendicular to the incident beam. At each slice the deposited dose and energy is computed.  
This example shows the dose distribution in water along the incident proton beam. The beam hits the water cube surface and deposits a dose under the surface of the water. The volume of the water cube is divided into slices perpendicular to the incident beam. At each slice the deposited dose and energy is computed.  
-
The slices are created using class '''G4PVReplica'''. The energy and dose are scored using classes '''G4UserSteppingAction''' and '''G4UserRunAction'''. Alternatively, the energy and dose are scored using class '''G4ScoringManager''' by defining scoring mesh. Protons are generated using '''G4ParticleGun''' class. There is an option to chose among several EM and '''QGSP_BIC_EMY''' physics lists.
+
The slices are created using class '''G4PVReplica'''. The energy and dose are scored using classes '''G4UserSteppingAction''' and '''G4UserRunAction'''. Alternatively, the energy and dose are scored using class '''G4ScoringManager''' by defining two scoring meshes in logitudinal and lateral direction of the beam. More information about scoring meshes can be found [https://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/ch04s08.html here]. Protons are generated using '''G4ParticleGun''' class. There is an option to chose among several '''EM''' and '''QGSP_BIC_EMY''' physics lists.
== <span style="color:#000080"> Setting up the environment </span> ==  
== <span style="color:#000080"> Setting up the environment </span> ==  
Line 63: Line 63:
== <span style="color:#000080"> How to analyze data </span> ==
== <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 energy deposition around the peak. The macro also produces two text files '''DoseFile.txt''' and '''PlotDose.txt'''. The file '''DoseFile.txt''' contains energy and dose deposition for every layer. The file '''PlotDose.txt''' contains only depth vs dose values for each layer. These values can be imported in MATLAB.  
+
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 energy deposition around the peak. The macro also produces several text files.
 +
 
 +
* The data in files '''DoseFile.txt''' and '''PlotDose.txt''' was created using classes '''G4UserSteppingAction''' and '''G4UserRunAction'''. The file '''DoseFile.txt''' contains energy and dose deposition for every layer. The file '''PlotDose.txt''' contains only depth vs dose values for each layer. These values can be imported in MATLAB or analyzed with ROOT macro.
 +
 
 +
* The files '''DoseLongitudinalMesh.txt''', '''EnergyLongitudinalMesh.txt''', '''DoseLateralMesh.txt''' and '''EnergyLateralMesh.txt''' contain information about the dose and energy deposition in voxels in longitudinal and lateral direction of the beam.    
=== <span style="color:#000080"> Text files </span> ===
=== <span style="color:#000080"> Text files </span> ===
Line 70: Line 74:
<pre style="color: #800000; background-color: #dcdcdc">
<pre style="color: #800000; background-color: #dcdcdc">
-
  Layers : x[mm] Edep Edep/Ebeam[%] Dose Dose/MaxDose[%]
+
  Layers : x[mm]   Edep     Edep/Ebeam[%] Dose Dose/MaxDose[%]
  layer 1: 1.33333 8.84429 GeV 2.3775 1.06276e-05 Gy 20.6613
  layer 1: 1.33333 8.84429 GeV 2.3775 1.06276e-05 Gy 20.6613
  layer 2: 2.66667 8.91694 GeV 2.39703 1.07149e-05 Gy 20.831
  layer 2: 2.66667 8.91694 GeV 2.39703 1.07149e-05 Gy 20.831
Line 147: Line 151:
40 0
40 0
</pre>  
</pre>  
 +
 +
'''DoseLongitudinalMesh.txt''' and '''EnergyLongitudinalMesh.txt''' contain information about the dose and energy deposition in 30 voxels along the beam. 
 +
 +
'''DoseLateralMesh.txt''' and '''EnergyLateralMesh.txt''' contain information about the dose and energy deposition in 30 voxels in direction perpendicular to the beam at its peak location along the beam.
=== <span style="color:#000080"> Root file </span> ===
=== <span style="color:#000080"> Root file </span> ===
Line 253: Line 261:
/score/dumpQuantityToFile waterMeshlateral doseDeposit DoseLateralMesh.txt
/score/dumpQuantityToFile waterMeshlateral doseDeposit DoseLateralMesh.txt
/score/dumpQuantityToFile waterMeshlateral energyDeposit EnergyLateralMesh.txt
/score/dumpQuantityToFile waterMeshlateral energyDeposit EnergyLateralMesh.txt
 +
</pre>
 +
 +
'''Change dimensions of the water box'''
 +
 +
The default size is 4x4x4 cm. You can change the dimensions by modifying the lines
 +
 +
<pre style="color: #800000; background-color: #dcdcdc">
 +
/protonPB/det/setSizeX  4 cm
 +
/protonPB/det/setSizeYZ 4 cm
</pre>
</pre>
Line 269: Line 286:
</pre>
</pre>
-
Now run the code:
+
'''Change the incident proton energy'''
-
 
+
-
<pre style="color: #800000; background-color: #dcdcdc">
+
-
./protonPB proton.mac
+
-
</pre>
+
-
 
+
-
'''Change the incident particle energy'''
+
The default energy is 62 MeV. This is one of the energies used in radiotherapy. In proton.mac you can change the value of 62 MeV  
The default energy is 62 MeV. This is one of the energies used in radiotherapy. In proton.mac you can change the value of 62 MeV  
Line 287: Line 298:
<pre style="color: #800000; background-color: #dcdcdc">
<pre style="color: #800000; background-color: #dcdcdc">
/gun/energy 50 MeV
/gun/energy 50 MeV
-
</pre>
 
-
 
-
and run the macro
 
-
 
-
<pre style="color: #800000; background-color: #dcdcdc">
 
-
./protonPB proton.mac
 
</pre>
</pre>
Line 315: Line 320:
</pre>
</pre>
-
then run the macro
+
'''Modify the mesh'''
 +
 
 +
You can change the size of the mesh and the number of voxels by modifying
<pre style="color: #800000; background-color: #dcdcdc">
<pre style="color: #800000; background-color: #dcdcdc">
-
./protonPB proton.mac
+
/score/mesh/boxSize 2. 2. 2. cm
 +
/score/mesh/nBin 30 1 1
</pre>
</pre>
-
If you modify the files in directory ProtonPB_source (for example change the value of MaxLayer) you need to comppile the code. In directory PhotonPB_build do
+
'''After modifications in proton.mac'''
 +
 
 +
After modifying the macro proton.mac you can run it
<pre style="color: #800000; background-color: #dcdcdc">
<pre style="color: #800000; background-color: #dcdcdc">
-
make
+
./protonPB proton.mac
</pre>
</pre>
-
 
+
-
then run the macro
+
If you modify files in directory ProtonPB_source (for example change the value of MaxLayer) you need to comppile the code. In directory PhotonPB_build do
<pre style="color: #800000; background-color: #dcdcdc">
<pre style="color: #800000; background-color: #dcdcdc">
-
./protonPB proton.mac
+
make
</pre>
</pre>
 +
 +
then run the macro proton.mac.
=== <span style="color:#000080"> Visualisation </span> ===
=== <span style="color:#000080"> Visualisation </span> ===

Revision as of 12:47, 24 July 2014

Personal tools