Monoenergetic photon pencil beam
From UCL HEP PBT Wiki
for
Monoenergetic photon pencil beam
Jump to:
navigation
,
search
== <span style="color:#000080"> Introduction </span> == This example shows the dose distribution in water along the incident photon 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. The dose and energy deposited from the pencil beams at each slice is computed. == <span style="color:#000080"> Setting up the environment </span> == ; Connect to HEP cluster and create folder PhotonPencilBeam in your area <pre style="color: #800000; background-color: #dcdcdc"> ssh username@plus1.hep.ucl.ac.uk cd /home/username/ mkdir PhotonPB cd PhotonPB </pre> ; Setup GEANT4 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 <pre style="color: #800000; background-color: #dcdcdc"> cp -r /unix/pbt/tutorials/basic/PhotonPB /home/username/.../PhotonPB_source </pre> == <span style="color:#000080"> How to run the code </span> == ; Inside /home/username/.../ create a directory <pre style="color: #800000; background-color: #dcdcdc"> mkdir PhotonPB_build </pre> ; To compile the code enter this directory and run cmake and make <pre style="color: #800000; background-color: #dcdcdc"> cd PhotonPB_build cmake -DGeant4_DIR=/unix/pbt/software/dev /home/username/.../PhotonPB_source make </pre> ; Run the macro gamma.mac. The macro generates 10000 events. <pre style="color: #800000; background-color: #dcdcdc"> ./photonPB gamma.mac </pre> == <span style="color:#000080"> How to analyze data </span> == The macro produces a root file with 1D histogram showing the energy deposition in the water box along the beam line. It also produces a text file ""DoseFile.txt"" with energy and dose deposited at each slice of the water box. This is an example output with the default settings: physics process emstandard_opt0 and incident gamma energy of 20 MeV. <pre style="color: #800000; background-color: #dcdcdc"> Cumulated Doses : X[mm] Edep Edep/Ebeam Dose layer 1: 10 695.299 MeV 0.347649 % 6.96245e-09 Gy layer 2: 20 1.17329 GeV 0.586646 % 1.17489e-08 Gy layer 3: 30 1.60782 GeV 0.80391 % 1.61001e-08 Gy layer 4: 40 1.89698 GeV 0.94849 % 1.89956e-08 Gy layer 5: 50 2.23625 GeV 1.11812 % 2.23929e-08 Gy layer 6: 60 2.41072 GeV 1.20536 % 2.414e-08 Gy layer 7: 70 2.5396 GeV 1.2698 % 2.54306e-08 Gy layer 8: 80 2.66291 GeV 1.33145 % 2.66653e-08 Gy layer 9: 90 2.5538 GeV 1.2769 % 2.55727e-08 Gy layer 10: 100 2.47482 GeV 1.23741 % 2.47819e-08 Gy layer 11: 110 2.45013 GeV 1.22507 % 2.45346e-08 Gy layer 12: 120 2.34969 GeV 1.17484 % 2.35288e-08 Gy layer 13: 130 2.3329 GeV 1.16645 % 2.33608e-08 Gy layer 14: 140 2.37302 GeV 1.18651 % 2.37625e-08 Gy layer 15: 150 2.4226 GeV 1.2113 % 2.4259e-08 Gy layer 16: 160 2.4147 GeV 1.20735 % 2.41799e-08 Gy layer 17: 170 2.38873 GeV 1.19437 % 2.39198e-08 Gy layer 18: 180 2.36667 GeV 1.18333 % 2.36989e-08 Gy layer 19: 190 2.28832 GeV 1.14416 % 2.29143e-08 Gy layer 20: 200 8.08046e+167 J 2.52171e+177 % 5.05029e+169 Gy The run consists of 10000 gamma of 20 MeV through 20 cm of Water (density: 1 g/cm3 ) </pre> This is a 1D histogram showing the energy deposition in water box. The histogram comes from the Gamma.root files which is created after the simulation. [[File:/pbt/RadiotherapyWorkbook/skins/common/images/PhotonPB/Edep.png|Energy deposit per event along the beam]] === Change of physics process === You can change the physics process by modifying the macro gamma.mac. The default process is ""emstandard_opt0"" which is used in high energy experiments. Change <pre style="color: #800000; background-color: #dcdcdc"> /photonPB/phys/addPhysics emstandard_opt0 </pre> to <pre style="color: #800000; background-color: #dcdcdc"> /photonPB/phys/addPhysics emlivermore </pre> The process ""emlivermore"" is used for low energy physics. Now you have to run the code again: <pre style="color: #800000; background-color: #dcdcdc"> ./photonPB gamma.mac </pre> === Change the incident particle energy === You can change the incident energy by modifying the macro gamma.mac. The default energy is 20 MeV. This energy is used in radiotherapy. You can change its value and check the efect on the energy deposit. Change <pre style="color: #800000; background-color: #dcdcdc"> /gun/energy 20 MeV </pre> to for example <pre style="color: #800000; background-color: #dcdcdc"> /gun/energy 10 MeV </pre> and run the code: <pre style="color: #800000; background-color: #dcdcdc"> ./photonPB gamma.mac </pre> Keep in mind that the primary particle generation is done at /PhotonPB/src/PrimaryGeneratorAction.cc <pre style="color: #800000; background-color: #dcdcdc"> fParticleGun = new G4ParticleGun(1); G4ParticleDefinition* particle = G4ParticleTable::GetParticleTable()->FindParticle("proton"); fParticleGun->SetParticleDefinition(particle); fParticleGun->SetParticleEnergy(160*MeV); fParticleGun->SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.)); ... G4double x0 = -0.5*(fDetector->GetAbsorSizeX()); G4double y0 = 0.*cm, z0 = 0.*cm; ... fParticleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0)); </pre> The line <pre style="color: #800000; background-color: #dcdcdc"> fParticleGun = new G4ParticleGun(1); </pre> means that only one particle is generated and incident from coordinates x0,y0,z0. The default number of events is set to 10000. Therefore 10000 particles are incident to the water box. === Change the material of the phantom === This experiment is to compute the energy deposition of photons in a water box. However, there is an option to change the box material from water to lead. This can be done in the gamma.macro. Change <pre style="color: #800000; background-color: #dcdcdc"> /photonPB/det/setMat Water </pre> to <pre style="color: #800000; background-color: #dcdcdc"> /photonPB/det/setMat Lead </pre> and run the code <pre style="color: #800000; background-color: #dcdcdc"> ./photonPB gamma.mac </pre> === Change the number of slices === You can change the number of water box slices. The default number is 20. Keep in mind that if you want to have bigger number of slices you should also modify the DetectorConstruction.hh file in /PhotonPB/include/. Change the MaxLayer into your desired value. <pre style="color: #800000; background-color: #dcdcdc"> const G4int MaxLayer = 20; </pre> In gamma.mac you should change the number of slices <pre style="color: #800000; background-color: #dcdcdc"> /photonPB/det/sliceNumber 20 </pre> Since you modified your code (by changing the file DetectorConstruction.hh) you should compile the code. In your PhotonPB_build director do <pre style="color: #800000; background-color: #dcdcdc"> make </pre>
Return to
Monoenergetic photon pencil beam
.
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