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
@@ -0,0 +1,25 @@
///\file "radioactivedecay/.README.txt"
///\brief Examples radioactivedecay README page
/*! \page Examples_radioactivedecay Category "radioactivedecay"
Examples in this directory demonstrate the use of some features of the
Radioactive-Decay hadronic model in Geant4.
\link Examplerdecay01 rdecay01 \endlink
This example allows to display basic features of the radioactive decay
of a nuclei: energy spectrum of emitted particles, time of life, activity.
\link Examplerdecay02 rdecay02 \endlink
This example illustrates more advanced features of the package:
selected decay channels, time window, bias and variance reduction technique.
\link ExampleActivation Activation \endlink
Compute and plot time evolution of each nuclide in an hadronic cascade.
Compute and plot activity of emerging particles.
*/
@@ -0,0 +1,183 @@
///\file "radioactivedecay/Activation/.README.txt"
///\brief Example Activation README page
/*! \page ExampleActivation Example Activation
Survey energy deposition and particle's flux from an hadronic cascade,
including radioactive decays.
The main purpose of the example is to plot evolution of each metastable isomer
as a function of time, taking into account the time of exposure in the beam.
Also plot the activity of emerging particles.
Use PhysicsConstructor objects rather than predefined G4 PhysicsLists.
\section Activation_s1 MATERIALS AND GEOMETRY DEFINITION
The "absorber" is a box made of a given material.
Three parameters define the absorber :
- the material of the absorber
- the thickness of an absorber
- the transverse size of the absorber (the input face is a square)
The volume "World" contains the "absorber".
A function, and its associated UI command, allows to build a material
directly from a single isotope.
To be identified by the ThermalScattering module, the elements composing a
material must have a specific name (see G4ParticleHPThermalScatteringNames.cc)
Examples of such materials are build in DetectorConstruction::DefineMaterials().
\section Activation_s2 PHYSICS LIST
The physics list contains a "full" set of physics processes. It is defined in
the PhysicsList class as a Geant4 modular physics list with registered physics
constructors (builders).
Physics constructors are either constructors provided in Geant4 (with G4 prefix)
or 'local'. They include : HadronElastic, HadronInelastic, IonsInelastic, GammaNuclear,
RadioactiveDecay and Electomagnetic.
(see geant4/source/physics_lists/constructors)
HadronElasticPhysicsHP include a model for thermalized neutrons, under the control of a command
defined in NeutronHPMesseger.
GammmaNuclearPhysics is a subset of G4BertiniElectroNuclearBuilder.
ElectromagneticPhysics is a simplified version of G4EmStandardPhysics.
Several hadronic physics options are controlled by environment variables.
To select them, see Activation.cc
\section Activation_s3 AN EVENT : THE PRIMARY GENERATOR
The primary kinematic is a single particle which hits the absorber
perpendicular to the input face. The type of particle and its energy are
set in the PrimaryGeneratorAction class, and can be changed via the G4
build-in commands of G4ParticleGun class
(see the macros provided with this example).
One can control the transverse size of the beam.
The command
\verbatim
/testhadr/gun/beamSize
\endverbatim
is built in PrimaryGeneratorMessenger class.
The time of exposure in the beam may be finite. It is controled by the command
\verbatim
/testhadr/gun/beamTime.
\endverbatim
Then the time zero of each event is randomly chosen within this interval.
\section Activation_s4 PHYSICS
The program computes and plots energy deposited in the interaction volume
(absorber), energy spectrum and activity of particles leaving the absorber,
and evolution of population of metastable isomers within the absorber
(see below : histograms).
Processes invoked and particles generated during interactions are listed.
\section Activation_s5 HISTOGRAMS
The test contains 43 built-in 1D histograms, which are managed by
G4AnalysisManager and its Messenger. The histos can be individually
activated with the command :
\verbatim
/analysis/h1/set id nbBins valMin valMax unit
\endverbatim
where unit is the desired unit for the histo (MeV or keV, etc..)
(see the macros xxxx.mac).
1 "total energy deposit"
2 "Edep (MeV/mm) profile along beam direction"
3 "total kinetic energy emerging"
4 "energy spectrum of emerging gamma"
5 "energy spectrum of emerging e+-"
6 "energy spectrum of emerging neutrons"
7 "energy spectrum of emerging protons"
8 "energy spectrum of emerging deuterons"
9 "energy spectrum of emerging alphas"
10 "energy spectrum of all others emerging ions"
11 "energy spectrum of all others emerging baryons"
12 "energy spectrum of all others emerging mesons"
13 "energy spectrum of all others emerging leptons (neutrinos)"
14 "dN/dt (becquerel) of emerging gamma"
15 "dN/dt (becquerel) of emerging e+-"
16 "dN/dt (becquerel) of emerging neutrons"
17 "dN/dt (becquerel) of emerging protons"
18 "dN/dt (becquerel) of emerging deuterons"
19 "dN/dt (becquerel) of emerging alphas"
20 "dN/dt (becquerel) of all others emerging ions"
21 "dN/dt (becquerel) of all others emerging baryons"
22 "dN/dt (becquerel) of all others emerging mesons"
23 "dN/dt (becquerel) of all others emerging leptons (neutrinos)"
Histograms 24 to 43 are assigned to population of metastable isomer.
Here, ´metastable' means time life > 0.
The type and number of isomers created in a run cannot be predicted in advance.
Therefore the assignation : isomer <--> histo_Id is done on fly
and printed at end of run. A lock mechanism is necessary in MT mode; see Run.cc
Activation and binning control of histograms is done with the usual command
\verbatim
/analysis/h1/set
\endverbatim
One can control the name of the histograms file with the command:
\verbatim
/analysis/setFileName name (default Activation)
\endverbatim
It is possible to choose the format of the histogram file : root (default),
xml, csv, by using namespace in HistoManager.hh
It is also possible to print selected histograms on an ascii file:
\verbatim
/analysis/h1/setAscii id
\endverbatim
All selected histos will be written on a file name.ascii (default Activation)
\section Activation_s6 VISUALIZATION
The Visualization Manager is set in the main().
The initialisation of the drawing is done via the commands
/vis/... in the macro vis.mac. To get visualisation:
\verbatim
> /control/execute vis.mac
\endverbatim
The tracks are drawn at the end of event, and erased at the end of run.
gamma green
neutron yellow
negative particles (e-, ...) red
positive particles (e+, ions, ...) blue
\section Activation_s7 HOW TO START ?
Execute Activation in 'batch' mode from macro files :
\verbatim
% ./Activation run1.mac
\endverbatim
Execute Activation in 'interactive mode' with visualization :
\verbatim
% ./Activation
Idle> control/execute vis.mac
....
Idle> type your commands
....
Idle> exit
\endverbatim
Macros provided in this example:
- Bi209.mac: neutron (25 meV) on 10 cm of Bi209
- Co60.mac: neutron (25 meV) on 1 cm of Cobalt.
Macros to be run interactively:
- debug.mac: neutron (25 meV) on Cobalt
- vis.mac: To activate visualization
*/
@@ -0,0 +1,163 @@
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
Activation
----------
Survey energy deposition and particle's flux from an hadronic cascade,
including radioactive decays.
The main purpose of the example is to plot evolution of each metastable isomer
as a function of time, taking into account the time of exposure in the beam.
Also plot the activity of emerging particles.
Use PhysicsConstructor objects rather than predefined G4 PhysicsLists.
1- MATERIALS AND GEOMETRY DEFINITION
The "absorber" is a box made of a given material.
Three parameters define the absorber :
- the material of the absorber
- the thickness of an absorber
- the transverse size of the absorber (the input face is a square)
The volume "World" contains the "absorber".
A function, and its associated UI command, allows to build a material
directly from a single isotope.
To be identified by the ThermalScattering module, the elements composing a
material must have a specific name (see G4ParticleHPThermalScatteringNames.cc)
Examples of such materials are build in DetectorConstruction::DefineMaterials().
2- PHYSICS LIST
The physics list contains a "full" set of physics processes. It is defined in
the PhysicsList class as a Geant4 modular physics list with registered physics
constructors (builders).
Physics constructors are either constructors provided in Geant4 (with G4 prefix)
or 'local'. They include : HadronElastic, HadronInelastic, IonsInelastic, GammaNuclear,
RadioactiveDecay and Electomagnetic.
(see geant4/source/physics_lists/constructors)
HadronElasticPhysicsHP include a model for thermalized neutrons, under the control of a command
defined in NeutronHPMesseger.
GammmaNuclearPhysics is a subset of G4BertiniElectroNuclearBuilder.
ElectromagneticPhysics is a simplified version of G4EmStandardPhysics.
Several hadronic physics options are controlled by environment variables.
To select them, see Activation.cc
3- AN EVENT : THE PRIMARY GENERATOR
The primary kinematic is a single particle which hits the absorber
perpendicular to the input face. The type of particle and its energy are
set in the PrimaryGeneratorAction class, and can be changed via the G4
build-in commands of G4ParticleGun class
(see the macros provided with this example).
One can control the transverse size of the beam.
The command /testhadr/gun/beamSize is built in PrimaryGeneratorMessenger class.
The time of exposure in the beam may be finite. It is controled by the command
/testhadr/gun/beamTime.
Then the time zero of each event is randomly chosen within this interval.
4- PHYSICS
The program computes and plots energy deposited in the interaction volume
(absorber), energy spectrum and activity of particles leaving the absorber,
and evolution of population of metastable isomers within the absorber
(see below : histograms).
Processes invoked and particles generated during interactions are listed.
5- HISTOGRAMS
The test contains 43 built-in 1D histograms, which are managed by
G4AnalysisManager and its Messenger. The histos can be individually
activated with the command :
/analysis/h1/set id nbBins valMin valMax unit
where unit is the desired unit for the histo (MeV or keV, etc..)
(see the macros xxxx.mac).
1 "total energy deposit"
2 "Edep (MeV/mm) profile along beam direction"
3 "total kinetic energy emerging"
4 "energy spectrum of emerging gamma"
5 "energy spectrum of emerging e+-"
6 "energy spectrum of emerging neutrons"
7 "energy spectrum of emerging protons"
8 "energy spectrum of emerging deuterons"
9 "energy spectrum of emerging alphas"
10 "energy spectrum of all others emerging ions"
11 "energy spectrum of all others emerging baryons"
12 "energy spectrum of all others emerging mesons"
13 "energy spectrum of all others emerging leptons (neutrinos)"
14 "dN/dt (becquerel) of emerging gamma"
15 "dN/dt (becquerel) of emerging e+-"
16 "dN/dt (becquerel) of emerging neutrons"
17 "dN/dt (becquerel) of emerging protons"
18 "dN/dt (becquerel) of emerging deuterons"
19 "dN/dt (becquerel) of emerging alphas"
20 "dN/dt (becquerel) of all others emerging ions"
21 "dN/dt (becquerel) of all others emerging baryons"
22 "dN/dt (becquerel) of all others emerging mesons"
23 "dN/dt (becquerel) of all others emerging leptons (neutrinos)"
Histograms 24 to 43 are assigned to population of metastable isomer.
Here, ´metastable' means time life > 0.
The type and number of isomers created in a run cannot be predicted in advance.
Therefore the assignation : isomer <--> histo_Id is done on fly
and printed at end of run. A lock mechanism is necessary in MT mode; see Run.cc
Activation and binning control of histograms is done with the usual command
/analysis/h1/set
One can control the name of the histograms file with the command:
/analysis/setFileName name (default Activation)
It is possible to choose the format of the histogram file : root (default),
xml, csv, by using namespace in HistoManager.hh
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 Activation)
6- VISUALIZATION
The Visualization Manager is set in the main().
The initialisation of the drawing is done via the commands
/vis/... in the macro vis.mac. To get visualisation:
> /control/execute vis.mac
The tracks are drawn at the end of event, and erased at the end of run.
gamma green
neutron yellow
negative particles (e-, ...) red
positive particles (e+, ions, ...) blue
7- HOW TO START ?
Execute Activation in 'batch' mode from macro files :
% ./Activation run1.mac
Execute Activation in 'interactive mode' with visualization :
% ./Activation
Idle> control/execute vis.mac
....
Idle> type your commands
....
Idle> exit
Macros provided in this example:
- Bi209.mac: neutron (25 meV) on 10 cm of Bi209
- Co60.mac: neutron (25 meV) on 1 cm of Cobalt.
Macros to be run interactively:
- debug.mac: neutron (25 meV) on Cobalt
- vis.mac: To activate visualization
+24
View File
@@ -0,0 +1,24 @@
Geant4 extended examples - radioactive decay
--------------------------------------------
Examples in this directory demonstrate the use of some features of the
Radioactive-Decay hadronic model in Geant4.
rdecay01
--------
This example allows to display basic features of the radioactive decay
of a nuclei: energy spectrum of emitted particles, time of life, activity.
rdecay02
--------
This example illustrates more advanced features of the package:
selected decay channels, time window, bias and variance reduction technique.
Activation
----------
Compute and plot time evolution of each nuclide in an hadronic cascade.
Compute and plot activity of emerging particles.
@@ -0,0 +1,163 @@
///\file "radioactivedecay/rdecay01/.README.txt"
///\brief Example rdecay01 README page
/*! \page Examplerdecay01 Example rdecay01
Survey G4RadioactiveDecay process. See Physics Reference Manual, chapter 36.
See also http://ie.lbl.gov/decay.html
\section rdecay01_s1 Geometry construction
It is a simple box which represente an 'infinite' homogeneous medium.
\section rdecay01_s2 Physics list
PhysicsList.cc defines only G4RadioactiveDecay, G4Transportation processes,
and relevant particle definitions.
Therefore, once created, particles or ions travel as geantino.
\section rdecay01_s3 Primary generator
Default kinematic is an ion (Ne24), at rest, at coordinate origin.
Can be changed with particleGun commands.
\section rdecay01_s4 Physics
As said above, all particles and ions behave as geantino, eg. no energy loss.
A flag:
\verbatim
/rdecay01/fullChain (true or false)
\endverbatim
allows to limit to single decay or full decay chain (default).
In case of full decay chain, G4TrackStatus of ions is set to fStopButAlive
in order to force decay at rest.
In case of single decay, G4TrackStatus of secondary ion is set to fStopAndKill.
At each decay, one counts and plots energy spectrum of created particles and
ions, and energy-momentum balance of that decay.
Total time of life of decay chain is plotted. Activity is computed.
The command
\verbatim
/rdecay01/timeWindow
\endverbatim
allows to survey activity of each nuclide in a specified
time window [t1,t2] : population at t1 and t2, nb of decays within [t1,t2], mean activity.
See timeWindow.mac
Few macros are given in example. Debug.mac is to be run in interactive mode.
\section rdecay01_s5 User data files
Users can redefine RadioactiveDecay and PhotonEvaporation data, via commands:
\verbatim
/grdm/setRadioactiveDecayFile
/grdm/setPhotoEvaporationFile
\endverbatim
Examples of such files are given in subdirectory UserData. \n
Formats are described in readme \n
Examples in macros Cf238.mac and No252.mac
\section rdecay01_s6 example of biasing
macro timeWindowBiased.mac illustrates one of the biasing capabilities of the
radioactiveDecay package. Ca47 is forced to decay within 20 days
(eg. 1728000 seconds in data file).
It is instructive to plot time of life (histo 8) with and without the weight of the track:
see line 189/190 of TrackingAction.cc
And also to compare with analog decay mode : comment out /grdm/ commands in the macro.
\section rdecay01_s7 Visualisation
Visualization Manager is set in the main () (see rdecay01.cc).
Initialisation of the drawing is done via the commands
/vis/.. in the macro vis.mac. This macro is automatically read from the main
in case of interactive running mode.
- e- red
- e+ blue
- nu_e white
- anti_nu_e white
- gamma green
- alpha yellow
- GenericIon grey
\section rdecay01_s8 How to start ?
- Execute rdecay01 in 'batch' mode from macro files
\verbatim
% rdecay01 singleDecay.mac
\endverbatim
- Execute rdecay01 in 'interactive mode' with visualization
\verbatim
% rdecay01
....
Idle> ---> type your commands. For instance:
Idle> /control/execute debug.mac
....
Idle> /run/beamOn 1
....
Idle> exit
\endverbatim
Macros provided in this example:
- Co60.mac: Co60
- Gd158.mac: Gd158 excited state
- No158.mac: read user data file
- Po212.mac: Po212 excited state
- Ra228.mac: Ra228 excited state
- alpha.mac: Po212 alpha decay
- atomicDeexcitation.mac: plot Auger cascade
- fullChain.mac: U238
- neutron.mac: Li10 neutron emission
- proton.mac: Co53 proton emission
- singleDecay.mac: Ne10
- timeWindow.mac: print activity within a given time window
- timeWindowBiased.mac: force decay within a given time window
Macros to be run interactively:
- Cf238.mac: read user data file
- debug.mac: Pb210
- electronicCapture.mac: Fe55 electronic capture
- vis.mac: To activate visualization
\section rdecay01_s9 Histograms
rdecay01 produces several 1D histograms which are saved as
rdecay01.root by default.
- 1 : energy spectrum: e+ e-
- 2 : energy spectrum: nu_e anti_nu_ev
- 3 : energy spectrum: gamma
- 4 : energy spectrum: alpha
- 5 : energy spectrum: ions
- 6 : total kinetic energy (Q)
- 7 : momentum balance
- 8 : total time of life of decay chain
- 9 : total visible energy
The histograms are managed by G4AnalysiManager and its Messenger.
The histos can be individually activated with the command :
\verbatim
/analysis/h1/set id nbBins valMin valMax unit
\endverbatim
where unit is the desired unit for the histo (MeV or keV, deg or mrad, etc..)
One can control the name of the histograms file with the command:
\verbatim
/analysis/setFileName name (default rdecay1)
\endverbatim
It is possible to choose the format of the histogram file : root (default),
xml, csv, by using namespace in HistoManager.hh
It is also possible to print selected histograms on an ascii file:
\verbatim
/analysis/h1/setAscii id
\endverbatim
All selected histos will be written on a file name.ascii (default rdecay1)
*/
@@ -0,0 +1,153 @@
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
rdecay01
--------
Survey G4RadioactiveDecay process. See Physics Reference Manual, chapter 36.
See also http://ie.lbl.gov/decay.html
1- Geometry construction
---------------------
It is a simple box which represente an 'infinite' homogeneous medium.
2- Physics list
------------
PhysicsList.cc defines only G4RadioactiveDecay, G4Transportation processes,
and relevant particle definitions.
Therefore, once created, particles or ions travel as geantino.
3- Primary generator
-----------------
Default kinematic is an ion (Ne24), at rest, at coordinate origin.
Can be changed with particleGun commands.
4- Physics
-------
As said above, all particles and ions behave as geantino, eg. no energy loss.
A flag, /rdecay01/fullChain (true or false), allows to limit to
single decay or full decay chain (default).
In case of full decay chain, G4TrackStatus of ions is set to fStopButAlive
in order to force decay at rest.
In case of single decay, G4TrackStatus of secondary ion is set to fStopAndKill.
At each decay, one counts and plots energy spectrum of created particles and
ions, and energy-momentum balance of that decay.
Total time of life of decay chain is plotted. Activity is computed.
The command /rdecay01/timeWindow allows to survey activity of each nuclide in a specified
time window [t1,t2] : population at t1 and t2, nb of decays within [t1,t2], mean activity.
See timeWindow.mac
Few macros are given in example. Debug.mac is to be run in interactive mode.
4-a User data files
-------------------
Users can redefine RadioactiveDecay and PhotonEvaporation data, via commands:
/grdm/setRadioactiveDecayFile
/grdm/setPhotoEvaporationFile
Examples of such files are given in subdirectory UserData.
Formats are described in readme
Examples in macros Cf238.mac and No252.mac
4-b example of biasing
----------------------
macro timeWindowBiased.mac illustrates one of the biasing capabilities of the
radioactiveDecay package. Ca47 is "forced" to decay within 20 days
(eg. 1728000 seconds in data file).
It is instructive to plot time of life (histo 8) with and without the weight of the track:
see lines 189/190 of TrackingAction.cc
And also to compare with analog decay mode : comment out /grdm/ commands in the macro.
5- Visualisation
-------------
Visualization Manager is set in the main().
Initialisation of the drawing is done via the commands
/vis/.. in the macro vis.mac. This macro is automatically read from the main
in case of interactive running mode.
e- red
e+ blue
nu_e white
anti_nu_e white
gamma green
alpha yellow
GenericIon grey
6- How to start ?
--------------
- Execute rdecay01 in 'batch' mode from macro files
% rdecay01 singleDecay.mac
- Execute rdecay01 in 'interactive mode' with visualization
% rdecay01
....
Idle> ---> type your commands. For instance:
Idle> /control/execute debug.mac
....
Idle> /run/beamOn 1
....
Idle> exit
Macros provided in this example:
- Co60.mac: Co60
- Gd158.mac: Gd158 excited state
- No158.mac: read user data file
- Po212.mac: Po212 excited state
- Ra228.mac: Ra228 excited state
- alpha.mac: Po212 alpha decay
- atomicDeexcitation.mac: plot Auger cascade
- fullChain.mac: U238
- neutron.mac: Li10 neutron emission
- proton.mac: Co53 proton emission
- singleDecay.mac: Ne10
- timeWindow.mac: print activity within a given time window
- timeWindowBiased.mac: force decay within a given time window
Macros to be run interactively:
- Cf238.mac: read user data file
- debug.mac: Pb210
- electronicCapture.mac: Fe55 electronic capture
- vis.mac: To activate visualization
7- Histograms
----------
rdecay01 produces several 1D histograms which are saved as
rdecay01.root by default.
1 : energy spectrum: e+ e-
2 : energy spectrum: nu_e anti_nu_ev
3 : energy spectrum: gamma
4 : energy spectrum: alpha
5 : energy spectrum: ions
6 : total kinetic energy (Q)
7 : momentum balance
8 : total time of life of decay chain
9 : total visible energy
The histograms are managed by G4AnalysisManager and its Messenger.
The histos can be individually activated with the command :
/analysis/h1/set id nbBins valMin valMax unit
where unit is the desired unit for the histo (MeV or keV, deg or mrad, etc..)
One can control the name of the histograms file with the command:
/analysis/setFileName name (default rdecay1)
It is possible to choose the format of the histogram file : root (default),
xml, csv, by using namespace in HistoManager.hh
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 rdecay1)
@@ -0,0 +1,211 @@
///\file "radioactivedecay/rdecay02/.README.txt"
///\brief Example rdecay02 README page
/*! \page Examplerdecay02 Example rdecay02
Rdecay02 is created to show how to use the G4RadioactiveDecay process to
simulate the decays of radioactive isotopes as well as the induced
radioactivity resulted from nuclear interactions.
In this example a simple geometry consists of a cylindric target placed
in the centre of a tube detector. Various primary event generation and
tallying options are available.
\section rdecay02_s1 GEOMETRY
The world is filled with "Air" and there are two components in it:
- Target: A cylinder placed at the origin along the z-axis. The default
size of the cylinder is 0.5 cm radius and 1 cm length, and its default
material is "CsI".
- Detector: A tube centered at the origin along the z-axis, with inner
radius matching the radius of the target. The default thickness of the
tube is 2 cm and it is 5 cm long. The default material is "Germanium".
The user can change the target/detector size and material, using the
commands in the directory
\verbatim
/rdecay02/det
\endverbatim
\section rdecay02_s2 PHYSICS
The following physics processes are included by default:
- Standard electromagnetic
- Decay
- Radioactive Decay
By default radioactive decay is applied through out the geometry.
The user can limit it to just the target by commands :
/process/had/rdm/noVolumes
/process/had/rdm/selectVolume Target
- Hadronic processes
\section rdecay02_s3 EVENT: THE PRIMARY GENERATOR
The primary kinematic is a single particle or ion shooted at the
centre of the target. The type of the particle and its energy are set in
PrimaryGeneratorAction, and can be changed via the G4 build-in commands of
ParticleGun class (see the macros provided with this example).
Default is Ne24, at rest.
\section rdecay02_s4 DETECTOR RESPONSE
The relevant informations are collected in TrackingAction or
SteppingAction. These include:
- Emission particles in the RadioactiveDecay process:
particle PDGcode,
particle kinetic energy,
particle creation time,
particle weight.
Note: the residual nuclei is not considered as an emitted particle.
- Radio-Isotopes. All the radioactive isotopes produced in the simulation:
isotope PDGcode,
isotope creation time,
isotope weight.
- Energy depositions in the target and detector by prodicts of the
RadioactiveDecay process:
energy depostion (positive value for target and negative for detector),
time,
weight.
\section rdecay02_s5 HISTOGRAMS
The test contains 7 built-in 1D histograms, which are managed by
G4AnalysisManager and its Messenger. The histos can be individually
activated with the command :
\verbatim
/analysis/h1/set id nbBins valMin valMax unit
\endverbatim
where unit is the desired unit for the histo (MeV or keV, etc..)
(see the macros xxxx.mac).
histogram 0: The Pulse Height Spectrum (PHS) of the target.
histogram 1: The PHS of the detector.
histogram 2: The combined PHS of the target and detector.
histogram 3: The anti-coincidece PHS of the target.
histogram 4: The anti-coincidece PHS of the detector.
histogram 5: The coincidece PHS between the target and detector.
histogram 6: The emitted particle energy spectrum.
It is assumed the detector and target pulses both have an integration time
of 1 microsecond, and the gate is 2 microsecond for the coincidence spectrum.
The target and detctor have a threshold of 10 keV in the anti-/coincidence
modes.
HistoManager includes also 4 ntuples whose contents are described in the above paragraphe
(detector response)
The ntuples can be activated with the command
\verbatim
/analysis/ntuple/setActivation
\endverbatim
One can control the name of the analysis file with the command:
\verbatim
/analysis/setFileName name (default rdecay02)
\endverbatim
It is possible to choose the format of the histogram file : root (default),
xml, csv, by using namespace in HistoManager.hh
It is also possible to print selected histograms on an ascii file:
\verbatim
/analysis/h1/setAscii id
\endverbatim
All selected histos will be written on a file name.ascii (default rdecay02)
\section rdecay02_s6 VISUALIZATION
The Visualization Manager is set in the main().
The initialisation of the drawing is done via the commands
/vis/... in the macro vis.mac. To get visualisation:
\verbatim
> /control/execute vis.mac
\endverbatim
The tracks are drawn at the end of event, and erased at the end of run.
gamma green
neutron yellow
negative particles (e-, ...) red
positive particles (e+, ions, ...) blue
\section rdecay02_s7 HOW TO START ?
Execute rdecay02 in 'batch' mode from macro files :
\verbatim
% rdecay02 run1.mac
\endverbatim
Execute rdecay02 in 'interactive mode' with visualization :
\verbatim
% rdecay02
Idle> control/execute vis.mac
....
Idle> type your commands
....
Idle> exit
\endverbatim
\section rdecay02_s8 FURTHER EXAMPLES
There are a number of g4mac files in the ./macros subdirectory, to show
the features of the G4RadioactiveDecay process. Most of them will lead to
the creation of an root file in the same name of the macro file.
u238c.mac: shows the decays of the U238 chain in analogue MC mode.
th234c-b.mac: shows the decays of Th234 in variance reduction MC mode.
All its secondaies in along the decay chains are generated. The default
source profile and decay biasing schemes are used to determine the decay
times and weights of the secondaries.
proton.mac: simulation of 1 GeV protons incident on a lead target.
The decays of the radio-siotopes created in the proton-lead interactions
are simulated with RadioactiveDecay in analogue MC mode.
proton-beam.mac: same as proton.mac, but the decays of the radio-siotopes
created in the proton-lead interactions are simulated with
RadioactiveDecay in variance reduction MC mode. The isotopes and those
along the decay chains are forced to decay in the time windows specified
by the user in file measures.data, and the weights of the decay products
are determined by the beam profile as defined in the beam.data file and
their decay times.
neutron.mac: macrofile to show the incident of low energy neutrons on an
user specified NaI target and the decays of the induced radio-isotopes.
ne24.mac: this shows the decays of Ne-24 to Na-24 in variance reduction MC
mode. Further decays of Na-24 are not simulated by applying the
nucleuslimits in RadioactiveDecay. Two runs are carried out.
One with the bracjing ratio biasing applied and one without.
isotopes.mac: to show the decays of a number of different isotopes in a
single macro file.
f24.mac: to show the different treatments one can apply to the decays of F24.
i) the complete decay chain from F24 to Mg24, in analogue mode;
ii) the complete chain, but in variance reduction mode;
iii) restrict to the decay of F24 only in analogue mode; iv) restrict to
the decay of F24 only but in variance reduction mode.
as74.mac: The decays of As74 which has a rather complicated decay scheme.
i) in analogue MC mode;
ii) in variance reduction MC mode.
UserRadDataPb210Test.mac: show how the user can define its own radioactive
decay datafile
UserEvapDataBiTest.mac: show how the user can define its own
photo-evaporation datafile
No252.mac: show how to simulate Radoactive decay for nuclei with Z>100
based on user datafile
*/
@@ -0,0 +1,208 @@
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
rdecay02
--------
Rdecay02 is created to show how to use the G4RadioactiveDecay process to
simulate the decays of radioactive isotopes as well as the induced
radioactivity resulted from nuclear interactions.
In this example a simple geometry consists of a cylindric target placed
in the centre of a tube detector. Various primary event generation and
tallying options are available.
1. GEOMETRY
The world is filled with "Air" and there are two components in it:
- Target: A cylinder placed at the origin along the z-axis. The default
size of the cylinder is 0.5 cm radius and 1 cm length, and its default
material is "CsI".
- Detector: A tube centered at the origin along the z-axis, with inner
radius matching the radius of the target. The default thickness of the
tube is 2 cm and it is 5 cm long. The default material is "Germanium".
The user can change the target/detector size and material, using the
commands in the directory /rdecay02/det
2. PHYSICS
The following physics processes are included by default:
- Standard electromagnetic
- Decay
- Radioactive Decay
By default radioactive decay is applied through out the geometry.
The user can limit it to just the target by commands :
/process/had/rdm/noVolumes
/process/had/rdm/selectVolume Target
- Hadronic processes
3. AN EVENT: THE PRIMARY GENERATOR
The primary kinematic is a single particle or ion shooted at the
centre of the target. The type of the particle and its energy are set in
PrimaryGeneratorAction, and can be changed via the G4 build-in commands of
ParticleGun class (see the macros provided with this example).
Default is Ne24, at rest.
4. DETECTOR RESPONSE
The relevant informations are collected in TrackingAction or
SteppingAction. These include:
- Emission particles in the RadioactiveDecay process:
particle PDGcode,
particle kinetic energy,
particle creation time,
particle weight.
Note: the residual nuclei is not considered as an emitted particle.
- Radio-Isotopes. All the radioactive isotopes produced in the simulation:
isotope PDGcode,
isotope creation time,
isotope weight.
- Energy depositions in the target and detector by prodicts of the
RadioactiveDecay process:
energy depostion (positive value for target and negative for detector),
time,
weight.
5. HISTOGRAMS
The test contains 7 built-in 1D histograms, which are managed by
G4AnalysisManager and its Messenger. The histos can be individually
activated with the command :
/analysis/h1/set id nbBins valMin valMax unit
where unit is the desired unit for the histo (MeV or keV, etc..)
(see the macros xxxx.mac).
histogram 0: The Pulse Height Spectrum (PHS) of the target.
histogram 1: The PHS of the detector.
histogram 2: The combined PHS of the target and detector.
histogram 3: The anti-coincidece PHS of the target.
histogram 4: The anti-coincidece PHS of the detector.
histogram 5: The coincidece PHS between the target and detector.
histogram 6: The emitted particle energy spectrum.
It is assumed the detector and target pulses both have an integration time
of 1 microsecond, and the gate is 2 microsecond for the coincidence spectrum.
The target and detctor have a threshold of 10 keV in the anti-/coincidence
modes.
Initially, all histograms but histogram 6 are inactive. They can all be turned on
with the command
/analysis/h1/setActivationToAll true
or specific histograms can be turned on with the command
/analysis/h1/setActivation i true
where i is the histogram index (0,... n).
To turn off, set the final argument to false
HistoManager includes also 4 ntuples whose contents are described in the above paragraphe
(detector response)
The ntuples can be activated with the command /analysis/ntuple/setActivation
One can control the name of the analysis file with the command:
/analysis/setFileName name (default rdecay02)
It is possible to choose the format of the histogram file : root (default),
xml, csv, by using namespace in HistoManager.hh
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 rdecay02)
6. VISUALIZATION
The Visualization Manager is set in the main().
The initialisation of the drawing is done via the commands
/vis/... in the macro vis.mac. To get visualisation:
> /control/execute vis.mac
The tracks are drawn at the end of event, and erased at the end of run.
gamma green
neutron yellow
negative particles (e-, ...) red
positive particles (e+, ions, ...) blue
7. HOW TO START ?
Execute rdecay02 in 'batch' mode from macro files :
% rdecay02 run1.mac
Execute rdecay02 in 'interactive mode' with visualization :
% rdecay02
Idle> control/execute vis.mac
....
Idle> type your commands
....
Idle> exit
8. FURTHER EXAMPLES
There are a number of g4mac files in the ./macros subdirectory, to show
the features of the G4RadioactiveDecay process. Most of them will lead to
the creation of an root file in the same name of the macro file.
u238c.mac: shows the decays of the U238 chain in analogue MC mode.
th234c-b.mac: shows the decays of Th234 in variance reduction MC mode.
All its secondaies in along the decay chains are generated. The default
source profile and decay biasing schemes are used to determine the decay
times and weights of the secondaries.
proton.mac: simulation of 1 GeV protons incident on a lead target.
The decays of the radio-siotopes created in the proton-lead interactions
are simulated with RadioactiveDecay in analogue MC mode.
proton-beam.mac: same as proton.mac, but the decays of the radio-siotopes
created in the proton-lead interactions are simulated with
RadioactiveDecay in variance reduction MC mode. The isotopes and those
along the decay chains are forced to decay in the time windows specified
by the user in file measures.data, and the weights of the decay products
are determined by the beam profile as defined in the beam.data file and
their decay times.
neutron.mac: macrofile to show the incident of low energy neutrons on an
user specified NaI target and the decays of the induced radio-isotopes.
ne24.mac: this shows the decays of Ne-24 to Na-24 in variance reduction MC
mode. Further decays of Na-24 are not simulated by applying the
nucleuslimits in RadioactiveDecay. Two runs are carried out.
One with the bracjing ratio biasing applied and one without.
isotopes.mac: to show the decays of a number of different isotopes in a
single macro file.
f24.mac: to show the different treatments one can apply to the decays of F24.
i) the complete decay chain from F24 to Mg24, in analogue mode;
ii) the complete chain, but in variance reduction mode;
iii) restrict to the decay of F24 only in analogue mode; iv) restrict to
the decay of F24 only but in variance reduction mode.
as74.mac: The decays of As74 which has a rather complicated decay scheme.
i) in analogue MC mode;
ii) in variance reduction MC mode.
UserRadDataPb210Test.mac: show how the user can define its own radioactive
decay datafile
UserEvapDataBiTest.mac: show how the user can define its own
photo-evaporation datafile
No252.mac: show how to simulate Radoactive decay for nuclei with Z>100
based on user datafile