Monoenergetic photon pencil beam
From UCL HEP PBT Wiki
m |
m |
||
Line 101: | Line 101: | ||
</pre> | </pre> | ||
- | + | Inside is 1D histogram showing the energy deposition in water box: | |
[[File:/pbt/RadiotherapyWorkbook/skins/common/images/PhotonPB/Edep.png|Energy deposit per event along the beam]] | [[File:/pbt/RadiotherapyWorkbook/skins/common/images/PhotonPB/Edep.png|Energy deposit per event along the beam]] | ||
- | + | You can change the physics process, incident photon energy, phantom material, number of slices etc. by | |
+ | modifying the macro gamma.mac. Use your favorite editor (pico, vi, emacs etc.). For example open the macro with editor pico: | ||
- | + | <pre style="color: #800000; background-color: #dcdcdc"> | |
- | '''emstandard_opt0''' | + | pico gamma.mac |
+ | </pre> | ||
+ | |||
+ | === Change the physics process === | ||
+ | |||
+ | The default physics process is '''emstandard_opt0''' used in high energy experiments. Change | ||
<pre style="color: #800000; background-color: #dcdcdc"> | <pre style="color: #800000; background-color: #dcdcdc"> | ||
Line 120: | Line 126: | ||
</pre> | </pre> | ||
- | The process '''emlivermore''' is used for low energy physics. | + | The process '''emlivermore''' is used for low energy physics experiments. Now run the code: |
- | + | ||
- | Now | + | |
<pre style="color: #800000; background-color: #dcdcdc"> | <pre style="color: #800000; background-color: #dcdcdc"> | ||
Line 130: | Line 134: | ||
=== Change the incident particle energy === | === Change the incident particle energy === | ||
- | + | The default energy is 20 MeV. This is the energy used in radiotherapy. You can change the value of 20 MeV | |
- | This energy | + | |
- | + | ||
- | + | ||
<pre style="color: #800000; background-color: #dcdcdc"> | <pre style="color: #800000; background-color: #dcdcdc"> | ||
Line 139: | Line 140: | ||
</pre> | </pre> | ||
- | to for example | + | to for example 10 MeV |
<pre style="color: #800000; background-color: #dcdcdc"> | <pre style="color: #800000; background-color: #dcdcdc"> | ||
Line 145: | Line 146: | ||
</pre> | </pre> | ||
- | and run the | + | and run the macro |
<pre style="color: #800000; background-color: #dcdcdc"> | <pre style="color: #800000; background-color: #dcdcdc"> | ||
Line 176: | Line 177: | ||
</pre> | </pre> | ||
- | means that only one particle is generated | + | means that only one particle is generated, incident from (x0,y0,z0). The default number of |
events is set to 10000. Therefore, 10000 particles are incident to the water box. | events is set to 10000. Therefore, 10000 particles are incident to the water box. | ||
- | |||
=== Change the material of the phantom === | === Change the material of the phantom === | ||
- | This | + | This example 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 | + | there is an option to change the box material from water to lead. |
- | + | ||
- | + | In gamma.mac change | |
<pre style="color: #800000; background-color: #dcdcdc"> | <pre style="color: #800000; background-color: #dcdcdc"> | ||
Line 198: | Line 197: | ||
</pre> | </pre> | ||
- | and run the | + | and run the macro |
<pre style="color: #800000; background-color: #dcdcdc"> | <pre style="color: #800000; background-color: #dcdcdc"> | ||
Line 207: | Line 206: | ||
You can change the number of water box slices. The default number is 20. Keep in mind that | You can change the number of water box slices. The default number is 20. Keep in mind that | ||
- | if you want to have | + | if you want to have more slices you need to modify the file DetectorConstruction.hh in |
/PhotonPB_source/include/. | /PhotonPB_source/include/. | ||
- | + | In DetectorConstruction.hh change the MaxLayer to your desired value. | |
<pre style="color: #800000; background-color: #dcdcdc"> | <pre style="color: #800000; background-color: #dcdcdc"> | ||
- | const G4int MaxLayer = | + | const G4int MaxLayer = 30; |
</pre> | </pre> | ||
- | + | Then in gamma.mac you need to change the number of slices | |
<pre style="color: #800000; background-color: #dcdcdc"> | <pre style="color: #800000; background-color: #dcdcdc"> | ||
- | /photonPB/det/sliceNumber | + | /photonPB/det/sliceNumber 30 |
</pre> | </pre> | ||
- | + | You modified your code therefore you need to comppile it. In directory PhotonPB_build do | |
- | + | ||
<pre style="color: #800000; background-color: #dcdcdc"> | <pre style="color: #800000; background-color: #dcdcdc"> |