Import Geant4 11.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2021-12-12 17:16:06 +01:00
parent 80e2389dd8
commit 84f33a068c
593 changed files with 68589 additions and 1 deletions
+118
View File
@@ -0,0 +1,118 @@
![alt text](https://github.com/hanswenzel/CaTS/blob/master/images/CaTS.png)
# CaTS: Calorimeter and Tracker Simulation
CaTS is a flexible and extend-able framework (based on geant4 and ROOT)
for the simulation of calorimeter and tracking detectors.
It also serves as an Example that demonstrates how to use opticks
from within Geant4 for the creation and propagation of optical photons.
https://bitbucket.org/simoncblyth/opticks.git.
The components of CaTS are:
Detector Description: described in gdml input file (e.g. crystalcal.gdml)
(Geometry, Materials,
optical properties,
sensitive detector)
Input modules:
GPS
Particle Gun
HEPMC (Pythia)
Physics Lists: choice of all Reference Physics Lists
optical physics processes (Cerenkov, Rayleigh,
Scintillation etc.) are added (talk to)
Sensitive Detectors: (+ corresponding Hit classes)
TrackerSD(Hit) registers the step points of charged particles.
CalorimeterSD(Hit) registering energy deposit
DRCalorimeterSD(Hit) besides registering energy deposit counts produced Cerenkov photons
MsCSD(Hit) used to study multiple scattering on a thin layer
PhotonSD(Hit) sensitive detector that registers optical photons.
lArTPCSD(Hit) sensitive detector that registers ionization and collects Gensteps (Scintillation and Cerenkov) to be processed by Opticks.
RadiatorSD no Hits just collection of Gensteps (Scintillation and Cerenkov) to be processed by Opticks.
This requires the opticks environment to be set up properly (see https://github.com/hanswenzel/CaTS/blob/master/Instructions.md)
To get started :
```bash
git clone https://github.com/hanswenzel/CaTS.git
cd CaTS/
# to setup the opticks environment source the setup_opticks.sh file described in:
# https://github.com/hanswenzel/CaTS/blob/master/Instructions.md
source (path to opticks WORK_DIR)/setup_opticks.sh
cd ../
mkdir CaTS-build
cd CaTS-build
cmake -DCMAKE_BUILD_TYPE=Debug \
-DWITH_G4OPTICKS=ON \
-DCMAKE_PREFIX_PATH="${LOCAL_BASE}/opticks/externals;${LOCAL_BASE}/opticks" \
-DOPTICKS_PREFIX=${LOCAL_BASE}/opticks \
-DCMAKE_MODULE_PATH=${OPTICKS_HOME}/cmake/Modules \
-DCMAKE_INSTALL_PREFIX=../CaTS-install \
../CaTS
make install
cd ../CaTS-install/bin
time ./CaTS -g simpleLArTPC.gdml -pl 'FTFP_BERT+OPTICAL+STEPLIMIT' -m time.mac
Only the -g command line variable is mandatory! If you don't specify the macro file interactive mode is assumed:
./CaTS -g simpleLArTPC.gdml -pl 'FTFP_BERT+OPTICAL+STEPLIMIT'
```
to compile CaTS without Opticks do:
```bash
cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_G4OPTICKS=OFF -DCMAKE_MODULE_PATH="../CaTS/cmake/Modules" -DCMAKE_INSTALL_PREFIX=../CaTS-install ../CaTS
```
if you don't provide the -pl argument the default physics list configuration:
'FTFP_BERT+OPTICAL+STEPLIMIT'
is used
![alt text](https://github.com/hanswenzel/CaTS/blob/master/images/display.png)
to look at the hit collection and make a few histograms:
./readPhotonHits NewHits_point_Run0.root PhotonHistos.root Det
The 3 arguments here are: name of input file (hits), name of output file for the histograms and the logical Volume that sensitive detector (PhotonSD)is attached to.
One can then use root to look at the plots:
```bash
root histos.root
------------------------------------------------------------------
| Welcome to ROOT 6.22/06 https://root.cern |
| (c) 1995-2020, The ROOT Team; conception: R. Brun, F. Rademakers |
| Built for linuxx8664gcc on Dec 13 2020, 13:28:00 |
| From tags/v6-22-06@v6-22-06 |
| Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------------
root [0]
Attaching file histos.root as _file0...
(TFile *) 0x559578f76f60
root [1] TBrowser b
(TBrowser &) Name: Browser Title: ROOT Object Browser
```
![alt text](https://github.com/hanswenzel/CaTS/blob/master/images/position.png)
For comparison one might want to disable Opticks and use Geant4 to generate and propagate optical photons:
time ./CaTS -g simpleLArTPC.gdml -pl 'FTFP_BERT+OPTICAL+STEPLIMIT' -m time_G4.mac
+104
View File
@@ -0,0 +1,104 @@
=====================================================================
Geant4 - Cexmc advanced example
=====================================================================
README
-----------------------
Author: A. Radkov (alexey.radkov@gmail.com)
------> Introduction
Cexmc stands for Charge EXchange Monte Carlo. The program was used to simulate
real experiments in Petersburg Nuclear Physics Institute (PNPI, Russia).
Detailed User's Manual and explanatory images of the experimental setup can be
found in directory doc/ of this example.
------> Compilation
Basic modules of Cexmc must compile with Geant4 version 9.4. Cexmc won't compile
with older versions of Geant4. Cexmc contains several optional modules which can
be enabled or disabled in the makefile by setting dedicated macros: most of them
are listed in the beginning of the makefile and well commented. Modules may
involve additional dependencies. In the following table the dependencies and
related modules are shown.
Dependency Requirement Makefile Macro / Module Comment
--------------------------------------------------------------------------------
boost::serialize Optional CEXMC_USE_PERSISTENCY / used when
Persistency (de)serialization of
events and run data
boost::split Optional CEXMC_USE_PERSISTENCY / used when parsing
Main command line
arguments related to
persistency module
boost::spirit Optional CEXMC_USE_CUSTOM_FILTER / used in custom
Custom filter filter engine
cernlib Optional CEXMC_USE_GENBOD / Main user can choose
native GENBOD() as
phase space
generator
CERN ROOT Optional CEXMC_USE_ROOT / used in histograming
Histograming
CERN ROOT / Qt Optional CEXMC_USE_ROOTQT / used for live
binding Histograming histograms in Qt
sessions
--------------------------------------------------------------------------------
The persistency module is compatible with a pretty old boost::serialize version
(compilation was tested under Scientific Linux 4.8 with gcc 3.4.6 and boost
version 1.32). Custom filter requires a newer boost as far as it uses modern
boost::spirit library which requires boost version 1.37 and higher.
Presence of CERN ROOT libraries is tested automatically in the makefile, but it
is possible to disable or enable the histograming framework manually using flag
CEXMC_USE_HISTOGRAMING in the makefile.
Compilation of visualization modules and interactive sessions depends on whether
standard Geant4 macros like G4VIS_USE, G4UI_USE, G4UI_USE_TCSH and G4UI_USE_QT
have been set.
If boost is installed in a special path in your system then you may need to
properly set environment variables BOOST_INCLUDE_PATH and BOOST_LIBRARY_PATH
which denote directories where boost include files and libraries are located.
------> Run modes
Run modes are set from command-line options. To see available command-line
options type in terminal 'cexmc -h' or just 'cexmc'. Some run modes can be
unavailable if certain modules were not compiled.
Here is list of run modes categorized by type of interaction with user:
1. Batch mode. The simplest mode without any interaction with user.
No command line option is required.
2. Interactive mode. The program provides an interactive shell.
To run in the interactive mode command line option -i must be specified.
3. Graphical Qt mode. This mode is specified by command line option -g.
List of run modes categorized by task:
1. Straight mode (or Monte Carlo mode). The program will read preinit and
init macros, then calculate acceptances and (optionally) save data in
project files. Project files are saved in a directory defined by
environment variable CEXMC_PROJECTS_DIR (or in the current directory if it
is not defined), name of the project is specified by option -w. Preinit
and init macros are set by options -p and -m respectively. In the straight
mode preinit macro must be specified explicitly, as far as desired
production model can be instantiated only in preinit phase.
2. Replay mode (or Read project mode). In this mode the program will not use
common Geant4's event loop. Instead, it will sequentially read event data
from an existing project and pass them into
CexmcEventAction::EndOfEventAction(). The read project is specified by
option -r. This mode is useful when user wants to recalculate data from an
existing project with different conditions (for example with different
reconstruction parameters) or apply a custom filter. The results of run
can be written again into another project.
3. Show results mode (or Output mode). The program will output various data
from an existing project (specified by option -r). Type(s) of data are
specified in option -o. For example, to show results of a run user can
specify -orun in command line. To show events, geometry and run results
user can specify -oevents,geom,run.
+227
View File
@@ -0,0 +1,227 @@
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
Example HGCal_testbeam
----------------------
This example is based on the Geant4 standalone application developed
by Thorben Quast for the CMS HGCal studies:
https://github.com/ThorbenQuast/HGCal_TB_Geant4.
The goal of this example is to demonstrate a test beam setup used
in HEP experiments, and as a base for the validation studies and
comparison with experiment data.
It presents a test beam setup used in the HGCal studies in October
2018. It can be easily extended to other configurations.
Details on the High Granularity Calorimeter (HGCal) can be found
i.a. in the Technical Design Report:
https://cds.cern.ch/record/2293646/files/CMS-TDR-019.pdf
1. Detector description
-----------------------
Detector construction in this example assumes that the setup is
constructed with different elements placed one behind another along
z axis (beam axis).
There are 3 configurations user can choose from, and could be set
with UI command:
/HGCalTestbeam/setup/configuration <ID>
where <ID> by default is equal to 0, which means the HGCal testbeam
setup used in October 2018.
<ID> 1 builds the same calorimeter setup, but places in front of it
several beamline elements.
<ID> 2 builds a very simplistic test configuration.
Whenever a silicon wafer or SiPM is placed in the detector, a sensitive
volume is attached to it, and will be used to collect signal.
Silicon wafer is divided into cells (pixels), and each individual pixel
can collect signal.
In order to change the maximum step size allowed in silicon pixels:
/HGCalTestbeam/setup/stepSilicon <STEP>
where <STEP> is value of the max step size in micrometres. By default
<STEP> is equal to 30 um.
2. Signal
---------
Energy deposited within silicon pixels and SiPMs is registered in the
sensitive detectors. Each deposit is added individually to the vector
of hits, in order to allow the digitisation.
Digitisation is performed at the end of the event. It accumulates the
energy deposits within pixels, taking into account the time cut on the
arrival of signal (global time of energy deposit). By default no time
cut is applied which means all the deposits are counted. It can be set
using UI command:
/HGCalTestbeam/hits/timeCut <TIME>
where <TIME> is the maximum global time of the energy deposit that
would be counted into the signal within the pixel.
Another hit parameter is TOA (time of arrival) which is calculated
as time of the energy deposit which added to the digitised pixel energy
exceeds the threshold. By default the threshold is equal to 0, which
means that any hit will exceed the value, so TOA of pixel equals to
the time of the first energy deposit. It can be set using UI command:
/HGCalTestbeam/hits/toaThreshold <ENERGY_THRESHOLD>
where <ENERGY_THRESHOLD> indicates the threshold the sum of energy
needs to exceed to be counted as time of arrival.
Additionally, for silicon pixels, time of the last energy deposit
(within the time window) is recorded.
3. Output
---------
Output with event signal is stored in ntuple and saved to a ROOT file.
Its name can be set with UI command:
/HGCalTestbeam/output/file <NAME>
Created TTree "hits" contains following branches:
+---------------------------------+-----------------+------+-------------------------------------------+
| Branch | Type | Unit | Description |
+---------------------------------+-----------------+------+-------------------------------------------+
| event | int | - | |
| pdgID | vector<int> | - | PDG code of primary particles |
| beamEnergy | vector<double> | GeV | initial energy of primaries |
| beamX_cm | vector<double> | cm | initial X position of primaries |
| beamY_cm | vector<double> | cm | initial Y position of primaries |
| beamZ_cm | vector<double> | cm | initial Z position of primaries |
| siliconHits_ID | vector<int> | - | ID of hits in Si (=1e3*waferID+cellID) |
| siliconHits_x_cm | vector<double> | cm | X position of Si pixel |
| siliconHits_y_cm | vector<double> | cm | Y position of Si pixel |
| siliconHits_z_cm | vector<double> | cm | Z position of Si pixel |
| siliconHits_Edep_keV | vector<double> | keV | energy deposited within Si pixel |
| siliconHits_EdepNonIonizing_keV | vector<double> | keV | non-ionizing energy deposit (Si) |
| siliconHits_TOA_ns | vector<double> | ns | time of arrival for Si pixel |
| siliconHits_TOA_last_ns | vector<double> | ns | time of last arrival for Si pixel |
| siliconHits_type | vector<int> | - | hit type for Si pixel (=0) |
| SiPMHits_ID | vector<int> | - | ID of hits in SiPM (=1e3*sensorID+cellID) |
| SiPMHits_x_cm | vector<double> | cm | X position of SiPM |
| SiPMHits_y_cm | vector<double> | cm | Y position of SiPM |
| SiPMHits_z_cm | vector<double> | cm | Z position of SiPM |
| SiPMHits_Edep_keV | vector<double> | keV | energy deposited within SiPM |
| SiPMHits_EdepNonIonizing_keV | vector<double> | keV | non-ionizing energy deposit (SiPM) |
| SiPMHits_TOA_ns | vector<double> | ns | time of arrival for SiPM |
| SiPMHits_type | vector<int> | - | hit type for SiPM (= 1) |
| signalSum_HGCAL_GeV | double | GeV | sum of energy deposited in Si pixels |
| COGZ_HGCAL_cm | double | cm | energy-weighted shower depth in z |
| NHits_HGCAL | int | - | number of Si pixel hits |
| signalSum_AHCAL_GeV | double | GeV | sum of energy deposited in SiPMs |
| COGZ_AHCAL_cm | double | cm | energy-weighted shower depth in z |
| NHits_AHCAL | int | - | number of SiPM hits |
+---------------------------------+-----------------+------+-------------------------------------------+
4. Primary particle generator
-----------------------------
Particle gun is used as a default primary particle generator.
It can be controlled with standard UI commands (/gun/) and with
additional ones introduced by the messenger:
/HGCalTestbeam/generator/momentumSpread <VALUE>
to change constant particle energy to Gaussian distribution with
sigma expressed in units of the initial energy (e.g. <VALUE>=0.05
means sigma of 0.05 * E). By default it equals to 0 and constant
energy value is used.
/HGCalTestbeam/generator/beamSpread <none/Gaussian/flat>
to define type of beam position spread. By default none is used.
/HGCalTestbeam/generator/beamSpreadX <SIZE>
to define size of beam spread along x axis. It is sigma of a
Gaussian distribution, or half-width of a flat distribution.
/HGCalTestbeam/generator/beamSpreadY <SIZE>
to define size of beam spread along y axis. It is sigma of a
Gaussian distribution, or half-width of a flat distribution.
/HGCalTestbeam/generator/fBeamZ0 <POSITION>
to define beam position along z axis. By default edge of the
world volume is used.
Additionally, if installation was done with ROOT package (CMake
was able to locate it), an option of input read from the ROOT file
is enabled. It can be activated with
/HGCalTestbeam/generator/fReadInputFile true
/HGCalTestbeam/generator/fPathInputFile <FILE>
sets the path to the input file.
/HGCalTestbeam/generator/startFromEvent <N>
allows to start simulation from Nth event.
Please note that in current implementation input from file needs to be
executed in a non-multithreaded mode (or with 1 thread).
Input file needs to have following structure:
- TDirectory "VirtualDetector"
- TNtuple "HGCAL" with branches:
+---------+-------+------+-------------------------------+
| Branch | Type | Unit | Description |
+---------+-------+------+-------------------------------+
| EventID | float | - | ID of event |
| PDGid | float | - | Particle type (PDG code) |
| x | float | mm | Initial X position |
| y | float | mm | Initial Y position |
| Px | float | MeV | Initial momentum along X axis |
| Py | float | MeV | Initial momentum along Y axis |
| Pz | float | MeV | Initial momentum along Z axis |
+---------+-------+------+-------------------------------+
Several particles may belong to the same event, in which case all
of them are read from the input file.
Z position is set to Z position of the entrance of the HGCal detector.
5. How to run the example
-------------------------
Example can be run in interactive mode, with visualisation:
./HGCal_testbeam
It will execute init_vis.mac and vis.mac.
To run in a batch mode, specify the path to the macro:
./HGCal_testbeam run.mac
which will run 10 single-electron events, with beam energy of 30 GeV.
The beam position is smeared with Gaussian with x/y sigma of 1.5 cm.
The momentum is smeared with Gaussian with sigma of 5% (2.5 GeV).
Z beam position is set to -1 m.
Maximum step size in Si pixel is 20 um.
The name of the created file is output_eM_smeared_30GeV_10events.root.
6. Additional settings
----------------------
6.1. Particle input from ROOT file
----------------------------------
If ROOT is found by CMake, it allows to use ROOT file as the input to
the primary generator. See more in the description of "4. Primary
particle generator".
./HGCal_testbeam readFromFile.mac
Macro readFromFile.mac can be used but name of the input file should
be specified (not provided with the example). This mode is meant to
be used in the validation with experimental data with geant-val.
@@ -0,0 +1,288 @@
=======================================================================
Geant4 - ICRP110_HumanPhantoms Example
=======================================================================
The ICRP110_HumanPhantoms example is developed and mantained by Susanna Guatelli, Matthew Large and Alessandra Malaroda,
Centre For Medical Radiation Physics (CMRP), University of Wollongong, NSW, Australia, and John Allison, Geant4 Associates International
and University of Manchester, UK.
Contacts:
- susanna@uow.edu.au
- mjl970@uowmail.edu.au
- malaroda@uow.edu.au
- John.Allison@g4ai.org
The example is based on the extended/medical/DICOM example
The authors acknowledge that this application of the ICRP110 human phantoms have been implemented in Geant4 with the kind permission of
the International Commission on Radiological Protection (ICRP).
----------------------------------------------------------------------------------------------------
--------------------------------------> Introduction <----------------------------------------------
----------------------------------------------------------------------------------------------------
This application models the ICRP110 reference computational human phantoms [1] in a Geant4 simulation and calculates
the dose in individual voxels and in entire organs.
The human male phantom, provided kindly by the ICRP, is created from a whole-body clinical CT image set of a 38yr old
individual with height 176 cm and mass approximately 70 kg. Similarly, the human female phantom was created from a set of
whole body CT images of a 43yr old individual with height 163 cm and weight 60 kg. The CT scans were acquired with both
individuals laying supine and with arms resting parallel alongside the body. Both sets of CT data were then scaled to
closely approximate the ICRP adult Reference Male and Reference Female, defined in previous ICRP publications [2, 3].
[1] HG Menzel, C Clement, and P DeLuca. ICRP publication 110. "Realistic reference phantoms:
an icrp/icru joint effort: A report of adult reference computational phantoms", Annals of the
ICRP, 39(2):1, 2009. URL: http://www.icrp.org/publication.asp?id=icrp%20publication%20110.
[2] Valetin J 2002 Basic anatomical and physiological data for use in radiological protection:
reference values: ICRP Publication 89 Ann. ICRP vol. 32 (Oxford: Elsevier) pp 1-277.
[3] Valetin J 2007 The 2007 recommendations of the international commission on radiological
protection Ann. ICRP vol 37 (Oxford: Elsevier) pp 1-133.
The table below summarises the key features of the male and female voxelised human phantoms.
PROPERTY AM AF
_____________________________________
Height (m) 1.76 1.63
Mass(Kg) 73.0 60.0
Slice Thickness(mm) 8.0 4.84
Voxel in-plane- 2.137 1.775
-resolution (mm)
Voxels along x 254 299
(i.e. columns)
Voxels along y 127 137
(i.e. rows)
Number of Slices 222 348
(i.e. along z)
______________________________________
----------------------------------------------------------------------------------------------------
------------------------------> Application Sub-Folder Structure <----------------------------------
----------------------------------------------------------------------------------------------------
- '/src': where the source .cc files are stored
- '/include': where header .hh files are stored
- '/ICRPdata': where the phantom data files (*.dat) and slice files are stored.
It is downloaded automatically from URL https://cern.ch/geant4-data/datasets/examples/advanced/ICRP110Phantoms/ICRPdata.tar.gz
during the configuration via cmake.
Phantom data files containing the voxelisation of each phantom, as well as files
containing the definitions of the phantom organs and materials used within geant4
code can be found in the folder /ICRPdata.
All data files used for this phantom were obtained from the ICRP's website on publication 110 under "Supplementary Data"
- https://www.icrp.org/publication.asp?id=ICRP%20Publication%20110.
----------------------------------------------------------------------------------------------------
----------------------------------> ICRP110Phantoms Data <------------------------------------------
----------------------------------------------------------------------------------------------------
Within the '/ICRPdata' directory, the following sub-directories are contained:
-> /ICRPdata/ : contains '*Data.dat' files which list the number of phantom slices to
simulate and the order in which to stack the phantom slices.
-> /ICRPdata/ICRP110_g4dat/AM/ : contains the individual male phantom slice files.
-> /ICRPdata/ICRP110_g4dat/AF/ : contains the individual female phantom slice files.
-> /ICRPdata/ICRP110_g4dat/P110_data_V1.2
The final directory contains the raw ICRP110 phantom data as obtained from the ICRP110 publication website [1];
5 files within folders for the AM and AF phantoms are given. These files are described as follows in the
supplementary data's included README file.
The array of organ identification numbers (in ASCII format); the file names are:
AM.dat
AF.dat
A list of individually segmented structures, their identification numbers, and assigned media (Appendix A in ICRP110); the file names are:
AM_organs.dat
AF_organs.dat
A list of the media, their elemental compositions and densities (Appendix B in ICRP110);
the file names are:
AM_media.dat
AF_media.dat
The mass ratios of bone constituents (trabecular bone, red and yellow bone marrow) in the spongiosa regions;
the file names are:
AM_spongiosa.dat
AF_spongiosa.dat
The mass ratios of blood in various body tissues; the file names are:
AM_blood.dat
AF_blood.dat
The primary data files AM.dat and AF.dat contain an array of organ identification numbers ranging from 0 to 141.
Each number respresents the organ associated with each voxel within the phantom. Within these files, the organ IDs
are listed slice by slice, within each slice row by row, within each row column by column. That means, the column
index changes fastest, then the row index, then the slice index - in other words, the phantom voxels first increase
along x, then along y and finally along z. Slice numbers increase from the toes up to the vertex of the body;
row numbers increase from front to back; and column numbers increase from right to left side.
For use in this application, the original AM.dat and AF.dat files containing the organ identification numbers of
all voxels of the phantom were sub-divided into many files with each representing a single phantom slice along z.
As such, each file represents a 2D phantom slice containing x,y voxel positions and organ identification numbers
of each voxel. This allows for subsections of the phantom to be simulated as required by the user, removing the
need to simulate the entire phantom every time when this may not nessecrily be needed by the user. This also will
allow for reductions in the simulation time depending on what portion of the total phantom is simulated by the user.
This feature was achieved via a code developed by Dr Alessandra Malaroda, University of Wollongong, Australia in 2017.
The AM human phantom is voxelised in x,y,z with 254 x 127 x 222 voxels with dimensions 2.137 x 2.137 x 8 mm.
The AF human phantom is voxelised in x,y,z with 299 x 137 x 348 voxels with dimensions 1.775 x 1.775 x 4.84 mm.
----------------------------------------------------------------------------------------------------
---------------------------------------> How to compile and run <-----------------------------------
----------------------------------------------------------------------------------------------------
- Create a build folder for the phantom run
% mkdir build/
- Navigate to inside the build folder and initialise Geant4
% cmake ../
The ICRP110 phantom data will be automatically downloaded from https://cern.ch/geant4-data/datasets/examples/advanced/ICRP110Phantoms/ICRPdata.tar.gz
- Compile and link to generate the executable (in your CMAKE build directory):
% make
- Execute the application in 'interactive' mode with visualization:
% ./ICRP110phantoms
- Execute the application in 'batch' mode from macro files:
% ./ICRP110phantoms female_head.in
-----------------------------
AVAILABLE MACRO FILES
-----------------------------
For the users convinience, macro files have been created which are designed to construct partial head
and trunk phantoms for both the male and female models. These macro files can be called upon in batch
mode when executing the application as specified above. If the user wishes to construct a completed/full
male or female phantom, the macros male.in and female.in can be called upon, respectively.
- male_head.in/female_head.in : Creates a partial head phantom for the male and female, respectively.
- male_trunk.in/female_trunk.in : Creates a partial trunk phantom for the male and female, respectively.
- male.in : Creates full male ICRP110 phantom. This can be modified along with 'ICRPdata/MaleData.dat'
if the user wishes to create their own custom partial phantom section.
- female.in : Creates full female ICRP110 phantom. This can be modified along with
'ICRPdata/FemaleData.dat' if the user wishes to create their own custom partial phantom section.
- openGLVis.mac : macro for visualisation with openGL.
- vis.mac (default) : Executed by default when the simulation is run in 'interactive' mode.
- primary.mac : Contains the definition of the primary radiation field.
At the very top of the various '.in' macro files (pre-initialization), there are a series of commands
which define the sex and section of the phantom to create. These commands are listed below:
o /phantom/setPhantomSex <option> : Passes sex of phantom to Detector Construction
o /phantom/setScoreWriterSex <option> : Passes sex of phantom to User Score Writer
o /phantom/setPhantomSection <option> : Passes section of phantom to Detector Construction
o /phantom/setScoreWriterSection <option> Passes section of phantom to User Score Writer
Available options for the first 2 commands are: male or female.
Avalable options for the last 2 commands are: head, trunk or full.
In the event that the macro called upon by the user when executing the application in 'batch' mode
does not contain these commands (default case), the application sets phantom sex to female and the section as the head.
WARNING: the phantom model can be chosen only in the initialization phase of the simulation!!!
It cannot be changed during the run session. This feature will be implemented in the next future.
----------------------------------------------------------------------------------------------------
----------------------------------> Creating a Custom Phantom <------------------------------------
----------------------------------------------------------------------------------------------------
If the user wishes to construct a customised section of the phantom (i.e. a single slice, the legs, etc),
he/she has to create a specific macro or edit the ones provided. The recommended method for a custom male
phantom is outlined as follows.
The user should edit the macro 'male.in' and the data file
'MaleData.dat'. Firstly, in 'FemaleData.dat', there are 2 simple ways in which the user can
select a custom range of phantom slices to simulate:
1. The very first entry of each Data.dat indicates how many slices to simulate.
Changing this number will determine the number of slices to construct.
2. Further down in the Data.dat files (beginning at line 61) is the name of the first slice to simulate, followed
by successive slices. Changing the slice file orders here will allow various subsections of the human
phantom to be simulated. As an indication the following phantom subsections have been identified for the
male phantom below.
--> AM_Slice1.g4dat to AM_Slice20.g4dat: Feet to ankles
--> AM_Slice21.g4dat to AM_Slice121.g4dat: Ankles to hips
--> AM_Slice169.g4dat: Single chest slice with good visualisation
of lungs, ribs, heart.
--> AM_Slice182.g4dat to AM_Slice222.g4dat: Neck and Head
NOTE: o Always order phantom slices beginning with the lowest number and increasing
in slice number going down the .dat files.
o Always use consecutive/adjacent slices when simulating multiple slices.
o The default number of slices for both male and female phantoms is set to 10
and starts at the feet of each phantom.
Once the user customises the MaleData.dat/FemaleData.dat (for example starting from the full phantoms macros),
he/she has also to fix appropriately the scoring mesh in male.in/female.in.
----------------------------------------------------------------------------------------------------
------------------------------> Scoring Mesh and the User Score Writer <----------------------------
----------------------------------------------------------------------------------------------------
The macro primary.mac defines the radiation beam type, energy, direction and geometry. The UI commands of the
General Particle Source should be used to change the radiation field. The macros male.in and female.in contain
the /run/beamOn command and can call upon the radiation beam definition through the UI command
'/control/execute primary.mac'.
Within male.in and female.in, a scoring mesh is defined which records the dose deposition within each individual
phantom voxel. The size of the scoring mesh is defined in line 54 of the male.in/female.in files, and must be defined
to match the constructed phantom dimensions (whole or partial) defined in the according '/ICRPdata/*Data.dat' file.
The mesh dimensions are defined as half-dimensions in x,y,z - meaning a defined scoring mesh x-dimension of 100mm will construct
a scoring mesh spanning from -100mm to +100mm in the geometrical world in which the phantom lies. Furthermore, for the completed
male phantom which has dimensions along x,y,z of 542.798 x 271.399 x 1776 mm, the scoring mesh half-dimensions should be defined
as 271.399 x 135.6995 x 888. mm. The number of bins or divisions to segment the mesh into is then defined in line 51. These
should match the number of phantom voxels in x,y,z which are defined in the MaleData.dat and FemaleData.dat files in the '/ICRPdata'
directory.
If the user edits the MaleData.dat or FemaleData.dat files to change the number of z-slices simulated in a run, they must also edit
the scoring mesh dimensions and number of bins to ensure it correctly scores their defined phantom. To do so, the user will typically
only have to edit lines 54 and 55 of the male.in or female.in macro files.
After completion of a simulation run, the phantom mesh records the deposited dose in each phantom voxel and outputs the data to a text file named
"PhantomMesh_Dose.txt". This text file lists the x,y,z positional number of the voxel in the phantom and the dose recorded within that voxel (in Gy).
The output PhantomMesh_Dose.txt file is created by the User Score Writer class defined in the source code ICRP110UserScoreWriter.cc. In the same class the dose
in the voxels is analysed and associated to organs.
A final output file "ICRP.out" is then created which contains the total dose delivered to each organ.
----------------------------------------------------------------------------------------------------
----------------------------------------> Further Info <--------------------------------------------
----------------------------------------------------------------------------------------------------
-------> ColourMap.dat <--------
This file located in the build directory assigns G4colours to the 53 phantom materials.
The user may edit these as they wish for visualistion purposes.
----------> Physics <-----------
The QGSP_BIC_HP Physics List is adopted. The user may want to change the
cut of production of secondary particles.
-----> Primary particles <------
The G4 General Particle Source (gps) is used to generate primary radiation field.
Macro primary.mac contains the definition of the primary radiation field.
+17
View File
@@ -0,0 +1,17 @@
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
Advanced Examples
-----------------
In this directory one can find examples of real complete applications used
for different simulation studies. The applications included here may require
third party products for handling of the data produced (visualization,
analysis or persistency tools). Refer to the README and documentation provided
in each example for the details.
These application are made part of the official GEANT4 distribution, however
their maintenance and updates is under responsibility of the authors.
+323
View File
@@ -0,0 +1,323 @@
=========================================================
Geant4 - Solid-target cyclotron example
=========================================================
README
---------------------
//
// March 2014 - September 2014 //
// The code was written by : //
// Floriane Poignant - floriane.poignant@gmail.com //
// with the support of Scott Penfold (University of Adelaide, Australia) //
// //
// for a colloboration work between the University of Adelaide & the SAHMRI //
// (J. Asp, P. Takhar) //
// //
//******************************************************************************************//
-------------------------------
---- I) Introduction ----
-------------------------------
This project was realised by F. Poignant at the University of Adelaide, for a collaboration
between the University of Adelaide, the SAHMRI and Comecer (company in charge of the design
of the solid target). The aim was to model a solid target of the cyclotron to study to
production of the radioisotope of interest for proton irradiation, and to be able to estimate
any undesired secondary product, especially isotopes of the product of interest.
For more details about this project and the results, see :
http://www.physicamedica.com/article/S1120-1797%2816%2930023-0/abstract
Anyone who would like to study the production of radioisotope for low current and low energy
irradiation can use this simulation.
The solid target system is made of a tube surrounded by aluminium, a foil, a volume of helium
between the foild and the target, and the target set on a plate of platinium.
------------------------------------
---- II) Setting the database ----
------------------------------------
Beforehand, you first need to make sure that the database used for inelastic collisions of primary
particles is set up correctly. You can download formated data of the TENDL and ENDF-VII0 database
at the following links:
TENDL data:
- CMake can download and install this dataset, add
-DGEANT4_INSTALL_DATASETS_TENDL=ON
to your CMake options.
- or, download via download page searching for TENDL download
https://cern.ch/geant4/support/download
- or direct download:
https://cern.ch/geant4-data/datasets/G4TENDL.1.3.2.tar.gz
ENDF-VII0:
ftp://gdo-nuclear.ucllnl.org/pub/G4LEND/ (G4 Low Energy Nuclear Data)
In your bashrc file, add the following:
export G4PARTICLEHPDATA=/PATH_TO_TENDL____OR____ENDF_DATABASE
export G4NEUTRONHPDATA=/PATHTO_GEANT4_INSTALLATION_FOLDER/share/Geant4-vXX.XX/data/G4NDL4.5
export G4PHP_DO_NOT_ADJUST_FINAL_STATE=1
export G4PHP_MULTIPLICITY_METHOD=Poisson
------------------------------------
---- III) Input parameters ----
------------------------------------
-----Macro/init_parameters.mac, file available also in the main directory.
To study the optimization of the isotope production, a list of parameters can be changed in
the Macro/init_parameters.mac (or using the Geant4 User Interface):
PART1) Beam parameters
Different parameters can be changed for the beam : type of particle, energy, energy distribution,
shape of the beam, etc ... To design your own beam, please refer to the Geant4 User's Guide for
Application Developpers.
Time and current parameters
As Geant4 doesn't model any time scale, the current/particles generated relation is established as
the following:
- for one event generated, the number of particles represent 10E-11 second of a real experiment. It
is calculated the following way :
NumberOfParticle = beamCurrent*timePerEvent/chargeParticle
where - beamCurrent is a parameter that can be changed, in ampere
- timePerEvent is set to 10E-11 second.
- chargetParticle is the charger of the particle
in Coulomb (for example, the value is 1.9E-19 C for proton).
Then, the user can choose the time of irradiation. Note that a simulation for a real time of irradiation
would be too long. The time of irradiation parameter enables to get results for the real time of irradiation
from a smaller time simulation.
PART2) Target parameters:
- the target thickness. Must be smaller than 38.32 mm, which is the length of the tube containing the target.
- the target diameter. Must be smaller than 15 mm, which is the diameter of the tube containing the target.
- the target material : there are two ways to change the material of the target :
- If the material is natural, the user can choose to use the NIST database.
- If the material is enriched, the user can set up their own material. The material created is made of a
number of elements. The number of elements can be set up by the user. Then, one element can be created in
two different ways : it can be a natural element, using the NIST database, or it can be made of a number
of isotopes that the user can set up. Please, note that the order to declare parameters is important and
has to be the following :
1) Material settings
2) Element i settings
3) Isotopes settings for the element i
4) Element i+1 settings
5) Isotopes settings for the element i+1, .... and so on.
For example, to create an target of nickel enriched to 60% of Ni64 : one will create a new material, made
of two elements : natural nickel and pure Ni64. The natural nickel will be an element created using the NIST
database. The pure Ni64 will be an element made of one isotope : Ni64. In case you want to create a pure 64Ni
target, the materialis made of one element, made itself of one isotope (Ni64). Few examples are provided in
the folder "Macro/Material/Target" that can be executed in the init_parameters.mac.
PART3) Foil parameters:
- the foil thickness.
- the foil material. With this parameter, it is possible to change the foil material in order to study some specific
aspects of the reaction. Refers to the change of target material for more detail.
PART4) Histograms:
The histograms parameters can be changed in order to fit to the expected range for a given data. For example, for a
proton beam with an expected energy of 16 MeV when reaching the target, the beam energy profile range can be set up
between 15. to 17. MeV.
-----Macro/Vis/vis.mac
This file sets up the visualisation parameters. vis.mac is also available in the main directory.
-----Macro/GUI/gui.mac
This file sets up the tool bars and buttons that enables to modify the parameters using the Geant4 User Interface.
------------------------------------
---- IV) Running the simulation ----
------------------------------------
To run your simulation, create a "STCyclotron-build" directory. Go in the build directory, and compile:
cmake PATHTO_SOURCE_DIRECTORY (corresponding to the path to the STCyclotron directory).
make
It will create and executable 'STCyclotron'. To run your simulation, type:
./STCyclotron
If the Graphical User Interface is activated and your Geant4 environment is correctly set, a Graphical User Interface
should open. On the top, the tool bar enables the user to execute the different commands. There are few menus : one for
the beam parameters, one for the target material, one for the geometry of the target, one for the foil material, and one
for the foil geometry. Through this tool bar, you can modify the main parameters you need to run your simulation.
The viewer shows you the structure of the target system. The proton beam arrives from the left and is transported through
the tube and the foil before impacting the target. The yellow tube is either void (before the blue foil) or pressured helium
(after the foil). The out-layer is made of aluminum or gold. The target is displayed in green.
To send protons, type
/run/beamOn 1
/!\IMPORTANT/!\ If the number of runs you launch is larger than a few, desactivate the viewer (Menu 'Viewer' -> 'Disable
Viewer') otherwise it will crash. This is due to the number of particles sent per event, that is quite large. The viewer
has a limit of the number of particles it can display on the screen.
Note that the number of particles per event is set according to the current, so that one event represents 10^-11 second
of irradiation. For 30 μA, it corresponds to 1 875 protons. This value was chosen so the number of protons per event won't
be too high. If you work on high current (over 100 μA) you might need to change the set up. This time is defined in the
PrimaryGeneratorAction class. Also note that, for one event, all primaries are set up with the same primary coordinates.
You need to launch a high enough number of runs (~ 1000) if you want a good statistics on results such as the beam intensity.
At the end of the run, type 'exit' to leave the Geant4 User Interface. Execute the file Plot.C by typing
root Plot.C
It will create many PDF files. To exit ROOT, type
.q
------------------------------------
---- V) Output ----
------------------------------------
Different types of output are available.
1) The .root file:
This ROOT file gives a list of histograms representing the following data :
a) 1D histograms :
- n°0: The energy distribution of primary particles (e.g. protons) when reaching the target (MeV).
- n°1: The energy distribution of primary particles (e.g. protons) when reaching the foil (MeV).
- n°2: The energy distribution of primary particles (e.g. protons) going out of the target (MeV).
- n°3: The energy distribution of primary particles (e.g. protons) going out of the foil (MeV).
- n°4: The depth of isotope production in your target (number of particles as a function of the foil
thickness in mm).
- n°5-8: energy spectrum of particles produced in the target following inelastic collision of primary
particles (e.g. protons) with the target material (MeV).
In order: 5 = positrons; 6 = electrons; 7 = gammas; 8 = neutrons.
- n°9-14: energy spectrum of particles produced in the target following decay of isotopes produced in
the target (MeV).
In order: 9 = positrons; 10 = electrons; 11 = gammas; 12 = neutrons; 13 = nu; 14 = anti_nu
(electron (anti)neutrinos).
b) 2D histograms :
- n°0: the beam intensity profile before hiting the target (mm x mm).
- n°1: the beam intensity profile before hiting the foil (mm x mm).
- n°2: the radioisotopes produced according to their Z and A number.
- n°3: the energy of the primary particles (e.g. protons) according to depth in the target (mm x MeV).
- n°4: the beam intensity going out from the target (mm x mm).
- n°5: the beam intensity going out from the foil (mm x mm).
/!\ the histograms are not normalized /!\. The file 'Plot.C' renormalize the histograms and plot them into
PDFs as explained below.
2) .txt files:
Several text files are provided :
----a) Output_General.txt
This file summarizes the parameters used during the simulation:
- Geam parameters: primary particles (by default protons), energy of the primary particles (MeV), current
of the beam (Ampere), irradiation time (hour(s)), and current factor. This last factor is a rescaling
factor: in the simulation, the number of particles sent is calculated for a current obtained before the foil,
while the current in the actual cyclotron the current is measured after the foil. This parameter therefore
rescales the number of particles to match the current arriving at the target.
- simulation parameters: equivalent time per event (by default set at 10^-11 second), number of events run
during the simulation, number of primaries per event (calculated according to the time per event, the beam
current and the charge of the primary particle), total number of particles sent during the simulation.
- Geometry parameters: target thickness, diameter and foil thickness.
It also provides the heating of the target and the foil (W/mm3).
----b) Output_ParentIsotopes.txt
This file provides a list of radioisotopes produced during the irradiation of the target. For each isotope, it contains:
- Name of the isotope.
- Number of isotopes created during the simulation. Can be used to evaluate the accuracy of your predictions.
- Decay constant (s-1).
- Half life time (hour(s)).
- Process that induced its creation.
- Number of isotopes produced per second of irradiation.
- Number of isotopes produced at the end of the beam.
- Activity induced by the isotope at the end of the beam (mCi).
----c) Output_DaughterIsotopes.txt
This file provides a list of unstable daughter radioisotopes produced due to the decay on unstable primary (parent) radiosotopes.
Note that it may be empty. As for the file Output_ParentIsotopes.txt, it contains:
- Name of the daughter isotope.
- Name of the parent isotope.
- Decay constant of the parent isotope (s-1).
- Decay constant of the daughter isotope (s-1).
- Half life time of the parent isotope (hour(s)).
- Half life time of the daughter isotope (hour(s)).
- Number of daughter isotopes produced per second of irradiation.
- Number of daughter isotopes produced at the end of the beam.
- Activity induced by the daughter isotope at the end of the beam (mCi).
----d) Output_StableIsotopes.txt
For information, this file provides a list of stable isotopes (name and number of isotopes produced during the simulation)
that are produced in the target due to the decay of radioisotopes.
----e) Output_Particles.txt
For information, this file provides a list of other particles such as electrons, etc., (name and number of isotopes produced
during the simulation) that are produced in the target.
This folder provides pdf format of the histograms generated in the root file, using a the macro
file Plot.C to generate it. It also provides the following curves :
- the number of each isotope according to the time, from the start of the irradiation to
the end of the irradiation, but also until few hours after the end of the irradiation.
- the variation of activity from the end of the irradiation time to few hours after.
3) PDF Files:
After running the 'Plot.C' file, you obtain many PDF files that are created in a folder 'Results'. This code reads the different
outputs from the simulation (.root file and .txt files), normalize the results and plot them in PDFs in various folders:
----a) Results/BeamData folder
- BeamEnergyInFoil.pdf and BeamEnergyInTarget.pdf: beam energy distribution before entering the foil/target using histograms 1D0 and 1D1,
normalized to the number of primary protons and the bin width.
- BeamEnergyOutFoil.pdf and BeamEnergyOutTarget.pdf: beam energy distribution when exiting the foil/target, using histograms 1D2 and 1D3,
normalized to the number of primary protons and the bin width.
- BeamIntensityInFoil.pdf and BeamIntensityInTarget.pdf: beam intensity before entering the foil/target using histograms 2D0 and 2D1,
normalized per primary particle and to the bins widths.
- BeamIntensityOutTarget.pdf: beam intensity when exiting the target using histogram 2D4, normalized per primary particle and to the bins
widths.
- EnergyDepth.pdf: energy of protons as a function of the depth in the target.
----b) Results/IsotopesProduction
- ActivityOfXX.pdf and YieldOfXX.pdf
Shows the production of the isotope XX (number of nuclei or activity) as a function of the time, starting from the beginning of
irradiation and up to 30 hours. Note that if the time of irradiation is longer than 30 hours, you must change the maximum time
to display the activity or yield by opening the file 'Plot.C' and changing tMax.
- ActivitySaturationOfXX.pdf and YiedSaturationOfXX.pdf
Shows the saturation reached for the production of the isotope XX (number of nuclei or activity) as a function of the time, if the
time of irradiation is set 'infinite'.
- Activity.pdf/Activity.jpg and Yield.pdf/Yield.jpg
Shows the activity (or yield) of all the isotopes produced during the irradiation as a function of the time up to 30 hours on the
same graph.
- TotalActivity.pdf
Shows the sum of the activities induced by all the radioisotope up to 30 hours.
- RadioisotopeProduction.pdf/RadioisotopeProduction.jpg
Shows the number of isotopes produced per primary particles, as a function of Z and A.
- DepthCreation.pdf
Shows the depth at which radioisotopes were created.
----c) ParticlesEnergySpectra
Subfolder: beam. Energy spectra (normalized per primary particles and bin width) of particles created following the inelastic
interaction of the beam with the target (1D 5->8).
Subfolder: decay. Energy spectra (normalized per primary particles and bin width) of particles created following the decay of
radioisotopes created in the target (1D 9->14).
------------------------------------
---- VI) Checking the results ----
------------------------------------
Keep a critical mind with the results : they are highly dependent on the accuracy of the database used. You can verify the coherence
of your results on checking the nuclear database you are using. Go to the following website:
http://www.oecd-nea.org/janis/book/
In the web access part, you can click on the “protons” to access the database of protons. Click on the atom which your target is made of.
For example, for the production of Copper 64, Nickel 64 is used, so you will click on 28-Ni. The list of isotopes of Nickel is available.
Click on 28-Ni-64 and select the nuclear reaction you are interested in. The cross sections will be displayed on your screen for different
nuclear databases and experiments.
The computed values can be used to be compared to experimental ones using the EXFOR website. Go on this website:
https://www-nds.iaea.org/exfor/exfor.htm
Enter the parameters of the irradiation (i.e., atomic target, reaction, etc.). Then click on submit. You will have different experimental
data available. Tick the ones you are interested in. Tick “Quick plot” and then click on retrieve. It will display a plot with different
experimental values. On the right, you can tick “use my data”. Do it and add the data from the JANIS Book website. Make sure the units
are coherent. Rename your data. Tick “authors” and “legend”. Then click on repaint. You can save your plot buy clicking on PostScript and
selecting a PDF format.
These tools can be used to check on the accuracy of the database at a given energy.
+111
View File
@@ -0,0 +1,111 @@
=========================================================
Geant4 - ULTRA-based air shower example
=========================================================
README
---------------------
------------------------------------------------------------------------
----> Introduction.
The ULTRA detector is a hybrid 2-component system consisting of:
1) an UV detection system - the UVscope
2) an array of scintillator detectors - the ETscope
The UVscope detects Cherenkov light associated to cosmic ray showers
when it is diffusively reflected on ground.
The ETscope detects in coincidence the charged particles of the shower.
In the current version only the UVscope simulation is included
------------------------------------------------------------------------
----> Description
The UVscope consists of a Fresnel lens and a PMT located in the focal
plane, enclosed in a cylindrical aluminum housing. The lens is 457 mm
in diameter and is made of UV transmitting acrylic with 5.6 grooves
per mm. The description of the geometry of the Fresnel lens makes use
of object parameterisation/replication capabilities.
The primary vertex generator describes a plane circular source of UV
(3eV, about 400 nm) optical photons.
Depending on the selected detector configuration, the source can be
positioned such that the photons are fired
to a reflecting surface or, by default, directly to the UVscope
(no reflecting surface is present in this case).
Reflection at the surface can be chosen to be specular or diffuse.
In both cases the normal to the surface makes an angle of 45 degrees
with the UVscope axis and the photons are emitted at an angle of
90 degrees with the UVscope axis.
If none of these variables is set no reflecting surface is used
and the photons source is positioned at the UVscope axis.
The definition of the relevant optical boundaries, parameters and
processes is made.
------------------------------------------------------------------------
----> SET-UP
A standard Geant4 example GNUmakefile and a CMakeLists.txt file are
provided, for building with cmake
The following environment variable can be set in order to get
additional verbosity during program running:
1) GNUmakefile
setenv ULTRA_VERBOSE
or
2) cmake -DULTRA_VERBOSE=ON "path to source"
------------------------------------------------------------------------
The analysis is performed using the native Geant4 analysis tools
(g4tools). In the default case, the output histograms are written
in a ROOT file.
The output file can be written in other formats (csv, xml, hdf5) by
changing the G4AnalysisManager default file type in UltraRunAction::BeginOfRunAction().
-----------------------------------------------------------------------
----> How to run the example.
From the directory where the Ultra binary resides :
./Ultra "macro name" for running in batch mode
./Ultra for running in interative mode.
The macro VisDirect.mac is executed.
Several macros are available for interactive visualisation.
While in interactive mode type the command
/control/execute "name_of_macro",
where "name_of_macro" is one of the following:
Direct.mac - a beam of photons is shot directly to the telescope.
Mirror.mac - the beam is directed to a specular reflecing surface
Ground.mac - the beam is directed to a diffusively reflecting surface
------------------------------------------------------------------------
----> Simulation output
the output is ultra.root
It contains:
1)1Dhistogram with the detected photons energy (eV)
2)1Dhistogram with the number of detected photons per event
To plot these histograms run the ROOT macro 'do_plots.C' :
> root do_plots.C
------------------------------------------------------------------------
for comments and questions: bernardo@lip.pt
for more info http://www.ge.infn.it/geant4/examples/
last modified: B. Tome 08/11/2019
created by : B. Tome and M.C. Espirito Santo 20/05/2004
+132
View File
@@ -0,0 +1,132 @@
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
amsEcal
-------
1- GEOMETRY DEFINITION
AMS Ecal calorimeter is described in the joined documument : ams_ecal.pdf
- A single layer is a plane of scintillating fibers within a box of
absorber material.
- Single layers are positionned (eg. placement) within Module
(called SuperLayer in the descriptive document),
alternatively with a relative offset of +- 0.25*distanceInterFibers.
- Modules are positionned within calorimeter, alternatively rotated of
90 deg around beam axis (X_axis).
Therefore all fibers are along Y_axis or Z_axis calorimeter.
The default geometry is constructed in DetectorConstruction class.
In addition a transverse uniform magnetic field can be applied.
2- PHYSICS LISTS
Physics lists can be local (eg. in this example) or from G4 kernel
(physics_lists subdirectory).
- "local" standard EM physics with current 'default' options.
From geant4/source/physics_lists/constructors:
- "emstandard_opt0" standard EM physics with all default options
- "emstandard_opt1" best CPU performance standard physics for LHC
- "emstandard_opt2"
- "emstandard_opt3"
Physics lists and options can be (re)set with UI commands
Please, notice that options set through G4EmProcessOPtions are global, eg
for all particle types. In G4 constructors, it is shown how to set options per
particle type.
3- PRIMARY GENERATOR : mono-energetic pencil beam
The primary kinematic is a single particle which hits the calorimeter
perpendicular to the input face (eg. along X_axis).
The type of particle and its energy are set in the PrimaryGeneratorAction,
and can be changed via the G4 build-in commands of ParticleGun class
(see the macros provided with this example).
One can choose randomly the tranverse position of the incident particle,
eg. the width of the beam. The associated interactive command is built
in PrimaryGeneratorMessenger.
4- DETECTOR RESPONSE
The program computes the 'visible' energy, eg. the energy deposited
in scintillating fibers.
It also computes the total energy deposited per layer, either in absorber
material or in scintillator material.
The list of fibers fired can be written event per event, on an ascii file.
The file is filled at EndOfEvent(); uncomment the function WriteFibers()
See EventAction::WriteFibers() and the format description : eventFormat.txt
NB: visible energy can be corrected for Birk's attenuation:
see the function SteppingAction::BirksAttenuation() (not activated)
5- HISTOGRAMS
The Program contains 5 built-in 1D histograms, managed by G4AnalysisManager.
These histograms can be activated individually with the command :
/analysis/h1/set id nbBins valMin valMax unit
where unit is the desired unit for the histo (MeV, keV, etc..)
(see the macros xxxx.mac).
1 total energy in calorimeter (eg. summed all layers)
2 vsible energy in calorimeter (eg. summed all layers)
3 total energy per layer (eg. longitudinal profile)
4 visible energy per layer (eg. longitudinal profile)
5 visible energy per fiber (eg. lateral profile)
Histograms can be viewed using ROOT.
One can control the name and format of the histograms file with the command:
/analysis/setFileName name (default amsEcal)
/analysis/setFileType type (choice: root(default), XML, csv)
It is also possible to print selected histograms on an ascii file:
/analysis/h1/setAscii id
All selected histos will be written on a file name.ascii (default amsEcal)
6- VISUALIZATION
Visualization Manager is set in the main().
Initialisation of the drawing is done via the commands :
/vis/... in the macro vis.mac. In interactive session:
PreInit or Idle > /control/execute vis.mac
Default view is a longitudinal view of the calorimeter.
Tracks are drawn at end of event, and erased at end of run.
Optionaly one can choose to draw all particles, only charged one, or none.
This command is defined in EventActionMessenger.
7- HOW TO START ?
- compile and link to generate an executable
% cd amsEcal
% gmake
- execute amsEcal in 'batch' mode from macro files
% amsEcal run1.mac
- execute amsEcal in 'interactive mode' with visualization
% amsEcal
....
Idle> type your commands. For instance:
Idle> /control/execute run1.mac
....
Idle> exit
8- HANDLE RANDOM NUMBER SEEDS
The macro rndmSeed.mac shows how to create a set of random number seeds.
Here we save the seed at begin of each run (the number of events per run
is arbitrary). The seeds are stored in subdirectory random.
Macro rndmSeed.mac shows also how to start a run from one of these seeds.
+192
View File
@@ -0,0 +1,192 @@
=========================================================
Geant4 - Brachytherapy example
=========================================================
README
---------------------
The brachytherapy example is currently maintained and upgraded by Susanna Guatelli (1), Albert Le (1) and Dean Cutajar (1), with the support of
Luciano Pandola (2)
1. Centre For Medical Radiation Physics (CMRP), University of Wollongong, NSW, Australia.
2. LNS, INFN, Catania, Italy.
------------------------------------------------------------------------
Contact: susanna@uow.edu.au
deanc@uow.edu.au
geant4-advanced-examples@cern.ch
------------------------------------------------------------------------
List of past co-authors:
S. George, S. Agostinelli, F. Foppiano, S. Garelli, M. G. Pia, M. Tropeano
-----------------------------------------------------------------
----> Introduction.
Brachytherapy example simulates the energy deposit in a water phantom, produced by:
1) Iridium sources (Flexisource and TG186).
2) Iodine sources (Bebig Isoseed and Oncura 6711 I-125).
3) Leipzig Applicator with an iridium source (model from the Istituto Tumori, Genova, Italy).
The Flexisource, an Ir-192 source manufactured by Nucletron, an Elekta company, is a source commonly used for high dose rate brachytherapy treatments.
The geometry of the Flexisource was adapted from D. Granero, J. Pérez-Calatayud, E. Casal, et al,
"A dosimetric study on the Ir-192 high dose rate Flexisource", Med. Phys. 33 (12), 2006, 4578-82.
The TG186 source is a generic Ir-192 source created to provide developers of model based dose engines with a method of validating new dose calculation techniques.
Details of the TG186 source may be obtained from Facundo Ballester, Åsa Carlsson Tedgren, Domingo Granero, et al,
"A generic high-dose rate 192Ir brachytherapy source for evaluation of model-based dose calculations beyond the TG-43 formalism", Med. Phys. 42, 2015, 3048-62
In particular in this example it is shown how to:
- model a radioactive source in terms of radiation field and geometry
- model the radiation field with the General Particle Source with two alternative methods:
1) Define the energy spectrum of photons exiting the radioactive core
2) Modelling the Radioactive decay
- calculate the energy deposition in a phantom by means of the G4 scoring mesh
- define the physics by means of a Geant4 Modular Physics List
- save results in an analysis ROOT file
- calculate the dose rate distribution along the main axis of the source
- compare the calculated dose rate distribution to reference data.
In the case of the example, the dose rate distribution of a Flexisource is compared to D. Granero,
J. Pérez-Calatayud, E. Casal, et al,"A dosimetric study on the Ir-192 high dose rate Flexisource", Med. Phys. 33 (12), 2006, 4578-82.
The dose rate distribution of the Oncura 6711 I-125 source is compared to J. Dolan, Z. Lia, J. F. Williamson, "Monte Carlo and experimental
dosimetry of an I-125 brachytherapy seed", Med. Phys. 33(12), 2006.
The example can be executed in multithreading mode.
------------------------------------------------------------------------
----> 1.Experimental set-up.
The default source is a Ir-192 Flexisource set in the center of a water phantom with size 30 cm.
The phantom is set in the World volume filled with air.
The primary radiation field is defined by means of the GeneralParticleSource
-------------------------------------------------------------------------
----> 2.SET-UP
A standard Geant4 example CMakeLists.txt is provided.
------------------------------------------------------------------------
----> 3.How to run the example.
- Batch mode:
$G4WORKDIR/bin/Linux-g++/Brachy FlexiSourceMacro.mac
$G4WORKDIR/bin/Linux-g++/Brachy LeipzigSourceMacro.mac
$G4WORKDIR/bin/Linux-g++/Brachy IridiumSourceMacro.mac
$G4WORKDIR/bin/Linux-g++/Brachy IodiumSourceMacro.mac (model of the Bebig Isoseed I-125)
$G4WORKDIR/bin/Linux-g++/Brachy OncuraIodineSourceMacro.mac (model of the Oncura 6711 I-125)
$G4WORKDIR/bin/Linux-g++/Brachy LeipzigSourceMacro.mac
- Interative mode:
3) $G4WORKDIR/bin/Linux-g++/Brachy
VisualisationMacro.mac is loaded automatically.
* How to change the absorber material of the phantom:
idle>/phantom/selectMaterial materialName
---------------------------------------------------------------------------------
----> 4. Primary radiation Field
The radiation field is defined with the General Particle Source.
Two alternative options are offered:
1) Define gamma as primary radiation field. The gamma are originated from the radioactive core.
This radiation field is defined in:
iodine_source_primary.mac and iridium_source_primary.mac
2) Model the radioactive Decay. The primary particle is the radionuclide.
This option is modelled in iodine_decay.mac and TG186_iridium_decay.mac
The GPS macros are executed in VisualisationMacro.mac by default, FlexiSourceMacro.mac, IodineSourceMacro.mac, LeipzigSourceMacro.mac
- The Flexisource is the default source of the example.
- In VisualisationMacro.mac the source is the default one. iridium_source_primary.mac is executed to define the radiation field emerging from the iridium core.
- In FlexiSourceMacro.mac the Flexi Ir source geometry is selected via interactive command. The radiation field is defined in the iridium_source_primary.mac.
- In IodineSourceMacro.mac, the Bebig Isoseed I-125 brachytherapy source is modelled. The radiation field is modelled in terms of emitted photons in iodine_source_primary.mac.
Alternatively the radioactive decay of I can be modelled using teh macro iodine_decay.mac.
- In LeipzigSourceMacro.mac, A Leipzig applicator (design provided by Istituto Tumori, Genova) is modelled. The iridium_source_leipzig_primary.mac defines the radiation field of the Ir core.
- The TG186SourceMacro.mac models the reference bIr brachytherapy source. The radiation field can be either defined with the iridium_source_primary.mac (spectrum of the emitted photons) or with TG186_iridium_decay.mac (model of the Ir decay).
- OncuraIodineSourceMacro.mac models both the geometry and the radioactive decay of the Oncura 6711 I-125 source.
--------------------------------------------------------------------------------
----> 5. Physics List
The electromagnetic Livermore Low Energy physics is active as well as the radioactive decay.
The cut is 0.05 mm.
Fluorescence and Auger electron emission are included.
------------------------------------------------------------------------
----> 6. Scoring mesh
The scoring mesh is used to calculate the energy deposition in the plane containing the source (z=0 plane)
integrated over the whole run. The scoring mesh is defined in the input macro files.
The default output format of the scoring is changed in the class BrachyUserScoreWriter.
The scoring mesh is fixed with a size of 20.025 cm along x and y. The bin size is 0.25 mm along x, y and z.
When running in interactive mode there is no scoring mesh.The user has to add it with appropriate UI
------------------------------------------------------------------------
----> 6. Analysis
G4Analysis is used to create and fill histograms in ROOT output files.
The installation of ROOT is required to plot the results of the simulation contained
in primary.root and brachytherapy.root(http://root.cern.ch/drupal/).
------------------------------------------------------------------------
----> 7. Simulation output
The output is:
- ASCII file EnergyDeposition.out, with xx (mm), yy(mm), zz(mm), and energy deposition (keV), in the phantom.
To limit the use of memory, the energy deposition is scored only in the plane containing the source, however this can be changed by the user.
By default:
EnergyDeposition_Flexi.out contains the Edep when the Flexi source is selected.
EnergyDeposition_iodine.out contains the Edep when Iodine Bebig Isoseed source is selected.
EnergyDeposition_TG186.out contains the Edep when the TG186 source is selected.
EnergyDeposition_Leipzig.out contains the Edep when the Iridium source with Leipzig applicator is selected.
EnergyDeposition_Oncura.out contains the Edep when the Iodine Oncura 6711 source is selected.
- brachytherapy.root, containing a 2D histogram with the energy deposition in the phantom. The macro macro.C is provided as example
to open brachytherapy.root in ROOT interactive session and to plot the results of the simulation.
- primary.root, with 1D histogram of the energy spectrum of photons emitted by the radionuclide (see section 4).
plot_primary.C is provided as example to open primary.root and to plot the energy spectra
-------------------------------------------------------------------------------
----> 8.Visualisation
A macro is provided ad example of visualisation: VisualisationMacro.mac.
-------------------------------------------------------------------------------
-----> 9. Comparison to reference data
The ROOT macros macro.C and plot_primary.C are provided to plot the results of the simulation, contained
in the brachytherapy.root file.
The ROOT macro TG43_relative_dose.C has brachytherapy.root as input file. It calculates the dose rate distribution along the main axis of
the brachytherapy source. The dose rate is normalised to 1 at 1 cm distance from the centre.
The output file is geant4_dose.txt with two columns:
distance from the centre (cm) dose rate distribution
The user can then compare the dose rate distribution calculated with the example to reference data.
Directory "comparison":
As an example, the dose rate distribution calculated with the Flexisource is compared to reference data from D. Granero, J. Pérez-Calatayud, E. Casal, et al, "A dosimetric study on the Ir-192 high dose rate Flexisource", Med. Phys. 33 (12), 2006, 4578-82.
The compare.C is a ROOT macro which reads the dose rate distribution calculated with the Flexisource (geant4.txt generated with the advanced example and 280 M histories ) against the reference.
The directory "comparison" contains:
- the reference data, granero.txt
- the data obtained in Geant4.10.3: geant4.txt, 280 M events. geant4.txt is obtained when executing the macro TG43_relative_dose.C
- comparison.C - macro to read geant4.txt and granero.txt and compare them in the same plot
-----> 10. Regression testing of Geant4
- the macros to run are in test_macro
- the results should be processed with analysis.C
@@ -0,0 +1,30 @@
/testem/phys/addPhysics emlivermore
/run/initialize
/control/verbose 1
/tracking/verbose 0
/run/verbose 0
/event/verbose 0
#
/source/switch Flexi
###### Generation of primary field
#### Generate gamma deriving from radioactive decay
/control/execute iridium_source_primary.mac
# Scoring mesh is used to calculate
# the energy deposition in the phantom
/score/create/boxMesh boxMesh_4
#
# the voxels are 0.25 mm wide.
/score/mesh/boxSize 10.0125 10.0125 0.0125 cm
/score/mesh/nBin 801 801 1
/score/quantity/energyDeposit eDep
#
/score/close
#
/score/list
/run/beamOn 1000000000
#
# Dump scores to a file
#
/score/dumpQuantityToFile boxMesh_4 eDep EnergyDeposition_Flexi_livermore.out
#
@@ -0,0 +1,30 @@
/testem/phys/addPhysics emstandard_opt0
/run/initialize
/control/verbose 1
/tracking/verbose 0
/run/verbose 0
/event/verbose 0
#
/source/switch Flexi
###### Generation of primary field
#### Generate gamma deriving from radioactive decay
/control/execute iridium_source_primary.mac
# Scoring mesh is used to calculate
# the energy deposition in the phantom
/score/create/boxMesh boxMesh_4
#
# the voxels are 0.25 mm wide.
/score/mesh/boxSize 10.0125 10.0125 0.0125 cm
/score/mesh/nBin 801 801 1
/score/quantity/energyDeposit eDep
#
/score/close
#
/score/list
/run/beamOn 1000000000
#
# Dump scores to a file
#
/score/dumpQuantityToFile boxMesh_4 eDep EnergyDeposition_Flexi_opt0.out
#
@@ -0,0 +1,30 @@
/testem/phys/addPhysics emstandard_opt3
/run/initialize
/control/verbose 1
/tracking/verbose 0
/run/verbose 0
/event/verbose 0
#
/source/switch Flexi
###### Generation of primary field
#### Generate gamma deriving from radioactive decay
/control/execute iridium_source_primary.mac
# Scoring mesh is used to calculate
# the energy deposition in the phantom
/score/create/boxMesh boxMesh_4
#
# the voxels are 0.25 mm wide.
/score/mesh/boxSize 10.0125 10.0125 0.0125 cm
/score/mesh/nBin 801 801 1
/score/quantity/energyDeposit eDep
#
/score/close
#
/score/list
/run/beamOn 1000000000
#
# Dump scores to a file
#
/score/dumpQuantityToFile boxMesh_4 eDep EnergyDeposition_Flexi_opt3.out
#
@@ -0,0 +1,30 @@
/testem/phys/addPhysics emstandard_opt4
/run/initialize
/control/verbose 1
/tracking/verbose 0
/run/verbose 0
/event/verbose 0
#
/source/switch Flexi
###### Generation of primary field
#### Generate gamma deriving from radioactive decay
/control/execute iridium_source_primary.mac
# Scoring mesh is used to calculate
# the energy deposition in the phantom
/score/create/boxMesh boxMesh_4
#
# the voxels are 0.25 mm wide.
/score/mesh/boxSize 10.0125 10.0125 0.0125 cm
/score/mesh/nBin 801 801 1
/score/quantity/energyDeposit eDep
#
/score/close
#
/score/list
/run/beamOn 1000000000
#
# Dump scores to a file
#
/score/dumpQuantityToFile boxMesh_4 eDep EnergyDeposition_Flexi_opt4.out
#
@@ -0,0 +1,29 @@
/testem/phys/addPhysics empenelope
/run/initialize
/control/verbose 1
/tracking/verbose 0
/run/verbose 0
/event/verbose 0
#
/source/switch Flexi
###### Generation of primary field
#### Generate gamma deriving from radioactive decay
/control/execute iridium_source_primary.mac
# Scoring mesh is used to calculate
# the energy deposition in the phantom
/score/create/boxMesh boxMesh_4
#
# the voxels are 0.25 mm wide.
/score/mesh/boxSize 10.0125 10.0125 0.0125 cm
/score/mesh/nBin 801 801 1
/score/quantity/energyDeposit eDep
#
/score/close
#
/score/list
/run/beamOn 1000000000
#
# Dump scores to a file
#
/score/dumpQuantityToFile boxMesh_4 eDep EnergyDeposition_Flexi_penelope.out
#
@@ -0,0 +1,129 @@
/gps/ene/type Arb
/gps/hist/type arb
/gps/hist/point 0.0614 1e-8
/gps/hist/point 0.0615 0.412
/gps/hist/point 0.0616 1e-8
/gps/hist/point 0.0629 1e-8
/gps/hist/point 0.063 0.7039
/gps/hist/point 0.0631 1e-8
/gps/hist/point 0.0650 1e-8
/gps/hist/point 0.0651 1.1309
/gps/hist/point 0.0652 1e-8
/gps/hist/point 0.0667 1e-8
/gps/hist/point 0.0668 1.9178
/gps/hist/point 0.0669 1e-8
/gps/hist/point 0.0710 1e-8
/gps/hist/point 0.0711 0.0827
/gps/hist/point 0.0712 1e-8
/gps/hist/point 0.0713 1e-8
/gps/hist/point 0.0714 0.1600
/gps/hist/point 0.0715 1e-8
/gps/hist/point 0.0733 1e-8
/gps/hist/point 0.0734 0.0560
/gps/hist/point 0.0735 1e-8
/gps/hist/point 0.0753 1e-8
/gps/hist/point 0.0754 0.2292
/gps/hist/point 0.0755 1e-8
/gps/hist/point 0.0756 1e-8
/gps/hist/point 0.0757 0.4408
/gps/hist/point 0.0758 1e-8
/gps/hist/point 0.0777 1e-8
/gps/hist/point 0.0778 0.1570
/gps/hist/point 0.0779 1e-8
/gps/hist/point 0.1103 1e-8
/gps/hist/point 0.1104 0.0042
/gps/hist/point 0.1105 1e-8
/gps/hist/point 0.1362 1e-8
/gps/hist/point 0.1363 0.0860
/gps/hist/point 0.1364 1e-8
/gps/hist/point 0.1769 1e-8
/gps/hist/point 0.1770 0.0018
/gps/hist/point 0.1771 1e-8
/gps/hist/point 0.2012 1e-8
/gps/hist/point 0.2013 0.1624
/gps/hist/point 0.2014 1e-8
/gps/hist/point 0.2057 1e-8
/gps/hist/point 0.2058 1.1468
/gps/hist/point 0.2059 1e-8
/gps/hist/point 0.2802 1e-8
/gps/hist/point 0.2803 0.0039
/gps/hist/point 0.2804 1e-8
/gps/hist/point 0.2832 1e-8
/gps/hist/point 0.2833 0.0913
/gps/hist/point 0.2834 1e-8
/gps/hist/point 0.2959 1e-8
/gps/hist/point 0.2960 12.3498
/gps/hist/point 0.2961 1e-8
/gps/hist/point 0.3084 1e-8
/gps/hist/point 0.3085 12.7626
/gps/hist/point 0.3086 1e-8
/gps/hist/point 0.3164 1e-8
/gps/hist/point 0.3165 35.5660
/gps/hist/point 0.3166 1e-8
/gps/hist/point 0.3291 1e-8
/gps/hist/point 0.3292 0.0060
/gps/hist/point 0.3293 1e-8
/gps/hist/point 0.3744 1e-8
/gps/hist/point 0.3745 0.2493
/gps/hist/point 0.3746 1e-8
/gps/hist/point 0.4164 1e-8
/gps/hist/point 0.4165 0.2877
/gps/hist/point 0.4166 1e-8
/gps/hist/point 0.4204 1e-8
/gps/hist/point 0.4205 0.0237
/gps/hist/point 0.4206 1e-8
/gps/hist/point 0.4680 1e-8
/gps/hist/point 0.4681 20.5587
/gps/hist/point 0.4682 1e-8
/gps/hist/point 0.4845 1e-8
/gps/hist/point 0.4846 1.0942
/gps/hist/point 0.4847 1e-8
/gps/hist/point 0.4852 1e-8
/gps/hist/point 0.4853 0.0010
/gps/hist/point 0.4854 1e-8
/gps/hist/point 0.4890 1e-8
/gps/hist/point 0.4891 0.1504
/gps/hist/point 0.4892 1e-8
/gps/hist/point 0.5885 1e-8
/gps/hist/point 0.5886 1.9423
/gps/hist/point 0.5887 1e-8
/gps/hist/point 0.5934 1e-8
/gps/hist/point 0.5935 0.0181
/gps/hist/point 0.5936 1e-8
/gps/hist/point 0.5993 1e-8
/gps/hist/point 0.5994 0.0017
/gps/hist/point 0.5995 1e-8
/gps/hist/point 0.6043 1e-8
/gps/hist/point 0.6044 3.5361
/gps/hist/point 0.6045 1e-8
/gps/hist/point 0.6124 1e-8
/gps/hist/point 0.6125 2.2962
/gps/hist/point 0.6126 1e-8
/gps/hist/point 0.7038 1e-8
/gps/hist/point 0.7039 0.0018
/gps/hist/point 0.7040 1e-8
/gps/hist/point 0.7657 1e-8
/gps/hist/point 0.7658 0.0006
/gps/hist/point 0.7659 1e-8
/gps/hist/point 0.8844 1e-8
/gps/hist/point 0.8845 0.1251
/gps/hist/point 0.8846 1e-8
/gps/hist/point 1.0614 1e-8
/gps/hist/point 1.0615 0.0228
/gps/hist/point 1.0616 1e-8
/gps/hist/point 1.0898 1e-8
/gps/hist/point 1.0899 0.0005
/gps/hist/point 1.0890 1e-8
/gps/hist/point 1.3781 1e-8
/gps/hist/point 1.3782 0.0005
/gps/hist/point 1.3783 1e-8
/gps/hist/inter Lin
/gps/particle gamma
/gps/pos/type Volume
/gps/pos/shape Cylinder
/gps/pos/radius 0.30 mm
/gps/pos/halfz 1.75 mm
/gps/pos/centre 0. 0. 0. mm
/gps/ang/type iso
@@ -0,0 +1,515 @@
-------------------------------------------------------------------
-------------------------------------------------------------------
=========================================================
Geant4 - Composite calorimeter example
=========================================================
README
---------------------
CompositeCalorimeter is an example of a test-beam simulation used
by the CMS Collaboration to validate Geant4 against real data taken
(in 1996) in a CMS Hadron calorimeter test-beam.
The name "Composite" for this example emphasizes that, although the
test-beam had the goal of studying the hadronic calorimeter response,
part of the data was taken with the presence of the electromagnetic
crystal calorimeter in front of the hadronic calorimeter, to better
reproduce the situation as in the real CMS experiment.
The geometry of the simulation has been setup in such a way to allow
very easily, at run time (therefore without need of changing any code;
see below for the details) the inclusion or exclusion of the
electromagnetic calorimeter part.
Although some important aspects, for a detailed comparison between
test-beam data and simulation, like beam profile, noise, and digitization,
have been omitted here (to avoid too many technical details),
nevertheless, this example is able to reproduce the main features of
most of the relevant observables as measured in the real test-beam.
The output of this example consists of a set of histograms
and one ntuple which are stored on a ROOT file (default).
In our opinion, the most original "lesson" which is offered by this
advanced example for the Geant4 user is to show how the Geometry and
the Sensitive/Hit part of the simulation is treated in a big experiment.
Although the details of how this is done vary from experiment to
experiment (it is worth, for instance, to compare with the Atlas-based
advanced example lAr_calorimeter), the main driving needs and goals
are quite general: to have consistency, but avoiding duplications
and couplings as much as possibile, between Simulation, Reconstruction,
and Visualization. Notice that the solution offered in this example
by CMS could appear "overdone" for the sake of simulating only a
relatively simple test-beam setup; but it should be kept in mind
that the same approach is used also for the full CMS detector
simulation, as well as for any subdetector.
1. Setting up the environment variables
---------------------------------------
The user should first setup, as "usual", the Geant4 environmental
variables (e.g. the script produced by cmake)
Then the specific setup for this example should be run:
> source envExample.csh in the case of C-shell
or
> . envExample.sh in the case of bash-shell
The analysis part is based on the native g4analysis tools. As default
the output is a ROOT file. This can be changed to XML by changing the G4AnalysisManager default file type in CCalRunAction::BeginOfRunAction().
2. Sample run
-------------
Once the environmental variables are setup, you can get the executable
CompositeCalorimeter
by configuring with cmake and then running the compiler.
Then, you can execute it using the Geant4 macro command input file test.g4mac
as follows:
> ./CompositeCalorimeter test.g4mac
which simulate a few events, each being a 100 GeV pi- incident on the
electromagnetic crystal calorimeter followed by the hadronic calorimeter,
without magnetic field.
The output is the ROOT file "ccal.root" .
See part "8. Analysis / Histogramming" below for more details on the
content of that file.
If you run instead:
> ./CompositeCalorimeter
after having setup the Geant4 visualization variables and the PATH,
you can visualize the geometry of the apparatus, and also see some
events. Similarly, you can get a very simple graphical user interface
that allows to select the particle type, its energy, and the number
of events (between a limited number of possibilities).
For more details, see part "9. Visualization / GUI".
3. Detector description
-----------------------
Let's start with a brief description of the test-beam setup.
There are two possible configurations:
i) HCAL only, that is only the hadronic calorimeter is present;
ii) ECAL+HCAL, that is the electromagnetic calorimeter (ECAL)
is placed in front of the hadronic calorimeter.
ECAL is made of 23 cm long PbWO4 crystals (corresponding to about
25.8 radiation lengths, and 1.1 interaction lengths); for the
test beam a 7 x 7 = 49 matrix of crystals is used.
HCAL is a sampling calorimeter, with plastic scintillator as sensitive
part and copper as absorber. 28 scintillator plates were used with
absorber of varying thickness in between, and also varying thickness
and type of scintillator. More precisely:
--- layer 1: 2 cm of Copper
--- layer 2 to 7: 4 cm of Copper
--- layer 8 to 21: 6 cm of Copper
--- layer 22 to 27: 8 cm of Copper
For the scintillators: 2 mm passive Plastic; 4 mm active Plastic;
1 mm passive Plastic.
The total length of HCAL consists of 152 cm of Copper plus 189 mm of Plastic.
The dimension orthogonal to the beam direction is 64 cm x 64 cm.
The ECAL and HCAL considered here are prototypes for the Central and
Endcap calorimeters of the CMS detector (which covers the rapidity
region |eta| < 3.0 ; CMS has also a Forward calorimeter, which covers
the region 3.0 < |eta| < 5.0, but this part was not considered in
this test-beam setup). Notice, however, that there are more layers
(28 instead of 19 in the Barrel or 18 in the Endcap) of HCAL in the
test-beam setup than in the real CMS detector, in order to study
energy containment. Therefore, the ECAL+HCAL in the test-beam amounts
to more than 11 radiation lengths as for the real CMS detector (the
19 layers of the Barrel have each 6 cm of absorber, whereas the
18 layers of the Endcap have each 6.6 cm of absorber, so that the
number of interaction lengths are rougly the same).
Five values of the magnetic field (parallel to the face of the scintillators)
have been considered in the test-beam: 0.0 , 0.375 , 0.75 , 1.50 , 3.0 Tesla.
In order to set the magnetic field, you have to edit the file
dataglobal/fmap.tb96
and change the first number (which appears in the third line of
that file, on the first column; the unit being Tesla):
#. Field map
*DO FLDM
0.0 9 652.0
for example, if you want a magnetic field of 3.0 Tesla the last
line must be set as follows (the magnetic field unity is kilo Gauss).
30.0 9 652.0
In order to deactivate either the ECAL or the HCAL, it is enough
to comment out the corresponding line in the file g4testbeamhcal96.conf,
using "#" as the comment character. For instance, to have only the HCAL
without ECAL:
"HcalTB96" "tbhcal96" 1
#"CrystalMatrixModule" "tbhcal96xtal" 1
In this test-beam setup, at the back of ECAL, there is also some
material for support and readout, which has been considered in the
simulation. For the HCAL, only the fibres are close to the test-beam,
and because they have the same composition as the scintillators
they are adequately represented in the simulation; the remaining
of the readout, including the photomultipliers, are in readout boxes
far away from the HCAL, and hence are not present in the simulation.
Let's summarizes now the geometry description of the simulation.
As said in the introduction, this part is the most original and
important of this example, but it is quite complex and can be fully
appreciated only in the context of the CMS software framework, in
particular in the relation between Simulation, Reconstruction, and
Visualization. Therefore we limit ourself to only few considerations,
pointing to the internal CMS documentation for more details.
--- In order to share the same geometrical and physical information
about CMS between Simulation, Reconstruction, and Visualization,
avoiding inconsistencies, duplications, and unnecessary dependecies,
all these information is store, once for all, in common databases
(typically in XML format), instead of putting them inside C++ classes,
as usually done in simpler detector descriptions (in most of the
the Geant4 examples, novice or advanced, the geometry information
is kept inside the concrete class which inherits from
G4VUserDetectorConstruction). For simplicity, in this example,
these "databases" are nothing more than ASCII files:
datageom/ : tbhcal96.geom, tbhcal96hcal.geom, tbhcal96xtal.geom
store the information about the experimental Hall,
the HCAL, and the ECAL, respectively.
dataconf/ : g4testbeamhcal96.conf, testbeamhcal96.conf
store the information about which configuration
(HCAL only, or ECAL+HACL) is considered, in the
Simulation and Reconstruction, respectively.
dataglobal/ : fmap.tb96, material.cms, rotation.cms
The first one is the magnetic field map (how the
intensity of the magnetic field, in the direction
orthogonal to the beam direction, varies along
the beam axis). The second one, material.cms,
keeps the full collection of all materials used in
the CMS detector (not only in the calorimeters,
although we are simulating only them in this example!).
The third one, rotation.cms, collects a set of useful
rotation parameters (angles).
datavis/ : tbhcal96.vis, tbhcal96hcal.vis, tbhcal96xtal.vis
visualization information for, respectively, the
experimental Hall, HCAL, and ECAL.
--- In order to allow an high degree of flexibility, at the geometry
level the user can choose which subsystem of the detector setup
should be simulated and can activate or deactivate the sensitive
parts, subsystem by subsystem. This can be done at run time,
by modifying one of the above database information, without need
of putting the hands on the code, recompiling, etc.
--- There are two "parallel geometry factories": one described by "core"
classes, which are independent from the Simulation (and therefore
can be used, for instance, by the Reconstruction); and one which
is specific of the Simulation. In the latter case (Geant4 side of
the geometry model), all the geometry factories are derived from the
base class CCalG4Albe. Furthermore, using double inheritance, each
of them derives also from the counterpart in the "core" hierarchy.
The design of the CCalG4Able class helps a modular approach and easy
interchanging at the level of subdetectors, allowing a straightforward
transition from the simulation of the entire CMS detector to that of
just a part of it, or to a test-beam geometry, as indeed in this example.
Of course this modular, flexible, and general approach does not come
for free: the price to pay here is its complexity, which would be
otherwise unjustified if we limited ourself to the pure simulation
of a relatively simple test-beam setup.
--- See "10. Classes Overview" below for a schematic summary of the
various classes involved in the Geometry description of this example.
4. Physics processes
--------------------
The factory physics list is used, therefore the choice of the physics list
is steered by the environmental variable PHYSLIST.
(Note: if this environmental variable is not set, the default physics list
which is used is FTFP_BERT).
5. Particle Generator
---------------------
The 1996 test-beam has been taken with the following particles:
--- 225 GeV muons (for calibration)
--- 10 to 300 GeV pions
--- 10 to 300 GeV electrons
therefore the standard Geant4 Particle Gun has been used as primary
generator. Notice that, for the sake of keeping the example not too
complicated, the proper simulation of the beam profile and
beam contamination have been neglected.
6. Hits
-------
In CMS there are two groups of hits: Tracker-like and Calorimeter-like.
Only the latter one appears in this example.
For the same reasons, as seen for the Geometry, of consistency without
duplication of information and unnecessary coupling between Simulation,
Reconstruction, and Visualization, the simulation calorimeter hit class,
CCalG4Hit, doubly inherits from the common Geant4 abstract class for
all hits, G4VHit, and from the "core" (i.e. simulation independent)
CMS calorimeter hit class, CCalHit.
A new Hit object is created
- for each new particle entering the calorimeter;
- for each detector unit (i.e cristal or fiber or scintillator layer);
- for each nanosecond of the shower development;
The information stored in each CCalHit object is the following:
- Entry : local coordinates of the entrance point of the particle
in the unit where the shower starts;
- the TrackID : Identification number of the incident particle;
- the IncidentEnergy : kinetic energy of that incident particle;
- the UnitID : the identification number of the detector unit
(crystal, or fiber, or scintillator layer);
- the TimeSlice : the time interval, in nanoseconds, in which the
hit has been created;
- the EnergyDeposit : the energy deposit in this hit.
Notice that all hit objects created for a given shower have the same
values for the first three pieces of information.
No Noise and Digitization
--------------------------
In order to keep the complexity of this example to a reasonable
level, both noise and digitization effects have not been included.
7. User Actions
----------------
In this example. there have been used the following User Actions:
--- G4UserRunAction (the derived, concrete class is CCalRunAction):
it is used to invoke the Analysis object at the beginning of
the Run, to instantiate it and passing it the Run number, and
at the end of the Run, to inform it that the Run is finished
and therefore the histograms, ntuples, etc. must be closed.
--- G4UserEventAction (the derived, concrete class is CCalEndOfEventAction):
it is used to examine, at the end of the Event, all collected
(calorimeter) hits, extract the various observables which are
interesting (to the goal of understanding things like: the effect
of magnetic field on scintiallator; choice of the absorber
thickness by optimizing resolution versus containment; impact of
the absorber depth in the energy caontainment; electromagnetic
calorimeter contribution in the electron - pion separation; etc.)
and finally call the analysis object to store such selected
information on histograms and/or in the ntuple.
The name of the class "CCalEndOfEventAction" is motivated by the
fact that at the beginning of the Event nothing is done.
--- G4UserSteppingAction (the derived, concrete class is CCalSteppingAction):
it is used to extract some "unphysical" information (that is not
experimentally measurable, although interesting for a better
understanding of the shower development), namely the lateral profile
and the deposit as a function of the time (see "8.Analysis/Histogramming
for more details"), which is available only from simulation, and then,
at the end of Event, the analysis object is invoked to store such
information on histograms.
Please notice that the stepping action is not used to create hits.
--- G4UserStackingAction (the derived, concrete class is CCalStackingAction):
it is used to ensure that the same track ID of the particle
originating a shower appears in all hits (calorimeter hit objects
of class CCalHit) of the shower, in any calorimeter part.
8. Analysis / Histogramming
----------------------------
The analysis part of CompositeCalorimeter is kept in class CCalAnalysis,
and is based on the g4tool interfaces.
Both the histograms and the ntuple are saved at the end of the run in the
ROOT file "ccal.root" (default: this can be changed to XML or to other
formats supported by the g4analysis tools).
Please note that in a multiple run session, the last run always overrides
the output file.
What the histograms and the variables of the ntuple represent is
explained below:
Histograms h100 - h127 : energy deposit (in GeV) in the sensitive part
(plastic scintillator layer) of one Hadronic
calorimeter module (there are 28 modules, numbered
from 0 to 27, and the corresponding histogram has
ID = 100 + number of module).
Ntuple variables hcal0 - hcal27 : provide the same information.
Histograms h200 - h248 : energy deposit (in GeV) in one crystal
electromagnetic towers (there are a matrix of
7 x 7 = 49 towers, numbered from 0 to 48, and
the corresponding histogram has
ID = 200 + number of tower).
Ntuple variables ecal0 - ecal48 : provide the same information.
Histograms h300 - h339 : total energy deposit (in GeV) in any
electromagnetic crystal tower or hadronic module
(either in a sensitive or insensitive layer)
in one of the 40 nanosecond time slices: in other
words, histogram 300+I , where I = 0 - 39,
contains the total deposit energy between
I and I+1 nanoseconds after the "collision".
(Notice that the time window considered,
40 nanoseconds, is larger than the LHC
bunch-crossing of 25 nanoseconds.)
Histograms h400 - h469 : energy profile (in GeV), summed over all layers
sensitive (plastic scintillator) and insensitive
(copper absorber), as a function of the radial
distance (in centimeter) from the beam axis
( ID histo = 400 + radial distance in cm ).
Histogram h4000 : total energy deposit (in GeV) in the sensitive parts
of either the electromagnetic or hadronic calorimeters.
Ntuple variable edep provides the same information.
Other ntuple variables are the following:
--- elab : energy (in GeV) of the incident particle.
--- xpos, ypos, zpos : position (in mm) from where the projectile
has been shot.
--- edec, edhc : total energy deposit (in GeV) in the sensitive
parts of, respectively, the electromagnetic
and hadronic calorimeters. Notice that their
sum edec+edhc coincides with edep
Notice that lateral profile (400-469) and time-slice (300-339)
histograms show purely Monte Carlo quantities, which cannot be
experimentally measured.
Please be careful that the range of the histograms has been chosen
in such a way to contain most of the entries, but only few histograms
fill a large fraction of that range, whereas the remaining majority
fill only the first few bins (corresponding to lower energy), and,
therefore, when plotted they look almost empty, but they are not,
and the results are sensible. We suggest to plot the ntuple's variables,
rather than the histograms, when the same information is available
from the ntuple.
9. Visualization / GUI
-----------------------
If you setup one of the following Geant4 environmental variables:
G4VIS_USE_DAWN
G4VIS_USE_VRML
G4VIS_USE_OPENGLX
which correspond to the use of DAWN, VRML, and OPENGLX, respectively,
as visualization engine of Geant4, and set properly the corresponding
PATH as well, it is then possible to visualize the detector and also
some events.
To do so, you have to run
> ./CompositeCalorimeter
without input file: you then see the detector; after that,
you can select the particle gun and its energy, in the
case you want something different from the the default
(which is a 100 GeV pi-), for example:
Idle> /gun/particle e-
Idle> /gun/energy 200 GeV
and then run some events, for example:
Idle> /run/beamOn 3
The tracks that are shown include both charged and neutral particles
of any momentum: if you want instead only charged, or only neutral,
then you have simply to edit src/CCalEndOfEventAction.cc
at the end of the method EndOfEventAction and uncomment the line
where the condition on the charge is made (it should then be
straighforward to eventual add some other conditions, for example
if you want to see only those particles that satisfy certain
kinematic conditions).
Rather than to specify "by hand" the type of particle gun,
its energy, and the number of events, it is possible to have
a very simple GUI (graphical user interface) from which to make
such choices, between a limited set of possibilities, via menus.
Such GUI is based on Motif XmCommand widget, but it would be
straightforward, eventually, to make the necessary changes
in order to use a different one.
The only thing you need to do to get the GUI is to setup
the following Geant4 environmental variables:
G4UI_BUILD_XM_SESSION=1
G4UI_USE_XM=1
Then, if you run the executable without specifying a macro file
(like test.g4mac):
> $G4WORKDIR/bin/$G4SYSTEM/CompositeCalorimeter
a window automatically pops out, with the menus where you
can make your selection of particle type, energy, and number
of events to be run.
10. Classes Overview
---------------------
This is a schematic overview of the classes defined in this example:
CCalPrimaryGeneratorAction
CCalPrimaryGeneratorMessenger
User action for primaries generator.
CCalDetectorConstruction
CCalAMaterial
CCalDataSet
CCalDetector
CCalEcal
CCalEcalOrganization
CCalG4Able
CCalG4Ecal
CCalG4Hall
CCalG4Hcal
CCalGeometryConfiguration
CCalHall
CCalHcal
CCalHcalOrganization
CCalMagneticField
CCalMaterial
CCalMaterialFactory
CCalRotationMatrixFactory
CCalVOrganization
CCalVisManager
CCalVisualisable
CCaloOrganization
CCalutils
Geometry and material definitions for the detector.
Notice in particular that:
CCalHall, CCalEcal, CCalHcal derive from CCalDetector;
CCalG4Hall, CCalG4Ecal, CCalG4Hcal derive from the above
corresponding classes and from CCalG4Able;
CCalEcalOrganization, CCalHcalOrganization derive from
CCalVOrganization : each sensitive cell has an unique
number for detector organization (this is a software
ID not an hardware/electronic one).
CCalHit
CCalG4Hit
CCalG4HitCollection
CCalSDList
CCalSensAssign
CCalSensitiveConfiguration
CCalSensitiveDetectors
CCaloSD
Hit and Sensitive Detectors.
Notice in particular that:
CCalG4Hit derives from G4VHit and CCalHit;
CCaloSD derives from G4VSensitiveDetector.
CCalActionInitializer
User-action initialization.
CCalAnalysis
Analysis manager class.
CCalRunAction
User run action class.
CCalEndOfEventAction
User event action class.
CCalStackingAction
User Stacking action class.
CCalSteppingAction
User Stepping action class.
+139
View File
@@ -0,0 +1,139 @@
===========================================================
---------------Geant4 doiPET example---------------------
===========================================================
Author list to be updated, with names of co-authors and contributors from National Institute of Radiological Sciences (NIRS)
Abdella M. Ahmed (1, 2), Andrew Chacon (1, 2), Harley Rutherford (1, 2),
Hideaki Tashima (3), Go Akamatsu (3), Akram Mohammadi (3), Eiji Yoshida (3), Taiga Yamaya (3)
Susanna Guatelli (2), and Mitra Safavi-Naeini (1, 2)
*Corresponding authors
e-mail: abdella.ahmed@health.nsw.gov.au
mitras@ansto.gov.au
susanna@uow.edu.au
(1) Australian Nuclear Science and Technology Organisation, Australia
(2) University of Wollongong, Australia
(3) National Institute of Radiological Sciences, Japan
================================================================================================
Introduction:
This example simulates depth-of-interaction (doi) enabled positron emission tomography (PET) scanner
and NEMA NU phantoms.The example can be executed in a multithreading mode. Some realistic approches
of identifying crystal ID are presented.
- The center of mass of the position of interaction is identified based on energy weighting
* Note: the following steps are performed if the option for AngerLogic is enabled (ApplyAngerLogic: true) in
the inputParameter.txt
- Four ideal photomultiplier tubes (PMTs) are placed at each corner of the crystal block
- Perform Anger type calculation method to identify the position of interaction in 2D based
- Shift the position response based on the reflector pattern
- DOI is identified by using a look-up-table and
- Crystal ID in 3D is determined
The above steps are illustrated figuratively in the supplementary document.
================================================================================================
1-Geometry and Phantoms
The detector construction has two main parts: constructing the PET system and placing the phantoms.
The PET system is constructed from depth-of-interaction (DOI)detectors blocks. Each detector consisted
of 16 x 16 x 4 crystal array constructed from GSO scintillation material. Materials are defined in the
DefineMaterials() using Geant4 NIST database. The geometrical specifications are given (and can be changed)
in the GlobalParameters.hh file.
The scanner has 4 ring detectors. The detectors are covered with Aluminum material. Gaps between crystal
elements, as well as adjacent rings are introduced.
Various types of NEMA NU phantoms has been provided and are defined in the ConstructPhantom() method.
To precisely create the image quality phantom, the G4UnionSolid from the Constructive Solid Geometry (CSG)
has been used. The type, position and size of the phantoms can be changed using the macro file when necessary.
A macro file is provided for each type of phantom imaging. For example, to run the simulation with image quality
phantom, the run_imageQualityPhantom_wholeBody.mac should be used.
2- PHYSICS LIST
The physics list contains standard electromagnetic processes and the radioactiveDecay module for GenericIon. It is
defined in the PhysicsList class as a Geant4 modular physics list with registered physics builders provided in Geant4:
- G4DecayPhysics - defines all particles and their decay processes
- G4RadioactiveDecayPhysics - defines radioactiveDecay for GenericIon
- G4EmStandardPhysics_option3 - defines EM standard processes
3- ACTION INITALIZATION
The ActionInitialization class instantiates and registers to Geant4 kernel all user action classes by invoking the
ActionInitialization::Build().
4- PRIMARY GENERATOR
The default particle beam is F-18 ion at rest defined in the GPS (General Particle Source). The GPS is used for all types
of activity distribution. Various macro files are provided with the name appended on it for specific simulation. The following
macro files are provided:
run_imageQualityPhantom_wholeBody.mac
run_imageQualityPhantom_smallAnimal.mac
run_NECR.mac
run_sensitivity.mac
run_spatialResolution.mac
run_normalization.mac (This one is not given in the NEMA NU manual but it is an important part of image reconstruction)
5-EVENT ACTION
At the end of each event, the information is extracted by calling FindInteractingCrystal() function and associative container
(multimap and set methods) and the containers are cleared by calling the Clear() function.
6- STEPPING ACTION
The SteppingAction class is the one which is used to track the steps. In the stepping action, interaction information of the
photon with the crystal and the phantoms are extracted. The interaction information (such as energy deposition, blockID, crystalID, etc)
is passed into the Analysis.cc class, which outputs the result into an ASCII file.
Generation of the source (F-18 ion) is confined in the physical volume by killing the event in the SteppingAction class when it is out of
the physical volume.
7-ANALYSIS
In the doiPETAnalysis class, several realistic parameters are provided. Deadtime of the detector and/or module, efficiency of the detector,
crystal dependent energy resoltion, etc are provided. The parameters can be changed in the inputparameters.txt file.
***** Geant4 ROOT ANALYSIS
/Path/doiPET/build/ and type:
cmake -DWITH_ANALYSIS_USE=ON -DGeant4_DIR=/path/to/geant4_install_dir ../
***** How to run a simulation:
Be in the build director
/Path/doiPET/build/ cmake ../
/Path/doiPET/build/ make
/Path/doiPET/build/ ./doiPET run.mac
Simulation output:
ASCII and ROOT files are created depending on the type of the output format. The following information of the event is written in the output file:
EventID, BlockID, tangentialCrystalID, AxialCrystalID, DOI_ID, time, and Energy deposition in the crystal is written to the file as a list-mode format.
The user can choose to make the output either in singles or coincidence mode in the inputParameter.txt file as follows:
#Choose the type of output: singlesOutput or coincidenceOutput
TypeOfOutput: coincidenceOutput
- Use the code analysis.cpp to analyse the raw simulation output data stored in the "resultCoincidence.data" or "resultCoincidence.root" file.
Before compiling, change the option in the header whether to analyse ASCII or root file (e.g. to use root file #define UseROOT). Then complie the code
as follows:
Compile: g++ analysis.cpp -o analysis `root-config --cflags --libs`
Run: ./analysis
Then, the axial sensitivity will be saved in a CSV file, and the total sensitivty will be displayed in the screen.
The reference data for this example are in: https://bitbucket.org/AbdellaAhmed/doipet_advancedexample_referencedata
The user can compare his/her simulation results with this data, after elaborating them with the provided analysis scripts.
=================== end ====================
+214
View File
@@ -0,0 +1,214 @@
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
eROSITA fluorescence
--------------------
Authors:
Dieter Schlosser (pnSensor, Munich),
Georg Weidenspointner (MPE Garching and MPI Halbleiterlabor, Munich),
Maria Grazia Pia (INFN Genova)
Francesco Longo (INFN Trieste)
Polsini Andrea (Universita' degli studi di Trieste)
Main references:
M.G. Pia et al., 2009, "PIXE Simulation With Geant4",
IEEE Trans. Nucl. Sci., vol. 56, no. 6, pp. 3614-3649
N. Meidinger et al., 2010, "Development of the focal plane PNCCD
camera system for the X-ray space telescope eROSITA", Nuclear
Instruments and Methods in Physics Research A 624, 321-329
Web site:
http://www.ge.infn.it/geant4/physics/pixe/erosita.html
Contact person:
Francesco Longo, francesco.longo@ts.infn.it
---- OVERVIEW ----
This example demonstrates:
- the generation of XRF and PIXE,
- how to use different physics processes from those encompassed in the
Geant4 toolkit in a simulation application.
The examples/advanced/eRosita/application directory contains files pertinent
to the experimental simulation model.
The examples/advanced/eRosita/physics directory contains the original Geant4
low energy physics processes for electron and photon interactions based on the
EEDL/EPDL/EADL data libraries (along with their complementary files),
that are actively used in several experimental applications
(http://indico.cern.ch/contributionListDisplay.pi?confId=159659).
The physics capabilities and validation of the physics processes used in this example
are documented in the PHYSICS REFERENCES section below.
---- EXAMPLE DESCRIPTION ----
This is example is based on simulations of the instrumental background
of the eROSITA X-ray telescope, in particular the strength of
fluorescence lines inside the passive graded Z shield. The set-up
considered in this example consists of a Cu block that is irradiated
with protons. Impact ionization of Cu atoms generates vacancies in
atomic shells. These are then filled by atomic de-excitation,
resulting in the emission of fluorescence photons and Auger electrons
- the PIXE (particle induced X-ray emission) process. In particular
fluorescence photons are then detected with a Si CCD positioned next to
the Cu block.
The simulated set-up is defined in eRositaDetectorConstruction.
The Cu block is located at position x = y = z = 0 cm. Its dimensions
in x, y, and z are 0.5 cm * 0.5 cm * 3 cm. The CCD, represented by a
slab of Si, is positioned at x = z = 0 cm and y = 2 cm. The CCD dimensions
in x, y, z and are 4 cm * 450 mu_m * 4 cm.
The vertex and initial momenta of the protons are defined in
eRositaPrimaryGeneratorAction. The vertex is at x = 0 cm, y = 2.25
cm, and z = 4 cm. The initial direction of the protons is given by the
vector (0.0, -0.5, -1.0). The initial kinetic energy of the protons is
150 MeV.
The physics processes relevant to this simulation are defined in
eRositaPhysicsList. The key process for generation of PIXE is
G4hImpactIonisation. In the example, proton cross sections based on
the ECPSSR model are used. Cross sections are computed for an energy
range from 1 keV to 200 MeV. The energy thresholds for the production
of fluorescence photons and Auger electrons by PIXE are set to a value
of 250 eV.
The output of the example is an ASCII file named
TrackerPhotonEnergy.out. It contains the energy, in MeV, of every
photon that finds its way to the tracker (or which is created as a
secondary inside the tracker). If the batch mode example is run, the
entries 0.00798467, 0.00800571, and 0.00886534 correspond to Cu
fluorescence lines K_alpha2, K_alpha1, and K_beta1,
respectively. Other photons originate e.g. from bremsstrahlung of
delta rays in Cu. A histogram of the energies in
TrackerPhotonEnergy.out, in particular if generated for more protons,
clearly shows the PIXE photons from Cu on top of a continuous
distribution.
Instructions on how to build and run the example:
- To compile the example:
% cd eRosita
% make
If the environment variable G4WORKDIR and has been defined, an executable
named eRosita will be generated in $G4WORKDIR/bin/$G4SYSTEM
- To run the example:
Do not forget to define the G4PIIDATA environment variable as appropriate
to get access to the PIXE data library (e.g. G4PII1.1)
+ To run without visualisation (batch mode):
Go to $G4WORKDIR/bin/$G4SYSTEM
Copy the file eRosita/eRosita.in to this directory.
The input file eRosita.in defines a simulation with 1000 protons
of energy 100 MeV.
Start the simulation with: eRosita eRosita.in > eRosita.out
The resulting files eRosita.out and the ASCII output file
TrackerPhotonEnergy.out are included in the example. Format
and content of the output file are described below.
+ To run with visualisation:
Go to $G4WORKDIR/bin/$G4SYSTEM
Copy eRosita/vis.mac to this directory.
The macro file vis.mac calls the DAWN visualization driver to
display the simulation of 100 protons with energy 100 MeV.
An ASCII output file TrackerPhotonEnergy.out is created. However,
this file may be empty in case the first 100 protons do not
produce any fluorescence photons that reach the tracker.
---- HOW TO INCLUDE ALTERNATIVE PHYSICS PROCESSES IN A REGULAR GEANT4 BUILD ----
Users wishing the convenience of including the physics processes encompassed in the
example in a regularly built Geant4 library may consider the following workaround:
*** prior to compiling the local Geant4 installation ***
- copy the content of eRosita/physics/include/ and eRosita/physics/src/ to /source/processes/electromagnetic/pii/include/ and /source/processes/electromagnetic/pii/src/
- replace /source/processes/electromagnetic/pii/GNUmakefile with eRosita/physics/GNUmakefile
- compile the local Geant4 installation as usual (according to the instructions in Geant4 User Documentation)
cp $G4INSTALL/examples/advanced/eRosita/physics/include/*.* $G4INSTALL/source/processes/electromagnetic/pii/include/.
cp $G4INSTALL/examples/advanced/eRosita/physics/src/*.* $G4INSTALL/source/processes/electromagnetic/pii/src/.
cp $G4INSTALL/examples/advanced/eRosita/physics/GNUmakefile $G4INSTALL/source/processes/electromagnetic/pii/.
[then compile Geant4 as described in Geant4 User Documentation]
If one wishes to perform the above operation after having already compiled Geant4,
it is recommended to first remove the result of the existing compilation (by issuing
"make clean" in $G4INSTALL/source/); then one can proceed with the above instructions.
Do not forget to delete the content of $G4INSTALL/examples/advanced/eRosita/physics/include/
and $G4INSTALL/examples/advanced/eRosita/physics/src/, if you wish to exercise
the eRosita example after moving the physics files to the pii package.
---- PHYSICS REFERENCES ----
M.G. Pia et al.,
PIXE Simulation With Geant4,
IEEE Trans. Nucl. Sci., vol. 56, no. 6, pp. 3614-3649, 2009.
A. Lechner, M.G. Pia, M. Sudhakar,
Validation of Geant4 low energy electromagnetic processes against precision measurements of electron energy deposit,
IEEE Trans. Nucl. Sci., vol. 56, no. 2, pp. 398-416, 2009.
K. Amako et al.,
Comparison of Geant4 electromagnetic physics models against the NIST reference data,
IEEE Trans. Nucl. Sci., vol. 52, no. 4, pp. 910-918, 2005.
S. Guatelli, A. Mantero, B. Mascialino, P. Nieminen, M. G. Pia,
Geant4 Atomic Relaxation,
IEEE Trans. Nucl. Sci., vol. 54, no. 3, pp. 585-593, 2007.
M.G. Pia, P. Saracco, M. Sudhakar,
Validation of radiative transition probability calculations,
IEEE Trans. Nucl. Sci., vol. 56, no. 6, pp. 3650-3661, 2009.
S. Guatelli, A. Mantero, B. Mascialino, P. Nieminen, M. G. Pia, V. Zampichelli,
Validation of Geant4 Atomic Relaxation against the NIST Physical Reference Data,
IEEE Trans. Nucl. Sci., vol. 54, no. 3, pp. 594-603, 2007.
L. Peralta et al.,
A new low-energy bremsstrahlung generator for GEANT4,
Radiat. Prot. Dosim., vol. 116, no. 1-4, pp. 59-64, 2005.
F. Longo et al.,
New Geant4 Developments for Doppler Broadening Simulation in Compton Scattering - Development of Charge Transfer Simulation Models in Geant4,
Proc. IEEE Nuclear Science Symposium, Dresden, 2008.
S. Chauvie et al.,
Validation of the Bremsstrahlung Models of Geant4,
Proc. IEEE Nuclear Science Symposium, 2006.
S. Chauvie et al.,
Geant4 Low Energy Electromagnetic Physics,
The Monte Carlo Method: Versatility Unbounded in a Dynamic Computing World, American Nucl. Soc., LaGrange Park, IL, 2005.
S. Chauvie et al.,
Geant4 low energy electromagnetic physics,
Proc.Nuclear Science Symposium, 2004.
S. Chauvie et al.,
Geant4 Low Energy Electromagnetic Physics,
Proc. CHEP 2001.
J. Apostolakis, S. Giani, M. Maire, P. Nieminen, M.G. Pia, L. Urban,
Geant4 low energy electromagnetic models for electrons and photons
CERN-OPEN-99-034 and INFN/AE-99/18, 1999.
Further references are listed in http://www.ge.infn.it/geant4/papers/,
that also documents recent developments intended for future improvements
to Geant4, and their validation.
+157
View File
@@ -0,0 +1,157 @@
=========================================================
Geant4 - FastAerosol advanced example
=========================================================
README
---------------------
Authors:
Ara Knaian : ara@nklabs.com
Nate MacFadden: natemacfadden@gmail.com
NK Labs, LLC (http://www.nklabs.com)
Related Publication:
MacFadden, N., Knaian, A., 2020, "Efficient Modeling of Particle
Transport through Aerosols in GEANT4", Manuscript in preparation.
----------------------
Using the FastAerosol geometry classes, it is possible to efficiently
and accurately simulate particle transport through aerosols containing
billions of randomly-positioned droplets, using an ordinary workstation.
This example demonstrates the use of these classes. It is based off
exampleB1.
1- GEOMETRY DEFINITION
FADetectorConstruction builds a user-defined-shape aerosol of
non-intersecting, arbitrarily-shaped droplets. The default
bulk shape is a 500 x 500 x 5000 mm box centerred at the origin;
the default droplet shape is a r = 1 mm sphere. Intersection checking
for non-spherical droplets is performed with the droplet's bounding
raidus. These droplets are randomly placed in the bulk.
A 500 x 500 x 50 mm box-shaped aluminum detector is placed at
(0,0,2625) mm so that particles shot along +Z from (0,0,-2612.5) mm
travel through the aerosol before being captured in the detector.
The background material is atmospheric air at an altitude of 14 km.
The droplet material is liquid water.
2- AEROSOL MODELLING
The example can be configured to allow modeling of the aerosol using
one of three methods, to allow for benchmarking and testing.
The methods are (a) using the demonstrated FastAerosol class,
(b) using a single low-density volume, and (c) using parameterized
volumes. Alternating between these build methods can be done by
setting one of "/geometry/fastAerosolCloud", "/geometry/smoothCloud",
and "/geometry/parameterisedCloud" true for a, b, and c respectively.
By default, FastAerosol dynamically populates droplets in the bulk
as particles transport through it. This reduces memory consumption,
especially when the number of primaries is small compared to the
number of droplets. Pre-population is slower and uses more memory,
but allows saving the droplet distribution over the full volume.
Pre-population may be enabled using the "/geometery/prePopulate true"
UI command. The example saves the droplet positions in files called
"distribution_r???mm_n???mm-3.csv" where ??? denotes the droplet
radius and number density respectively).
User-specified distibution functions for droplet position and rotation
may be specified for FastAerosol simulations. Examples of this can be
found in lines 311-317 and 326-330 of FADetectorConstruction.cc.
The example can be configured to model the aerosol using a
G4PVParameterized object, instead of using FastAerosol object.
This can be used to demonstrate that FastAerosol gives nearly
identical transport results as parameterized geometery, but
achieves order-of-magnitude performance gains.
To build the aerosol as a G4PVParameterised object, a droplet
distribution is required. The example is set up to use the droplet
distribution automatically generated and saved by a previously-run
pre-populated FastAerosol simulation, as this allows better comparison
between the two classes. By default, the example looks for this
distribution under the file name "distribution_r???mm_n???mm-3.csv",
so the generated pre-populated FastAerosol distribution can be used
by simply running a pre-populated FastAerosol simulation with the
same geometry before running the parameterised simulation.
For comparison, the example can also be run using a single volume
containg air and water mixed together at the correct average density.
For small-enough droplets, this works well. However, it becomes
increasingly innacurate as the droplets appoach a critical size range,
which is about r = 1 mm for the materials and energies used in this
example. This demonstraties the need to model some aerosols at a
droplet level for accurate physics results.
2- PHYSICS LIST
This example uses the QGSP_BIC physics list. A global step length
limiter physics process is also included, because this can significantly
speed up calculations using FastAerosol when particle trajectories
curve due to the application of fields.
3- ACTION INITALIZATION
Nothing special.
4- PRIMARY GENERATOR
Particles are shot from (0,0,-2612.5) mm with a spread in X and Y of
+/-55 mm with momentum in the +z direction. The example shoots 50 MeV
protons by default.
5- DETECTOR RESPONSE
Scoring is done with a scoring grid, to allow histograms of the energy
deposited to allow comparison of the results between geometry modeling
methods.
6- SAMPLE EVALUATION
It is recommended to run the test.mac script for a test/sample
evaluation. This will simulate the transport of 100 protons (50 MeV)
through an aerosol. The default bulk shape is "box"; other allowed
shapes are "ellipsoid", "cylinder", and "pipe". All shapes are aligned
along the z axis and maximally sized to fit in the 500 x 500 x 5000 mm
bounding box.
By default, droplets are dynamically populated in the aerosol. One
can populate all droplets at the beginning of the simulation by
setting prePopulate to true. This saves the generated distribution
of droplet centers. One can also run the same experiment, except
modelling the aerosol as a parameterised solid, by setting
parameterisedCloud to true and FastAerosolCloud to false. This
requires a distribution of droplet centers; the one generated by a
pre-opulated FastAerosol simulation automatically works. One can
also simulate the cloud as a single average-density object by setting
FastAerosolCloud and parameterisedCloud to false and smoothCloud to
true.
7 - OUTPUT
The energy deposited into the aluminum detector by any particles is
measured with command line scoring by a 20 x 20 x 1 scoring grid
and saved via "/score/dumpQuantityToFile" as a csv file named
"eDep_FastAerosol_r1p0mm_n1E-3p7mm-3_bulkbox_dropletsphere.csv"
for the default aerosol build parameters.
The GNU program "/usr/bin/time" may be used measure the simulation
time and memory load. If simulating a pre-populated FastAerosol cloud,
the time to populate the cloud is printed at population time in the
program. This population time is also saved as
"popTime_r???mm_n???mm-3.csv".
The distribution of droplet centers is saved as
"distribution_r???mm_n???mm-3.csv" where each row of this csv file
corresponds to a droplet with the 1st, 2nd, and 3rd columns
corresponding the the x, y, and z position of it's center respectively.
8 - HOW TO RUN THE EXAMPLE
Batch mode: fastAerosol test.mac
Interactive mode: fastAerosol (init_vis.mac is executed to set-up visualisation)
+119
View File
@@ -0,0 +1,119 @@
==========================================================================================
Geant4 - GAMMAKNIFE example
==========================================================================================
README file
--------------------------------------------
AUTHORS:
F.Romano* (a)
PAST AUTHORS:
J. Pipek (c), A. Varisano (b), G.Russo (e), G.A.P. Cirrone (b), M.Russo (e), G. Cuttone (b), M.G.Sabini (d)
(a) INFN - Sezione di Catania, Catania, Italy
(b) INFN - Laboratori Nazionali del Sud, Catania, Italy
(c) Faculty of Nuclear Sciences and Physical Engineering, Czech Technical University, Czech Republic
(d) UOS Fisica Sanitaria, Ospedale Cannizzaro, Catania, Italy
(e) Fondazione Istituto San Raffaele G.Giglio, Cefalù (Palermo), Italy
*Corresponding author, email to francesco.romano@ct.infn.it
-------------------------------------------------------------------------------------------------
----> INTRODUCTION.
The GAMMAKNIFE example is a Geant4 application specifically developed to simulate an advanced device for Stereotactic Radiosurgery. In particular, the example reproduces a Leksell Gamma-Knife unit model C, currently active at the Cannizzaro Hospital in Catania. Gamma-Knife Stereotactic Radiosurgery allows in a single session accurate external irradiations with high dose and sharp dose gradient to minimize radiation doses given to adjacent critical brain structures. The unit consists of a cast iron body containing 201 Co60 sources in a hemispherical arrangement. Beams of gamma radiation, coming from different directions focus through a collimation system at the isocentre, where the target volume is positioned.
This example allows to simulate the main components of a Gamma-Knife unit: the source, collimation system and also a spherical phantom used for routinely measurements. All the four available final collimators are reproduced and its dimension can be changed run-time by a macro command. The energy deposited distribution is computed at the end of the simulation in a voxellized geometry, using scoring mesh. GAMMAKNIFE example exploits original solutions for the sources device simulation, providing a very simple configuration of the geometry and primary events: a single source is, indeed, simulated (instead of 201) and the scoring mesh (placed in a spherical water phantom) is rotated at 201 angles correspondent to the real angular displacement of the sources in the device. This is possible thanks to the symmetry of the source positions respect to the isocentre.
The GAMMAKNIFE example has been recently migrated to multi-thread. Thus, according to the number of cores, you can choose the number of threads using the following command:
/run/numberOfThreads <nThread>
The GAMMAKNIFE example contains the following subfolders and files:
- /src: where source .cc files are stored
- /include: where header .hh files are stored
- README file
- MachineAngle.in, where the angular positions of the specific unit model are tabulated
- defaultMacro.mac, where visualization is included and a simple run with few events is done
- simulation.mac, where a whole simulation is performed, changing all the 201 angular positions, storing the deposited energy for each run and saving the total energy deposted at the end of the simulation.
----> INSTALLATION
GAMMAKNIFE source is currently released inside the official distribution of the Geant4 toolkit in the $G4INSTALL/examples/advanced folder.
To run GAMMAKNIFE you must first install the Geant4 package. Once Geant4 is installed, the example must be first compiled. When compilation has been completed the program can be executed.
A complete guide for the Geant4 installation in different operating systems can be found inside the official installation Geant4 pages.
If some troubles are faced with the Geant4 installation please send an e-mail to us.
----> HOW TO RUN THE EXAMPLE
The defaultMacro.mac is executed if no macro file is specified.
For a realistic simulation of the Gamma-Knife device, including the irradiation of all the sources, the macro simulation.mac has to be used, defining the number of particles shooted per each angle (that is, for each "source"). The following commands have to be used to this aim:
/gammaknife/loadAngles MachineAngle.in --> rotation agles file is called
/gammaknife/beamOn <number-of-events> --> <number-of-events> are shooted for each angle
----> PRIMARY EVENTS GENERATION
The primary particle beam parameter are:
- energy of gamma: 1.17 and 1.33 MeV with the same probability
- X Y Z positions sampled in a cylinder 20 mm lenght and 1 mm of radius
- angular biasing within an angle of 3 degree: it has been checked not to influence final results (respect to a 4p isotropic sampling) drastically decreasing computatuin time
GPS (General Particle Source) class is used to generate the primary events.The GPS.in macro is called and executed when yoo use bot simulation.mac and defaultMacro.mac macro.
----> GEOMETRICAL SET-UP.
The Gamma-Knife unit consists of a cast-iron body containing the 60Co sources and the collimation system. Sources are displaced along five parallel rings at the same distance from the isocentre. Depending on the specific ring, sources are located with a different spacing, respectively with an angle of 7.6◦, 8◦, 9◦, 9◦ and 10◦. These angles represent the rotation angles of the scoring mesh (contained in the MachineAngle.in file). Gamma radiation (1.17 and 1.33 MeV), emitted by Co60 sources arranged in a hemispherical shape, focuses on the isocentre, located 401 mm far from the source. The radiation beam is collimated by means of fixed and mobile collimation systems in order to obtain four possible beam diameters at the isocentre: 4, 8, 14 and 18 mm.
The elements simulated are:
- cobalt cylinder source (20 mm length, 1 mm radius)
- a stainless steel covering of the source
- a first tungsten cylindrical collimator (65 mm length)
- a second truncate cone lead collimator (92.5 mm lenght)
- final truncated cone tungsten collimator (60 mm lenght), with four available final apertures simulating the mobile helmet
- tungsten, iron and stainless steel surrounding the collimation system for shielding
- a spherical water phantom (8 mm radius) simulating the phantom typically used for dosimetrical measurements and routinely quality check
To change the diameter of the final truncated collimator (mobile helmet) the following command has to be used for chaching the diameter:
/calorimeter/helmetSize <diameter in mm>
Notice that, as in the real device, only four final diameters are allowed: 4, 8, 14 and 18 mm. These are not the physical apertures of the diameter but represent the final diameter of the beam at the isocentre. In the GammaKnifeDetectorConstruction::UpdateHelmet() method more details can be found in this concern.
Important note: the GAMMAKNIFE application is meant as an example of simulation of a device for Stereotactic Radiosurgery. Thus, all the main geometrical features of the Gamma-Knife device are accurately simulated but the geometrical displecement of the some elements is not exactly correspondent to the real one, because covered by a patent. In case you need detailed geometrical information, please contact the Elekta Company.
----> PHYSICS
Local PhysicsList is activated by default (GammaKnifePhysicsList.cc), which includes the G4EmStandardPhysics_option3.
Anyhow, it is recommended the use of the Reference Physics List QGSP_BIC_EMY, which is the suggested on for medical applications.
----> VISUALISATION
The user can visualise the experimental set-up with OpenGL, DAWN and vrml.
----> SIMULATION OUTPUT
At the end of the simulation the energy deposited in each voxel of the scoring mesh inside the spherical phantom is registered in the eDep_scorer.out file. Default voxelization is 45 x 45 x 45 cubic voxels 1 mm of side. User can change dimension and shape of box the mesh and the voxel.
Alternatively, the dose deposited can be also stored using the appropriate scoring commands
---------------------------------------------------------------------------
For comments, advices and questions please contact:
francesco.romano@ct.infn.it
last modified: F.Romano, 03/11/2020
+291
View File
@@ -0,0 +1,291 @@
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
gammaray_telescope
------------------
F.Longo, R.Giannitrapani & G.Santin
June 2003
--------------------------------------------------------------
Acknowledgments to GEANT4 people, in particular to R.Nartallo,
A.Pfeiffer, M.G.Pia and G.Cosmo
--------------------------------------------------------------
GammaRayTel is an example of application of Geant4 in a space
envinronment. It simulates a typical telescope for gamma ray analysis;
the detector setup is composed by a tracker made with silicon planes,
subdivided in ladders and strips, a CsI calorimeter and an
anticoincidence system. In this version, the three detectors are made
sensitive but only the hits on the tracker strips are registered and relevant
information (energy deposition, position etc) are dumped to an external
ASCII file for subsequent analysis.
Relevant information from the simulation is processed in the GammarayTelAnalysis
class and saved, through the G4AnalysisManager interface, to Histograms and
Tuples.
a) Macros for the visualization of geometry and tracks with
OpenGL, VRML and DAWN drivers
b) Implementation of messengers to change some parameters of
the detector geometry, the particle generator and the analysis
manager (if present) runtime
c) Readout geometry mechanism to describe an high number of
subdivisions of the planes of the tracker (strips) without
affecting in a relevant way the simulation performances
d) Histogramming facilities are presently provided through the G4AnalysisManager class.
e) User interfaces via Xmotif or normal terminal provided
1. Setting up the environment variables
---------------------------------------
- Setup for storing ASCII data
If you want to store the output data in an ASCII file 'Tracks_x.dat'
where x stays for the run number. You should specify the environment
variable:
setenv G4STORE_DATA 1
- Setup for Visualization
IMPORTANT: be sure that your Geant4 installation has been done
with the proper visualization drivers; for details please see the
file geant4/source/visualization/README.
To use the visualization drivers set the following variables in
your local environment:
setenv G4VIS_USE_OPENGLX 1 # OpenGL visualization
setenv G4VIS_USE_DAWNFILE 1 # DAWN file
setenv G4VIS_USE_VRMLFILE 1 # VRML file
setenv G4VRMLFILE_VIEWER vrmlview # If installed
- Setup for Xmotif user interface
setenv G4UI_USE_XM 1
- Set up for analysis
To compile the GammaRayTel example with the analysis tools activated,
set the following variables
setenv G4ANALYSIS_USE 1 # Use the analysis tools
2. Sample run
-------------
To run a sample simulation with gamma tracks interacting with
the detector in its standard configuration and without any
visualization, execute the following command in the example main
directory:
$G4WORKDIR/bin/$G4SYSTEM/GammaRayTel
It is possible also to run three different configuration defined in
macro1.mac, macro2.mac and macro3.mac for visualization (OpenGL, VRML
and DAWN respectively) with the following command
$G4WORKDIR/bin/$G4SYSTEM/GammaRayTel macroX.mac
where X can be 1, 2 or 3. Be sure to have the right environment (see
the preceding section) and the proper visualization driver enabled in
your local G4 installation (see geant4/source/visualization/README for
more information).
3. Detector description
-----------------------
The detector is defined in GammaRayTelDetectorConstruction.cc
It is composed of a Payload with three main detectors, a Tracker (TKR), a
Calorimeter (CAL) and an Anticoincidence system (ACD).
The standard configuration is made of a TKR of 15 Layers of 2 views made of
4*4 Si single sided silicon detectors with Lead converter, and a CAL of
5 layers of CsI, each made of 2 views of 12 CsI bars orthogonally posed.
4 lateral panels and a top layer of plastic scintillator (ACL and ACT)
complete the configuration.
The Si detectors are composed of two silicon planes subdivided in strips
aligned along the X axis in one plane and along the Y axis for the other.
The following baseline configuration is adopted:
GEOMETRICAL PARAMETER VALUE
Converter thickness 300 microns
Silicon Thickness 400 microns
Silicon Tile Size XY 9 cm
Silicon Pitch 200.micrometer
Views Distance 1. mm
CAL Bar Thickness 1.5 cm
ACD Thickness 1. cm
It is possible to modify in some way this configuration using the
commands defined in GammaRayTelDetectorMessenger.
This feature is available in the UI throught the commands subtree
"/payload/" (see the help command in the UI for more information).
4. Physics processes
--------------------
This example uses a modular physics list, with a sample of Hadronic processes
(see the web page http://cmsdoc.cern.ch/~hpw/GHAD/HomePage/ for more adeguate
physics lists), the Standard or the LowEnergy Electromagnetic processes.
5. Particle Generator
---------------------
The GammaRayTelParticleGenerationAction and its Messenger let the user define
the incident flux of particles, from a specific direction or from an
isotropic background. In the first case particles are generated on a spherical
surface which diameter is perpendicular to the arrival direction. In the second
case the arrival directions are isotropic.
The user can define also between two spectral options:
monochromatic or with a power-law dependence. The particle
generator parameters are accessible throught the UI tree "/gun/" (use the
UI help for more information). We are planning to include, in the next
releases of this example, the General Particle Source module of G4.
6. Hit
------
In this version the hits from the TKR the CAL and the ACD are generated.
Only the hit from the TRK are saved. Each TKR hit contains the following
information
a) ID of the event (this is important for multiple events run)
b) Energy deposition of the particle in the strip (keV)
c) Number of the strip
d) Number of the plane
e) Type of the plane (1=X 0=Y)
f) Position of the hit (x,y,z) in the reference frame of the payload
The hit information are saved on an ASCII file named Tracks_N.dat, where
N is the progressive ID number associated to the run.
7. Analysis
----------------
Relevant information from the simulation is processed in the GammarayTelAnalysis
class and saved, through the G4AnalysisManager interface, to Histograms and
Tuples. The output file is written in ROOT format, but one can easily switch to
XML (or Hbook) by changing the appropriate #include in GammarayTelAnalysis.hh
No external software is required (apart from the hbook case, in which the CERNLIB
must be installed and a FORTRAN compiler must be present)
Keep in mind that the actual implementation of the analysis tools in GammaRayTel
is of a pedagogical nature, so we kept it as simple as possible.
The actual analysis produces some histograms (see next section) and an ntuple.
Both the histograms and the ntuple are saved at the end of the run in the file
"gammaraytel.root". Please note that in a multiple run session,
the last run always override the root file.
8. Histogramming
----------------
The 1D histograms contain the energy deposition in the last X plane of
the TKR and the hits distribution along the X planes of the TKR
(note again that these histograms have been chosen more for pedagogical
motivation than for physical one).
These histograms are filled and updated at every event and are initialized
with each new run; the scale of the histograms is automatically derived from
the detector geometry.
Throught a messenger it is possible to set some options with
the UI subtree "/analysis/" (use the UI help for more info);
In this example we only show the use of very basic feature of this new
simulation/analysis framework.
9. Digi
--------
For the TKR also the digits corresponding to the Hits are generated.
A digi is generated when the hit energy deposit is greater than a threshold
(in this example setted at 120 keV).
The TKR digi information are stored on the same file Tracks_N.dat and contain:
a) ID of the event (this is important for multiple events run)
b) Number of the strip
c) Number of the plane
d) Type of the plane (1=X 0=Y)
10. Classes Overview
-------------------
This is the overview of the classes defined in this example
GammaRayTelPrimaryGeneratorAction
User action for primaries generator
GammaRayTelPrimaryGeneratorMessenger
Messenger for interactive particle generator
parameters modification via the User Interface
GammaRayTelPhysicsList
Determination of modular physics classes
GammaRayTelDetectorConstruction
Geometry and material definitions for the detector
GammaRayTelDetectorMessenger
Messenger for interactive geometry parameters
modification via the User Interface
GammaRayTelAnalysis
Analysis manager class (experimental)
GammaRayTelAnalysisMessenger
Messenger for interactive analysis options modification
via the User Interface
GammaRayTelRunAction
User run action class
GammaRayTelEventAction
User event action class
GammaRayTelTrackerHit
Description of the hits on the tracker
GammaRayTelDigi
Description of the digi on the tracker
GammaRayTelDigitizer
Description of the digitizer for the tracker
GammaRayTelTrackerSD
Description of the TKR sensitive detector
GammaRayTelAnticoincidenceHit
Description of the hits on the anticoincidence
GammaRayTelAnticoincidenceSD
Description of the ACD sensitive detector
GammaRayTelCalorimeterHit
Description of the hits on the calorimeter
GammaRayTelCalorimeterSD
Description of the CAL sensitive detector
+106
View File
@@ -0,0 +1,106 @@
========================================================
GORAD - Geant4 Open-source Radiation Analysis and Design
========================================================
First release : September 2020 with Geant4 version 10.7
Author : Makoto Asai (SLAC National Accelerator Laboratory)
Introduction
------------
Gorad (Geant4 Open-sourced Radiation Analysis and Design) is meant to be
a turn-key application for radiation analysis and spacecraft design built
on top of Geant4. Simulation geometry should be provided in the form of GDML.
Gorad is controlled by UI commands, and it works both in interactive mode
with Qt window and in batch mode with an input macro file.
The current Gorad requires Geant4 version 10.7 (release of December 2020).
It does not work with earlier version of Geant4. Geant4 has to be installed
with multithreading mode and GDML interface enabled. Qt is also recommended
for the use of Gorad in interactive mode. Geant4 GDML interface requires
Xerces-C++ version 3 or higher. Xerces-C++ has to be compiled with the same
compiler Geant4 is compiled. Please refer to the Geant4 installation guide
for enabling these options.
Building and running Gorad
--------------------------
To compile and run Gorad, all the Geant4 environment variables have to be
properly set. Use the shell script in the Geant4 installation directory.
Compilation of Gorad requires cmake and make same as the compilation of
Geant4 itself.
$ source $G4INSTALL/bin/geant4.(c)sh
$ cmake .
$ make
To run Gorad in interactive mode,
$ ./gorad
and then, in the keyboard input field, type
/control/execute <macroFile>
The user may also use any UI commands shown in the left side menu of the
Qt window.
To run Gorad in batch mode,
$ ./gorad <macroFIle>
A sample macro file
-------------------
Associated macro file "run.mac" can be used for both interactive mode
and batch mode. It uses a simple cone-shaped geometry (simpleCone.gdml)
and King Solar Proton Fluence model (https://doi.org/10.2514/3.62088).
It employs both primary particle generation biasing and geometry
importance biasing. This sample macro file defines a probe filled by
water located at the center of the world volume with dose and flux
scorers.
If this sample macro file is used in interactive mode, it also sets up
visualization (through vis.mac). After executing this sample macro, the
user can start an event loop with /run/beamOn command.
If this sample macro file is used in batch mode, it defines 4 histograms.
After the event loop, These histograms are dumped to corresponding files
and also plotted to a Postscript file. Scores of the dose and flux scorers
are also dumped into an output file. In batch mode, this macro executes
one million events.
Gorad manual and additional GDML file
-------------------------------------
Details of the sample macro file and available alternative commands are
described in the full manual downloadable from the following URL. Also,
additional sample GDML file of partial and simplified Orion Spacecraft
is available at the following URL. This is a sample input and it is not
mandatory to execute Gorad.
https://twiki.cern.ch/twiki/bin/view/Geant4/AdvancedExamplesGorad
Known warning messages while processing a GDML file
---------------------------------------------------
If the input GDML file uses some material names defined in G4NISTManager,
these names are unrecognizable by the GDML perser itself and cause
warning messages. For example
G4GDML: VALIDATION ERROR! ID attribute 'G4_AIR' is referenced but was
never declared at line: XX
These messages are harmless and these materials are properly interpreted
once they are set to G4LogicalVolume.
Acknowledgements
----------------
Development of Gorad is funded by NASA Johnson Space Center (JSC) under
the contract NNJ15HK11B.
+455
View File
@@ -0,0 +1,455 @@
=========================================================
Text version of the Hadrontherapy README file
=========================================================
Last revision:
Released with the Geant4 10.7 version (December 2020)
------------------------------------------------------------------------------------------------
ADVERTISEMENT: this is the text version of the README file of the 'basic' hadrontherapy,
as it has been released in the Geant4 10.7 release
Visit the Hadrontherapy web site (https://twiki.cern.ch/twiki/bin/view/Geant4/AdvancedExamplesHadrontherapy) to request
the complete version of this program, together with its documentation;
'hadrontherapy' (both basic and full version) is supported by the Italian INFN
Institute in the framework of the MC-INFN Group
-------------------------------------------------------------------------------------------------
=========================================================
HADRONTHERAPY
=========================================================
==========> MAIN AUTHORS <==========
G.A.P. Cirrone(a)*, L. Pandola(a), G.Milluzzo(a), G.Petringa(a)
==========> PAST AUTHORS <==========
J.Pipek(a),R. Calcagno(a), G.Cuttone(a),G.Danielsen (b), F.Di Rosa(a), S.Guatelli(c), A.Heikkinen(b), P.Kaitaniemi(b),
A.Lechner(d), S.E.Mazzaglia(a), M.G.Pia(e), F.Romano(f), G.Russo(a), M.Russo(a), A.Varisano(a), A. Tramontana (a,f)
(a) Laboratori Nazionali del Sud of the INFN, Catania, Italy
(b) Helsinki Institute of Physics, Helsinki, Finland
(c) University of Wollongong, Australia
(d) CERN, (CH)
(e) INFN Section of Genova, Genova, Italy
(f) Physics and Astronomy Department, University of Catania, Catania, Italy
*Corresponding author, email to: cirrone@lns.infn.it
-------------------------------------------------------------------------------------------------
HADRONTHERAPY:
WHAT IT IS, WHAT IT DOES AND WHAT IT WILL PROVIDE
===================================================
'hadrontherapy' is a Geant4-based application specifically developed to address typical needs related to proton and ion therapy.
Its first release was in 2004. At that time 'hadrontherapy' was only capable of simulating a well-specified proton therapy facility: the passive transport beam line installed at Laboratori Nazionali del Sud (INFN) in Catania, Italy.
Today Hadrontherapy, except that it is in continuous development, is more flexible and shows many additional capabilities with respect to the past.
Its geometrical set-up, for example, is now completely interchangeable permitting a simple switch between different geometrical configurations, which all share the same phantom (sensitive detector) with the related features.
It is possible to do a simulation of a generic proton/ion transport beam line and laser-driven beam line. In this release, a module for dose average LET and RBE computations have been also included.
The configurations are:
- Passive proton beam line, which is installed at the LNS-INFN facility in Catania for eye tumor treatment with protons at 62 MeV. It is simulated in PassiveProtonBeamLine.cc; (G.A.P. Cirrone et al., IEEE Nuclear Science Symposium Conference Record, 2003, 3, pp. 1756-1758, J2-5)
- Passive carbon beam line, which is the simulation of the transport beam line at LNS-INFN of Catania for experiments with ion beams (Carbon, Oxygen and Helium). It is simulated in PassiveCarbonBeamLine.cc;
- Laser-driven beam line, which is the simulation of a beam line for the focusing, the handling and the transport of a laser-driven beam, a Faraday Cup is the eligible detector for this class. It is simulated in LaserDrivenBeamLine.cc;
(A.Tramontana et al., A transport beamline solution for laser-driven proton beams
6th International Particle Accelerator Conference, IPAC 2015, 2015, pp. 2515-2518)
- TIFPA passive proton beam line, which is installed at the Protontherapy Center of Trento (Italy), used for experiments with proton beams. Geometry is implemented in HadrontherapyTIFPAPassiveProtonBeamLine.cc
(F.Tommasino et al., A new facility for proton radiobiology at the Trento proton therapy centre: Design and implementation, Physica Medica 58 (2019) 99106)
- BEST passive proton beam line is the beamline INFN-LNS is developing for the BEST Cyclotron company for eye tumor treatment with 70 MeV protons. The geometry is implemented in BESTPassiveProtonBeamline.cc.
In PassiveProtonBeamLine.cc, in PassiveCarbonBeamLine.cc, in LaserDrivenBeamLine.cc,in HadrontherapyTIFPAPassiveProtonBeamLine.cc and in BESTPassiveProtonBeamline.cc, the user can change the geometrical characteristics of beam line elements.
Alternatively, the user can use the macro file.
Folder structure of 'hadrontherapy'
'hadrontherapy' distribution contain different sub-folders:
\src: where source .cc files are stored
\include: where header .hh files are stored
\macro: where a set of ready-to-use macro files are provided
\field: where a set of ready-to-use.TABLE files are provided. These files are generated from OPERA & COMSOL codes for the laser-driven beam line.
\experimentalData: in this directory, a set of reference (both experimental and analytical) data are stored.
\data\rbe: contains the file lem1.csv including the alpha and beta values and rbe resulted from the radiobiological Local Effect Model (LEM) for three cell lines ( AG01522, U87 and HSG)
Description of the \macro folder
Inside the "macro" folder, different macro files are provided.
In particular, five macro files are related to the different beam lines:
defaultMacro.mac: permits to run a simulation using the default geometry, i.e. the CATANA proton beam line in Catania. A 62 MeV gaussian proton beam with 0.25 MeV sigma and 0.028° as divergence (sigma) is launched.
You can modify by macro the range shifter thickness you
want to select. The entrance of the phantom is positioned at the isocentre ( (0,0,0)
coordinates). LET and RBE computation are activated.
carbon_beamline.mac: reproduces a simple passive beam line for the use of carbon, oxygen and helium ion beams for multidisciplinary applications (selectGeometry Carbon). A parallel 62 MeV/u carbon beam with 0.740 MeV/u sigma is simulated.
laserDrivenBeamline.mac: simulates a typical laser-driven proton spectrum as input for a beam line made of a quadrupole system, an energy selector and a Faraday Cup (selectGeometry LaserDriven)
Trento_parameters.mac: reproduces the experimental beam line installed at the Trento protontherapy centre and implements a typical source.
BestBeamLine.mac: implements the elements of the beam line developed for the BEST company and simulates a 70 MeV proton beam as input of the simulation. Dose and LET longitudinal distributions are computed at the isocentre and a native dose scorer is also added to retrieve the lateral dose profiles.
3 additional macro files are also included:
modulatorMacro.mac : allows the reconstruction of the spread out bragg peak modulating the proton beams by means of a rotating modulator wheel. The wheel is rotated of 1 degree at each run and 1000 protons are simulated in each run.
stoppingPowers.mac : calculates the stopping power of protons and alpha particles in the energy range between 1 keV up to 200 MeV
detectorGeometry.mac : example of how to modify the detector geometry
The main folder also includes an additional macro file, batch.mac which runs a simple simulation using the default geometry of the CATANA beamline.This macro is also used during the system testing process.
DOWNLOAD AND INSTALLATION
===================================================
'hadrontherapy' source code is released inside the distribution of the Geant4 toolkit in the $G4INSTALL/examples/advanced folder.
To run 'hadrontherapy' you must first install the Geant4 package. Once Geant4 is installed, the example must be first compiled. When the compilation is completed the program can be executed.
A complete guide for the Geant4 installation in different operating systems can be found inside the official installation Geant4 pages.
A CMakeLists.txt file (preferred) is provided together with a standard GNUmakefile for compilation.
GEOMETRIC SET-UP
===================================================
The idea of 'hadrontherapy' is to provide a tool useful for Users interested in the field of proton and ion therapy. These can include the simple calculation of dose distribution curves in water or other materials, the derivation of important transport parameters (stopping powers, ranges, etc.) in different geometrical set-ups and for different materials, up to the complete simulation of a real transport beam line for therapy.
The main component of the simulation is the phantom, a box that can be filled with different materials and where the scoring of different information (at moment the dose deposited in voxels) can be performed. A more complete description of the phantom is given in the next subsection.
All these configurations will be set using macro commands.
There is also a feature that allows the user to make a choice between alternative geometry set-ups. This can be done by using the command:
/geometrySetup/selectGeometry <name>
where <name> is either "default" for the standard 'hadrontherapy' geometry, "Carbon" for INFN-LNS transport beam line, normally used for interdisciplinary researches at LNS-INFN in Catania with carbon and other ion beams, "LaserDriven" for the laser-driven beam line, "TrentoLine" for the TIFPA beam line and "BESTBeamLine" for the beam line designed for the BEST company.
At the end of the beam line a phantom (a box of uniform material) is reproduced. Inside it, a user-defined region is divided into cubic and identical voxels. The voxel size can be varied as well as the voxelized region.
At the end of a simulation run, the dose deposited by primaries and secondaries in each voxel is collected. This information is available as an .out file.
The default size of the active voxelized region is 40x40x40 mm and actually the default voxel configuration is 200 x 1 x 1, which means 200 slices with 0.2 mm of thickness.
Of course, this default can be modified in order to obtain, for example, a matrix of 80x80x80 cubic voxels each with a lateral dimension of 0.5 mm.
Concerning the cut and stepMax values, the default configuration implies a cut value of 1 mm in the whole world (use the command /run/setCut <length> in order to set the cut for all, and the command /run/setCutForRegion <name> <length> to set the cut for the desired volume (<name>) only) and a stepMax of 0.01 mm just in the phantom and in other volumes of the laser-driven beam line (use the command /Step/waterPhantomStepMax 0.01 mm).
In any case, it is strongly recommended to use a stepMax value not bigger than 5% of the dose slice thickness.
THE PROTON PASSIVE LINE CLASS FILE
===================================================
The following is the description of the elements of the passive proton beam line of the INFN, Laboratori Nazionali del Sud in Catania (I). This line is completely simulated inside this class.
The main elements are:
* The SCATTERING SYSTEM: to transversally enlarge the original beam
* The COLLIMATORS: placed along the beam line to collimate the beam;
* The RANGE SHIFTERS: to decrease the energy of the primary proton beam to a specific value;
* The MODULATOR WHEEL: to modulate the energy of the primary and mono-energetic beam into a wide spectrum. The energy modulation is necessary to homogeneously irradiate a tumour volume that can extend in depth up to 20 mm;
* The MONITOR CHAMBERS: very thin ionisation chamber that permits the dose monitoring during the patient irradiation;
* The MOPI detector: microstrips, air-free detector utilised for the check of the beam symmetry during the treatment;
* The PATIENT COLLIMATOR: a brass, tumour-shaped collimator able to confine the proton irradiation field to irradiate just the tumour mass in the transverse direction;
The user can vary, via messenger, almost all the geometrical characteristics of the beam line elements (i.e. their position along the beam line, their thickness, etc.).
The elements simulated in the PassiveBeamLine.cc file are:
1. A scattering system, to spread geometrically the beam;
2. A system of collimators, to avoid the scattering radiation;
3. A modulation system that spreads the beam in energy and produces the so-called spread-out Bragg peak; It is constituted by a rotating wheel of different thicknesses. The wheel rotates around its axis (parallel to the proton beam axis) and its movement can be obtained employing a messenger between runs.
4. A set of monitor chambers (special transmission ionization chambers used to control the particle flux during the irradiation);
5. A final long collimator and a patient collimator defining the final shape of the beam before reaching the patient.
6. A water phantom: it is a box of water where the dose deposit is calculated. The use of the water phantom is required by the international protocol on the measure of dose in the case of proton and ion beams (IAEA 398, 2000).
THE CARBON PASSIVE LINE CLASS FILE
===================================================
The PassiveCarbonBeamLine.cc class implements the Zero Degree (ZD) beamline installed at LNS-INFN and entirely dedicated to in-air irradiation with ion beams (Z > 1, E ≤ 80AMeV ).
The beam line is composed of an exit 50 um Kapton window which separates the in vacuum pipe from the in air section. The beam then hits a scattering system composed by a 20 um tantalum foil and a brass central stopper. Moreover, two different systems for the beam modulation energy are simulated reproducing the available systems at LNS-INFN: a ripple filter specifically designed for 62 AMeV carbon ion beams and a ridge filter designed for 62 AMeV helium and oxygen ion beams. A transmission monitor ionization chamber providing the on-line monitoring of the delivered dose is also simulated.
The final collimator system is then composed by a brass tube (50 cm long and 27 mm in diameter) and a brass collimator with a variable in diameter from a maximum of 27 mm to 1 mm.
RIDGE FILTER
The ridge filter consists in a 2D array of pins, whose the shape and the thickness is optimized to obtain the desired SOBP.
The developed and simulated ridge filter is composed of 900 pins, each having a square base of 1.7 x 1.7 mm2 and height of 4.72 mm. The material chosen for its realization was plastic (C21 O4 N24) with a density of 1.18 g/cm3. The filter was designed and produced thanks to a collaboration between the INFN-LNS group and the GSI, Darmstadt(D). The reconstruction of the ridge geometry was obtained by superimposed native structures (with a trapezoid shape) already presented in Geant4 (G4Trp).
RIPPLE FILTERS
===================================================
Due to the native norrower bragg peak of carbon ions with respect to protons, a configuration with two ripple filters is the most suggested for realizing a SOBP.
This solution was adopted at the ZD beam line and implemented in the simulation to obtain a flat longitudinal dose profile with carbon ions: the first filter is positioned at 7 cm from the exit window and the second one at 10 cm from the first. A single structure has a triangular section with a thin base of plexiglass (200 mm x 200 mm x 0.3 mm) and a basis 3 mm in thickness. The material density is 1.19 g/cm3.
LASER DRIVEN PROTON BEAMLINE
===================================================
Nowadays a big effort is being devoted to optically accelerate charged particles. There are several ion acceleration regimes that are being discussed in literature, but up to now the most experimentally investigated is the Target Normal Sheath Acceleration (TNSA) one.
The beam transport and focusing as well as the energy selection of these laser produced beams represents one of the critical points in order to make such beams suitable for clinical applications. In fact, in contrast to conventional accelerators, the beams produced by high intensity laser-matter interaction are typically characterized by a wide angular divergence (for example ± 25 degrees) and a 100 % energy spread.
Moreover due to the high current, conventional dosimetric systems cannot be used during the experimental sections (saturation issues) and for this reason the faraday cup detector has been proposed as the elegible absolute dosimetric device.
The following is the description of the elements of the laser-driven beam line. This line is completely simulated inside this class.
The main elements are:
* The QUADRUPOLES SYSTEM: made of four quadrupoles, to focus/defocus protons with a different energy;
* The COLLIMATORS: placed along the beam line to collimate the beam;
* The ENERGY SELECTOR SYSTEM: made of four dipoles, that provide the spatial separation of charged particles with different energies;
* The FARADAY CUP: that provide the charge measurement and the distribution of the secondary electrons;
The user can have the possibility to vary, via messenger, many characteristics of the beam line elements (i.e. their position along the beam line, their thickness, etc.).
- /LaserDriven/EnergySelector/Disable -> to disable the Energy Selector
- /LaserDriven/EnergySelector/FirstCollimator/Radius <value> -> to set the Radius of the first collimator
- /LaserDriven/EnergySelector/FirstCollimator/thickness <value> -> to set the Thickness of the first collimator
- /LaserDriven/EnergySelector/FirstCollimator/zPosizion <value> -> to set the position of the first collimator hole along the radial plane
- /LaserDriven/EnergySelector/SecondCollimator/Radius <value> -> to set the Radius of the second collimator
- /LaserDriven/EnergySelector/SecondCollimator/thickness <value> -> to set the Thickness of the second collimator
- /LaserDriven/EnergySelector/SecondCollimator/zPosizion <value> -> to set the position of the second collimator hole along the radial plane
- /LaserDriven/EnergySelector/Slit/thickness <value> -> to set the Thickness of the slit, maximum value 10mm for geometric constraintconstrain
- /LaserDriven/EnergySelector/Slit/HoleDimensionY <value> -> to set the Y dimension of the Slit Hole
- /LaserDriven/EnergySelector/Slit/HoleDimensionZ <value> -> to set the Z dimension of the Slit Hole
- /LaserDriven/EnergySelector/Slit/HolePositionZ <value> -> to set the Slit hole position in the Z direction as respect the Slit body center
- /LaserDriven/Quadrupoles/DisableQuad -> to disable the Quadrupole system
PHYSICS PROCESSES AND PHYSICS MODELS IMPLEMENTATION
===================================================
Physics models in 'hadrontherapy', following the Geant4 organization, can be defined using four different approaches:
Particular care is addressed to the simulation of the physics processes.
Three different approaches can be used for the choose of the physic models.
Approach 1:
Using the macro command:
/physic/addPhysics/<physics List name>.
In this case, the models (for electromagnetic, hadronic elastic and hadronic inelastic) can be
activated directly calling the name of the Physics Lists that are available inside the
Geant4 kernel in the directory:
$G4INSTALL/source/physics_lists/builders/include
An example of the use of the Physics List can be found in the macro files:
default_macro.mac and carbon_beamline.mac
Approach 2:
A set of built-in physic lists are also defined and included in the class HadrontherapyPhisicsList.cc and can be activated by macro command:
/physic/addPhysics/<name>.
Two different physics lists can be selected using this approach:
- HADRONTHERAPY_1: include HP hadronic physics models
- HADRONTHERAPY_2: HP physics models are switched off
Approach 3:
We developed this approach in order to simplify the choice of the physic models to
be used in the application.
With this approach the user must only insert a command line in his/her .mac file using the: /physics/addPackage <PACKAGE_NAME>
This permits to switch-on an already built physics package.
Various packages are already present in the Geant4 tree: they are in the directory: geant4/source/physics_lists/lists/include
Approach 4:
Directly call a reference physics list by setting the variable PHYSLIST. Ex.:
export PHYSLIST=QGSP_BIC_EMY
and the export QGSP_BIC_EMY reference physics list will be setted
INTERACTIVE COMMANDS
===================================================
How to change Phantom and Detector geometries
In order to let the user change phantom and detector geometries and voxelization, some interactive commands have been provided. All parameters are mandatory, except those inside square brackets.
Detector geometry
The user can change:
(1) The detector (box) size.
(2) The voxels sizes. Changing these parameters, and/or the detector sizes, users should choose values in order to be divisors of the detector correspondent sizes.
For both above commands, zero or negative values mean << don't change it >>
(3) The displacement between the phantom and the detector. Displacement parameters refer to the lower-left corner of the detector with respect to that of the phantom, by the point of view of the beam. In this case, zero or positive values are allowed, while the negatives ones mean: << don't change it>>.
Command synopsis:
/changeDetector/size <dimX> <dimY> <dimZ> <[unit]>
/changeDetector/voxelSize <dimX> <dimY> <dimZ> <[unit]>
/changeDetector/displacement <dispX> <dispY> <dispZ> <[unit]>
Default size values are 4x4x4 cm for the detector, 0.2x40x40 mm for any voxel and 0x18x18 cm for the displacement.
where the X dimension is that along the beam direction
Phantom geometry
(1) The phantom size. As usually, zero or negative values mean: <<don't change it>>.
(2) The phantom position respects the world. In this case, specified values refer to the three components of the position of the phantom's centre respect to the world.
Command synopsis:
/changePhantom/size <dimX> <dimY> <dimZ> <[unit]> # 40 40 40 cm
/changePhantom/position <posX> <posY> <posZ> <[unit]> # 20 0 0 cm
All these commands must be followed by the command /changePhantom/update
to check and eventually apply changes to the real geometry.
Moreover, they must be issued between runs (so where you want but after the /run/initialize initialization command, or the G4State_Idle Geant4 state machine).
Obviously, all the previous sizes must be set in order to maintain the detector fully inside the phantom, otherwise, the system will give an error message.
Some examples follow:
/changeDetector/size 40 0 0 cm
# Will extend detector X size to cover in full the phantom X size
/changeDetector/size 0 4.5 0 cm
# Will extend the Y size to 4.5 cm (note that voxel size Y is automatically
# rounded to 4.5 cm because the default value along Y is 4 cm)
/changePhantom/update
# Remember to always update the geometry before the beamOn command!!
/changeDetector/size 0 8 0 cm
# Will extend the Y size to 8 cm. In this case voxel size Y doesn't change, but
# the number of voxels along Y doubles.
/changePhantom/update
/changeDetector/voxelSize 100 0 0 um
# 100 um should be a divisor of detector size X
# Will change only slabs X size to 100 um, without affecting the other.
/changePhantom/update
/changeDetector/displacement 0 0 0 # default unit mm
# Will place the detector in the left lower corner (from the point of view of the beam) of #the phantom.
/changePhantom/update
Stopping powers calculation
The end-user can calculate, via macro command, stopping powers only for those materials inserted into G4NistMaterialBuilder class (about 300).
To get stopping powers user must provide this command line on the idle interactive terminal (or into a macro file) :
/parameter/getstopping <G4_material> <Emin> <Emax> <nPoints> <[particle]> <[output_filename]>
All parameters are mandatory except those inside square brackets [].
Default values for parameters inside square brackets are respectively proton and standard output (usually the user console terminal).
Parameters are respectively:
The material (NIST) name (something like G4_..., the complete list of elements and materials is available into the G4NistMaterialBuilder class and can be printed to the terminal screen via the macro command: /parameter/nist )
Kinetic energy range in MeV and the number of data points to be retrieved (in a logarithmically uniform space)
The particle name (proton, e+, e-, He3, neutron,... a full list can be produced via the macro command: /particle/list).
Currently, it does not work with ions.
The output filename: if users leave this blank then the standard output is used.
Below is an example in order to calculate the stopping power for alphas into Hydrogen between 1 keV to 150 MeV for 15 points:
/parameter/getstopping G4_H 0.001 150 15 alpha
GEANT4 GENERAL PARTICLE SOURCE
===================================================
The General Particle Source (GPS, G4 class name: G4GeneralParticleSource) is in the current version of 'hadrontherapy': it enables the user to use standard energy, angular and spatial distributions. The GPS also includes methods to bias the sampling distribution.
The G4GeneralParticleSource can be utilized by typing commands from the /gps command directory, or include the /gps commands in a macro file.
RADIOBIOLOGICAL QUANTITIES: DOSE, LET, RBE
===================================================
LET calculation
'hadrontherapy' application simulates and calculates the averaged LET-dose and LET-track fully accounting for the contribution of secondary particles generated in the target fragmentation
Dependencies as respect to the transport parameters adopted during the Monte Carlo simulations as the production cut of secondaries particles, voxel size and the maximum steps length are minimized in the LET calculation. The first implementation of LET calculation adopted in hadrontherapy is reported in F. Romano et al.,(2014) Phys Med Biol 59(12): 28638. Now, in hadrontherapy is implemented the approach reported in G. Petringa et al., (2020) Phys Med Bio. (DOI: 10.1088/1361-6560/abaeb9)
At run time, data needed to calculate LET are collected. At the end of simulation, LET mean values are calculated and stored into a file.
The Let.out file will be produced at the end of a run, where you can
find the dose and track average LET for each tracked particles (both primary and
secondary ones) and the total mean LET.
The file is structured as follows:
- The first three columns contain the voxel indexes (first index "i" refers to the beam direction);
- The fourth and fifth columns contain respectively total mean dose LET (LDT) and total mean track LET (LTT)
- The rest of columns contain LET Dose and Track for each single ion (whose name is in the top row of the file).
To activate the LET computation (HadrontherapyLet.cc), you have to execute
the following command:
/analysis/secondary true
/analysis/computeLet
RBE and Survival calculation
A method was developed to assess the biological damages produced by proton and ion beams in terms of survival fraction curves, i.e of the number of cells able to survive after the irradiation at different dose. The approach is based on the combined use of Monte Carlo Geant4 simulations (to calculate the doses deposited and the energy spectra of particles interacting with cells) and of the Survival analytical code (Manganaro L, Russo G, et al. Survival: a simulation toolkit introducing a modular approach for radiobiological evaluations in ion beam therapy. Phys. Med. Biol. 2018;63(8). 0801).
The Monte Carlo simulations permit the calculation of the Edep and Ekin distributions that, coupled with the radiobiological response model, allow the final and calculation of a survival curve.
The kinetic energy and the LET value of any primary ion and of the secondaries generated in each slice of the simulated water phantom are retrieved at each simulation step. The corresponding values of αi and βi, for each specific ion i with a kinetic energy Ei and a released dose Di, are then calculated by direct linear interpolation of the Look-up-tables provided by the Survival analytical code.
(G.Petringa et al., Physica Medica 58 (2019) 7280)
The AlphaAndBeta.out and RBE.out files are produced at the end of the run.
AlphaAndBeta.out contains the average alpha (first column) and beta (second column) parameters calculated for each slice (third column).
RBE.out contains the following quantities:
Dose (Gy): the physical dose;
ln(S): the natural log of the Survival Fraction;
Survival Fraction;
DoseB (Gy): the biological dose;
RBE: relative biological effectiveness;
depth (slice): n. of the slice;
To activate the RBE computation (HadrontherapyRBEcc), you have to execute
the following command:
#you can choose the verbosity level
/rbe/verbose 2
#you have to indicate the name of the LUT inside the rbe folder
/rbe/loadLemTable data/rbe/lem.csv
/rbe/calculation 1
/rbe/accumulate 1
#you have to indicate the name of the cell line
/rbe/cellLine ARPE19
/rbe/doseScale 7777770
SIMULATION OUTPUT
===================================================
Store results in an ASCII file
A .out ASCII file is generated at the end of each run, Dose.out is its default name that can be changed in the HadrontherapyMatrix.cc file.
The file contains four columns; the first three columns represent the voxel indexes (that unequivocally identify the voxel volume), while the last column represents the dose deposited in that given voxel.
Alternatively, users can force the store of data to a given filename, after any BeamOn command and before the program ends, by the macro command /analysis/writeDoseFile <myfile.out>.
Moreover, if the macro command /analysis/secondary <true> is given, before the BeamOn command, ordinated dose and fluence, for every secondary produced, is added to the file.
If the macro command /analysis/computeLet is given, and the ascii file Let.out is written, with the dose and track average LET computations.
Users must take care that any change of the phantom geometry will clear all dose data.
It is also possible to create multiple new output files in the same simulation session. For example:
/beam/energy/meanEnergy 4800 MeV
/analysis/setAnalysisFile firstRun.root
/run/beamOn 1000
/analysis/writeDoseFile firstRun.out # this will write both the .root and the .out file!
/beam/energy/meanEnergy 3000 MeV
/analysis/setAnalysisFile secondRun.root # this
/run/beamOn 1000
/analysis/writeDoseFile secondRun.out
Please contact cirrone@lns.infn.it for more details or suggestions and feedback on this document.
@@ -0,0 +1,13 @@
README file relative to proton experimental Bragg peaks
Description of experimental data file provided and of the
corresponding simulation configuration to use for the comparison
--> experimental62MeVProtonBraggPeak.out
This is a two columns file reresenting an experimental proton Bragg peak acquired
at the INFN-LNS proton therapy facility and generated by a 62 MeV proton beam penetrating
a water tank.
The first column represent the depth in millimeters of water;
The second column represent the energy deposited per millimeter as measured by an
ionisation chamber moving in water.
+145
View File
@@ -0,0 +1,145 @@
-------------------------------------------------------------------
=========================================================
Geant4 - human_phantom example
=========================================================
README
-----------------------
Past Authors: G. Guerrieri, S. Guatelli, M. G. Pia (pia@ge.infn.it),INFN Genova, Italy.
Current authors (since 2007): S. Guatelli (susanna@uow.edu.au), University of Wollongong, Australia.
Contributions by F. Ambroglini (filippo.ambroglini@pg.infn.it), INFN Perugia, Italy.
The example is based on code developed by G. Guerrieri, University of Genova, Italy.
------> Introduction
The human_phantom example models anthropomorphic phantoms for
Geant4 simulations.
Two models are available: MIRD [1] and ORNL [2] (Male and Female for each approach).
[1] W.S. Snyder, et al, "MIRD Pamphlet No. 5 Revised, Estimates of
absorbed fractions for monoenergetic photon sources uniformly distributed
in various organs of a heterogeneous phantom",
J. Nucl. Med. Suppl., no. 3, pp. 5-52, 1969.
[2] M. Cristy and K. F. Eckerman, "Specific absorbed fractions of energy
at various ages from internal photon sources", ORNL/TM-8381/VI, Apr. 1987.
Note: Currently the ORNL phantom is under review.
-----> Geometry
The process of building a phantom is handled through the Builder
design pattern.
The creation of coherent models of the human phantom is handled through
an Abstract Factory design pattern.
The organs of the MIRD phantom are implemented in hard-code; the organs of
the ORNL phantom are handled through GDML (Geometry Description Markup Language,
www.cern.ch/gdml). The materials of the MIRD model are defined in the
class G4HumanPhantomMaterial. The materials of the ORNL model are defined in
the GDML files.
If using ORNL phantom model with no GDML set-up a segmentation
fault will be otained when running the simulation.
*** Parameterized breast ***
MIRD Female model: a breast is analytical and derives from the MIRD
anthropomorphic phantom; the other breast derives from the model [3] and
it is voxelised.
[3] D.R. Dance and R. A. Hunt, "Voxel breast phantom to represent breasts
of different sizes and glandularities for use with a Monte Carlo simulation
program", Report RMTPC 02/1005.
-----> Physics
Particles: charged particles, gamma, geantino
Physics list: electromagnetic processes are modelled.
The threshold of production of secondary particles is set to 1 * mm.
-----> Primary particles
The G4 General Particle Source is used to generate primary radiation field.
Macro primary.mac contains the definition of the primary radiation field.
-----> Energy deposit
The energy deposit is calculated in the organs of the phantom.
At the end of the execution of the simulation the summary of the total energy deposit in
each organ is print out.
Currently for ORNL model the energy deposition is calculated in the head only.
If the sensitivity is not set ( /bodypart/addBodyPart organName no ),
the energy deposit is not calculated in the specific organ.
The energy deposit is calculated in each voxel of the parameterised breast.
-----> Analysis
To activate the analysis, the application must be built with the option
WITH_ANALYSIS_USE=ON :
make -DCMAKE_INSTALL_PREFIX=/path/to/geant4-installation -DWITH_ANALYSIS_USE=ON /path/to/human_phantom/
**** SEQUENTIAL MODE *************
output file: g4humanphantom.root containing
an ntuple with the Energy Deposit in each Body Part.
macro.C is provided to print the content of the ntuple in a ROOT
interactive analysis session.
**** MULTITHREAD MODE
output files:
human_phantom.root_t0
..
..
human_phantom.root_t#
where # is the number of threads
type: source MergeFiles to merge the output of each thread in a single one
called human_phantom.root
macro.C is provided to print the content of the ntuple in a ROOT
interactive analysis session.
----> Macro files: example of different human phantoms
default.mac is executed by default in the simulation, with visualisation
batch.mac: macro to run in batch mode ( with no visualisation)
adultMIRDFemale.mac: example to define a MIRD female human phantom
adultMIRDMale.mac: example to define a MIRD male human phantom
adultHead.mac: example how to define one piece of the anatomy
adultORNLFemale.mac: example to define a ORNL female human phantom - THIS NEEDS GDML INSTALLED
adultORNLMale.mac: example to define a ORNL male human phantom - THIS NEEDS GDML INSTALLED
adultMIXFemale.mac : example of MIRD human female phantom with
parameterised breast
-----> How to build the example
If the user wants to run the example importing geometries via GDML,
he/she needs to have built the persistency/gdml module by having
set the -DGEANT4_USE_GDML=ON flag during the CMAKE configuration step,
as well as the -DXERCESC_ROOT_DIR=<path_to_xercesc> flag pointing to
the path where the XercesC XML parser package is installed in your system.
- By default GDML is not configured to be used in the example. If the user wishes
to use GDML, he/she has to build the example with the following command:
cmake -DCMAKE_INSTALL_PREFIX=/path/to/geant4-installation -DWITH_GDML_USE=ON /path/to/human_phantom/
- if using GDML, the directory gdmlData must be copied in the directory where
the simulation will be launched.
- Compile and link to generate the executable (in your CMAKE build directory):
% make
- Execute the application:
% ./phantom
- Default macro: default.mac (MIRD, Female model)
- Visualization macros: vrmlVis.mac, dawnVis.mac, openGLVis.mac
- Run simulation in batch mode: batch.mac
---------------------------------------------------------------------------
+233
View File
@@ -0,0 +1,233 @@
=========================================================
Text version of the iort_therapy README file
=========================================================
Main Authors:
G.Russo(a,b), C.Casarino*(c), G.C. Candiano(c), G.A.P. Cirrone(d), F.Romano(d)
Contributor Authors:
S.Guatelli(e)
Past Authors:
G.Arnetta(c), S.E.Mazzaglia(d)
(a) Fondazione Istituto San Raffaele G.Giglio, Cefalù, Italy
(b) IBFM-CNR , Segrate (Milano), Italy
(c) LATO (Laboratorio di Tecnologie Oncologiche), Cefalù, Italy
(d) Laboratori Nazionali del Sud of the INFN, Catania, Italy
(e) University of Wollongong, Australia
*Corresponding author, email to carlo.casarino@polooncologicocefalu.it
-------------------------------------------------------------------------------------------------
iort_therapy:
WHAT IT IS, WHAT IT DOES AND WHAT IT WILL PROVIDE
iort_therapy is a Geant4-based application specifically developed to address typical needs related to the Intra-Operative Radio-Therapy (IORT) technique.
iort_therapy is capable to simulate a well specified intra-operative electron radio-therapy facility: the collimator beam line system of a typical medical mobile linac and the relative target (water-phantom). iort_therapy application is currently used by the G.Russo team in clinical and research activities carried out in Fondazione Istituto San Raffaele G.Giglio Hospital (Cefalù, Italy) where a NOVAC7 linac is installed.
iort_therapy, is flexible and show many capabilities. Its geometrical set-up, for example, is completely interchangeable permitting a simple switch between different geometrical collimator system configurations; the possibility to simulate a composite metallic shielding disc inside the water-phantom was also implemented.
Folder structure of iort_therapy
iort_therapy distribution contain these sub-folders:
\src: where source .cc files are stored
\include: where header .hh files are stored
Currently this folders structure is in development and in the meanwhile new features and capabilities will be added.
DOWNLOAD AND INSTALLATION
iort_therapy source code is released inside the official distribution of the Geant4 toolkit in the $G4INSTALL/examples/AdvancedExamples folder.
To run iort_therapy you must first install the Geant4 package. Once Geant4 is installed the example must be first compiled (with the command gmake inside the
../iort_therapy folder). When compilation is completed the program can be executed.
A CMakeLists.txt file is provided together with a standard GNUmakefile for compilation.
A complete guide for the Geant4 installation in different operating systems can be found inside the official installation Geant4 pages.
GEOMETRICAL SET-UP
The idea of iort_therapy is to provide a tool useful for Users interested in the field of electron intra-operative radio-therapy. These can include the simple calculation of dose distribution curves in water or other materials, the possibility to study and plan dose distribution in the tumor treatment region with different clinical set-up, and to optimize radio-protection of normal patient tissues simulating a composite metallic shielding disc.
The main component of the simulation is the collimator beam line system, the phantom, the detector and the composite metallic shielding disc.
COLLIMATOR BEAM LINE SYSTEM
At moment iort_therapy include the simulation of a collimator beam line system, based on a typical medical mobile linac structure us the NOVAC7. This collimator beam line is elaborated in the files CollimatorXXBeamLine.cc , where XX may be 40, 50, 60, 70 ,80 or 100 (mm) depending on the diameter collimator set-up chosen.
In fact, there is also a facility in iort_therapy that allows the user to make a choice, via macro, between alternative collimator beam line set-up. This can be done by using command:
/geometrySetup/selectGeometry <name>
where <name> is coll40, coll50, coll60, coll70, coll80 or coll100 depending on the diameter collimator set-up chosen (40mm, 50mm, 60mm, 70mm, 80mm or 100mm). The standard "default" geometry is coll60.
The Collimator beam line system class file
The following is the description of the elements of the collimator beam line system from the accelerator head to the final collimator. This line is completely simulated inside this class.
The main elements are the accelerator head and the applicator.
The accelerator head performs as a primary collimator system. It consists of titanium exit window and a cylindrical PMMA structure where two monitor chambers are installed.
The applicator consists of a cylindrical PMMA tube (the final collimator). In the order we have implemented the following functions:
IortBeamLineVacuumSource();
IortBeamLineTitaniumWindows();
IortBeamLineMonitorChambers();
IortBeamLineBlocks() ;
IortBeamLineJunctions();
IortBeamLineFinalCollimator();
The user has now the possibility to vary, via messenger, the inner and outer radius of the final collimator.
THE PHANTOM
At the end of the beam line a phantom (a box of 20cmx20cmx20cm default dimensions) is reproduced.
Inside it, a user-defined region (the detector) is divided (via the ROGeomtry classes of Geant4) in cubic and identical voxels. The voxels size can be varied as well as the voxelized region.
At the end of a simulation run the dose deposited by primaries and secondaries in each voxel is collected. This information is available as an .out file.
THE DETECTOR
A scoring mesh is set to score the dose in the phantom (see defaultMacro.mac)
As concern the cut and stepMax values, the default configuration implies a cut value of 0.01 mm in the whole world (use the command /physic/setCuts <length> in order to set the cut for all, and the command /physic/setDetectorCuts <length> to set the cut for the detector only) and a stepMax of 0.01 mm just in the phantom (use the command /Step/waterPhantomStepMax 0.01 mm).
In any case it is strongly recommended to use a stepMax value not bigger than 5% of the dose slice thickness.
SHIELDING DISC
Inside the detector is positioned a double layered shielding disc. For both layers it is possible via macro to change the outer and inner radius, the thickness, the position along the beam axis and the material.
NOTE 1: to delete the disc out the entire geometry the relative macro command must be used!!
NOTE 2: to re-insert the disc in the entire geometry the relative macro command must be used!!
PHYSICS PROCESSES AND PHYSICS MODELS IMPLEMENTATION
EM Standard option 4 is activated. The user can change the physics list interactively.
INTERACTIVE COMMANDS
How to change Phantom, Detector and Shielding Disc geometries
In order to let the end user to change phantom and detector geometries and voxelization, some interactive commands have been provided. All parameters are mandatory, except those inside square brackets.
Phantom geometry
(1) The phantom size. As usually, zero or negatives values mean: <<don't change it>>.
(2) The phantom position respect to the world. In this case specified values refer to the three components of the position of the phantom's center respect to the world's.
Command synopsis:
/changePhantom/size <dimX> <dimY> <dimZ> <[unit]> # 20 20 20 cm
/changePhantom/position <posX> <posY> <posZ> <[unit]> # 4.5 0 0 cm
Detector geometry
The user can change:
(1) The detector (box) size.
(2) The displacement between the phantom and the detector. Displacement parameters refer to the lower left corner of the detector respect to that of the phantom, by the point of view of the beam. In this case zero or positive values are allowed, while the negatives ones mean: << don't change it>>.
Command synopsis:
/changeDetector/size <dimX> <dimY> <dimZ> <[unit]>
/changeDetector/displacement <dispX> <dispY> <dispZ> <[unit]>
The user has to change the scoring mesh accordingly via UI commands.
Shielding Disc geometry
Command synopsis:
/ProtectionDisc1/OuterRadiusDisc1 <dim> # default -> 40*mm ;
/ProtectionDisc1/InnerRadiusDisc1 <dim> # default -> 0*mm
/ProtectionDisc1/HeightDisc1 <dim> # default -> 2*mm
/ProtectionDisc1/XPositionDisc1 <dimX> # default -> -11*mm
/ProtectionDisc1/material <G4_Material> # default -> G4_WATER ;
/ProtectionDisc2/OuterRadiusDisc2 <dim> # default -> 40*mm ;
/ProtectionDisc2/InnerRadiusDisc2 <dim> # default -> 0*mm
/ProtectionDisc2/HeightDisc2 <dim> # default -> 1*mm
/ProtectionDisc2/XPositionDisc2 <dimX> # default -> -8*mm
/ProtectionDisc2/material <G4_Material> # default -> G4_WATER ;
All these commands must be followed by the command /changePhantom/update
in order to check and eventually apply changes to the real geometry.
Moreover they must be issued between runs (so where you want but after the /run/initialize initialization command, or the G4State_Idle Geant4 state machine).
Obviously all the previous sizes must be set in order to maintain the detector fully inside the phantom, otherwise system complains.
To Delete Disc geometry
Command synopsis:
/DeleteProtectionDisc/delete
To Re-insert Disc geometry
Command synopsis:
/InsertProtectionDisc/insert
**** To set initial beam features
By default, the beam propagates along the positive X direction with Gaussian momentum and Y-Z distributions.
It is possible to select: particle type, mean energy and relative standard deviation, X,Y and Z coordinates, Y and Z standard deviations and, finally, the beam spread along X direction (Theta).
Command synopsis:
/gun/particle
/beam/energy/meanEnergy
/beam/energy/sigmaEnergy
/beam/position/Xposition
/beam/position/Yposition
/beam/position/Yposition/sigmaY
/beam/position/Zposition
/beam/position/Zposition/sigmaZ
/beam/momentum/Theta
HOW RUN iort_therapy
Run the example in interactive mode
> $G4WORDIR/bin/Linux-g++/iort_therapy
In this case the main file (iort_therapy.cc) performs different operations depending on which environment variable is activated;
For example, if the environment variable G4UI_USE_TCSH is activated, iort_therapy will start with the TCSH User Interface that has many useful functionalities. On the other hand, if this first variables is not defined, the program will continue searching for the G4UI_USE_QT variable and, finally, will open the standard G4UITerminal.
Run the example using macro files
iort_therapy can be launched using a macro file:
> $G4WORDIR/bin/Linux-g++/iort_therapy macroFile.mac
The defaultMacro.mac file is contained in the main directory of iort_therapy and is automatically read in case the user launch the executable without a parameter.
SIMULATION OUTPUT
Store results in an ASCII file
A .out ASCII file is generated at the end of each run, Dose.out.
The file contains four columns; the first three columns represent the voxel indexes (that univocally identify the voxel volume), while the last column represents the dose in Gray deposited in that given voxel.
+106
View File
@@ -0,0 +1,106 @@
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
lArCal
--------
This example is intended to simulate the Forward Liquid Argon Calorimeter
(FCAL) of the ATLAS Detector at LHC. The goal of the FCAL is to provide
a good missing energy determination in the region of very small angles
from the beam direction.
1. GEOMETRY DEFINITION
------------------------
The liquid Argon calorimeter consists of three modules with the same
nominal outer dimensions: an electromagnetic module (made
of copper) followed by two hadronic ones (made of tungsten alloy).
The corresponding parameters of these modules are defined inside the
FCALEMModuleParameters.input and FCALHadModuleParameters.input files.
The package contains as well a FCALTestbemSetup class whose geometry is given by
FCALTestbeamSetupParameters.input. See these files for details concerning to
radius, lenght and angles of the different components.
2. AN EVENT : THE PRIMARY GENERATOR
------------------------------------
The primary kinematic consists of a single particle which hits the
geometry perpendicular to the input face. The FCALPrimaryGeneratorAction
class gives the particle and its energy (by default it is an electron of
20 GeV). These parameters can be changed in commands of ParticleGun class
inside the macros given in this example.
The subdirectory data-tracks contains the kinematic files
of the particles for different energies (20 GeV, 40 GeV, 60 GeV, 80 GeV,
120 GeV and 200 GeV).
The information given inside these files are the X, Y, Z and cosX,
cosY, cosZ variables for each event.
A RUN is a set of events.
3. VISUALIZATION
------------------
The Visualization Manager is set in the main().
The initialisation of the drawing is done via the command
> /control/execute vis.mac
The detector has a default view which is a transversal view of the geometry.
The tracks are drawn at the end of event, and erased at the end of run.
Optionally the way of drawing the particles can be changed in the
TBEVentActionMessenger class.
4. PHYSICS
----------
You can select between 4 Physics Lists: QGSP, LHEP, QGSC, QGSP_BIC_EMY.
The last one is set as default, so that you can test the low-energy
electromagnetic.
The selection is done simply by comment/uncomment a line in the main
lArCal.cc (look for the keyword ***LOOKHERE***).
5. HOW TO START ?
-----------------
- compile and link to generate an executable
% cd geant4/examples/advanced/lAr_calorimeter
% gmake
- execute the program in 'batch' mode from macro files
% lArCal prerunlArcal.mac
- execute Test in 'interactive mode' with visualization
% lArCal
...
Idle> type your commands
...
Idle> exit
6. HISTOGRAMS
--------------
The analysis is performed using the histogramming tools provided by
Geant4. No external dependencies are required.
lArCal produces 4 histograms (saved as fcal.root) which illustrate
the final state of the most important variables of the example:
Histo1 --> Number of tracks out of World
Histo2 --> Number of secondary particles
Histo3 --> Total energy deposited (in MeV) in the electromagnetic module
Histo4 --> Total energy deposited (in MeV) in the hadronic module
See their definitions in FCALRunAction.cc
The histograms are saved (default) as a ROOT file. It is possible to save the
histograms in a xml file by changing the G4AnalysisManager default file type
in the FCALRunAction constructor.
+137
View File
@@ -0,0 +1,137 @@
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| MedLinac |
+ +
| README |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The MedLinac2 advanced example (ML2) is a renewed version of the MedLinac advanced example developed
by Michela Piergentili with the support of M.G.Pia and Franca Foppiano in 2004.
This application has been developed by the Geant4 users:
^Claudio Andenna,*Barbara Caccia with the support of Pablo Cirrone (LNS-INFN Catania, Italy) and with the contribute of Alessandro Occhigrossi*.
Support by S. Guatelli (University of Wollongong, Autralia) in 2018.
^INAIL DIPIA - ex ISPESL and INFN Roma, gruppo collegato Sanita', Italy
*Istituto Superiore di Sanita' and INFN Roma, gruppo collegato Sanita', Italy
Viale Regina Elena 299, 00161 Roma (Italy)
tel (39) 06 49902246
fax (39) 06 49387075
---> A brief description
The example is based on a typical structure of a medical linear accelerator for Intensity Modulated Radiation Therapy (IMRT), such as Varian Clinac 2100 accelerator.
The user may choice a cubic phantom filled with water, a phantom filled with an equivalent lung-tissue with a inhomogeneity (a 6 cm sided PMMA cube) located in the centre of the phantom, or a DICOM phantom.
Two type of particle sources may be chosen, a random generator of electrons gun shooting the target or particles loaded from a phase space.
The program allows the generation of a plane phase space. However since the mother volume of this plane phase space is the accelerator volume it can be positioned only inside the accelerator main volume. Furthermore, the phase space can be calculated only if the accelerator is not rotated.
The example package contains:
- source files (src, include, ml2.cc)
- GNUmakefile
- README.txt
- ml2.mac and vis.mac macro files
-macroAndData directory with all the macros.
- a launches directory as an example to use the package (pay attention to properly set the path inside the macro files). It contains also an example of dicom phantom as taken from the extended/medical/DICOM example.
- two log files (macLoop.log and macExp.log) obtained launching the ml2.mac (with the proper directories) with the /convergence/bCompareExp false and /convergence/bCompareExp true respectively.
-----------------------------------------------------------------------
----> 1. Experimental set-up.
The elements simulated are:
1-A source of electrons (the distribution of the electron energy and the electron radial intensity was assumed Gaussian in direction and energy). The beam direction is along the z axis.
2-A target
3-A primary collimator
4-A vacuum window
5-A flattening filter
6-A ion chamber
7-A mirror
8-A light field reticle
9-Secondary movable collimators (jaws)
10-A simple Multi Leaf Collimator
11-Phantom1 ("fullWater") filled with water (cube of 30 cm sided)
12-Phantom2 ("BoxInBox") filled with G4_ICRP lung tissue (cube of 30 cm sided) with a inhomogeneity (PMMA 6 cm sided cube) in the centre and a PLEXIGLASS slab 1 cm thick on the surface of the phantom.
13-Phantom3 ("Dicom1") it is a dicom phantom generated starting from *.dcm files. It uses part of the code given in the extended/medical/DICOM example.
-----------------------------------------------------------------------
----> 2. Some main features
Dicom phantom
The dicom *.dcm files can be read and used as input data to build a parameterized phantom according to the extended/medical/DICOM example. Only some of the extended example classes have been used and they have been adapted to the architecture of the ML2 program avoiding a deep change in the code. Consequently the dicom part still reads the *.dcm files and translate them into *g4dcm and *g4dcmb files to be used later to build the phantom (for more information on the dicom format, see the readme file in the extended/medical/DICOM example). However new materials have been added and a different way to check if the material defined in the data.dat file are implemented has been realized.
As an example three contiguous dicom images are supplied as an example to use. You can find the three dicom images reproduced as a sequence in the movie CT_abdomen.mov.
Accelerator rotation:
it is possible to arbitrary rotate the accelerator around the X axis (/accelerator/rotationX 20 deg)
it is possible to rotate the accelerator along the y axis of 90 deg (/accelerator/rotation90Y true/false)
The last possibility has been implemented because there was an experimental conflict between the dicom phantom and the accelerator world. Both have the z direction as the main directions, i.e. the dicom slices grows along the z direction and the accelerator gun shoots along the z axis. Consequently it is impossible to irradiate transversally to the phantom (unless the accelerator is rotated along the Y axis of 90 deg).
Phantom translation:
This feature has been added to allow the possibility to irradiate a particular area of the phantom. The accelerator rotates around the isocentre set at coordinates (/phantom/centre 0,0,0) of the world, consequently to irradiate a selected area of the phantom this has to be located at the world centre.
A check of the physical volumes overlap is performed each time the geometry is changed, but not in the case of the dicom phantom because of the very high number of physical volumes.
Several phantom centres and accelerator rotations (around the X axis) can be independently assigned by the user through the macro file.
The /accelerator/rotation90Y, the /accelerator/rotationX and the /phantom/centre are the only interactive commands to change the geometry during the run. The first doesn't refresh the screen.
-----------------------------------------------------------------------
----> 3. How to run the example.
The example runs with the ml2.mac macro file.
This file contains some setup information and the name of other macro files (the accelerator macro file -"acc1.mac"- and, if required by the phantom chosen the phantom macro file -"dicomPhantom.mac"-) describing the chosen accelerator and phantom. If the dicom phantom is chosen other data files are necessary (typically data.dat, CT2Denstity.dat, ColourMap.dat) according to the extended example.
Inside the ml2.mac file there is a flag "/OnlyVisio" that has to be set to "true" to switch on the visualization mode calling the "vis.mac" file ("false" for the modality without visualization). Generally the visualization should be used to check the set up of the simulation while to compute the dose is faster to switch it to false.
The example needs as input data the macro file (like "ml2.mac") and a seed number.
Medlinac2 can be launched using a macro file:
$G4WORKDIR/bin/Linux-g++/ml2
that is equivalent to
$G4WORKDIR/bin/Linux-g++/ml2 ml2.mac 1
while the string
$G4WORKDIR/bin/Linux-g++/ml2 user_macro_file
is equivalent to
$G4WORKDIR/bin/Linux-g++/ml2 user_macro_file 1
-----------------------------------------------------------------------
----> 4. The physics
The ML2Physicslist class allows the activation of all the physic models either using the physics lists
or the physics package lists. The standard electromagnetic option3 model is the default model.
------------------------------------------------------------------------
----> 5. Simulation output
The output of the ML2 example is:
a totDose.txt with the dose in the water phantom.
------------------------------------------------------------------------
----> 6. Main differences with the previous ML2 release.
The RO Geometry has been deleted. The Geant4 MultifunctionalDetector is used.
The example is going through an extensive revision.
------------------------------------------------------------------------
----> 7. Contacts
If you have any questions or wish to notify of updates and/or modification
please contact:
Barbara Caccia at barbara.caccia@iss.it
Claudio Andenna at claudio.andenna@ispesl.it, claudio.andenna@iss.infn.it
Istituto Superiore di Sanita' and INFN Roma, gruppo collegato Sanita', Italy
Viale Regina Elena 299, 00161 Roma (Italy)
tel (39) 06 49902246
fax (39) 06 49387075
+173
View File
@@ -0,0 +1,173 @@
-------------------------------------------------------------------
-------------------------------------------------------------------
=========================================================
Geant4 - Microbeam example
=========================================================
README file
----------------------
CORRESPONDING AUTHOR
S. Incerti (a, *) et al.
a. Centre d'Etudes Nucleaires de Bordeaux-Gradignan
(CENBG), IN2P3 / CNRS / Bordeaux 1 University, 33175 Gradignan, France
* e-mail:incerti@cenbg.in2p3.fr
---->0. INTRODUCTION.
The microbeam example simulates the cellular irradiation beam line
installed on the AIFIRA electrostatic accelerator facility located at
CENBG, Bordeaux-Gradignan, France. For more information on this facility,
please visit :
http://www.cenbg.in2p3.fr/
---->1. GEOMETRY SET-UP.
The elements simulated are:
1. A switching dipole magnet with fringing field, to deflect the 3 MeV alpha
beam generated by the electrostatic accelerator into the microbeam line,
oriented at 10 degrees from the main beam direction;
2. A circular collimator object, defining the incident beam size at the
microbeam line entrance;
3. A quadrupole based magnetic symmetric focusing system allowing equal
transverse demagnifications of 10. Fringe fields are calculated from Enge's
model.
4. A dedicated cellular irradiation chamber setup;
5. A set of horizontal and vertical electrostatic deflecting plates which can
be turned on or off to deflect the beam on target;
6. A realistic human keratinocyte voxellized cell observed from confocal
microscopy and taking into account realistic nucleus and cytoplasm chemical
compositions.
---->2. EXPERIMENTAL SET-UP.
The beam is defined at the microbeam line entrance through a collimator
5 micrometer in diameter. The beam is then focused onto target using a
quadruplet of quadrupoles in the so-called Dymnikov magnetic configuration.
The beam is sent to the irradiation chamber where it travels through a
isobutane gas detector for counting purpose before reaching the polypropylene
culture foil of the target cell which is immersed in the growing medium and
enclosed within a dish.
A cell is placed on the polypropylene foil and is irradiated using the
microbeam. The cell is represented through a 3D phantom (G4PVParameterization)
obtained from confocal microscopy. In the provided example, the voxels sizes
are : 359 nm (X) x 359 nm (Y) x 163 nm (Z)
The primary particle beam parameters are generated from experimental
measurements performed on the AIFIRA facility. Incident particle used for
cellular irradiation are 3 MeV alpha particles.
More details on the experimental setup and its simulation with Geant4 can
be found in the following papers:
- IN SILICO NANODOSIMETRY: NEW INSIGHTS INTO NON-TARGETED BIOLOGICAL RESPONSES TO
RADIATION
By Z. Kuncic, H. L. Byrne, A. L. McNamara, S. Guatelli, W. Domanova, S. Incerti
Publsihed in Comp. Math. Meth. Med. (2012) 147252
- MONTE CARLO MICRODOSIMETRY FOR TARGETED IRRADIATION OF INDIVIDUAL CELLS USING
A MICROBEAM FACILITY
By S. Incerti, H. Seznec, M. Simon, Ph. Barberet, C. Habchi, Ph. Moretto
Published in Rad. Prot. Dos. 133, 1 (2009) 2-11
- MONTE CARLO SIMULATION OF THE CENBG MICROBEAM AND NANOBEAM LINES WITH THE
GEANT4 TOOLKIT
By S. Incerti, Q. Zhang, F. Andersson, Ph. Moretto, G.W. Grime,
M.J. Merchant, D.T. Nguyen, C. Habchi, T. Pouthier and H. Seznec
Published in Nucl. Instrum. and Meth. B 260 (2007) 20-27
- A COMPARISON OF CELLULAR IRRADIATION TECHNIQUES WITH ALPHA PARTICLES USING
THE GEANT4 MONTE CARLO SIMULATION TOOLKIT
By S. Incerti, N. Gault, C. Habchi, J.L.. Lefaix, Ph. Moretto, J.L.. Poncy,
T. Pouthier, H. Seznec. Dec 2006. 3pp.
Published in Rad. Prot. Dos. 122, 1-4, (2006) 327-329
- GEANT4 SIMULATION OF THE NEW CENBG MICRO AND NANO PROBES FACILITY
By S. Incerti, C. Habchi, Ph. Moretto, J. Olivier and H. Seznec. May 2006. 5pp.
Published in Nucl.Instrum.Meth.B249:738-742, 2006
- A COMPARISON OF RAY-TRACING SOFTWARE FOR THE DESIGN OF QUADRUPOLE MICROBEAM
SYSTEMS
By S. Incerti et al.,
Published in Nucl.Instrum.Meth.B231:76-85, 2005
- DEVELOPMENT OF A FOCUSED CHARGED PARTICLE MICROBEAM FOR THE IRRADIATION OF
INDIVIDUAL CELLS.
By Ph. Barberet, A. Balana, S. Incerti, C. Michelet-Habchi, Ph. Moretto,
Th. Pouthier. Dec 2004. 6pp.
Published in Rev.Sci.Instrum.76:015101, 2005
- SIMULATION OF CELLULAR IRRADIATION WITH THE CENBG MICROBEAM LINE USING
GEANT4.
By S. Incerti, Ph. Barberet, R. Villeneuve, P. Aguer, E. Gontier,
C. Michelet-Habchi, Ph. Moretto, D.T. Nguyen, T. Pouthier, R.W. Smith. Oct 2003. 6pp.
Published in IEEE Trans.Nucl.Sci.51:1395-1401, 2004
- SIMULATION OF ION PROPAGATION IN THE MICROBEAM LINE OF CENBG USING
GEANT4.
By S. Incerti, Ph. Barberet, B. Courtois, C. Michelet-Habchi,
Ph. Moretto. Sep 2003.
Published in Nucl.Instrum.Meth.B210:92-97, 2003
---->3 VISUALIZATION
The user can visualize the targeted cell thanks to the Qt interface.
---->4. HOW TO RUN THE EXAMPLE
The code should be compiled with cmake.
Run the example from your build directory with:
./microbeam microbeam.mac
or in interactive mode:
./microbeam
The example works in MT mode.
---->5. PHYSICS
Livermore physics list is used by default.
---->6. SIMULATION OUTPUT AND RESULT ANALYZIS
The output results consist in a microbeam.root file per thread,
containing several ntuples:
* total deposited dose in the cell nucleus and in the cell
cytoplasm by each incident alpha particle;
* average on the whole run of the dose deposited per
Voxel per incident alpha particle;
* final stopping (x,y,z) position of the incident
alpha particle within the irradiated medium (cell or culture medium);
* stopping power dE/dx of the incident
alpha particle just before penetrating into the targeted cell;
* beam transverse position distribution (X and Y)
just before penetrating into the targeted cell;
These results can be easily analyzed using for example the provided ROOT macro
file plot.C; to do so :
* be sure to have ROOT installed on your machine
* be sure to be in the directory where the output ROOT files have been created
* do: root plot.C
* or under your ROOT session, type in : .X plot.C to execute the macro file
---------------------------------------------------------------------------
Should you have any enquiry, please do not hesitate to contact:
incerti@cenbg.in2p3.fr
+127
View File
@@ -0,0 +1,127 @@
-------------------------------------------------------------------
-------------------------------------------------------------------
=========================================================
Geant4 - Microelectronics example
=========================================================
README file
----------------------
CORRESPONDING AUTHORS
M. Raine*, D. Lambert*, C. Inguimbert', Q. Gibaru'
* CEA, DAM, DIF, F-91297 Arpajon, France
' ONERA, 2 avenue Edouard Belin - BP 74025 - 31055 TOULOUSE, France
email: melanie.raine@cea.fr damien.lambert@cea.fr
christophe.Inguimbert@onera.fr Quentin.Gibaru@onera.fr
---->0. INTRODUCTION.
The microelectronics example simulates the track of a 5 MeV proton in silicon.
Geant4 standard EM models are used in the World volume while Geant4-MicroElec models
are used in a Target volume, declared as a Region.
---->1. GEOMETRY SET-UP.
By default, the geometry is a 2 um side cube (World) made of silicon containing
a smaller cubic Target volume of silicon (1 um3).
The target material can be modified and simulated with G4MicroElecPhysics processes.
---->2. SET-UP
Make sure that the G4EMLOW database version is correct (> or = 7.16)
The variable G4ANALYSIS_USE must be set to 1.
The code should be compiled with cmake:
$ mkdir microelectronics-build
$ cd microelectronics-build
$ cmake -DGeant4_DIR=/your_path/geant4-install/ $PATHTOMICROELECEXAMPLE/microelectronics
$ make
It works in MT mode (but in this example today MT=1 due to memory consumption of new Microelec models).
---->3. HOW TO RUN THE EXAMPLE
In interactive mode, run:
./microelectronics
The macro microelectronics.mac is executed by default.
To get visualization, make sure to uncomment the #/control/execute vis.mac
line in the macro.
By default, the new MicroElec models are used.
You can used the Silicon MicroElec models, with the "-onlySi" option:
./microelectronics -onlySi
or
./microelectronics microelectronics.mac -onlySi
You can change the type of the target material
(G4_Ag G4_Al G4_C G4_Cu G4_Ge G4_KAPTON G4_Ni G4_Si G4_SILICON_DIOXIDE G4_Ti G4_W),
if you uncomment one line (/microelectronics/det/setMat) into the .mac file.
---->4. PHYSICS
This example shows:
- how to use the G4MicroElecPhysics and G4MicroElecSiPhysics processes,
- how to affect them a name
- how to combine them with Standard EM Physics.
A simple electron capture process is also provided in order to kill electrons
below a chosen energy threshold, set in the Physics list.
Look at the G4MicroElecSiPhysics.cc (previous silicon MicroElec models)
and G4MicroElecPhysics.cc (new MicroElec models) files.
---->5. SIMULATION OUTPUT AND RESULT ANALYZIS
The output results consists in a microelectronics.root file, containing for each simulation step:
- the type of particle for the current step
- the type of process for the current step
- the track position of the current step (in nanometers)
- the energy deposit along the current step (in eV)
- the step length (in nm)
- the total enery loss along the current step (in eV)
This file can be easily analyzed using for example the provided ROOT macro
file plot.C; to do so :
* be sure to have ROOT installed on your machine
* be sure to be in the microelectronics directory
* launch ROOT by typing root
* under your ROOT session, type in : .X plot.C to execute the macro file
* alternatively you can type directly under your session : root plot.C
The naming scheme on the displayed ROOT plots is as follows (see SteppingAction.cc):
-particles:
e- : 1
proton : 2
ion : 3
-processes:
e-_G4MicroElecElastic 11
e-_G4MicroElecInelastic 12
eCapture 13
p_G4MicroElecInelastic 14
ion_G4MicroElecInelastic 15
hIoni 16
eIoni 17
G4MicroElecPhysics parameters:
e-_G4LOPhononScattering 19
e-_G4MicroElecSurface 20
alpha_G4Dielectrics 21
ion_G4Dielectrics 22
---------------------------------------------------------------------------
Should you have any enquiry, please do not hesitate to contact one the corresponding authors.
+135
View File
@@ -0,0 +1,135 @@
-------------------------------------------------------------------
-------------------------------------------------------------------
=========================================================
Geant4 - Nanobeam example
=========================================================
README file
----------------------
CORRESPONDING AUTHOR
S. Incerti (a, *) et al.
a. Centre d'Etudes Nucleaires de Bordeaux-Gradignan
(CENBG), IN2P3 / CNRS / Bordeaux 1 University, 33175 Gradignan, France
* e-mail:incerti@cenbg.in2p3.fr
---->1. INTRODUCTION.
The nanobeam example simulates the beam optics of the nanobeam line installed
on the AIFIRA electrostatic accelerator facility located at CENBG,
Bordeaux-Gradignan, France. For more information on this facility,
please visit :
http://www.cenbg.in2p3.fr/
The code can be used to calculate :
1) intrinsic aberration coefficients of the nanobeam line
2) beam image from a relasitic primary emittance distribution
3) grid shadow images
Three quadrupole field models can be used :
- a simple square field model
- a 3D mesh field model computed from OPERA3D
- an analytical model based on Enge's model
---->2. GEOMETRY SET-UP.
The full magnetic configuration of the nanobeam line is simulated.
This configuration is made of a combination of a doublet and triplet of
5 Oxford Microbeams Ltd. OM50 quadrupoles.
More details on the experimental setup and its simulation with Geant4 can
be found in the following papers:
- A DETAILED RAY-TRACING SIMULATION OF THE HIGH RESOLUTION MICROBEAM AT THE
AIFIRA FACILITY
By F. Andersson, Ph. Barberet, S. Incerti, Ph. Moretto
Published in Nucl.Instrum.Meth.B266:1653-1658, 2008
- MONTE CARLO SIMULATION OF THE CENBG MICROBEAM AND NANOBEAM LINES WITH THE
GEANT4 TOOLKIT
By S. Incerti, Q. Zhang, F. Andersson, Ph. Moretto, G.W. Grime,
M.J. Merchant, D.T. Nguyen, C. Habchi, T. Pouthier and H. Seznec
Published in Nucl.Instrum.Meth.B260:20-27, 2007
- GEANT4 SIMULATION OF THE NEW CENBG MICRO AND NANO PROBES FACILITY
By S. Incerti, C. Habchi, Ph. Moretto, J. Olivier and H. Seznec
Published in Nucl.Instrum.Meth.B249:738-742, 2006
- A COMPARISON OF RAY-TRACING SOFTWARE FOR THE DESIGN OF QUADRUPOLE MICROBEAM
SYSTEMS
By S. Incerti et al.,
Published in Nucl.Instrum.Meth.B231:76-85, 2005
---->3 VISUALIZATION
Visualization has not been implemented.
---->4. HOW TO RUN THE EXAMPLE
1) You must have compiled your Geant4 installation with the FULL version of the
CLHEP library which can handle matrix operations.
2) The code should be compiled cmake and run with :
./nanobeam
The macro file default.mac is read by default.
Several macro files are provided:
1) for the computation of intrinsic aberration coefficients :
coef-square.mac : using square magnetic field model
coef-map.mac : using 3D map magnetic field model
coef-enge.mac : using Enge's analytical field model
2) for the simulation of the beam image with a realistic emittance :
image-square.mac : using square magnetic field model (=default.mac)
image-map.mac : using 3D map magnetic field model
image-enge.mac : using Enge's analytical field model
3) for the simulation of grid shadow images
grid-square.mac : using square magnetic field model
grid-map.mac : using 3D map magnetic field model
grid-enge.mac : using Enge's analytical field model
These macros files are stored in the ./macros directory.
To run macros which include *map* in their name, copy the file OM50.grid
into the directory in which you run ./nanobeam.
The code can be run in MT mode, for high statistics image simulation.
Do not use MT for aberration coefficients calculation (32 rays only are shot).
The switch to MT can be made in nanobeam.cc.
---->5. PHYSICS
The example runs with protons with fluctuating energies around 3 MeV.
Standard electromagnetic processes are activated by default (corresponding to the
Physics builder G4EmStandardPhysics), including the G4StepLimiter process.
---->6. SIMULATION OUTPUT AND RESULT ANALYZIS
All results are stored in the nanobeam.root file and can be displayed with the provided
ROOT macro file plot.C:
* be sure to have ROOT installed on your machine
* be sure to be in the directory where ROOT output files are generated
* copy plot.C into this directory
* launch ROOT by typing root, then under your ROOT session, type in : .X plot.C
to execute the macro file
* or type directly: root plot.X
This macro file shows :
- the beam profile along the nanobeam line (only for the computation of intrinsic
coefficients)
- the beam image (Y vs X) on target
- the beam emittance (THETA vs X) and (PHY vs Y) on target
- the grid shadow image (option)
The output ntuples can be written as xml or csv files, by changing the G4AnalysisManager default file type in RunAction::BeginOfRunAction().
---------------------------------------------------------------------------
Should you have any enquiry, please do not hesitate to contact:
incerti@cenbg.in2p3.fr
@@ -0,0 +1 @@
Needed by svn for results directory
+124
View File
@@ -0,0 +1,124 @@
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
purgin_magnet
-------------
s. Larsson, May 2004
-----------------------------------------------------------------
Acknowledgments to the GEANT4 Collaboration, in particular to J. Apostolakis,
J Generowicz, G. Folger, Vladimir Ivanchenko, M.G.Pia and
S. Guatelli.
-----------------------------------------------------------------
0. Introduction
----------------
This example simulates electrons traveling through a 3D magnetic field.
The Purging Magnet example is an application of Geant4 in a medical
environment. It simulates a strong purging magnet in a treatment head.
The geometry is very simplified. The major idea of this example is to
implement an external magnetic field grid and test if the deviation of
electrons are as expected in this particular field. The data (position,
energy and momentum) are collected in a measurement volume. The data is
stored in a CSV file (or, optionally in a ROOT, or a XML file, by changing
the G4AnalysisManager default file type in PurgMagRunAction::Book().
<<<<<<< HEAD
=======
>>>>>>> Migration to G4RunManagerFactory done.
1. Setting up the environment variables
---------------------------------------
The following environment variables need to be set:
G4LEDATA: points to low energy data base
The required data-file for the detailed field map can be downloaded from:
http://cern.ch/geant4-data/datasets/PurgMag3D.TABLE.gz
2. How to run the example
-------------------------
- Run the "PurgMag" executable.
- File PurgMag.TABLE needs to be available in the current directory in order to run correctly.
- For visualisation use vis.mac.
- Interactive or batch modes possible.
Default: Interactive mode.
To run a certain number of events in interactive mode,
type the following at the "idle>" prompt:
idle> run/beamOn NumberOfEvents
idle> exit
- Simulation histogram output is stored in purgmag_101.cvs (e-),
purgmag_102.cvs (gammas), purgman_103.cvs (e+)
1)Ntuple with position, energy and momentum for electrons
2)Ntuple with position, energy and momentum for photons
(not needed in this example, will be used in further development)
3)Ntuple with position, energy and momentum for positrons
(not needed in this example, will be used in further development)
A default visualisation macro (vis.mac) is pre-loaded before interactive runs.
Executing it from the build directory:
$ ./PurgMag
runs vis.mac before giving you an interactive prompt.
3. Detector description
-----------------------
Simply a measurement volume. All particles entering the volume are scored.
4. Physics processes
--------------------
This example uses the standard Electromagnetic processes.
5. Particle Generator
----------------------
The PurgMagPrimaryGeneratorAction sets the initial state of tracks to
-electrons 50MeV
-Start position (0, 0, 15cm)
-Momentum direction (0, 0, -1)
6. Geometry and materials
--------------------------
The world consists of Vacuum to minimize interactions of the electrons
with the medium. The purging magnet is implemented as a 3D field grid
of field values and geometerically as a pole gap made of iron. The
measurement volume also contains vacuum.
The field is interpolated using a simple linear interpolation in two
dimensions (z and rho).
7. Comparison
--------------
The design of the magnetic field was made with the OPERA 3D package
which is an electromagnetic finite element and finite difference
analysis software. The deviation in the y-direction (ey in Ntuple 1)
has also been calculated in the OPERA 3D module TOSCA for comparison.
TOSCA: deviation y-direction: 35.112 cm
GEANT4: deviation y-direction: 35.170 cm (updated after PurgMag.pdf)
****************************************************************
* *
* More information about the setup and geometry in PurgMag.pdf *
* *
****************************************************************
+141
View File
@@ -0,0 +1,141 @@
=========================================================
Geant4 - Radioprotection example
=========================================================
README
---------------------
The radioprotection example is developed and mantained by Susanna Guatelli (Centre For Medical Radiation Physics (CMRP), University of Wollongong, NSW, Australia) and Francesco Romano (INFN - Sezione di Catania, Catania, Italy)
------------------------------------------------------------------------
Contact: susanna@uow.edu.au
francesco.romano@ct.infn.it
geant4-advanced-examples@cern.ch
------------------------------------------------------------------------
List of external collaborators:
J. Magini and G. Parisi - University of Surrey, United Kingdom
J. Davis and D. Bolst - University of Wollongong, NSW, Australia
-----------------------------------------------------------------
----> Introduction.
Radioprotection example models different detectors for microdosimetry in space applications. The example lets the user
choose between the models of a simplified diamond (1), a micro-diamond (2) and a silicon microdosimeter (3):
1) A semplified diamond microdosimeter is based on the detector developed by Prof. Anatoly Rosenfeld and his team at the Centre For Medical Radiation Physics, CMRP, University of Wollongong, NSW, Australia. The design of the device is documented in J. Davis, et al., "Characterisation of a novel diamond-based microdosimeter prototype
for radioprotection applications in space environments",IEEE Transactions on Nuclear Science,
Vol. 59, pp. 3110-3116, 2012.
2) The microdiamond detector is based on the detectors developed by the Research Group of The University of Rome "Tor Vergata". The design and performances of the detector are documented in C. Verona et al., "Spectroscopic properties and radiation damage investigation of a diamond based Schottky diode for ion-beam therapy microdosimetry", Journal of Applied Physics, vol. 118, 2015, and in C. Verona et al., "Toward the use of single crystal diamond based detector for ion-beam therapy microdosimetry", Radiation Measurements, vol. 110, 2018.
3) The silicon microdosimeter is based on the "Bridge" microdosimeter, developed by the Centre For Medical Radiation physics, University of Wollongong, documented in chapter 7 of the PhD Thesis of D. Bolst “Silicon microdosimetry in hadron therapy using Geant4”, https://ro.uow.edu.au/theses1/619/
All the microdosimeters are set in vacuum and it is possible to select among the avilable detectors
via a macro command (/geometrySetup/selectDetector "..."), which is included in the "geometry.mac" macro.
This macro is, in turn, called in both the vis.mac and run.mac macro files.
An isotropic field of Galactic Cosmic Rays (GCR) protons is incident on the device.
The energy deposition is calculated in the sensitive detectors.
In particular in this example it is shown how to:
- model a realistic isotropic field of GCRs by means of the General Particle Source
- model a realistic detector in Geant4
- retrieve the information of secondary particles originated in the SV
- define the physics by means of a Geant4 Modular Physics List
- characterise the response of a realistic detector.
- save results in an analysis ROOT file using the Geant4 analysis component.
The example can be executed in multithreading mode
------------------------------------------------------------------------
----> 1.Experimental set-up.
The diamond microdosimeter is set in the center of the world. The world is a box with size 1 m, filled with vacuum.
Four SV structures are modelled, but only one has been made active (SV_phys1)
The primary radiation field is defined by means of the GeneralParticleSource in the file
primary.mac
-------------------------------------------------------------------------
----> 2.SET-UP
A standard Geant4 example CMakeLists.txt is provided.
Setup for analysis:
By default, the example has no analysis component.
To compile and use the application with the analysis on, build the example with the following command:
cmake -DWITH_ANALYSIS_USE=ON -DGeant4_DIR=/path/to/Geant4_installation /path/to/radioprotection example
plot.C is provided to plot the results of the simulation, contained
in the radioprotection.root file. If the user intends to use this macro, ROOT must be installed
(http://root.cern.ch/drupal/).
------------------------------------------------------------------------
----> 3.How to run the example.
- Batch mode:
./radioprotection run.mac
- Interative mode:
./radioprotection
vis.mac is the default macro, executed in interactive mode.
---------------------------------------------------------------------------------
----> 4. Primary radiation Field
The radiation field is defined with the General Particle Source.
Look at the macro primary.mac .
NOTE: To maximise efficiency the field has been modelled with a limiting angle to reduce redundant events.
------------------------------------------------------------------------
----> 5. Simulation output
**** SEQUENTIAL MODE
The output is radioprotection.root, containing
- an ntuple with the A, Z, and energy of the secondary particles originated in the diamond microdosimeters.
- an ntuple withe the energy spectrum (in MeV) of primary particles.
- an ntuple with the energy deposition per event(in keV) in the SV.
**** MULTITHREAD mode
output files:
radioprotection.root_t0
..
..
radioprotection.root_t#
where # is the number of threads
type: source MergeFiles to merge the output of each thread in a single one
-------------------------------------------------------------------------------
----> 6.Visualisation
a macro is provided ad example of visualisation: vis.mac
For any problem or question please contact Susanna Guatelli, susanna@uow.edu.au
-------------------------------------------------------------------------------
----> 7. Analysis
A macro: ProcessMicro.C
This macro performs analysis of the energy deposition stored in the ntuple of the ROOT file and performs the following microdosimetry operations:
-Bins the event by event energy deposition stored in the ntuple into a histogram (both with linear and logarithmic binning) and converts to lineal energy
-Calculates the quantities: mean lineal energy (yF), the dose mean lineal energy (yD), the quality factor (Q) using the weighting factors from the ICRP 60 report
-In addition to these quantities the macro also calculates an estimate for the RBE using the modified MK model. This model is not generally used for shielding/radiation proction but in hadron therapy, but is provided for interest.
-The macro also generates the common "microdosimetric spectra" or yd(y) in a semi-log plot and is saved as an image by default
------------------------------------------------------------------------------
-----> Future developments
1) The code will be refined and analysis improved
2) scripts for micorodosimetric spectra analysis will be implemented
3) Different models of detectors will be also included
@@ -0,0 +1,209 @@
------------------------------Advanced Example--------------------------------- README FILE
Note: Due to the importation of data files during the initialisation stage of
Geant4, load-time may be in excess of 5 minutes.
UNDERGROUND PHYSICS
An example of a underground dark matter experiment.
Please see the UserRequirements.txt and related web-pages referred to
at the end of that document.
Over-view:
A single liquid xenon cell is simulated within Geant4 and the scintillation
light produced from interactions from various calibration species is recorded
as PhotoMultiplier hits. The output is then written to an ASCII file for
future off-line analysis.
Geometry:
Experimental set-up:
G4double worldWidth = 470.0*cm + 2.*wallThick; // "x"
G4double worldLength = 690.0*cm + 2.*wallThick; // "y"
G4double worldHeight = 280.0*cm + 2.*wallThick; // "z"
A "cavern" of dimensions 5.18m x 7.38m x 3.28m with concrete walls is defined
as the World Volume. A laboratory geometry is incorporated included desks,
cupboards, door and windows. For ease this is included in a separate ".icc"
file which can be removed should the code seem cumbersome. In the centre of
the cavern a steel vacuum vessel containing liquid and gaseous xenon is placed.
The internal construction of the vessel accurately reproduces an existing
prototype Dark Matter detector which allows experimental comparison. The active
detector volume is defined by a series of metal rings, complemented by
a cover mirror and a PMT immersed in the liquid. Two grids and a
thermalising copper shield are also incorporated. The liquid/gas
interface is located 6mm away from the mirror surface. A Am241
calibration source is suspended from one of the grids in the liquid
phase, above the PMT.
XXX================XXX mirror
XXX________________XXX gas phase
XXX XXX
XXX XXX liquid phase
XXX XXX
XXX.......U........XXX grid + calibrator
XXX................XXX grid
XXX| |XXX
| ___------___ |
|| PMT ||
|| ||
Hits Output (file "hits.out"):
An ASCII file containing the following information:
Evt # : event number
Etot, MeV : energy deposited in liquid xenon
LXe hits : number of hits in liquid xenon
LXeTime, ns : time of first hit in liquid xenon
PMT hits : number of hits in PMT (photocathode)
PmtTime, ns : average PMT hit time relative to LXeTime
First hit : first particle to hit liquid xenon
Flags : particles contributing to energy deposition
Seeds : the initial seed values for given hit events
Note:
The time information PmtTime is erroneous when forcing nuclear
decay with the RadioactiveDecay module due to the precision
required to detect nanosecond scintillation times on a global
time of 432 years (in the case of 241Am decay).
Pmt Output (file "pmt.out"):
Photon hit positions within the PMT face (overwritten every event):
"Hit# X, mm Y, mm Z, mm"
To Run:
Either run the macro files interactively or in batch with the command
DMX macro_name.mac.
Macros:
initInter.mac
Initialisation macro for interactive mode.
gamma.mac
Shoots one 60 keV gamma upwards from the calibrator and traces the
scintillation light produced in LXe to the PMT. All tracks are drawn
with custom colours. PMT hits in photocathode are also shown. Event
summary is writen to file "hits.out".
gamma_1000.mac
Similar to above, but 1000 gammas are emmited isotropically from the
source. No hits or tracks are draw, and the verbosity is reduced.
alpha.mac
Shoots one 5.486 MeV alpha particle upwards from the calibrator and
traces the scintillation light to the PMT. All tracks except
optical photons are drawn. Event summary is written to file
"hits.out" and PMT hits to file "pmt.out".
alpha_1000.mac
Similar to above, but 1000 alphas are emmited isotropically from the
source. No tracks are stored, and the verbosity is reduced. Event
summary is written to file "hits.out", PMT hits are not written out.
neutron.mac
Shoots one 2.48 MeV neutron inside the room aimed at the detector.
All tracks except scintillation photons are drawn (custom colours).
Gammas are not killed at the concrete wall. Event summery is written
to file "hits.out".
ambe_spectrum.mac
Produces a spectrum of neutrons according to an approximation of a Am/Be
neutron source. However, this uses the GPS and therefore will only work
after compilation with the DMXENV_GPS_USE environment variable (see below)
sourceAm241.mac
Forces the decay of 241Am nuclei in the calibrator and tracks the
resulting particles (237Np + alpha + gamma from 237Np
de-excitation). All tracks are drawn except scintillation photons.
Event summery is written to file "hits.out".
-> To be added for a future release
sourceAm241_1000.mac
Similar to above but for 1000 events. No tracks are stored.
-> To be added for a future release
Note:
The following environment variables need to be set:
G4RADIOACTIVEDATA : points to Radioactive Decay Data files
G4LEDATA : points to low energy data base
G4LEVELGAMMADATA : points to PhotoEvaporation data
NeutronHPCrossSections : points to neutron data files
In addition if you require to use the full General Particle Source then the
variable DMXENV_GPS_USE can be set. The DMX gun is still included in order to
allow forward compatibility should the GPS change.
ANALYSIS:
The program should produce ROOT-based histogram files. It is possible to
produce the output in XML-compliant format by changing the G4AnalysisManager default file type in DMXRunAction::Book().
SEEDS:
The seeds of event hits are stored in the hit record file. These can be used
to repeat events for visualisation, test crashes/idiosyncracies:
/random/setDirectoryName ./seeds
/random/resetEngineFrom currentEvent.rndm
/random/saveThisEvent
/random/setSavingFlag
The file currentEvent.rndm should contain the two seeds which were outputed in
the scintHit file.
ERRORS:
When running interactively the following error will be shown:
BooleanProcessor::caseIE : unimplemented case
BooleanProcessor::caseIE : unimplemented case
BooleanProcessor::caseIE : unimplemented case
BooleanProcessor::caseIE : unimplemented case
BooleanProcessor::caseIE : unimplemented case
BooleanProcessor::caseIE : unimplemented case
BooleanProcessor: boolean operation failed
BooleanProcessor::caseIE : unimplemented case
BooleanProcessor::caseIE : unimplemented case
BooleanProcessor::caseIE : unimplemented case
BooleanProcessor::caseIE : unimplemented case
BooleanProcessor: boolean operation failed
This is a "feature" of the visualisation of boolean volumes, but does not
affect functionality/performance so can be ignored.
NB:
If using explicit libraries (?) i.e. non-shared then compilation time with
neutrons in physics list is very long (>5 minutes) - check this.............
It is more efficient to use shared libraries that are loaded at run-time with
increased initialisation time (at run-time).
Also if using shared libraries the load time at run-time may be several minutes
- this is partially due to the neutron implementation requires full data sets
for each isotope being specified.
--------------------------------------
If running on Redhat 7.0 or above set G4SYSTEM to Linux-g++, alternatively you
can install backward compatibility to egcs, however, requires
config/sys/Linux-egcs.gmk to be altered so that CXX is set to kgcc
(compared to g++ in original file)
--------------------------------------
Alex Howard, 29/11/01
updated 18/06/02
@@ -0,0 +1,38 @@
*******************************************************************************
*******************************************************************************
Readme File for STT of the Underground_Physics Advanced Example, DMX
*******************************************************************************
*******************************************************************************
STT testing of DMX should contain the following:
gmake
DMX stt.mat
this should produce two output files:
stt.out
stt_pmt.out
These should be compared with
stt_ref.out
stt_pmt_ref.out
The job should take
real 6m0.226s
user 5m25.870s
sys 0m2.410s
on a 850MHz Linux machine.
The memory usage should be around 110Mbytes.
The initialisation time is ~4.5 minutes, requires loading G4EMLOW1.1 and
G4NDL3.5 via setting G4LEDATA and NeutronHPCrossSections environment variables.
Platforms to be tested on:
SUN and LINUX, NOT WINDOWS.
Alex Howard
e-mail: alexander.howard@cern.ch
*******************************************************************************
*******************************************************************************
@@ -0,0 +1,83 @@
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
xray_fluorescence
-----------------
XrayFluo is an advanced Geant4 example reproducing various setups for PIXE or XRF experiments.
A sample macro (livermore.mac) is provided.
The detector is a monolitic Si(Li) or HPGe detector, with real response functions, stored in response.dat and SILIresponse.dat.
The sample, a simple box whose material can be selected, can be irradiated with different particles, with different spectra for the incident energy and with different shapes of the primary generator.
Two diaphragms reproducing those used to collimate the incident beam on sample and detector during the test beam are simulated as well
The aim of this advanced example is to illustrate Deexcitation products generation and analysis schemes available in Geant4.
Generation of particles is done via the G4ParticleGun: the example shows how to use it in order to obtain a beam of circular section or a particle source isotropic in space
The example includes the possibility to shoot particles according to a given energy spectrum: the files B_flare.dat, C_Flare.dat and M_flare.dat store the spectra of photons during solar flares, the files mercury2_flx_solmax.dat and mercury_flx_solmin.dat contain the spectra of protons respectively during solar maximum and solar minimum conditions, and merc2_flx_alp_max.dat merc_flx_alp_min.dat contain the spectra of alpha particles again respectively during solar maximum and solar minimum conditions. These features are available by changing hard-doced values in XrayFluoRunAction.cc
Histogramming facilities are provided using the built-it g4analysis tools of Geant4.
In order to be able to use any of these packages, prior installation is necessary to configure you environment to get visulaization, as described in geant4 manual.
#path to the lowEnergy data base
setenv G4LEDATA /your/path/to/geant4/data/G4EMLOWXX.XX
#path to Xray_Fluorescence data files, if not set, PWD is assumed:
setenv XRAYDATA /path/to/detector/and/input/spctra/files
1. Run
After the compilation of the program, to execute a sample simulation type (for example):
$G4WORKDIR/bin/Linux-g++/XrayFluo
The program gives, at tis point,the user 4 options:
Please Select Simulation Geometrical Set-Up:
1 - Test Beam
2 - Infinite Plane
3 - Planet and Sun
4 - Phase-Space Production
The first three choices are to choose different experimental set-ups (a test beam one, an infite plane and a planetary geometry), while the fourth is a simplified version of the first, without a detector, only to generate a tuple with particles genereted or exiting the sample.
In order to run a macro, type the following command:
idle> execute command "/control/execute xxxxx.mac"
If the analysis options are set, histograms will automatically stored in the corresponding files (root, by default)
In order to launch the application in batch mode, it is necessary to specify, after the executable file name, the name of the macro file and the number of the choice:
$G4WORKDIR/bin/Linux-g++/XrayFluo xxxxx.mac 1
2. Detector description
The telescope and detector geometry is defined in XrayFluoDetectorConstruction.cc and similar
3. Detector peculiar properties are described in XrayFluoSiLiDetectorType and XrayFluoHPGeDetectorType, both derived from XrayFluoVDetectorType. Other detector types can be added, creating other implementations of XrayFluoVDetectorType objects. Detector type selection is made in XrayFluoDetectorConstruction, and can be modified trough /apparate/detector command of the UI.
Other commands (apparate/sample /apparate/sampleGranularity /apparate/GrainDiameter) are present to simulate sample granulosity: grains are spheres, disposed in a compact cubic structure, i.e superipmposition of planes of maximum density with ABC ABC path. The fundamental cell is of type cubic with centered-faces.
4. Physics processes
Tha user can select the preferred physics list form the pre-built ones producin atomic deexcitation products: livermore, standard (opt 0, 1, 2, 3) and penelope.
5. Event generation
This is done using the G4ParticleGun with some modifications. See XrayFluoParticleGeneratorAction.cc
Event generation is controlled by commands in the /gun/category (see help for further details). In this readme only two commands are undrlined:
- /gun/loadGunData <filename>: to be used with the setup #1, loads the ntuple created in the setup #4. The loaded particles will be generated and will be directed ALL OF THEM to the detector. This can be useful to perform detector studies with encreased efficiency.
- /gun/loadRayleighFlag <true/false> This is used to let the user decide if backscattered primary particles should be loaded and directed toward the detector. This command, in order to be useful, must be used BEFORE the previous one.
+87
View File
@@ -0,0 +1,87 @@
-------------------------------------------------------------------
=========================================================
Geant4 - X-Ray Telescope Example
=========================================================
Introduction
------------
XrayTel is an advanced Geant4 example based on a realistic simulation of
an X-ray Telescope. It is based on work carried out by a team of Geant4
experts to simulate the interaction between X-ray Telescopes XMM-Newton
and Chandra with low energy protons present in the orbital radiation
background. The X-ray mirrors are designed to collect x-ray photons at
grazing-incidence angles and focus them onto detectors at the focal plane.
However, this mechanism also seems to work for low energy protons which,
if they reach the detectors in sufficient numbers, can cause damage.
In this example, the geometry has been simplified by using a single mirror
shell and no baffles, but all the dimensions and materials are realistic.
The aim of this advanced example is to illustrate the use advanced
GUI, visualisation, particle generation and analysis schemes available
in Geant4:
- macros are provided to display the geometry and particle tracks with
OpenGL, DAWN Postscript or VRML visualisation
- the generation of particles is done via the new General Particle Source
- histograming facilities are available through the G4AnalysisManager tools
In order to be able to use any of these packages, prior installation is
necessary and a number of environment variables will have to be set.
NOTE: The geometry is refreshed on the viewer at the beginning of each run,
but the tracks are plotted only in case an interesting event occurs.
This is the case only for about 1 every 10**4 events.
2. Run
To execute a sample simulation with visualisation of proton tracks
reaching the detector run:
XrayTel
execute command "/control/execute test.mac"
To enable visualisation, uncomment one line from test.mac:
/control/execute vis.mac
If the analysis options are set, histograms will
automatically created and the corresponding files will be created.
A 1D histogram will display the energy distribution of the protons
that reach the detector at the end of the run.
3. Detector description
The telescope and detector geometry is defined in
XrayTelDetectorConstruction.cc
4. Physics processes
The physics processes are in XrayTelPhysicsList.cc
The main process in this example is G4hMultipleScattering for scattering of the protons
off the mirror surfaces.
5. Event generation
This is done using the new General Particle Source. Documentation for
this can be found in:
http://reat.space.qinetiq.com/gps/
6. Analysis
Relevant information from the simulation is processed in the XrayTelAnalysis
class and saved, through the G4AnalysisManager interface, to Histograms and
Tuples. The output file is written in Root format, but one can easily switch to Xml (or Csv, Hdf5) by changing the G4AnalysisManager default file type in XrayTelAnalysis::book().
No external software is required (apart from the Hdf5 case).