Monoenergetic photon pencil beam

From UCL HEP PBT Wiki

Jump to: navigation, search
 
Line 7: Line 7:
http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/PhotonPB/g4_00_6000e.png
http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/PhotonPB/g4_00_6000e.png
-
== <span style="color:#000080"> Setting up the environment </span> ==
+
The image shows the water box divided into slices using class '''G4PVReplica'''. Photons are in green, electrons are in red.
-
; Connect to HEP cluster and create folder PhotonPBFolder in your area
+
== <span style="color:#000080"> How to run the tutorial </span> ==
 +
 
 +
; Connect to the HEP cluster and create folder PhotonPBFolder in your area
<pre style="color: #800000; background-color: #dcdcdc">
<pre style="color: #800000; background-color: #dcdcdc">
Line 26: Line 28:
[username@plus1 PhotonPBFolder]$ source /unix/pbt/software/dev/bin/pbt-dev.sh   
[username@plus1 PhotonPBFolder]$ source /unix/pbt/software/dev/bin/pbt-dev.sh   
</pre>
</pre>
-
 
-
== <span style="color:#000080"> How to get the code </span> ==
 
; Copy the code to your working directory and rename it
; Copy the code to your working directory and rename it
Line 36: Line 36:
[username@plus1 PhotonPBFolder]$ mv PhotonPB PhotonPB_source
[username@plus1 PhotonPBFolder]$ mv PhotonPB PhotonPB_source
</pre>
</pre>
-
 
-
== <span style="color:#000080"> How to run the code </span> ==
 
; Inside /home/username/PhotonPBFolder/ create a directory
; Inside /home/username/PhotonPBFolder/ create a directory
Line 55: Line 53:
</pre>
</pre>
-
; Run macro gamma.mac. The macro generates 6000 events.
+
; Run macro gamma.mac  
<pre style="color: #800000; background-color: #dcdcdc">
<pre style="color: #800000; background-color: #dcdcdc">
Line 214: Line 212:
<pre style="color: #800000; background-color: #dcdcdc">
<pre style="color: #800000; background-color: #dcdcdc">
-
root -l Simulation.root
+
[username@plus1 PhotonPB_build]$ root -l Simulation.root
root [1] new TBrowser
root [1] new TBrowser
Line 225: Line 223:
http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/PhotonPB/DoseDeposition1.png   
http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/PhotonPB/DoseDeposition1.png   
-
=== <span style="color:#000080"> Changes in macro gamma.mac </span> ===
+
You can also plot the file '''PlotDose.txt''' using MATLAB. This software is installed on the plus1 cluster but using it via ssh is not recommended because it is slow. If you have MATLAB installed on your computer you can import the '''PlotDose.txt''' file and plot it. You can also use the MATLAB installed on the computers at the Science Library.
 +
Before proceeding with MATLAB you need to copy the text files from the cluster to your computer. In the terminal at your computer write:
 +
 
 +
<pre style="color: #800000; background-color: #dcdcdc">
 +
scp username@plus1.hep.ucl.ac.uk:/home/username/PhotonPBFolder/PhotonPB_build/PlotDose.txt .
 +
</pre>
 +
 
 +
The file '''PlotDose.txt''' will be copied in your current directory. Then, open MATLAB and follow the procedure:
 +
 
 +
* Import the file: Chose 'HOME' tab and 'Import Data'.
 +
* In the 'Import Data' window select the 'PlotDose.txt' file choosing the right path.
 +
* In the opened window select the data points in the 'IMPORT' tab. If you like, you can change the name of the variables. For example, 'x' instead of 'VarName1' and 'Dose' instead of 'VarName2'. Then, press 'Import Selection'/'Import Data'. 
 +
* Close the Import Window and in the Command Window type plot(x,Dose). Press Enter.
 +
 
 +
This plot will be created with added axis labels and a legend:
 +
 
 +
http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/PhotonPB/matlab0photon.png
 +
 
 +
=== <span style="color:#000080"> Run with different settings </span> ===
You can change the physics process, incident photon energy, phantom material, number of slices etc. by
You can change the physics process, incident photon energy, phantom material, number of slices etc. by

Latest revision as of 13:31, 10 September 2014

Personal tools