Software for design optimization: Difference between revisions

From pCT
Line 15: Line 15:


=== GATE simulations ===
=== GATE simulations ===
==== Creating the full simulations files for a range-energy look-up-table ====
== GATE simulations ==
* Edit Module.mac to direct to readout_full.mac
=== Creating the full simulations files for a range-energy look-up-table ===
* Comment out such that the ..._Full_... filename is in use
First, enable the full scoring of all volumes by commenting / uncommenting in ''Main.mac'':
    #/control/execute readout.mac
    /control/execute readout_full.mac
Then, in the same file, save to the correct ROOT file:
    /gate/output/root/setFileName ../../DTCToolkit/Data/MonteCarlo/DTC_Full_Aluminium_Absorber{absorberthickness}mm_Degrader{degraderthickness}mm_{energy}MeV
    #/gate/output/root/setFileName ../../DTCToolkit/Data/MonteCarlo/DTC_Aluminium_Absorber{absorberthickness}mm_{energy}MeV
To loop through different energy degrader thicknesses, run the script ''runDegrader.sh'':
To loop through different energy degrader thicknesses, run the script ''runDegrader.sh'':
     $ sh runDegrader.sh <absorber thickness> <degraderthickness from> <degraderthickness stepsize> <degraderthickness to>
     $ sh runDegrader.sh <absorber thickness> <degraderthickness from> <degraderthickness stepsize> <degraderthickness to>
For example, with a 3 mm degrader, and simulating a 250 MeV beam passing through a phantom of 50, 55, 60, 65 and 70 mm water:
For example, with a 3 mm degrader, and simulating a 250 MeV beam passing through a phantom of 50, 55, 60, 65 and 70 mm water:
     $ sh runDegrader.sh 3 50 5 70
     $ sh runDegrader.sh 3 50 5 70
It is not critical to have a high number of primaries in this part. 10000 is enough for this step. Change this in the ''Main.mac'' file!
=== Creating the chip-readout simulations files for resolution calculation ===
First, undo the changes to Main.mac:
    /control/execute readout.mac
    #/control/execute readout_full.mac
Then, in the same file, save to the correct ROOT file:
    #/gate/output/root/setFileName ../../DTCToolkit/Data/MonteCarlo/DTC_Full_Aluminium_Absorber{absorberthickness}mm_Degrader{degraderthickness}mm_{energy}MeV
    /gate/output/root/setFileName ../../DTCToolkit/Data/MonteCarlo/DTC_Aluminium_Absorber{absorberthickness}mm_{energy}MeV
And loop through the different absorber thicknesses:
    $ sh runDegrader.sh 3 50 5 70
In this step a higher number of particles is desired. I usually use 25000 since we need O(100) simulations. A sub 1-mm step size will really tell us if we manage to detect such small changes in a beam energy.


==== Creating the chip-only readout simulation files for analysis ====
==== Creating the chip-only readout simulation files for analysis ====

Revision as of 20:12, 23 February 2017

Simulation software

In order to run the software to generate the geomtry, Monte Carlo data and do full simulations, you need the following software:

Generating the geometry

To generate the geometry files to run in Gate, a Python script is supplied. It is located within the gate/python subfolder.

   $ python gate/python/makeGeometryDTC.py

GATE geometry builder.PNG

Choose the wanted characteristics of the detector, and use write files in order to create the Module.mac file, which is automatically included in Main.mac.

GATE simulations

GATE simulations

Creating the full simulations files for a range-energy look-up-table

First, enable the full scoring of all volumes by commenting / uncommenting in Main.mac:

   #/control/execute readout.mac
   /control/execute readout_full.mac

Then, in the same file, save to the correct ROOT file:

   /gate/output/root/setFileName ../../DTCToolkit/Data/MonteCarlo/DTC_Full_Aluminium_Absorber{absorberthickness}mm_Degrader{degraderthickness}mm_{energy}MeV
   #/gate/output/root/setFileName ../../DTCToolkit/Data/MonteCarlo/DTC_Aluminium_Absorber{absorberthickness}mm_{energy}MeV

To loop through different energy degrader thicknesses, run the script runDegrader.sh:

   $ sh runDegrader.sh <absorber thickness> <degraderthickness from> <degraderthickness stepsize> <degraderthickness to>

For example, with a 3 mm degrader, and simulating a 250 MeV beam passing through a phantom of 50, 55, 60, 65 and 70 mm water:

   $ sh runDegrader.sh 3 50 5 70

It is not critical to have a high number of primaries in this part. 10000 is enough for this step. Change this in the Main.mac file!

Creating the chip-readout simulations files for resolution calculation

First, undo the changes to Main.mac:

   /control/execute readout.mac
   #/control/execute readout_full.mac

Then, in the same file, save to the correct ROOT file:

   #/gate/output/root/setFileName ../../DTCToolkit/Data/MonteCarlo/DTC_Full_Aluminium_Absorber{absorberthickness}mm_Degrader{degraderthickness}mm_{energy}MeV
   /gate/output/root/setFileName ../../DTCToolkit/Data/MonteCarlo/DTC_Aluminium_Absorber{absorberthickness}mm_{energy}MeV

And loop through the different absorber thicknesses:

   $ sh runDegrader.sh 3 50 5 70

In this step a higher number of particles is desired. I usually use 25000 since we need O(100) simulations. A sub 1-mm step size will really tell us if we manage to detect such small changes in a beam energy.

Creating the chip-only readout simulation files for analysis