Import Geant4 11.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2021-12-10 14:46:44 +01:00
committed by Ben Morgan
parent 6399a014b6
commit 80e2389dd8
3932 changed files with 202519 additions and 246221 deletions
-57
View File
@@ -1,57 +0,0 @@
///\file "runAndEvent/.README.txt"
///\brief Examples runAndEvent README page
/*! \page Examples_runAndEvent Category "runAndEvent"
Examples in this directory demonstrate the use of some features in
Run and Event categories. Since these categories are on the top of
hierarchy of Geant4 structure to control the full functionarities of
Geant4, some examples contain features in other categories such as
Tracking, Track, Particles, Detector responces, and even some cases
Geometry and Processes.
\link ExampleRE01 RE01 \endlink
This example demonstrates how to connect the information between
primary particles and hits. It also utilizes some user-information
classes.
\link ExampleRE02 RE02 \endlink
This example demonstrates how to accumulate the physics quantities
such as energy deposition and dose for a run. It also demonstrates
the use of primitive scorers.
\link ExampleRE03 RE03 \endlink
This example demonstrates how to use UI-command base scoring.
It create parallel world(s) for defining scoring mesh(es).
\link ExampleRE04 RE04 \endlink
This example demonstrates how to define layered mass geometry in
a parallel world and use it in a simulation.
\link ExampleRE05 RE05 \endlink
Defines a simplified collider detector setup.
Demonstrates interfacing to the PYTHIA primary generator. Includes
the definition of a 'readout' geometry. Exercises event filtering using
the stacking mechanism. Includes visualization. \n
It was moved in extended examples from novice/N04 with removal of
novice examples.
\link ExampleRE06 RE06 \endlink
Implements three simplified sandwitch calorimeters.
Shows how to modify part of the geometry setup at run-time. Includes
detector description parameterisation by materials. Demonstrates
sharing of a sensitive detector definition for different sub-detectors.
Defines different geometrical regions with different production
thresholds. Shows customization of the G4Run. \n
It was moved in extended examples from novice/N07 with removal of
novice examples.
*/
+2 -1
View File
@@ -1,6 +1,6 @@
#---Adding all runAndEvent examples subdirectories explicitly
cmake_minimum_required(VERSION 3.12...3.20)
cmake_minimum_required(VERSION 3.16...3.21)
add_subdirectory(RE01)
add_subdirectory(RE02)
@@ -8,3 +8,4 @@ add_subdirectory(RE03)
add_subdirectory(RE04)
add_subdirectory(RE05)
add_subdirectory(RE06)
add_subdirectory(RE07)
+3
View File
@@ -15,6 +15,9 @@ track of all tags.
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
Dec. 06th, 2021, I. Hrivnacova (exRunAndEvent-V10-07-01)
- Added RE07 in Doxygen documentation
May 24th, 2021, B. Morgan (exRunAndEvent-V10-07-00)
- Bump required CMake version range to 3.12...3.20, matching core Geant4
@@ -1,70 +0,0 @@
///\file "runAndEvent/RE01/.README.txt"
///\brief Example RE01 README page
/*! \page ExampleRE01 Example RE01
Contact : M.Asai (SLAC)
\section RE01_s1 Introduction
This example demonstrates how to connect the information between
primary particles and hits. It also utilize some user-information
classes.
\subsection RE01_s11 Geometry and region information
It has a quite simple cylindrical tracker of 5 layers and a
cylindrical calorimeter of lead and scintillator. Dedicated regions
are assigned to both tracker and calorimeter mother volumes not
for setting additional production thresholds but for adding some
more information to these regions. RE01RegionInformation is the
class for this purpose.
A "readout geometry" is attached to the calorimeter to define
its cells.
\subsection RE01_s12 Physics
This example basically uses QGSP_BERT physics list. In addition
to this, RE01UnknownDecayPhysics is used for adding decay process to
G4UnknownParticle.
\subsection RE01_s13 Event generator
An event sample is attached. This event has a Higgs particle
which decays into e+e- and mu+mu- pairs through two Z bosons.
It uses G4HEPEvtInterface.
In this example, by utilizing G4UnknownParticle, all particles
appear in the primary event are converted to G4Track and then
to RE01Trajectory. Relation between primary particles and track
IDs are shown at the end of event execution.
\section RE01_s2 "Source track" information
"Source track" is meant for a track that is either a primary
particle or a track born is the tracking region. This information
is stored in RE01TrackInformation class object and copied from
a parent track to its daughters.
\subsection RE01_s21 Track suspension
All source tracks are suspended for their tracking when they are
getting into the calorimeter region. Thus, all tracks in the tracker
region are tracked before generating any shower in the calorimeter.
\subsection RE01_s22 Tracker hits associated with primary particle information
Information kept in RE01TrackInformation is used to connect each
tracker hit to the primary particle.
\subsection RE01_s23 Energy deposition of each source track
Utilizing RE01StackingAction, shower generation is done for each
souorce track separately, and thus energy deposition in calorimeter
cells are shown for each individual source track. With the trajectory
information, energy deposition for each primary particle can also
be gotten.
*/
@@ -1,6 +1,6 @@
#----------------------------------------------------------------------------
# Setup the project
cmake_minimum_required(VERSION 3.12...3.20)
cmake_minimum_required(VERSION 3.16...3.21)
project(RE01)
#----------------------------------------------------------------------------
-66
View File
@@ -1,66 +0,0 @@
RE01 - An extended example for run and event
--------------------------------------------
Contact : M.Asai (SLAC)
1. Introduction
This example demonstrates how to connect the information between
primary particles and hits. It also utilize some user-information
classes.
1.1 Geometry and region information
It has a quite simple cylindrical tracker of 5 layers and a
cylindrical calorimeter of lead and scintillator. Dedicated regions
are assigned to both tracker and calorimeter mother volumes not
for setting additional production thresholds but for adding some
more information to these regions. RE01RegionInformation is the
class for this purpose.
A "readout geometry" is attached to the calorimeter to define
its cells.
1.2 Physics
This example basically uses QGSP_BERT physics list. In addition
to this, RE01UnknownDecayPhysics is used for adding decay process to
G4UnknownParticle.
1.3 Event generator
An event sample is attached. This event has a Higgs particle
which decays into e+e- and mu+mu- pairs through two Z bosons.
It uses G4HEPEvtInterface.
In this example, by utilizing G4UnknownParticle, all particles
appear in the primary event are converted to G4Track and then
to RE01Trajectory. Relation between primary particles and track
IDs are shown at the end of event execution.
2. "Source track" information
"Source track" is meant for a track that is either a primary
particle or a track born is the tracking region. This information
is stored in RE01TrackInformation class object and copied from
a parent track to its daughters.
2.1 Track suspension
All source tracks are suspended for their tracking when they are
getting into the calorimeter region. Thus, all tracks in the tracker
region are tracked before generating any shower in the calorimeter.
2.2 Tracker hits associated with primary particle information
Information kept in RE01TrackInformation is used to connect each
tracker hit to the primary particle.
2.3 Energy deposition of each source track
Utilizing RE01StackingAction, shower generation is done for each
souorce track separately, and thus energy deposition in calorimeter
cells are shown for each individual source track. With the trajectory
information, energy deposition for each primary particle can also
be gotten.
File diff suppressed because it is too large Load Diff
@@ -1,250 +0,0 @@
///\file "runAndEvent/RE02/.README.txt"
///\brief Example RE02 README page
/*! \page ExampleRE02 Example RE02
This example simulates a simplified water phantom measurement
in medical application with demonstration of primitive scorers.
This example also demonstrates nested parameterised volume which
realizes segmented boxes using a combination of replicated volumes
and a parameterised volume.
---- (Tips)
This example creates 100 x 100 x 200 boxes using Nested Parameterised
Volume for realistic situation of medical application.
This is very memory consumption if normal Parameterised Volume is used,
and needs roughly more than 1 GB memory for execution. However,
NestedParameterised volume effectively works to reduce the memory consumption,
and it only needs less than 100 MB memory for execution.
\section RE02_s1- GEOMETRY DEFINITION
The setup contains a water phantom as target by default. The world volume
is 200 cm x 200 cm x 200 cm box filled with air. The water phantom is box shape
and the size of 200 mm x 200 mm x 400 mm. The volume of water phantom is divided
into 100 x 100 x 1 towers using replicated volume,(RE02DetectorConstruction),
and then those towers are segmented into 200 boxes with respect to z axis
using nested parameterized volume,(RE02NestedPhantomParameterisation).
e.g. The volume of water phantom is divided into 100 x 100 x 200 boxes,
and a voxel size is 2.0 mm x 2.0 mm x 2.0 mm.
For demonstration purpose of the nested parameterised volume,
(RE02NestedPhantomParameterisation), materials are assigned as water (lead)
in even (odd) order segments, alternately.
The simulation for homogeneous water phantom is also possible using an option.
---- Tips(1)
If you want to reduce number of segments of water phantom,
please change following numbers which represent number of segments
in x, y, z axis, respectively.The following code can be found in
exampleRE02.cc.
\verbatim
RE02DetectorConstruction* detector = new RE02DetectorConstruction;
detector->SetNumberOfSegmentsInPhantom(100,100,200);
Nx, Ny, Nz
\endverbatim
---- Tips(2)
If you want to set all materials to water,
please use the following method. The following code can be found in
exampleRE02.cc.
\verbatim
detector->SetLeadSegment(FALSE); // Homogeneous water phantom
\endverbatim
The geometry and sensitive detector are constructed in
RE02DetectorConstruction class.
(See \ref RE02_s4 "SCORER " for detail descriptions about sensitive detector.)
\section RE02_s2 PHYSICS LIST
The particle's type and the physic processes which is available
in this example are set in PhysicsList class.
The PhysicsList is originally copied from extended example,
(example/extended/analysis/A01).
Full set of particles (baryons, bosons and mesons) are created, and
Standard EM Physics and Low/High Energy parameterized models
for hadrons are applied. The detail description will be found in
example/extended/analysis/A01/README.
Specially, the PhysicsList was modified in this example,
to use Binary cascade model for hadron physics at low energy (<4GeV)
and inelastic process for generic ions with BinaryLightIonReaction.
The data files for physics processes have to be assigned using
environment variables.
RE02PhysicsList is optimized for robustness and is not optimized for
any particular cases. If you will do precise calculation for your
use-case, please consider utilizing hadronic_lists, and defines the
production cut properly.
The default CutValue defines the production threshold of secondary
particles (mainly Ionisation and Bremsstrahlung processes are
concerned by this CutValue).
\section RE02_s3 RUNS and EVENTS
\subsection RE02_s31 Primary particles
The primary kinematics consists of a single particle which hits the
target perpendicular to the input face. The default type of the particle
and its energy are set in the RE02PrimaryGeneratorAction class.
However it can be changed via the G4 build-in commands of ParticleGun
class.
The RE02PrimaryGeneratorAction class introduces a beam spot size
that makes initial particle position of x,y randomized using a Gaussian
random function, where the center position is fixed to (0,0).
The standard deviation of the beam spot size is given in
RE02PrimaryGeneratorAction as 10 mm.
\subsection RE02_s32 Event
An EVENT represents a simulation of one primary particle.
A RUN is a set of events.
The user has control:
- at Begin and End of each run (class RunAction)
- at Begin and End of each event (class EventAction)
- at Begin and End of each track (class TrackingAction, not used here)
- at End of each step (class SteppingAction, not used here)
\section RE02_s4 SCORER
\subsection RE02_s41 Concrete Scorer
This example introduces concrete primitive scorer (PS) and filter
classes for easy scoring. Those primitive scorers are registered to
MultiFunctionalDetector which is a concrete class of sensitive
detector(SD). Then the MultiFunctionalDetector is attached to
the logical volume of sensitive geometry.
A MultiFunctionalDetector, PrimitiveScorers, and SDFilters are
created and assigned to the logical volume of water phantom in
DetectorConstruction.
A primitive scorer can score one kind of physical quantity, and
creates one hits collection per event. The quantity is collected in
G4THitsMap with the copy number of geometry. Here collection name is
given as "MultiFunctionalDetector Name"/"PrimitiveScorer Name".
A primitive scorer can have one filter (SDFilter) for selecting hits
to be used for the quantity.
Since the geometry is constructed using nested parameterisation,
the copy number of geometry is defined as follows,
\verbatim
copy number of geometry = iy*Nx*Ny+ix*Nz+iz,
\endverbatim
where Nx,Ny,Nz is total number of segmentation in x, y, and z axis,respectively,
and ix,iy,iz is a copy number of the mother volume, the grand mother volume,
and this volume, respectively.
This conversion is described in GetIndex() method in PrimitiveScorer.
\subsection RE02_s42 The physical quantities scored in this example are:
- Total energy deposit \n
- unit: Energy, collName: totalEDep
- Energy deposit by protons \n
- unit: Energy, collName: protonEDep
- Number of steps of protons \n
- unit: - , collName: protonNStep
- Cell Flux of charged tracks which pass through the geometry\n
- unit: Length/Volume, collName: chargedPassCellFlux
- Cell Flux of all charged tracks\n
- unit: Length/Volume, collName: chargedCellFlux
- Flux of charged particle at -Z surface of the BOX geometry,
where incident angle at the surface is taken into account.\n
- unit: Surface^(-1), collName: chargedSurfFlux
- Surface current of gamma at -Z surface of the BOX geometry.
The energy of gammas are from 1. keV to 10. keV.
The incident angle is not taken into account.\n
- unit: Surface^(-1), collName: gammaSurfCurr000
- Same as previous one, but different energy bin.
The energy of gammas are from 10. keV to 100. keV.\n
- unit: Surface^(-1), collName: gammaSurfCurr001
- Same as previous one, but different energy bin.
The energy of gammas are from 100. keV to 1. MeV. \n
- unit: Surface^(-1), collName: gammaSurfCurr002
- Same as previous one, except for energy bin.
The energy of gammas are from 1. MeV to 10. MeV. \n
- unit: Surface^(-1), collName: gammaSurfCurr003
\subsection RE02_s43 Accumulating quantities during a RUN
A PrimitiveScorer creates one hits collection per event.
The physical quantity in the hits collection need to be accumulated
into another G4THitsMap object during a RUN, in order to obtain
integrated flux or dose in a RUN. The accumulation of quantities
are done at RE02Run class.
RE02Run class can automatically generate G4THitsMap objects for a RUN,
and accumulate physical quantities of an event into it. The accumulation
is done at RE02Run::RecordEvent(G4Event* aEvent).
\subsection RE02_s44 Generate a Run object, and print results
The RE02Run object is generated at RE02RunAction::GenerateRun().
The accumulated physical quantities are printed at the end of RUN
( RE02RunAction::EndOfEvent() ). This example prints only selected
physical quantities.
\section RE02_s5 VISUALIZATION
The Visualization Manager is set in the main () (see RE02.cc).
The initialization of the drawing is done via a set of /vis/ commands
in the macro vis.mac. This macro is automatically read from
the main when running in interactive mode.
The tracks are automatically drawn at the end of event and erased at
the beginning of the next run.
The visualization (with OpenGL driver) assumes two things:
-# the visualization & interfaces categories have been compiled
with the environment variable G4VIS_BUILD_OPENGLX_DRIVER.
-# exampleRE02.cc has been compiled with G4VIS_USE_OPENGLX.
(The same with DAWNFILE instead of OPENGLX)
\section RE02_s6 USER INTERFACES
The default command interface, called G4UIterminal, is done via
standard G4cin/G4cout.
On Linux and Sun-cc on can use a smarter command interface G4UItcsh.
It is enough to set the environment variable G4UI_USE_TCSH before
compiling exampleRE02.cc
\section RE02_s7 HOW TO START ?
- Execute RE02 in 'batch' mode from macro files (without visualization)
\verbatim
% exampleRE02 run1.mac
\endverbatim
- Execute RE02 in 'interactive mode' with visualization
\verbatim
% exampleRE02
....
Idle> type your commands. For instance:
Idle> /run/beamOn 10
....
Idle> /control/execute run2.mac
....
Idle> exit
\endverbatim
- Macros are for different primary particles.
- vis.mac : 200 MeV proton with visualization
- run1.mac : 150 MeV proton
- run2.mac : 195 MeV/u Carbon ion
- run3.mac : 30 MeV electron
- run4.mac : 60 keV gamma
*/
@@ -1,6 +1,6 @@
#----------------------------------------------------------------------------
# Setup the project
cmake_minimum_required(VERSION 3.12...3.20)
cmake_minimum_required(VERSION 3.16...3.21)
project(RE02)
#----------------------------------------------------------------------------
-238
View File
@@ -1,238 +0,0 @@
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
ExampleRE02
-----------
This example simulates a simplified water phantom measurement
in medical application with demonstration of primitive scorers.
This example also demonstrates nested parameterised volume which
realizes segmented boxes using a combination of replicated volumes
and a parameterised volume.
(Tips)
This example creates 100 x 100 x 200 boxes using Nested Parameterised
Volume for realistic situation of medical application.
This is very memory consumption if normal Parameterised Volume is used,
and needs roughly more than 1 GB memory for execution. However,
NestedParameterised volume effectively works to reduce the memory consumption,
and it only needs less than 100 MB memory for execution.
1- GEOMETRY DEFINITION
The setup contains a water phantom as target by default. The world volume
is 200 cm x 200 cm x 200 cm box filled with air. The water phantom is box shape
and the size of 200 mm x 200 mm x 400 mm. The volume of water phantom is divided
into 100 x 100 x 1 towers using replicated volume,(RE02DetectorConstruction),
and then those towers are segmented into 200 boxes with respect to z axis
using nested parameterized volume,(RE02NestedPhantomParameterisation).
e.g. The volume of water phantom is divided into 100 x 100 x 200 boxes,
and a voxel size is 2.0 mm x 2.0 mm x 2.0 mm.
For demonstration purpose of the nested parameterised volume,
(RE02NestedPhantomParameterisation), materials are assigned as water (lead)
in even (odd) order segments, alternately.
The simulation for homogeneous water phantom is also possible using an option.
---- Tips(1)
*If you want to reduce number of segments of water phantom,
please change following numbers which represent number of segments
in x, y, z axis, respectively.The following code can be found in
exampleRE02.cc.
RE02DetectorConstruction* detector = new RE02DetectorConstruction;
detector->SetNumberOfSegmentsInPhantom(100,100,200);
Nx, Ny, Nz
---- Tips(2)
*If you want to set all materials to water,
please use the following method. The following code can be found in
exampleRE02.cc.
detector->SetLeadSegment(FALSE); // Homogeneous water phantom
----
The geometry and sensitive detector are constructed in
RE02DetectorConstruction class.
(See "4- SCORER " for detail descriptions about sensitive detector.)
2- PHYSICS LIST
The particle's type and the physic processes which is available
in this example are set in PhysicsList class.
The PhysicsList is originally copied from extended example,
(example/extended/analysis/A01).
Full set of particles (baryons, bosons and mesons) are created, and
Standard EM Physics and Low/High Energy parameterized models
for hadrons are applied. The detail description will be found in
example/extended/analysis/A01/README.
Specially, the PhysicsList was modified in this example,
to use Binary cascade model for hadron physics at low energy (<4GeV)
and inelastic process for generic ions with BinaryLightIonReaction.
The data files for physics processes have to be assigned using
environment variables.
RE02PhysicsList is optimized for robustness and is not optimized for
any particular cases. If you will do precise calculation for your
use-case, please consider utilizing hadronic_lists, and defines the
production cut properly.
The default CutValue defines the production threshold of secondary
particles (mainly Ionisation and Bremsstrahlung processes are
concerned by this CutValue).
3- RUNS and EVENTS
- Primary particles.
The primary kinematics consists of a single particle which hits the
target perpendicular to the input face. The default type of the particle
and its energy are set in the RE02PrimaryGeneratorAction class.
However it can be changed via the G4 build-in commands of ParticleGun
class.
The RE02PrimaryGeneratorAction class introduces a beam spot size
that makes initial particle position of x,y randomized using a Gaussian
random function, where the center position is fixed to (0,0).
The standard deviation of the beam spot size is given in
RE02PrimaryGeneratorAction as 10 mm.
An EVENT represents a simulation of one primary particle.
A RUN is a set of events.
The user has control:
-at Begin and End of each run (class RunAction)
-at Begin and End of each event (class EventAction)
-at Begin and End of each track (class TrackingAction, not used here)
-at End of each step (class SteppingAction, not used here)
4- SCORER
- Concrete Scorer
This example introduces concrete primitive scorer (PS) and filter
classes for easy scoring. Those primitive scorers are registered to
MultiFunctionalDetector which is a concrete class of sensitive
detector(SD). Then the MultiFunctionalDetector is attached to
the logical volume of sensitive geometry.
A MultiFunctionalDetector, PrimitiveScorers, and SDFilters are
created and assigned to the logical volume of water phantom in
DetectorConstruction.
A primitive scorer can score one kind of physical quantity, and
creates one hits collection per event. The quantity is collected in
G4THitsMap with the copy number of geometry. Here collection name is
given as <MultiFunctionalDetector Name>/<PrimitiveScorer Name>.
A primitive scorer can have one filter (SDFilter) for selecting hits
to be used for the quantity.
Since the geometry is constructed using nested parameterisation,
the copy number of geometry is defined as follows,
copy number of geometry = iy*Nx*Ny+ix*Nz+iz,
where Nx,Ny,Nz is total number of segmentation in x, y, and z axis,respectively,
and ix,iy,iz is a copy number of the mother volume, the grand mother volume,
and this volume, respectively.
This conversion is described in GetIndex() method in PrimitiveScorer.
The physical quantities scored in this example are:
----------------------------------------------------
- Total energy deposit
unit: Energy, collName: totalEDep
- Energy deposit by protons
unit: Energy, collName: protonEDep
- Number of steps of protons
unit: - , collName: protonNStep
- Cell Flux of charged tracks which pass through the geometry
unit: Length/Volume, collName: chargedPassCellFlux
- Cell Flux of all charged tracks
unit: Length/Volume, collName: chargedCellFlux
- Flux of charged particle at -Z surface of the BOX geometry,
where incident angle at the surface is taken into account.
unit: Surface^(-1), collName: chargedSurfFlux
- Surface current of gamma at -Z surface of the BOX geometry.
The energy of gammas are from 1. keV to 10. keV.
The incident angle is not taken into account.
unit: Surface^(-1), collName: gammaSurfCurr000
- Same as previous one, but different energy bin.
The energy of gammas are from 10. keV to 100. keV.
unit: Surface^(-1), collName: gammaSurfCurr001
- Same as previous one, but different energy bin.
The energy of gammas are from 100. keV to 1. MeV.
unit: Surface^(-1), collName: gammaSurfCurr002
- Same as previous one, except for energy bin.
The energy of gammas are from 1. MeV to 10. MeV.
unit: Surface^(-1), collName: gammaSurfCurr003
-------------------------------------------------
- Accumulating quantities during a RUN
A PrimitiveScorer creates one hits collection per event.
The physical quantity in the hits collection need to be accumulated
into another G4THitsMap object during a RUN, in order to obtain
integrated flux or dose in a RUN. The accumulation of quantities
are done at RE02Run class.
RE02Run class can automatically generate G4THitsMap objects for a RUN,
and accumulate physical quantities of an event into it. The accumulation
is done at RE02Run::RecordEvent(G4Event* aEvent).
- Generate a Run object, and print results
The RE02Run object is generated at RE02RunAction::GenerateRun().
The accumulated physical quantities are printed at the end of RUN
( RE02RunAction::EndOfEvent() ). This example prints only selected
physical quantities.
5- VISUALIZATION
The Visualization Manager is set in the main().
The initialization of the drawing is done via a set of /vis/ commands
in the macro vis.mac. This macro is automatically read from
the main when running in interactive mode.
The tracks are automatically drawn at the end of event and erased at
the beginning of the next run.
The visualization (with OpenGL driver) assumes two things:
1- the visualization & interfaces categories have been compiled
with the environment variable G4VIS_BUILD_OPENGLX_DRIVER.
2- exampleRE02.cc has been compiled with G4VIS_USE_OPENGLX.
(The same with DAWNFILE instead of OPENGLX)
6- USER INTERFACES
The default command interface, called G4UIterminal, is done via
standard G4cin/G4cout.
On Linux and Sun-cc on can use a smarter command interface G4UItcsh.
It is enough to set the environment variable G4UI_USE_TCSH before
compiling exampleRE02.cc
7- HOW TO START ?
- execute RE02 in 'batch' mode from macro files (without visualization)
% exampleRE02 run1.mac
- execute RE02 in 'interactive mode' with visualization
% exampleRE02
....
Idle> type your commands. For instance:
Idle> /run/beamOn 10
....
Idle> /control/execute run2.mac
....
Idle> exit
- macros are for different primary particles.
vis.mac : 200 MeV proton with visualization
run1.mac : 150 MeV proton
run2.mac : 195 MeV/u Carbon ion
run3.mac : 30 MeV electron
run4.mac : 60 keV gamma
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,59 +0,0 @@
///\file "runAndEvent/RE03/.README.txt"
///\brief Example RE03 README page
/*! \page ExampleRE03 Example RE03
Contact : M.Asai (SLAC), A.Kimura (AIT), T.Aso (TNCMT)
\section RE03_s1 Introduction
This example demonstrates how to use UI-command base scoring.
It create parallel world(s) for defining scoring mesh(es).
Due to some performance overhead, this functionality is not
provided by default. To get it included, the pointer to
G4ScoringManager must be accessed. The access to the static
method G4ScoringManager::GetScoringManager() activates this
functionality.
\subsection RE03_s11 Geometry and primary particle
It has just one water box in the world volume filled by air.
No detector in the mass geometry. Particle gun shoots a gamma
into the water box.
\subsection RE03_s12 Physics
The physics list is taken from referenced physics-list QGS_BIC
in Geant4.
\section RE03_s2 Macro files
"run1.mac" through "run4.mac" macro files should be used
independently. Each macro file create its own scoring parallel
world(s). "vis.mac", "drawSlices.mac" and "drawCylinderSlices.mac"
are used internally. Each macro should work for both interactively
and batch, but interactive mode is advised for better visualization.
IMPORTANT: DO NOT use more than one of these macro files in one
execution of this example.
\section RE03_s3 RE03UserScoreWriter
G4ScoringManager has a default score writer which dumps every
entry of one quantity of a mesh for all quantities of the mesh
one by one in CSV format. To alternate the file format the user
can implement his/her own score writer deriving from G4VUserScoreWriter
base class and set it to G4ScoringManager. To demonstrate this,
RE03UserScoreWriter is included in this example. To use this
alternative writer, un-comment its instantiation in RE03.cc.
*/
@@ -1,6 +1,6 @@
#----------------------------------------------------------------------------
# Setup the project
cmake_minimum_required(VERSION 3.12...3.20)
cmake_minimum_required(VERSION 3.16...3.21)
project(RE03)
#----------------------------------------------------------------------------
-55
View File
@@ -1,55 +0,0 @@
RE03 - An extended example for run and event
--------------------------------------------
Contact : M.Asai (SLAC), A.Kimura (AIT), T.Aso (TNCMT)
1. Introduction
This example demonstrates how to use UI-command base scoring.
It create parallel world(s) for defining scoring mesh(es).
Due to some performance overhead, this functionality is not
provided by default. To get it included, the pointer to
G4ScoringManager must be accessed. The access to the static
method G4ScoringManager::GetScoringManager() activates this
functionality.
1.1 Geometry and primary particle
It has just one water box in the world volume filled by air.
No detector in the mass geometry. Particle gun shoots a gamma
into the water box.
1.2 Physics
The physics list is taken from referenced physics-list QGS_BIC
in Geant4.
2. Macro files
"run1.mac" through "run4.mac" macro files should be used
independently. Each macro file create its own scoring parallel
world(s). "vis.mac", "drawSlices.mac" and "drawCylinderSlices.mac"
are used internally. Each macro should work for both interactively
and batch, but interactive mode is advised for better visualization.
IMPORTANT: DO NOT use more than one of these macro files in one
execution of this example.
3. RE03UserScoreWriter
G4ScoringManager has a default score writer which dumps every
entry of one quantity of a mesh for all quantities of the mesh
one by one in CSV format. To alternate the file format the user
can implement his/her own score writer deriving from G4VUserScoreWriter
base class and set it to G4ScoringManager. To demonstrate this,
RE03UserScoreWriter is included in this example. To use this
alternative writer, un-comment its instantiation in RE03.cc.
@@ -1,97 +0,0 @@
///\file "runAndEvent/RE04/.README.txt"
///\brief Example RE04 README page
/*! \page ExampleRE04 Example RE04
Contact : M.Asai (SLAC)
\section RE04_s1 Introduction
This example demonstrates how to define a layered mass
geometry in parallel world. In the mass (tracking) world,
there are two boxes only. One is the world volume and the
other is a box in the world. They both are made of air.
Thus, if tracks do not see materials (water and lead)
defined in the parallel world, they rarely interact.
In the parallel world, there are boxes made of water and
lead.
\subsection RE04_s11 Geometry
RE04DetectorConstruction defines the mass (tracking)
geometry. It firstly defines all materials which apear
either in mass world or parallel world. Then in SetupGeometry()
method, it defines the world volume and a box named "phantom".
Both boxes are made of air.
RE04ParallelWorldConstruction defines the parallel world.
For a parallel world, solid, logical and physical volumes
which represent parallel world must not be created here but
should be taken through G4VUserParallelWorld::GetWorld()
method which creates clones of solid, logical and physical
volumes of the world volume of the mass world. Please note
that this cloned logical volume of the parallel world volume
does not have a valid pointer to aa material but null.
In the parallel world, if a logical volume has a valid
material pointer, a track in this volume (precisely saying
a physical volume which is made of this logical volume)
will see the material defined in this logical volume,
regardless of the material in the mass geometry. If a
logical volume has a null material pointer, a track will
see the ordinary material defined in the mass world.
RE04ParallelWorldConstruction defines one placement
volume of box-shape, which is made of water, and a mother
box (placement volume with null material pointer), which
contains parameterized volumes. RE04ParallelWorldParam
class defines a parameterization of the parameterized
volume "paraPara", which represents two boxes at different
locations and made of water and lead respectively.
\subsection RE04_s12 Physics
RE04PhysicsList uses ordinary physics builders. It also
defines G4ParallelWorldProcess which deals with the parallel
world. This G4ParallelWorldProcess is an extension of
G4ParallelWorldScoringProcess. If SetLayeredMaterialFlag()
of this process class is invoked, in addition to taking
care of sensitive detectors in the parallel world, it also
takes care of layered mass geometry. If this set method is
not invoked, it behaves exactly same as G4ParallelWorldScoringProcess.
The constructor of G4ParallelWorldProcess takes the name
of the parallel world physical volume as an argument.
G4ParallelWorldProcess may be associated only to some
limited kinds of particle types. The parallel world is
seen only bythe particles which have G4ParallelWorldProcess
in their process manager objects. In this RE04 example
G4ParallelWorldProcess is defined to all particle types
except ChargedGeantino. Thus, if you shoot CargedGeantino,
it won't see any volume boundary defined in the parallel
world.
\section RE04_s2 Macro files
The macro file "score.mac" defines a scoring mesh which covers
the "Phantom" and scores energy deposition. It shoots 1000
primary particles (by default 10 GeV muon-). Though the mass
world has only air, given tracks, both primary muons and
secondary particles see water and lead defined in the parallel
world, you will see the energy deposition is not evenly
distributed.
\section RE04_s3 User action classes
In the main () of RE04.cc, three user action classes, i.e.
RE04EventAction, RE04TrackingAction and RE04SteppingAction,
are commented out. By using RE04SteppingAction, you will
see a material name which a track sees for each step.
By using RE04EventAction and RE04TrackingAction, you will
see the similar information for all trajectories of one
event.
*/
@@ -1,6 +1,6 @@
#----------------------------------------------------------------------------
# Setup the project
cmake_minimum_required(VERSION 3.12...3.20)
cmake_minimum_required(VERSION 3.16...3.21)
project(RE04)
#----------------------------------------------------------------------------
-92
View File
@@ -1,92 +0,0 @@
RE04 - An extended example for run and event
--------------------------------------------
Contact : M.Asai (SLAC)
1. Introduction
This example demonstrates how to define a layered mass
geometry in parallel world. In the mass (tracking) world,
there are two boxes only. One is the world volume and the
other is a box in the world. They both are made of air.
Thus, if tracks do not see materials (water and lead)
defined in the parallel world, they rarely interact.
In the parallel world, there are boxes made of water and
lead.
1.1 Geometry
RE04DetectorConstruction defines the mass (tracking)
geometry. It firstly defines all materials which apear
either in mass world or parallel world. Then in SetupGeometry()
method, it defines the world volume and a box named "phantom".
Both boxes are made of air.
RE04ParallelWorldConstruction defines the parallel world.
For a parallel world, solid, logical and physical volumes
which represent parallel world must not be created here but
should be taken through G4VUserParallelWorld::GetWorld()
method which creates clones of solid, logical and physical
volumes of the world volume of the mass world. Please note
that this cloned logical volume of the parallel world volume
does not have a valid pointer to aa material but null.
In the parallel world, if a logical volume has a valid
material pointer, a track in this volume (precisely saying
a physical volume which is made of this logical volume)
will see the material defined in this logical volume,
regardless of the material in the mass geometry. If a
logical volume has a null material pointer, a track will
see the ordinary material defined in the mass world.
RE04ParallelWorldConstruction defines one placement
volume of box-shape, which is made of water, and a mother
box (placement volume with null material pointer), which
contains parameterized volumes. RE04ParallelWorldParam
class defines a parameterization of the parameterized
volume "paraPara", which represents two boxes at different
locations and made of water and lead respectively.
1.2 Physics
RE04PhysicsList uses ordinary physics builders. It also
defines G4ParallelWorldProcess which deals with the parallel
world. This G4ParallelWorldProcess is an extension of
G4ParallelWorldScoringProcess. If SetLayeredMaterialFlag()
of this process class is invoked, in addition to taking
care of sensitive detectors in the parallel world, it also
takes care of layered mass geometry. If this set method is
not invoked, it behaves exactly same as G4ParallelWorldScoringProcess.
The constructor of G4ParallelWorldProcess takes the name
of the parallel world physical volume as an argument.
G4ParallelWorldProcess may be associated only to some
limited kinds of particle types. The parallel world is
seen only bythe particles which have G4ParallelWorldProcess
in their process manager objects. In this RE04 example
G4ParallelWorldProcess is defined to all particle types
except ChargedGeantino. Thus, if you shoot CargedGeantino,
it won't see any volume boundary defined in the parallel
world.
2. Macro files
The macro file "score.mac" defines a scoring mesh which covers
the "Phantom" and scores energy deposition. It shoots 1000
primary particles (by default 10 GeV muon-). Though the mass
world has only air, given tracks, both primary muons and
secondary particles see water and lead defined in the parallel
world, you will see the energy deposition is not evenly
distributed.
3. User action classes
In the main() of RE04.cc, three user action classes, i.e.
RE04EventAction, RE04TrackingAction and RE04SteppingAction,
are commented out. By using RE04SteppingAction, you will
see a material name which a track sees for each step.
By using RE04EventAction and RE04TrackingAction, you will
see the similar information for all trajectories of one
event.
+245 -181
View File
@@ -11,7 +11,7 @@ Environment variable "G4FORCE_RUN_MANAGER_TYPE" enabled with value == Serial. Fo
**************************************************************
Geant4 version Name: geant4-10-07-ref-06 (25-June-2021)
Geant4 version Name: geant4-11-00-ref-00 (10-December-2021)
Copyright : Geant4 Collaboration
References : NIM A 506 (2003), 250-303
: IEEE-TNS 53 (2006), 270-278
@@ -29,10 +29,8 @@ You have successfully registered the following graphics systems.
Registered graphics systems are:
ASCIITree (ATree)
DAWNFILE (DAWNFILE)
G4HepRep (HepRepXML)
G4HepRepFile (HepRepFile)
RayTracer (RayTracer)
VRML1FILE (VRML1FILE)
VRML2FILE (VRML2FILE)
gMocrenFile (gMocrenFile)
OpenGLImmediateQt (OGLIQt, OGLI)
@@ -143,32 +141,99 @@ The materials defined are :
### Adding tracking cuts for neutron TimeCut(ns)= 10000 KinEnergyCut(MeV)= 0
.... G4ScoringMessenger::MeshBinCommand - G4ScoringBox
=======================================================================
====== Electromagnetic Physics Parameters ========
=======================================================================
LPM effect enabled 1
Enable creation and use of sampling tables 0
Apply cuts on all EM processes 0
Use general process 0
Enable linear polarisation for gamma 0
Enable sampling of quantum entanglement 0
X-section factor for integral approach 0.8
Min kinetic energy for tables 100 eV
Max kinetic energy for tables 100 TeV
Number of bins per decade of a table 7
Verbose level 1
Verbose level for worker thread 0
Bremsstrahlung energy threshold above which
primary e+- is added to the list of secondary 100 TeV
Bremsstrahlung energy threshold above which primary
muon/hadron is added to the list of secondary 100 TeV
Lowest triplet kinetic energy 1 MeV
Enable sampling of gamma linear polarisation 0
5D gamma conversion model type 0
5D gamma conversion model on isolated ion 0
Livermore data directory livermore
=======================================================================
====== Ionisation Parameters ========
=======================================================================
Step function for e+- (0.2, 1 mm)
Step function for muons/hadrons (0.2, 0.1 mm)
Step function for light ions (0.2, 0.1 mm)
Step function for general ions (0.2, 0.1 mm)
Lowest e+e- kinetic energy 1 keV
Lowest muon/hadron kinetic energy 1 keV
Fluctuations of dE/dx are enabled 1
Use ICRU90 data 0
Use built-in Birks satuaration 0
Build CSDA range enabled 0
Use cut as a final range enabled 0
Enable angular generator interface 0
Max kinetic energy for CSDA tables 1 GeV
Max kinetic energy for NIEL computation 0 eV
Linear loss limit 0.01
Read data from file for e+e- pair production by mu 0
=======================================================================
====== Multiple Scattering Parameters ========
=======================================================================
Type of msc step limit algorithm for e+- 1
Type of msc step limit algorithm for muons/hadrons 0
Msc lateral displacement for e+- enabled 1
Msc lateral displacement for muons and hadrons 0
Urban msc model lateral displacement alg96 1
Range factor for msc step limit for e+- 0.04
Range factor for msc step limit for muons/hadrons 0.2
Geometry factor for msc step limitation of e+- 2.5
Safety factor for msc step limit for e+- 0.6
Skin parameter for msc step limitation of e+- 1
Lambda limit for msc step limit for e+- 1 mm
Use Mott correction for e- scattering 0
Factor used for dynamic computation of angular
limit between single and multiple scattering 1
Fixed angular limit between single
and multiple scattering 3.1416 rad
Upper energy limit for e+- multiple scattering 100 MeV
Type of electron single scattering model 0
Type of nuclear form-factor 1
Screening factor 1
=======================================================================
phot: for gamma SubType=12 BuildTable=0
LambdaPrime table from 200 keV to 100 TeV in 61 bins
===== EM models for the G4Region DefaultRegionForTheWorld ======
LivermorePhElectric : Emin= 0 meV Emax= 100 TeV SauterGavrila Fluo
LivermorePhElectric : Emin= 0 eV Emax= 100 TeV SauterGavrila Fluo
compt: for gamma SubType=13 BuildTable=1
Lambda table from 100 eV to 1 MeV, 7 bins/decade, spline: 1
LambdaPrime table from 1 MeV to 100 TeV in 56 bins
===== EM models for the G4Region DefaultRegionForTheWorld ======
Klein-Nishina : Emin= 0 meV Emax= 100 TeV
Klein-Nishina : Emin= 0 eV Emax= 100 TeV
conv: for gamma SubType=14 BuildTable=1
Lambda table from 1.022 MeV to 100 TeV, 18 bins/decade, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
BetheHeitlerLPM : Emin= 0 meV Emax= 100 TeV ModifiedTsai
BetheHeitlerLPM : Emin= 0 eV Emax= 100 TeV ModifiedTsai
Rayl: for gamma SubType=11 BuildTable=1
Lambda table from 100 eV to 100 keV, 7 bins/decade, spline: 0
LambdaPrime table from 100 keV to 100 TeV in 63 bins
===== EM models for the G4Region DefaultRegionForTheWorld ======
LivermoreRayleigh : Emin= 0 meV Emax= 100 TeV CullenGenerator
LivermoreRayleigh : Emin= 0 eV Emax= 100 TeV CullenGenerator
msc: for e- SubType= 10
===== EM models for the G4Region DefaultRegionForTheWorld ======
UrbanMsc : Emin= 0 meV Emax= 100 MeV Nbins=42 100 eV - 100 MeV
UrbanMsc : Emin= 0 eV Emax= 100 MeV Nbins=42 100 eV - 100 MeV
StepLim=UseSafety Rfact=0.04 Gfact=2.5 Sfact=0.6 DispFlag:1 Skin=1 Llim=1 mm
WentzelVIUni : Emin= 100 MeV Emax= 100 TeV Nbins=42 100 MeV - 100 TeV
StepLim=UseSafety Rfact=0.04 Gfact=2.5 Sfact=0.6 DispFlag:1 Skin=1 Llim=1 mm
@@ -178,25 +243,25 @@ eIoni: for e- XStype:1 SubType=2
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
StepFunction=(0.2, 1 mm), integ: 1, fluct: 1, linLossLim= 0.01
===== EM models for the G4Region DefaultRegionForTheWorld ======
MollerBhabha : Emin= 0 meV Emax= 100 TeV
MollerBhabha : Emin= 0 eV Emax= 100 TeV
eBrem: for e- XStype:4 SubType=3
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
LPM flag: 1 for E > 1 GeV, VertexHighEnergyTh(GeV)= 100000
===== EM models for the G4Region DefaultRegionForTheWorld ======
eBremSB : Emin= 0 meV Emax= 1 GeV ModifiedTsai
eBremSB : Emin= 0 eV Emax= 1 GeV ModifiedTsai
eBremLPM : Emin= 1 GeV Emax= 100 TeV ModifiedTsai
CoulombScat: for e- XStype:3 SubType=1 BuildTable=1
Lambda table from 100 MeV to 100 TeV, 7 bins/decade, spline: 1
Lambda table from 100 MeV to 100 TeV, 7 bins/decade, spline: 0
ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531
===== EM models for the G4Region DefaultRegionForTheWorld ======
eCoulombScattering : Emin= 100 MeV Emax= 100 TeV
msc: for e+ SubType= 10
===== EM models for the G4Region DefaultRegionForTheWorld ======
UrbanMsc : Emin= 0 meV Emax= 100 MeV Nbins=42 100 eV - 100 MeV
UrbanMsc : Emin= 0 eV Emax= 100 MeV Nbins=42 100 eV - 100 MeV
StepLim=UseSafety Rfact=0.04 Gfact=2.5 Sfact=0.6 DispFlag:1 Skin=1 Llim=1 mm
WentzelVIUni : Emin= 100 MeV Emax= 100 TeV Nbins=42 100 MeV - 100 TeV
StepLim=UseSafety Rfact=0.04 Gfact=2.5 Sfact=0.6 DispFlag:1 Skin=1 Llim=1 mm
@@ -206,29 +271,29 @@ eIoni: for e+ XStype:1 SubType=2
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
StepFunction=(0.2, 1 mm), integ: 1, fluct: 1, linLossLim= 0.01
===== EM models for the G4Region DefaultRegionForTheWorld ======
MollerBhabha : Emin= 0 meV Emax= 100 TeV
MollerBhabha : Emin= 0 eV Emax= 100 TeV
eBrem: for e+ XStype:4 SubType=3
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
LPM flag: 1 for E > 1 GeV, VertexHighEnergyTh(GeV)= 100000
===== EM models for the G4Region DefaultRegionForTheWorld ======
eBremSB : Emin= 0 meV Emax= 1 GeV ModifiedTsai
eBremSB : Emin= 0 eV Emax= 1 GeV ModifiedTsai
eBremLPM : Emin= 1 GeV Emax= 100 TeV ModifiedTsai
annihil: for e+ XStype:2 SubType=5 BuildTable=0
===== EM models for the G4Region DefaultRegionForTheWorld ======
eplus2gg : Emin= 0 meV Emax= 100 TeV
eplus2gg : Emin= 0 eV Emax= 100 TeV
CoulombScat: for e+ XStype:3 SubType=1 BuildTable=1
Lambda table from 100 MeV to 100 TeV, 7 bins/decade, spline: 1
Lambda table from 100 MeV to 100 TeV, 7 bins/decade, spline: 0
ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531
===== EM models for the G4Region DefaultRegionForTheWorld ======
eCoulombScattering : Emin= 100 MeV Emax= 100 TeV
msc: for proton SubType= 10
===== EM models for the G4Region DefaultRegionForTheWorld ======
WentzelVIUni : Emin= 0 meV Emax= 100 TeV Nbins=84 100 eV - 100 TeV
WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV
StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llim=1 mm
hIoni: for proton XStype:1 SubType=2
@@ -236,31 +301,31 @@ hIoni: for proton XStype:1 SubType=2
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
StepFunction=(0.2, 0.1 mm), integ: 1, fluct: 1, linLossLim= 0.01
===== EM models for the G4Region DefaultRegionForTheWorld ======
Bragg : Emin= 0 meV Emax= 2 MeV
Bragg : Emin= 0 eV Emax= 2 MeV
BetheBloch : Emin= 2 MeV Emax= 100 TeV
hBrems: for proton XStype:1 SubType=3
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 0
===== EM models for the G4Region DefaultRegionForTheWorld ======
hBrem : Emin= 0 meV Emax= 100 TeV ModifiedMephi
hBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi
hPairProd: for proton XStype:1 SubType=4
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 0
Sampling table 17x1001 from 7.50618 GeV to 100 TeV
===== EM models for the G4Region DefaultRegionForTheWorld ======
hPairProd : Emin= 0 meV Emax= 100 TeV ModifiedMephi
hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi
CoulombScat: for proton XStype:3 SubType=1 BuildTable=1
Lambda table from threshold to 100 TeV, 7 bins/decade, spline: 1
Lambda table from threshold to 100 TeV, 7 bins/decade, spline: 0
ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531
===== EM models for the G4Region DefaultRegionForTheWorld ======
eCoulombScattering : Emin= 0 meV Emax= 100 TeV
eCoulombScattering : Emin= 0 eV Emax= 100 TeV
msc: for GenericIon SubType= 10
===== EM models for the G4Region DefaultRegionForTheWorld ======
UrbanMsc : Emin= 0 meV Emax= 100 TeV
UrbanMsc : Emin= 0 eV Emax= 100 TeV
StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llim=1 mm
ionIoni: for GenericIon XStype:1 SubType=2
@@ -269,12 +334,12 @@ ionIoni: for GenericIon XStype:1 SubType=2
StepFunction=(0.2, 0.1 mm), integ: 1, fluct: 1, linLossLim= 0.02
Stopping Power data for 17 ion/material pairs
===== EM models for the G4Region DefaultRegionForTheWorld ======
BraggIon : Emin= 0 meV Emax= 2 MeV
BraggIon : Emin= 0 eV Emax= 2 MeV
BetheBloch : Emin= 2 MeV Emax= 100 TeV
msc: for alpha SubType= 10
===== EM models for the G4Region DefaultRegionForTheWorld ======
UrbanMsc : Emin= 0 meV Emax= 100 TeV
UrbanMsc : Emin= 0 eV Emax= 100 TeV
StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llim=1 mm
ionIoni: for alpha XStype:1 SubType=2
@@ -282,12 +347,12 @@ ionIoni: for alpha XStype:1 SubType=2
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
StepFunction=(0.2, 0.1 mm), integ: 1, fluct: 1, linLossLim= 0.02
===== EM models for the G4Region DefaultRegionForTheWorld ======
BraggIon : Emin= 0 meV Emax=7.9452 MeV
BraggIon : Emin= 0 eV Emax=7.9452 MeV
BetheBloch : Emin=7.9452 MeV Emax= 100 TeV
msc: for anti_proton SubType= 10
===== EM models for the G4Region DefaultRegionForTheWorld ======
WentzelVIUni : Emin= 0 meV Emax= 100 TeV Nbins=84 100 eV - 100 TeV
WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV
StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llim=1 mm
hIoni: for anti_proton XStype:1 SubType=2
@@ -295,31 +360,31 @@ hIoni: for anti_proton XStype:1 SubType=2
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
StepFunction=(0.2, 0.1 mm), integ: 1, fluct: 1, linLossLim= 0.01
===== EM models for the G4Region DefaultRegionForTheWorld ======
ICRU73QO : Emin= 0 meV Emax= 2 MeV
ICRU73QO : Emin= 0 eV Emax= 2 MeV
BetheBloch : Emin= 2 MeV Emax= 100 TeV
hBrems: for anti_proton XStype:1 SubType=3
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 0
===== EM models for the G4Region DefaultRegionForTheWorld ======
hBrem : Emin= 0 meV Emax= 100 TeV ModifiedMephi
hBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi
hPairProd: for anti_proton XStype:1 SubType=4
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 0
Sampling table 17x1001 from 7.50618 GeV to 100 TeV
===== EM models for the G4Region DefaultRegionForTheWorld ======
hPairProd : Emin= 0 meV Emax= 100 TeV ModifiedMephi
hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi
CoulombScat: for anti_proton XStype:3 SubType=1 BuildTable=1
Lambda table from threshold to 100 TeV, 7 bins/decade, spline: 1
Lambda table from threshold to 100 TeV, 7 bins/decade, spline: 0
ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531
===== EM models for the G4Region DefaultRegionForTheWorld ======
eCoulombScattering : Emin= 0 meV Emax= 100 TeV
eCoulombScattering : Emin= 0 eV Emax= 100 TeV
msc: for kaon+ SubType= 10
===== EM models for the G4Region DefaultRegionForTheWorld ======
WentzelVIUni : Emin= 0 meV Emax= 100 TeV Nbins=84 100 eV - 100 TeV
WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV
StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llim=1 mm
hIoni: for kaon+ XStype:1 SubType=2
@@ -327,31 +392,31 @@ hIoni: for kaon+ XStype:1 SubType=2
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
StepFunction=(0.2, 0.1 mm), integ: 1, fluct: 1, linLossLim= 0.01
===== EM models for the G4Region DefaultRegionForTheWorld ======
Bragg : Emin= 0 meV Emax=1.05231 MeV
Bragg : Emin= 0 eV Emax=1.05231 MeV
BetheBloch : Emin=1.05231 MeV Emax= 100 TeV
hBrems: for kaon+ XStype:1 SubType=3
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 0
===== EM models for the G4Region DefaultRegionForTheWorld ======
hBrem : Emin= 0 meV Emax= 100 TeV ModifiedMephi
hBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi
hPairProd: for kaon+ XStype:1 SubType=4
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 0
Sampling table 18x1001 from 3.94942 GeV to 100 TeV
===== EM models for the G4Region DefaultRegionForTheWorld ======
hPairProd : Emin= 0 meV Emax= 100 TeV ModifiedMephi
hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi
CoulombScat: for kaon+ XStype:3 SubType=1 BuildTable=1
Lambda table from threshold to 100 TeV, 7 bins/decade, spline: 1
Lambda table from threshold to 100 TeV, 7 bins/decade, spline: 0
ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531
===== EM models for the G4Region DefaultRegionForTheWorld ======
eCoulombScattering : Emin= 0 meV Emax= 100 TeV
eCoulombScattering : Emin= 0 eV Emax= 100 TeV
msc: for kaon- SubType= 10
===== EM models for the G4Region DefaultRegionForTheWorld ======
WentzelVIUni : Emin= 0 meV Emax= 100 TeV Nbins=84 100 eV - 100 TeV
WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV
StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llim=1 mm
hIoni: for kaon- XStype:1 SubType=2
@@ -359,31 +424,31 @@ hIoni: for kaon- XStype:1 SubType=2
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
StepFunction=(0.2, 0.1 mm), integ: 1, fluct: 1, linLossLim= 0.01
===== EM models for the G4Region DefaultRegionForTheWorld ======
ICRU73QO : Emin= 0 meV Emax=1.05231 MeV
ICRU73QO : Emin= 0 eV Emax=1.05231 MeV
BetheBloch : Emin=1.05231 MeV Emax= 100 TeV
hBrems: for kaon- XStype:1 SubType=3
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 0
===== EM models for the G4Region DefaultRegionForTheWorld ======
hBrem : Emin= 0 meV Emax= 100 TeV ModifiedMephi
hBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi
hPairProd: for kaon- XStype:1 SubType=4
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 0
Sampling table 18x1001 from 3.94942 GeV to 100 TeV
===== EM models for the G4Region DefaultRegionForTheWorld ======
hPairProd : Emin= 0 meV Emax= 100 TeV ModifiedMephi
hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi
CoulombScat: for kaon- XStype:3 SubType=1 BuildTable=1
Used Lambda table of kaon+
ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531
===== EM models for the G4Region DefaultRegionForTheWorld ======
eCoulombScattering : Emin= 0 meV Emax= 100 TeV
eCoulombScattering : Emin= 0 eV Emax= 100 TeV
msc: for mu+ SubType= 10
===== EM models for the G4Region DefaultRegionForTheWorld ======
WentzelVIUni : Emin= 0 meV Emax= 100 TeV Nbins=84 100 eV - 100 TeV
WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV
StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llim=1 mm
muIoni: for mu+ XStype:1 SubType=2
@@ -391,32 +456,32 @@ muIoni: for mu+ XStype:1 SubType=2
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
StepFunction=(0.2, 0.1 mm), integ: 1, fluct: 1, linLossLim= 0.01
===== EM models for the G4Region DefaultRegionForTheWorld ======
Bragg : Emin= 0 meV Emax= 200 keV
Bragg : Emin= 0 eV Emax= 200 keV
BetheBloch : Emin= 200 keV Emax= 1 GeV
MuBetheBloch : Emin= 1 GeV Emax= 100 TeV
muBrems: for mu+ XStype:1 SubType=3
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 0
===== EM models for the G4Region DefaultRegionForTheWorld ======
MuBrem : Emin= 0 meV Emax= 100 TeV ModifiedMephi
MuBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi
muPairProd: for mu+ XStype:1 SubType=4
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 0
Sampling table 21x1001 from 1 GeV to 100 TeV
===== EM models for the G4Region DefaultRegionForTheWorld ======
muPairProd : Emin= 0 meV Emax= 100 TeV ModifiedMephi
muPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi
CoulombScat: for mu+ XStype:3 SubType=1 BuildTable=1
Lambda table from threshold to 100 TeV, 7 bins/decade, spline: 1
Lambda table from threshold to 100 TeV, 7 bins/decade, spline: 0
ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531
===== EM models for the G4Region DefaultRegionForTheWorld ======
eCoulombScattering : Emin= 0 meV Emax= 100 TeV
eCoulombScattering : Emin= 0 eV Emax= 100 TeV
msc: for mu- SubType= 10
===== EM models for the G4Region DefaultRegionForTheWorld ======
WentzelVIUni : Emin= 0 meV Emax= 100 TeV Nbins=84 100 eV - 100 TeV
WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV
StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llim=1 mm
muIoni: for mu- XStype:1 SubType=2
@@ -424,32 +489,32 @@ muIoni: for mu- XStype:1 SubType=2
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
StepFunction=(0.2, 0.1 mm), integ: 1, fluct: 1, linLossLim= 0.01
===== EM models for the G4Region DefaultRegionForTheWorld ======
ICRU73QO : Emin= 0 meV Emax= 200 keV
ICRU73QO : Emin= 0 eV Emax= 200 keV
BetheBloch : Emin= 200 keV Emax= 1 GeV
MuBetheBloch : Emin= 1 GeV Emax= 100 TeV
muBrems: for mu- XStype:1 SubType=3
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 0
===== EM models for the G4Region DefaultRegionForTheWorld ======
MuBrem : Emin= 0 meV Emax= 100 TeV ModifiedMephi
MuBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi
muPairProd: for mu- XStype:1 SubType=4
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 0
Sampling table 21x1001 from 1 GeV to 100 TeV
===== EM models for the G4Region DefaultRegionForTheWorld ======
muPairProd : Emin= 0 meV Emax= 100 TeV ModifiedMephi
muPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi
CoulombScat: for mu- XStype:3 SubType=1 BuildTable=1
Used Lambda table of mu+
ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531
===== EM models for the G4Region DefaultRegionForTheWorld ======
eCoulombScattering : Emin= 0 meV Emax= 100 TeV
eCoulombScattering : Emin= 0 eV Emax= 100 TeV
msc: for pi+ SubType= 10
===== EM models for the G4Region DefaultRegionForTheWorld ======
WentzelVIUni : Emin= 0 meV Emax= 100 TeV Nbins=84 100 eV - 100 TeV
WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV
StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llim=1 mm
hIoni: for pi+ XStype:1 SubType=2
@@ -457,31 +522,31 @@ hIoni: for pi+ XStype:1 SubType=2
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
StepFunction=(0.2, 0.1 mm), integ: 1, fluct: 1, linLossLim= 0.01
===== EM models for the G4Region DefaultRegionForTheWorld ======
Bragg : Emin= 0 meV Emax=297.505 keV
Bragg : Emin= 0 eV Emax=297.505 keV
BetheBloch : Emin=297.505 keV Emax= 100 TeV
hBrems: for pi+ XStype:1 SubType=3
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 0
===== EM models for the G4Region DefaultRegionForTheWorld ======
hBrem : Emin= 0 meV Emax= 100 TeV ModifiedMephi
hBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi
hPairProd: for pi+ XStype:1 SubType=4
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 0
Sampling table 20x1001 from 1.11656 GeV to 100 TeV
===== EM models for the G4Region DefaultRegionForTheWorld ======
hPairProd : Emin= 0 meV Emax= 100 TeV ModifiedMephi
hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi
CoulombScat: for pi+ XStype:3 SubType=1 BuildTable=1
Lambda table from threshold to 100 TeV, 7 bins/decade, spline: 1
Lambda table from threshold to 100 TeV, 7 bins/decade, spline: 0
ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531
===== EM models for the G4Region DefaultRegionForTheWorld ======
eCoulombScattering : Emin= 0 meV Emax= 100 TeV
eCoulombScattering : Emin= 0 eV Emax= 100 TeV
msc: for pi- SubType= 10
===== EM models for the G4Region DefaultRegionForTheWorld ======
WentzelVIUni : Emin= 0 meV Emax= 100 TeV Nbins=84 100 eV - 100 TeV
WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV
StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llim=1 mm
hIoni: for pi- XStype:1 SubType=2
@@ -489,27 +554,27 @@ hIoni: for pi- XStype:1 SubType=2
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
StepFunction=(0.2, 0.1 mm), integ: 1, fluct: 1, linLossLim= 0.01
===== EM models for the G4Region DefaultRegionForTheWorld ======
ICRU73QO : Emin= 0 meV Emax=297.505 keV
ICRU73QO : Emin= 0 eV Emax=297.505 keV
BetheBloch : Emin=297.505 keV Emax= 100 TeV
hBrems: for pi- XStype:1 SubType=3
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 0
===== EM models for the G4Region DefaultRegionForTheWorld ======
hBrem : Emin= 0 meV Emax= 100 TeV ModifiedMephi
hBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi
hPairProd: for pi- XStype:1 SubType=4
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 0
Sampling table 20x1001 from 1.11656 GeV to 100 TeV
===== EM models for the G4Region DefaultRegionForTheWorld ======
hPairProd : Emin= 0 meV Emax= 100 TeV ModifiedMephi
hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi
CoulombScat: for pi- XStype:3 SubType=1 BuildTable=1
Used Lambda table of pi+
ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531
===== EM models for the G4Region DefaultRegionForTheWorld ======
eCoulombScattering : Emin= 0 meV Emax= 100 TeV
eCoulombScattering : Emin= 0 eV Emax= 100 TeV
====================================================================
HADRONIC PROCESSES SUMMARY (verbose level 1)
@@ -518,17 +583,17 @@ CoulombScat: for pi- XStype:3 SubType=1 BuildTable=1
Hadronic Processes for neutron
Process: hadElastic
Model: hElasticCHIPS: 0 meV ---> 100 TeV
Cr_sctns: G4NeutronElasticXS: 0 meV ---> 100 TeV
Model: hElasticCHIPS: 0 eV ---> 100 TeV
Cr_sctns: G4NeutronElasticXS: 0 eV ---> 100 TeV
Process: neutronInelastic
Model: FTFP: 3 GeV ---> 100 TeV
Model: BertiniCascade: 0 meV ---> 6 GeV
Cr_sctns: G4NeutronInelasticXS: 0 meV ---> 100 TeV
Model: BertiniCascade: 0 eV ---> 6 GeV
Cr_sctns: G4NeutronInelasticXS: 0 eV ---> 100 TeV
Process: nCapture
Model: nRadCapture: 0 meV ---> 100 TeV
Cr_sctns: G4NeutronCaptureXS: 0 meV ---> 100 TeV
Model: nRadCapture: 0 eV ---> 100 TeV
Cr_sctns: G4NeutronCaptureXS: 0 eV ---> 100 TeV
Process: nKiller
@@ -536,67 +601,67 @@ CoulombScat: for pi- XStype:3 SubType=1 BuildTable=1
Hadronic Processes for B-
Process: hadElastic
Model: hElasticLHEP: 0 meV ---> 100 TeV
Cr_sctns: Glauber-Gribov: 0 meV ---> 100 TeV
Model: hElasticLHEP: 0 eV ---> 100 TeV
Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV
Process: B-Inelastic
Model: FTFP: 0 meV ---> 100 TeV
Cr_sctns: Glauber-Gribov: 0 meV ---> 100 TeV
Model: FTFP: 0 eV ---> 100 TeV
Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for D-
Process: hadElastic
Model: hElasticLHEP: 0 meV ---> 100 TeV
Cr_sctns: Glauber-Gribov: 0 meV ---> 100 TeV
Model: hElasticLHEP: 0 eV ---> 100 TeV
Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV
Process: D-Inelastic
Model: FTFP: 0 meV ---> 100 TeV
Cr_sctns: Glauber-Gribov: 0 meV ---> 100 TeV
Model: FTFP: 0 eV ---> 100 TeV
Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for GenericIon
Process: ionInelastic
Model: Binary Light Ion Cascade: 0 meV/n ---> 6 GeV/n
Model: Binary Light Ion Cascade: 0 eV /n ---> 6 GeV/n
Model: FTFP: 3 GeV/n ---> 100 TeV/n
Cr_sctns: Glauber-Gribov Nucl-nucl: 0 meV ---> 25.6 PeV
Cr_sctns: Glauber-Gribov Nucl-nucl: 0 eV ---> 25.6 PeV
---------------------------------------------------
Hadronic Processes for He3
Process: hadElastic
Model: hElasticLHEP: 0 meV/n ---> 100 TeV/n
Cr_sctns: Glauber-Gribov Nucl-nucl: 0 meV ---> 25.6 PeV
Model: hElasticLHEP: 0 eV /n ---> 100 TeV/n
Cr_sctns: Glauber-Gribov Nucl-nucl: 0 eV ---> 25.6 PeV
Process: He3Inelastic
Model: Binary Light Ion Cascade: 0 meV/n ---> 6 GeV/n
Model: Binary Light Ion Cascade: 0 eV /n ---> 6 GeV/n
Model: FTFP: 3 GeV/n ---> 100 TeV/n
Cr_sctns: Glauber-Gribov Nucl-nucl: 0 meV ---> 25.6 PeV
Cr_sctns: Glauber-Gribov Nucl-nucl: 0 eV ---> 25.6 PeV
---------------------------------------------------
Hadronic Processes for alpha
Process: hadElastic
Model: hElasticLHEP: 0 meV/n ---> 100 TeV/n
Cr_sctns: Glauber-Gribov Nucl-nucl: 0 meV ---> 25.6 PeV
Model: hElasticLHEP: 0 eV /n ---> 100 TeV/n
Cr_sctns: Glauber-Gribov Nucl-nucl: 0 eV ---> 25.6 PeV
Process: alphaInelastic
Model: Binary Light Ion Cascade: 0 meV/n ---> 6 GeV/n
Model: Binary Light Ion Cascade: 0 eV /n ---> 6 GeV/n
Model: FTFP: 3 GeV/n ---> 100 TeV/n
Cr_sctns: Glauber-Gribov Nucl-nucl: 0 meV ---> 25.6 PeV
Cr_sctns: Glauber-Gribov Nucl-nucl: 0 eV ---> 25.6 PeV
---------------------------------------------------
Hadronic Processes for anti_He3
Process: hadElastic
Model: hElasticLHEP: 0 meV/n ---> 100.1 MeV/n
Model: hElasticLHEP: 0 eV /n ---> 100.1 MeV/n
Model: AntiAElastic: 100 MeV/n ---> 100 TeV/n
Cr_sctns: AntiAGlauber: 0 meV ---> 25.6 PeV
Cr_sctns: AntiAGlauber: 0 eV ---> 25.6 PeV
Process: anti_He3Inelastic
Model: FTFP: 0 meV/n ---> 100 TeV/n
Cr_sctns: AntiAGlauber: 0 meV ---> 25.6 PeV
Model: FTFP: 0 eV /n ---> 100 TeV/n
Cr_sctns: AntiAGlauber: 0 eV ---> 25.6 PeV
Process: hFritiofCaptureAtRest
@@ -604,13 +669,13 @@ CoulombScat: for pi- XStype:3 SubType=1 BuildTable=1
Hadronic Processes for anti_alpha
Process: hadElastic
Model: hElasticLHEP: 0 meV/n ---> 100.1 MeV/n
Model: hElasticLHEP: 0 eV /n ---> 100.1 MeV/n
Model: AntiAElastic: 100 MeV/n ---> 100 TeV/n
Cr_sctns: AntiAGlauber: 0 meV ---> 25.6 PeV
Cr_sctns: AntiAGlauber: 0 eV ---> 25.6 PeV
Process: anti_alphaInelastic
Model: FTFP: 0 meV/n ---> 100 TeV/n
Cr_sctns: AntiAGlauber: 0 meV ---> 25.6 PeV
Model: FTFP: 0 eV /n ---> 100 TeV/n
Cr_sctns: AntiAGlauber: 0 eV ---> 25.6 PeV
Process: hFritiofCaptureAtRest
@@ -618,13 +683,13 @@ CoulombScat: for pi- XStype:3 SubType=1 BuildTable=1
Hadronic Processes for anti_deuteron
Process: hadElastic
Model: hElasticLHEP: 0 meV/n ---> 100.1 MeV/n
Model: hElasticLHEP: 0 eV /n ---> 100.1 MeV/n
Model: AntiAElastic: 100 MeV/n ---> 100 TeV/n
Cr_sctns: AntiAGlauber: 0 meV ---> 25.6 PeV
Cr_sctns: AntiAGlauber: 0 eV ---> 25.6 PeV
Process: anti_deuteronInelastic
Model: FTFP: 0 meV/n ---> 100 TeV/n
Cr_sctns: AntiAGlauber: 0 meV ---> 25.6 PeV
Model: FTFP: 0 eV /n ---> 100 TeV/n
Cr_sctns: AntiAGlauber: 0 eV ---> 25.6 PeV
Process: hFritiofCaptureAtRest
@@ -632,12 +697,12 @@ CoulombScat: for pi- XStype:3 SubType=1 BuildTable=1
Hadronic Processes for anti_lambda
Process: hadElastic
Model: hElasticLHEP: 0 meV ---> 100 TeV
Cr_sctns: Glauber-Gribov: 0 meV ---> 100 TeV
Model: hElasticLHEP: 0 eV ---> 100 TeV
Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV
Process: anti_lambdaInelastic
Model: FTFP: 0 meV ---> 100 TeV
Cr_sctns: Glauber-Gribov: 0 meV ---> 100 TeV
Model: FTFP: 0 eV ---> 100 TeV
Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV
Process: hFritiofCaptureAtRest
@@ -645,13 +710,13 @@ CoulombScat: for pi- XStype:3 SubType=1 BuildTable=1
Hadronic Processes for anti_neutron
Process: hadElastic
Model: hElasticLHEP: 0 meV ---> 100.1 MeV
Model: hElasticLHEP: 0 eV ---> 100.1 MeV
Model: AntiAElastic: 100 MeV ---> 100 TeV
Cr_sctns: AntiAGlauber: 0 meV ---> 25.6 PeV
Cr_sctns: AntiAGlauber: 0 eV ---> 25.6 PeV
Process: anti_neutronInelastic
Model: FTFP: 0 meV ---> 100 TeV
Cr_sctns: AntiAGlauber: 0 meV ---> 25.6 PeV
Model: FTFP: 0 eV ---> 100 TeV
Cr_sctns: AntiAGlauber: 0 eV ---> 25.6 PeV
Process: hFritiofCaptureAtRest
@@ -659,13 +724,13 @@ CoulombScat: for pi- XStype:3 SubType=1 BuildTable=1
Hadronic Processes for anti_proton
Process: hadElastic
Model: hElasticLHEP: 0 meV ---> 100.1 MeV
Model: hElasticLHEP: 0 eV ---> 100.1 MeV
Model: AntiAElastic: 100 MeV ---> 100 TeV
Cr_sctns: AntiAGlauber: 0 meV ---> 25.6 PeV
Cr_sctns: AntiAGlauber: 0 eV ---> 25.6 PeV
Process: anti_protonInelastic
Model: FTFP: 0 meV ---> 100 TeV
Cr_sctns: AntiAGlauber: 0 meV ---> 25.6 PeV
Model: FTFP: 0 eV ---> 100 TeV
Cr_sctns: AntiAGlauber: 0 eV ---> 25.6 PeV
Process: hFritiofCaptureAtRest
@@ -673,13 +738,13 @@ CoulombScat: for pi- XStype:3 SubType=1 BuildTable=1
Hadronic Processes for anti_triton
Process: hadElastic
Model: hElasticLHEP: 0 meV/n ---> 100.1 MeV/n
Model: hElasticLHEP: 0 eV /n ---> 100.1 MeV/n
Model: AntiAElastic: 100 MeV/n ---> 100 TeV/n
Cr_sctns: AntiAGlauber: 0 meV ---> 25.6 PeV
Cr_sctns: AntiAGlauber: 0 eV ---> 25.6 PeV
Process: anti_tritonInelastic
Model: FTFP: 0 meV/n ---> 100 TeV/n
Cr_sctns: AntiAGlauber: 0 meV ---> 25.6 PeV
Model: FTFP: 0 eV /n ---> 100 TeV/n
Cr_sctns: AntiAGlauber: 0 eV ---> 25.6 PeV
Process: hFritiofCaptureAtRest
@@ -687,60 +752,60 @@ CoulombScat: for pi- XStype:3 SubType=1 BuildTable=1
Hadronic Processes for deuteron
Process: hadElastic
Model: hElasticLHEP: 0 meV/n ---> 100 TeV/n
Cr_sctns: Glauber-Gribov Nucl-nucl: 0 meV ---> 25.6 PeV
Model: hElasticLHEP: 0 eV /n ---> 100 TeV/n
Cr_sctns: Glauber-Gribov Nucl-nucl: 0 eV ---> 25.6 PeV
Process: dInelastic
Model: Binary Light Ion Cascade: 0 meV/n ---> 6 GeV/n
Model: Binary Light Ion Cascade: 0 eV /n ---> 6 GeV/n
Model: FTFP: 3 GeV/n ---> 100 TeV/n
Cr_sctns: Glauber-Gribov Nucl-nucl: 0 meV ---> 25.6 PeV
Cr_sctns: Glauber-Gribov Nucl-nucl: 0 eV ---> 25.6 PeV
---------------------------------------------------
Hadronic Processes for e+
Process: electronNuclear
Model: G4ElectroVDNuclearModel: 0 meV ---> 1 PeV
Cr_sctns: ElectroNuclearXS: 0 meV ---> 100 TeV
Process: positronNuclear
Model: G4ElectroVDNuclearModel: 0 eV ---> 1 PeV
Cr_sctns: ElectroNuclearXS: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for e-
Process: electronNuclear
Model: G4ElectroVDNuclearModel: 0 meV ---> 1 PeV
Cr_sctns: ElectroNuclearXS: 0 meV ---> 100 TeV
Model: G4ElectroVDNuclearModel: 0 eV ---> 1 PeV
Cr_sctns: ElectroNuclearXS: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for gamma
Process: photonNuclear
Model: GammaNPreco: 0 meV ---> 200 MeV
Model: GammaNPreco: 0 eV ---> 200 MeV
Model: BertiniCascade: 199 MeV ---> 6 GeV
Model: TheoFSGenerator: 3 GeV ---> 100 TeV
Cr_sctns: PhotoNuclearXS: 0 meV ---> 100 TeV
Cr_sctns: GammaNuclearXS: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for kaon+
Process: hadElastic
Model: hElasticLHEP: 0 meV ---> 100 TeV
Cr_sctns: Glauber-Gribov: 0 meV ---> 100 TeV
Model: hElasticLHEP: 0 eV ---> 100 TeV
Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV
Process: kaon+Inelastic
Model: FTFP: 3 GeV ---> 100 TeV
Model: BertiniCascade: 0 meV ---> 6 GeV
Cr_sctns: Glauber-Gribov: 0 meV ---> 100 TeV
Model: BertiniCascade: 0 eV ---> 6 GeV
Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for kaon-
Process: hadElastic
Model: hElasticLHEP: 0 meV ---> 100 TeV
Cr_sctns: Glauber-Gribov: 0 meV ---> 100 TeV
Model: hElasticLHEP: 0 eV ---> 100 TeV
Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV
Process: kaon-Inelastic
Model: FTFP: 3 GeV ---> 100 TeV
Model: BertiniCascade: 0 meV ---> 6 GeV
Cr_sctns: Glauber-Gribov: 0 meV ---> 100 TeV
Model: BertiniCascade: 0 eV ---> 6 GeV
Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV
Process: hBertiniCaptureAtRest
@@ -748,27 +813,27 @@ CoulombScat: for pi- XStype:3 SubType=1 BuildTable=1
Hadronic Processes for lambda
Process: hadElastic
Model: hElasticLHEP: 0 meV ---> 100 TeV
Cr_sctns: Glauber-Gribov: 0 meV ---> 100 TeV
Model: hElasticLHEP: 0 eV ---> 100 TeV
Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV
Process: lambdaInelastic
Model: FTFP: 3 GeV ---> 100 TeV
Model: BertiniCascade: 0 meV ---> 6 GeV
Cr_sctns: Glauber-Gribov: 0 meV ---> 100 TeV
Model: BertiniCascade: 0 eV ---> 6 GeV
Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for mu+
Process: muonNuclear
Model: G4MuonVDNuclearModel: 0 meV ---> 1 PeV
Cr_sctns: KokoulinMuonNuclearXS: 0 meV ---> 100 TeV
Model: G4MuonVDNuclearModel: 0 eV ---> 1 PeV
Cr_sctns: KokoulinMuonNuclearXS: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for mu-
Process: muonNuclear
Model: G4MuonVDNuclearModel: 0 meV ---> 1 PeV
Cr_sctns: KokoulinMuonNuclearXS: 0 meV ---> 100 TeV
Model: G4MuonVDNuclearModel: 0 eV ---> 1 PeV
Cr_sctns: KokoulinMuonNuclearXS: 0 eV ---> 100 TeV
Process: muMinusCaptureAtRest
@@ -776,25 +841,25 @@ CoulombScat: for pi- XStype:3 SubType=1 BuildTable=1
Hadronic Processes for pi+
Process: hadElastic
Model: hElasticGlauber: 0 meV ---> 100 TeV
Cr_sctns: BarashenkovGlauberGribov: 0 meV ---> 100 TeV
Model: hElasticGlauber: 0 eV ---> 100 TeV
Cr_sctns: BarashenkovGlauberGribov: 0 eV ---> 100 TeV
Process: pi+Inelastic
Model: FTFP: 3 GeV ---> 100 TeV
Model: BertiniCascade: 0 meV ---> 6 GeV
Cr_sctns: BarashenkovGlauberGribov: 0 meV ---> 100 TeV
Model: BertiniCascade: 0 eV ---> 6 GeV
Cr_sctns: BarashenkovGlauberGribov: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for pi-
Process: hadElastic
Model: hElasticGlauber: 0 meV ---> 100 TeV
Cr_sctns: BarashenkovGlauberGribov: 0 meV ---> 100 TeV
Model: hElasticGlauber: 0 eV ---> 100 TeV
Cr_sctns: BarashenkovGlauberGribov: 0 eV ---> 100 TeV
Process: pi-Inelastic
Model: FTFP: 3 GeV ---> 100 TeV
Model: BertiniCascade: 0 meV ---> 6 GeV
Cr_sctns: BarashenkovGlauberGribov: 0 meV ---> 100 TeV
Model: BertiniCascade: 0 eV ---> 6 GeV
Cr_sctns: BarashenkovGlauberGribov: 0 eV ---> 100 TeV
Process: hBertiniCaptureAtRest
@@ -802,25 +867,25 @@ CoulombScat: for pi- XStype:3 SubType=1 BuildTable=1
Hadronic Processes for proton
Process: hadElastic
Model: hElasticCHIPS: 0 meV ---> 100 TeV
Cr_sctns: BarashenkovGlauberGribov: 0 meV ---> 100 TeV
Model: hElasticCHIPS: 0 eV ---> 100 TeV
Cr_sctns: BarashenkovGlauberGribov: 0 eV ---> 100 TeV
Process: protonInelastic
Model: FTFP: 3 GeV ---> 100 TeV
Model: BertiniCascade: 0 meV ---> 6 GeV
Cr_sctns: BarashenkovGlauberGribov: 0 meV ---> 100 TeV
Model: BertiniCascade: 0 eV ---> 6 GeV
Cr_sctns: BarashenkovGlauberGribov: 0 eV ---> 100 TeV
---------------------------------------------------
Hadronic Processes for sigma-
Process: hadElastic
Model: hElasticLHEP: 0 meV ---> 100 TeV
Cr_sctns: Glauber-Gribov: 0 meV ---> 100 TeV
Model: hElasticLHEP: 0 eV ---> 100 TeV
Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV
Process: sigma-Inelastic
Model: FTFP: 3 GeV ---> 100 TeV
Model: BertiniCascade: 0 meV ---> 6 GeV
Cr_sctns: Glauber-Gribov: 0 meV ---> 100 TeV
Model: BertiniCascade: 0 eV ---> 6 GeV
Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV
Process: hBertiniCaptureAtRest
@@ -828,13 +893,13 @@ CoulombScat: for pi- XStype:3 SubType=1 BuildTable=1
Hadronic Processes for triton
Process: hadElastic
Model: hElasticLHEP: 0 meV/n ---> 100 TeV/n
Cr_sctns: Glauber-Gribov Nucl-nucl: 0 meV ---> 25.6 PeV
Model: hElasticLHEP: 0 eV /n ---> 100 TeV/n
Cr_sctns: Glauber-Gribov Nucl-nucl: 0 eV ---> 25.6 PeV
Process: tInelastic
Model: Binary Light Ion Cascade: 0 meV/n ---> 6 GeV/n
Model: Binary Light Ion Cascade: 0 eV /n ---> 6 GeV/n
Model: FTFP: 3 GeV/n ---> 100 TeV/n
Cr_sctns: Glauber-Gribov Nucl-nucl: 0 meV ---> 25.6 PeV
Cr_sctns: Glauber-Gribov Nucl-nucl: 0 eV ---> 25.6 PeV
================================================================
=======================================================================
@@ -857,7 +922,6 @@ Time limit for long lived isomeres (ns) 1
Isomer production flag 1
Internal e- conversion flag 1
Store e- internal conversion data 0
Electron internal conversion ID 3
Correlated gamma emission flag 0
Max 2J for sampling of angular correlations 10
=======================================================================
@@ -1,64 +0,0 @@
///\file "runAndEvent/RE05/.README.txt"
///\brief Example RE05 README page
/*! \page ExampleRE05 Example RE05
Example RE05 has a simplified collider detector geometry. This example
demonstrates the following features. \n
It was moved in extended examples from novice/N04 with removal of
novice examples.
\section RE05_s1 PYTHIA primary events
RE05PrimaryGeneratorAction has G4HEPEvtInterface as the generator.
G4HEPEvtInterface accesses to "pythia_event.data", which contains three
events of Higgs generation produced by PYTHIA. "pythia_main.f" is an
example FORTRAN code of PYTHIA for generating this event sample.
\section RE05_s2 Readout geometry
RE05DetectorConstruction defines a simplified collider detecor
geometry, a tracker made of cylindrical tubes, a calorimeter made of
cylindrical tubes, and muon trackers made of planes.
The cylindrical calorimeter is made of tubes of lead and a scintillator.
Energy deposition in the scintillator is accumulated by RE05CalorimeterSD
sensitive detector, which is assigned to a dedicated parallel world,
RE05CalorimeterParallelWorld, which defines the phi-z cell.
\section RE05_s3 Physics processes
The example uses the QBBC physics list, which includes electromagnetic
and hadronic interactions.
\section RE05_s4 Event filtering by the stacking mechanism
Higgs events in "pythia_event.data" have two lepton pairs produced
by the Higgs decay via Z0. At the first stage of each event, only the
primary muons are tracked without tracking secondaries. then the number
of hits on the muon trackers are examined. At the next stage, only
the primary charged particles are tracked only inside the barrel
tracking area and the isolation of the primary muons are examined.
At the third stage, all particles in the RoI (Region of Interest) along
the isolated muons are tracked. All these examinations are applied in
RE05StackingAction.
\section RE05_s5 How to start
- Execute RE05 in 'batch' mode from macro files
\verbatim
% exampleRE05 exampleRE05.in
\endverbatim
- Execute RE05 in 'interactive mode' with visualization
\verbatim
% exampleRE05
....
Idle> type your commands. For instance:
Idle> /run/beamOn 3
....
Idle> exit
\endverbatim
*/
@@ -1,6 +1,6 @@
#----------------------------------------------------------------------------
# Setup the project
cmake_minimum_required(VERSION 3.12...3.20)
cmake_minimum_required(VERSION 3.16...3.21)
project(RE05)
#----------------------------------------------------------------------------
@@ -16,6 +16,9 @@ track of all tags.
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
18-10-21 B. Morgan (exampleRE05-V10-07-01)
- Use std::string member functions from G4String in place of synonyms
02-10-21 M. Asai (exampleRE05-V10-07-00)
- Migration to the new SteppingVerbose.
-61
View File
@@ -1,61 +0,0 @@
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
Example RE05
------------
Example RE05 has a simplified collider detector geometry. This example
demonstrates the following features.
It was moved in extended examples from novice/N04 with removal of
novice examples.
1. PYTHIA primary events.
RE05PrimaryGeneratorAction has G4HEPEvtInterface as the generator.
G4HEPEvtInterface accesses to "pythia_event.data", which contains three
events of Higgs generation produced by PYTHIA. "pythia_main.f" is an
example FORTRAN code of PYTHIA for generating this event sample.
2. Readout geometry
RE05DetectorConstruction defines a simplified collider detecor
geometry, tracker made of cylindrical tubes, calorimeter made of
cylindrical tubes, and muon trackers made of planes.
The cylindrical calorimeter is made of tubes of lead and a scintillator.
Energy deposition in the scintillator is accumulated by RE05CalorimeterSD
sensitive detector, which is assigned to a dedicated parallel world,
RE05CalorimeterParallelWorld, which defines the phi-z cell.
3. Physics processes
The example uses the QBBC physics list, which includes electromagnetic
and hadronic interactions.
4. Event filtering by the stacking mechanism.
Higgs events in "pythia_event.data" have two lepton pairs produced
by the Higgs decay via Z0. At the first stage of each event, only the
primary muons are tracked without tracking secondaries. then the number
of hits on the muon trackers are examined. At the next stage, only
the primary charged particles are tracked only inside the barrel
tracking area and the isolation of the primary muons are examined.
At the third stage, all particles in the RoI (Region of Interest) along
the isolated muons are tracked. All these examinations are applied in
RE05StackingAction.
5. How to start
- Execute RE05 in 'batch' mode from macro files
% exampleRE05 exampleRE05.in
- Execute RE05 in 'interactive mode' with visualization
% exampleRE05
....
Idle> type your commands. For instance:
Idle> /run/beamOn 3
....
Idle> exit
File diff suppressed because it is too large Load Diff
@@ -71,11 +71,11 @@ void RE05SteppingAction::UserSteppingAction(const G4Step * theStep)
G4StepPoint * thePrePoint = theStep->GetPreStepPoint();
G4VPhysicalVolume * thePrePV = thePrePoint->GetPhysicalVolume();
G4String thePrePVname = thePrePV->GetName();
if(thePrePVname(0,4)=="calo") { return; }
if(thePrePVname.substr(0,4)=="calo") { return; }
G4StepPoint * thePostPoint = theStep->GetPostStepPoint();
G4VPhysicalVolume * thePostPV = thePostPoint->GetPhysicalVolume();
G4String thePostPVname = thePostPV->GetName();
if(thePostPVname(0,4)!="calo") { return; }
if(thePostPVname.substr(0,4)!="calo") { return; }
// then suspend the track
theTrack->SetTrackStatus(fSuspend);
@@ -1,213 +0,0 @@
///\file "runAndEvent/RE06/.README.txt"
///\brief Example RE06 README page
/*! \page ExampleRE06 Example RE06
This example simulates three simplified sandwitch calorimeters.
The main features demonstrated in this example are :
-# Utilizing a concrete run class derived from G4Run base class for
accumulating physics quantities for a run
-# Changing calorimeter geometries without re-building a world volume
-# Defining geometrical regions and setting production thresholds
for each region
-# Demonstrating the use of primitive scorer and filter classes without
implementing sensitive detector class
-# Demonstrating the use of parallel scoring geometry and associating
parallel world scoring process
-# Measuring the timing spent for each region, both for all particle
types and for e+/e-
It was moved in extended examples from novice/N07 with removal of
novice examples.
<i> Note: Since this example utilizes its own RE06SteppingVerbose for the
timing measurement, the user cannot get the ordinary verbosity with
/tracking/verbose. </i>
\section RE06_s1 Utilizing a concrete run class derived from G4Run base class for accumulating physics quantities for a run
G4Run is a class the user can inherit and create his/her own concrete
class for accumulating information useful to him/her. It has a virtual
method RecordEvent(const G4Event*), which will be invoked by G4RunManager
at the end of processing each event. By implemeting this method in the
user'r concrete run class, he/she can store information associating with
G4Event class itself and hits collections attached with G4Event. In this
example, RE06Run is the class derived from G4Run. In the method
RE06Run::RecordEvent(const G4Event*), in addition to counting the
number of events, all hits collections are accessed to accumulate
energy depositions, step lengths and number of steps.
In case the user create his/her own run class, an object of this class
must be instantiated in the method GenerateRun() of his/her concrete
class derived from G4UserRunAction base class. The pointer to this run
object must be returned by this method. In this example, RE06RunAction
is the class which instantiating RE06Run class object. In
RE06RunAction::EndOfRunAction(const G4Run*) method, RE06Run object
is analized to output the run summary.
It should be noted that some information about generated secondaries
are collected in RE06StackinAction instead of sensitive detector class.
RE06StackingAction::ClassifyNewTrack(const G4Track*) method is used
not for classifying tracks sent to the stack, but for accessing to all
secondaries generated in an event.
\section RE06_s2 Changing calorimeter geometries without re-building a world volume
In RE06DetectorConstruction, all solids, logical and physical volumes
are constructed only once at the first invocation of Constuct() method.
Positions and number of slices are changed not by re-constructing another
objects but by modifying data members of already existing objects as
it is implemented in RE06DetectorConstruction::SetNumberOfLayers(G4int)
for changing the number of parameterized volumes, and also
RE06DetectorConstruction::SetSerialGeometry(G4bool) for changing the
position of placed volumes.
\section RE06_s3 Defining geometrical regions and setting production thresholds for each region
Setting production thresholds (so-called production cuts) to individual
region of a detector geometry is the new feature provided by Geant4 5.1
release. This feature is also called as "Cuts per region".
Please note that this new feature is supporsed to be used only by the
users,
a) who is simulating most complex geometry such as an LHC detector,
b) and who has enough experience of simulating EM showers in matter.
We strongly recommend to compare the simulated results of this new
feature with the results of the same geometry but having uniform
production thresholds. Setting completely different cut values for
individual region may break the coherent and comprehensive accuracy
of the simulation. Thus such cut values should be carefully optimized
by the user with comparison with results of uniform cuts.
In RE06DetectorConstruction::Construct(), Three objects of G4Region
class are instantiated and set to the logical volumes of each of three
calorimeter modules. Also, these individual logical volumes are
registered as "root logical volume" so that all daghter volumes in
these logical volumes are also affected by the corresponding regions.
In RE06PhysicsList::SetCuts(), in addition to set the default threshold
values for the world volume, three threshold values are set to three
calorimeter regions respectively. By setting production thresholds to
a region, gamma, electron or positron will not be generated as a
secondary if its range is shorter than the production threshold of that
particular region. Please note that some EM processes still generate
such secondary below threshold.
\section RE06_s4 Demonstrating the use of primitive scorer and filter classes without implementing sensitive detector class
In RE06DetectorConstruction::SetupDetector() method, concrete classes
G4PSEnergyDeposit, G4PSNofSecondary, G4PSTrackLength, G4PSNofStep and
G4PSMinKinEAtGeneration, all of thich are derivalable of G4VPrimitiveScorer,
are used to define the sensitivity of the calorimeter. All of them are
registered to G4MultiFunctionalDetector and this detector object is set
to the logical volume. G4SDParticleFilter is used to define the particle
type(s) to be scored.
In RE06Run::RecordEvent() method, the way of retreiving G4THitsMap
from each primitive scorer via G4HCofThisEvent is demonstrated.
In RE06RunAction::EndOfRunAction(), Run is summarized with data kept
in RE06Run class object.
\section RE06_s5 Demonstrating the use of parallel scoring geometry and associating parallel world scoring process
In RE06PhysicsList::ConstructGeneral(), G4ParallelWorldScoringProcess is
assigned to all the particle types. This process invokes sensitive detectors
(and scorers) defined in the parallel world "ParallelScoringWorld", the
name of the parallel world which is defined in main() (exampleRE06.cc) as
an argument of RE06ParallelWorld constructor.
As implemented in RE06ParallelWorld::SetupGeometry(), the world volume of
the parallel world is obtained by GetWorld() method as a clone copy of the
world volume of the mass geometry. The user should not create the world volume.
RE06ParallelWorld defines three cylindrical volumes, each of them is
located at the same position as three sandwitch calorimeters defined
in the mass geometry (RE06DetectorConstruction). Each cylinder is replicated
in Rho to define 20 layers, and scores the same quantities as the mass geometry.
These three cylinders are relocated accordingly when the mass geometry is
modified by RE06DetectorConstruction::SetSerialGeometry().
\section RE06_s6 Measuring the timing spent for each region, both for all particle types and for e+/e-
RE06SteppingVerbose class has two G4SliceTimer class objects for each
detector region. One G4SliceTimer is measuring the time spent by a step
in a region for all types of particles, and another is measuring for
e+/e- only.
RE06SteppingVerbose::InitializeTimers() is invoked by RE06RunAction::
BeginOfRunAction(), and checks the number of regions appear in the
geometry and instantiates the necessary number of timers. Thus, this
RE06SteppingVerbose class can be used for any kind of geometry the user
defines without any modification. Given G4VSteppingVerbose is not invoked
if the verbosity of G4SteppingManager is 0, this verbosity is set to 1.
NewStep() and StepInfo() are the methods defined in G4VSteppingVerbose
base class, and they are invoked at the beginning and the end of every
step, respectively, from G4SteppingManager. Thus, these methods are
utilized in RE06SteppingVerbose to start/resume and pause the timer.
RE06SteppingVerbose::Report() method is used by RE06RunAction::
EndOfRunAction() to get the timing measured.
\section RE06_s7 Macro files
- exampleRE06.in \n
To be used for batch mode. The reference output file is made by this
macro file.
- sample.mac \n
To be used for interactive mode. Issue "/control/execute sample.mac"
when "Idle>" prompt appears.
- vis.mac \n
Setting visualization parameters. This macro file will be called
automatically when interactive execution starts.
\section RE06_s8 UI commands defined in this example
<pre>
Command /RE06/setAbsMat
Guidance :
Select Material of the Absorber.
Parameter : choice
Parameter type : s
Omittable : False
Candidates : Aluminium liquidArgon Lead Water Scintillator Air Galactic
Command /RE06/setGapMat
Guidance :
Select Material of the Gap.
Parameter : choice
Parameter type : s
Omittable : False
Candidates : Aluminium liquidArgon Lead Water Scintillator Air Galactic
Command /RE06/numberOfLayers
Guidance :
Set number of layers.
Range of parameters : nl>0
Parameter : nl
Parameter type : i
Omittable : False
Command /RE06/serialGeometry
Guidance :
Select calorimeters to be placed in serial or parallel.
Parameter : serialize
Parameter type : b
Omittable : False
</pre>
*/
@@ -1,6 +1,6 @@
#----------------------------------------------------------------------------
# Setup the project
cmake_minimum_required(VERSION 3.12...3.20)
cmake_minimum_required(VERSION 3.16...3.21)
project(RE06)
#----------------------------------------------------------------------------
@@ -16,6 +16,10 @@ track of all tags.
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
Oct. 05, 2021 M. Asai (exampleRE06-V10-07-01)
- Changing the order of deleting RE06SteppingVerbose to be prior to
the deletion of RunManager. Addressing to the Valgring warning message.
Feb. 10, 2021 M. Asai (exampleRE06-V10-07-00)
- Migration to new SteppingVerbose.
-222
View File
@@ -1,222 +0,0 @@
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
ExampleRE06
----------
This example simulates three simplified sandwitch calorimeters.
The main features demonstrated in this example are :
1. Utilizing a concrete run class derived from G4Run base class for
accumulating physics quantities for a run
2. Changing calorimeter geometries without re-building a world volume
3. Defining geometrical regions and setting production thresholds
for each region
4. Demonstrating the use of primitive scorer and filter classes without
implementing sensitive detector class
5. Demonstrating the use of parallel scoring geometry and associating
parallel world scoring process
6. Measuring the timing spent for each region, both for all particle
types and for e+/e-
It was moved in extended examples from novice/N07 with removal of
novice examples.
**********************************************************************
Note: Since this example utilizes its own RE06SteppingVerbose for the
timing measurement, the user cannot get the ordinary verbosity with
/tracking/verbose.
**********************************************************************
1- Utilizing a concrete run class derived from G4Run base class for
accumulating physics quantities for a run
G4Run is a class the user can inherit and create his/her own concrete
class for accumulating information useful to him/her. It has a virtual
method RecordEvent(const G4Event*), which will be invoked by G4RunManager
at the end of processing each event. By implemeting this method in the
user'r concrete run class, he/she can store information associating with
G4Event class itself and hits collections attached with G4Event. In this
example, RE06Run is the class derived from G4Run. In the method
RE06Run::RecordEvent(const G4Event*), in addition to counting the
number of events, all hits collections are accessed to accumulate
energy depositions, step lengths and number of steps.
In case the user create his/her own run class, an object of this class
must be instantiated in the method GenerateRun() of his/her concrete
class derived from G4UserRunAction base class. The pointer to this run
object must be returned by this method. In this example, RE06RunAction
is the class which instantiating RE06Run class object. In
RE06RunAction::EndOfRunAction(const G4Run*) method, RE06Run object
is analized to output the run summary.
It should be noted that some information about generated secondaries
are collected in RE06StackinAction instead of sensitive detector class.
RE06StackingAction::ClassifyNewTrack(const G4Track*) method is used
not for classifying tracks sent to the stack, but for accessing to all
secondaries generated in an event.
2- Changing calorimeter geometries without re-building a world volume
In RE06DetectorConstruction, all solids, logical and physical volumes
are constructed only once at the first invocation of Constuct() method.
Positions and number of slices are changed not by re-constructing another
objects but by modifying data members of already existing objects as
it is implemented in RE06DetectorConstruction::SetNumberOfLayers(G4int)
for changing the number of parameterized volumes, and also
RE06DetectorConstruction::SetSerialGeometry(G4bool) for changing the
position of placed volumes.
3- Defining geometrical regions and setting production thresholds
for each region
Setting production thresholds (so-called production cuts) to individual
region of a detector geometry is the new feature provided by Geant4 5.1
release. This feature is also called as "Cuts per region".
Please note that this new feature is supporsed to be used only by the
users,
a) who is simulating most complex geometry such as an LHC detector,
b) and who has enough experience of simulating EM showers in matter.
We strongly recommend to compare the simulated results of this new
feature with the results of the same geometry but having uniform
production thresholds. Setting completely different cut values for
individual region may break the coherent and comprehensive accuracy
of the simulation. Thus such cut values should be carefully optimized
by the user with comparison with results of uniform cuts.
In RE06DetectorConstruction::Construct(), Three objects of G4Region
class are instantiated and set to the logical volumes of each of three
calorimeter modules. Also, these individual logical volumes are
registered as "root logical volume" so that all daghter volumes in
these logical volumes are also affected by the corresponding regions.
In RE06PhysicsList::SetCuts(), in addition to set the default threshold
values for the world volume, three threshold values are set to three
calorimeter regions respectively. By setting production thresholds to
a region, gamma, electron or positron will not be generated as a
secondary if its range is shorter than the production threshold of that
particular region. Please note that some EM processes still generate
such secondary below threshold.
4- Demonstrating the use of primitive scorer and filter classes without
implementing sensitive detector class
In RE06DetectorConstruction::SetupDetector() method, concrete classes
G4PSEnergyDeposit, G4PSNofSecondary, G4PSTrackLength, G4PSNofStep and
G4PSMinKinEAtGeneration, all of thich are derivalable of G4VPrimitiveScorer,
are used to define the sensitivity of the calorimeter. All of them are
registered to G4MultiFunctionalDetector and this detector object is set
to the logical volume. G4SDParticleFilter is used to define the particle
type(s) to be scored.
In RE06Run::RecordEvent() method, the way of retreiving G4THitsMap
from each primitive scorer via G4HCofThisEvent is demonstrated.
In RE06RunAction::EndOfRunAction(), Run is summarized with data kept
in RE06Run class object.
5- Demonstrating the use of parallel scoring geometry and associating
parallel world scoring process
In RE06PhysicsList::ConstructGeneral(), G4ParallelWorldScoringProcess is
assigned to all the particle types. This process invokes sensitive detectors
(and scorers) defined in the parallel world "ParallelScoringWorld", the
name of the parallel world which is defined in main() (exampleRE06.cc) as
an argument of RE06ParallelWorld constructor.
As implemented in RE06ParallelWorld::SetupGeometry(), the world volume of
the parallel world is obtained by GetWorld() method as a clone copy of the
world volume of the mass geometry. The user should not create the world volume.
RE06ParallelWorld defines three cylindrical volumes, each of them is
located at the same position as three sandwitch calorimeters defined
in the mass geometry (RE06DetectorConstruction). Each cylinder is replicated
in Rho to define 20 layers, and scores the same quantities as the mass geometry.
These three cylinders are relocated accordingly when the mass geometry is
modified by RE06DetectorConstruction::SetSerialGeometry().
6- Measuring the timing spent for each region, both for all particle
types and for e+/e-
RE06SteppingVerbose class has two G4SliceTimer class objects for each
detector region. One G4SliceTimer is measuring the time spent by a step
in a region for all types of particles, and another is measuring for
e+/e- only.
RE06SteppingVerbose::InitializeTimers() is invoked by RE06RunAction::
BeginOfRunAction(), and checks the number of regions appear in the
geometry and instantiates the necessary number of timers. Thus, this
RE06SteppingVerbose class can be used for any kind of geometry the user
defines without any modification. Given G4VSteppingVerbose is not invoked
if the verbosity of G4SteppingManager is 0, this verbosity is set to 1.
NewStep() and StepInfo() are the methods defined in G4VSteppingVerbose
base class, and they are invoked at the beginning and the end of every
step, respectively, from G4SteppingManager. Thus, these methods are
utilized in RE06SteppingVerbose to start/resume and pause the timer.
RE06SteppingVerbose::Report() method is used by RE06RunAction::
EndOfRunAction() to get the timing measured.
7- Macro files
exampleRE06.in
To be used for batch mode. The reference output file is made by this
macro file.
sample.mac
To be used for interactive mode. Issue "/control/execute sample.mac"
when "Idle>" prompt appears.
vis.mac
Setting visualization parameters. This macro file will be called
automatically when interactive execution starts.
8- UI commands defined in this example
Command /RE06/setAbsMat
Guidance :
Select Material of the Absorber.
Parameter : choice
Parameter type : s
Omittable : False
Candidates : Aluminium liquidArgon Lead Water Scintillator Air Galactic
Command /RE06/setGapMat
Guidance :
Select Material of the Gap.
Parameter : choice
Parameter type : s
Omittable : False
Candidates : Aluminium liquidArgon Lead Water Scintillator Air Galactic
Command /RE06/numberOfLayers
Guidance :
Set number of layers.
Range of parameters : nl>0
Parameter : nl
Parameter type : i
Omittable : False
Command /RE06/serialGeometry
Guidance :
Select calorimeters to be placed in serial or parallel.
Parameter : serialize
Parameter type : b
Omittable : False
@@ -112,9 +112,9 @@ int main(int argc,char** argv)
// owned and deleted by the run manager, so they should not
// be deleted in the main() program !
delete verbosity;
delete visManager;
delete runManager;
delete verbosity;
return 0;
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,55 @@
#----------------------------------------------------------------------------
# Setup the project
cmake_minimum_required(VERSION 3.16...3.21)
project(RE07)
#----------------------------------------------------------------------------
# Find Geant4 package, activating all available UI and Vis drivers by default
# You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui
# to build a batch mode only executable
#
option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON)
if(WITH_GEANT4_UIVIS)
find_package(Geant4 REQUIRED ui_all vis_all)
else()
find_package(Geant4 REQUIRED)
endif()
#----------------------------------------------------------------------------
# Setup Geant4 include directories and compile definitions
#
include(${Geant4_USE_FILE})
include_directories(${PROJECT_SOURCE_DIR}/include
${Geant4_INCLUDE_DIR})
#----------------------------------------------------------------------------
# Define sources for this project
#
set(sources
exampleRE07.cc
src/ActionInitialization.cc
src/DetectorConstruction.cc
src/DetectorMessenger.cc
src/EmStandardPhysicsTrackingManager.cc
src/EventAction.cc
src/PhysicsList.cc
src/PhysicsListEmSpecialized.cc
src/PhysicsListEmStandardTracking.cc
src/PhysicsListMessenger.cc
src/PrimaryGeneratorAction.cc
src/RunAction.cc
src/Run.cc
src/SpecializedTrackingManager.cc
src/SteppingAction.cc
src/TrackingAction.cc)
#----------------------------------------------------------------------------
# Add the executable, and link it to the Geant4 libraries
#
add_executable(exampleRE07 ${sources})
target_link_libraries(exampleRE07 ${Geant4_LIBRARIES})
#----------------------------------------------------------------------------
# Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
#
install(TARGETS exampleRE07 DESTINATION bin)
@@ -0,0 +1,22 @@
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
Example RE07 History file
-------------------------
This file should be used by the G4 example coordinator to briefly
summarize all major modifications introduced in the code and keep
track of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
Nov. 12, 2021 J. Hahnfeld (exampleRE07-V10-07-01)
- SpecializedTrackingManager: Fix condition for particles switching
regions (entering or exiting the Back region in this case)
Oct. 31, 2021 J. Hahnfeld (exampleRE07-V10-07-00)
- Created
@@ -0,0 +1,81 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file RE07/exampleRE07.cc
/// \brief Main program of the RE07 example
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
#include "ActionInitialization.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.hh"
#include "G4RunManagerFactory.hh"
#include "G4UImanager.hh"
#include "G4ios.hh"
#include <memory>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
int main(int argc, char** argv)
{
if(argc < 2)
{
G4cerr << "No macro file provided, exiting!" << G4endl;
return 1;
}
// Creating run manager
std::unique_ptr<G4RunManager> runManager(
G4RunManagerFactory::CreateRunManager());
if(argc == 3)
{
G4int nThreads = G4UIcommand::ConvertToInt(argv[2]);
runManager->SetNumberOfThreads(nThreads);
}
// set mandatory initialization classes
DetectorConstruction* detector = new DetectorConstruction;
runManager->SetUserInitialization(detector);
runManager->SetUserInitialization(new PhysicsList);
// set user action classes
runManager->SetUserInitialization(new ActionInitialization(detector));
// get the pointer to the User Interface manager
G4UImanager* UImanager = G4UImanager::GetUIpointer();
G4String command = "/control/execute ";
G4String fileName = argv[1];
UImanager->ApplyCommand(command + fileName);
return 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,53 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
/// \file ActionInitialization.hh
/// \brief Definition of the ActionInitialization class
#ifndef ActionInitialization_h
#define ActionInitialization_h 1
#include "G4VUserActionInitialization.hh"
class DetectorConstruction;
/// Action initialization class.
///
class ActionInitialization : public G4VUserActionInitialization
{
public:
ActionInitialization(DetectorConstruction*);
~ActionInitialization() override;
void BuildForMaster() const override;
void Build() const override;
private:
DetectorConstruction* fDetector;
};
#endif
@@ -0,0 +1,124 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file include/DetectorConstruction.hh
/// \brief Definition of the DetectorConstruction class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef DetectorConstruction_h
#define DetectorConstruction_h 1
#include "G4Cache.hh"
#include "G4VUserDetectorConstruction.hh"
#include "globals.hh"
#include <memory>
class G4Box;
class G4LogicalVolume;
class G4VPhysicalVolume;
class G4Material;
class DetectorMessenger;
class G4GlobalMagFieldMessenger;
const G4int kMaxAbsor = 10; // 0 + 9
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class DetectorConstruction : public G4VUserDetectorConstruction
{
public:
DetectorConstruction();
public:
void SetNbOfAbsor(G4int);
void SetAbsorMaterial(G4int, const G4String&);
void SetAbsorThickness(G4int, G4double);
void SetWorldMaterial(const G4String&);
void SetCalorSizeYZ(G4double);
void SetNbOfLayers(G4int);
G4VPhysicalVolume* Construct() override;
void ConstructSDandField() override;
public:
void PrintCalorParameters();
G4double GetWorldSizeX() const { return fWorldSizeX; };
G4double GetWorldSizeYZ() const { return fWorldSizeYZ; };
G4double GetCalorThickness() const { return fCalorThickness; };
G4double GetCalorSizeYZ() const { return fCalorSizeYZ; };
G4int GetNbOfLayers() const { return fNbOfLayers; };
G4int GetNbOfAbsor() const { return fNbOfAbsor; };
G4double GetAbsorThickness(G4int i) const { return fAbsorThickness[i]; };
const G4Material* GetAbsorMaterial(G4int i) const
{
return fAbsorMaterial[i];
};
const G4VPhysicalVolume* GetphysiWorld() const { return fPhysiWorld; };
const G4Material* GetWorldMaterial() const { return fWorldMaterial; };
private:
void ComputeCalorParameters();
G4int fNbOfAbsor;
G4Material* fAbsorMaterial[kMaxAbsor];
G4double fAbsorThickness[kMaxAbsor];
G4int fNbOfLayers;
G4double fLayerThickness;
G4double fCalorSizeYZ;
G4double fCalorThickness;
G4Material* fWorldMaterial;
G4double fWorldSizeYZ;
G4double fWorldSizeX;
G4LogicalVolume* fLogicWorld;
G4VPhysicalVolume* fPhysiWorld;
G4LogicalVolume* fLogicLayerFront;
G4LogicalVolume* fLogicLayerBack;
G4LogicalVolume* fLogicAbsorFront[kMaxAbsor];
G4LogicalVolume* fLogicAbsorBack[kMaxAbsor];
std::unique_ptr<DetectorMessenger> fDetectorMessenger;
G4Cache<G4GlobalMagFieldMessenger*> fFieldMessenger;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,71 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file include/DetectorMessenger.hh
/// \brief Definition of the DetectorMessenger class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef DetectorMessenger_h
#define DetectorMessenger_h 1
#include "G4UImessenger.hh"
#include "globals.hh"
#include <memory>
class DetectorConstruction;
class G4UIdirectory;
class G4UIcommand;
class G4UIcmdWithAnInteger;
class G4UIcmdWithADoubleAndUnit;
class G4UIcmdWithoutParameter;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class DetectorMessenger : public G4UImessenger
{
public:
DetectorMessenger(DetectorConstruction*);
~DetectorMessenger();
void SetNewValue(G4UIcommand*, G4String) override;
private:
DetectorConstruction* fDetector;
std::unique_ptr<G4UIdirectory> fDetDir;
std::unique_ptr<G4UIcmdWithADoubleAndUnit> fSizeYZCmd;
std::unique_ptr<G4UIcmdWithAnInteger> fNbLayersCmd;
std::unique_ptr<G4UIcmdWithAnInteger> fNbAbsorCmd;
std::unique_ptr<G4UIcommand> fAbsorCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,97 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// EmStandardPhysicsTrackingManager
//
// Class description:
//
// An implementation of the G4VTrackingManager interface for e-/e+ and gamma
// with the same processes as G4EmStandardPhysics.
//
// Original author: Jonas Hahnfeld, 2021
#ifndef EmStandardPhysicsTrackingManager_h
#define EmStandardPhysicsTrackingManager_h 1
#include "G4VTrackingManager.hh"
#include "globals.hh"
class G4eMultipleScattering;
class G4CoulombScattering;
class G4eIonisation;
class G4eBremsstrahlung;
class G4eplusAnnihilation;
class G4ComptonScattering;
class G4GammaConversion;
class G4PhotoElectricEffect;
class G4RayleighScattering;
class EmStandardPhysicsTrackingManager : public G4VTrackingManager
{
public:
EmStandardPhysicsTrackingManager();
~EmStandardPhysicsTrackingManager();
void BuildPhysicsTable(const G4ParticleDefinition&) override;
void PreparePhysicsTable(const G4ParticleDefinition&) override;
void HandOverOneTrack(G4Track* aTrack) override;
private:
void TrackElectron(G4Track* aTrack);
void TrackPositron(G4Track* aTrack);
void TrackGamma(G4Track* aTrack);
struct
{
G4eMultipleScattering* msc;
G4eIonisation* ioni;
G4eBremsstrahlung* brems;
G4CoulombScattering* ss;
} fElectronProcs;
struct
{
G4eMultipleScattering* msc;
G4eIonisation* ioni;
G4eBremsstrahlung* brems;
G4eplusAnnihilation* annihilation;
G4CoulombScattering* ss;
} fPositronProcs;
struct
{
G4PhotoElectricEffect* pe;
G4ComptonScattering* compton;
G4GammaConversion* conversion;
G4RayleighScattering* rayleigh;
} fGammaProcs;
static EmStandardPhysicsTrackingManager* masterTrackingManager;
};
#endif
@@ -0,0 +1,65 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file include/EventAction.hh
/// \brief Definition of the EventAction class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef EventAction_h
#define EventAction_h 1
#include "DetectorConstruction.hh"
#include "G4UserEventAction.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class EventAction : public G4UserEventAction
{
public:
EventAction(DetectorConstruction*);
void BeginOfEventAction(const G4Event*) override;
void EndOfEventAction(const G4Event*) override;
void SumEnergy(G4int k, G4double de, G4double dl)
{
fEnergyDeposit[k] += de;
fTrackLengthCh[k] += dl;
};
private:
DetectorConstruction* fDetector;
G4double fEnergyDeposit[kMaxAbsor];
G4double fTrackLengthCh[kMaxAbsor];
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,62 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file PhysicsList.hh
/// \brief Definition of the PhysicsList class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PhysicsList_h
#define PhysicsList_h 1
#include "G4VUserPhysicsList.hh"
#include "globals.hh"
#include <memory>
class G4VPhysicsConstructor;
class PhysicsListMessenger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PhysicsList : public G4VUserPhysicsList
{
public:
PhysicsList();
void ConstructParticle() override;
void ConstructProcess() override;
void SetMode(const G4String& name);
private:
std::unique_ptr<PhysicsListMessenger> fMessenger;
std::unique_ptr<G4VPhysicsConstructor> fEmPhysicsList;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,53 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file include/PhysicsListEmSpecialized.hh
/// \brief Definition of the PhysicsListEmSpecialized class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PhysicsListEmSpecialized_h
#define PhysicsListEmSpecialized_h 1
#include "G4EmStandardPhysics.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PhysicsListEmSpecialized : public G4EmStandardPhysics
{
public:
PhysicsListEmSpecialized(G4int ver = 1, const G4String& name = "");
~PhysicsListEmSpecialized();
public:
void ConstructProcess() override;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,54 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file include/PhysicsListEmStandardTracking.hh
/// \brief Definition of the PhysicsListEmStandardTracking class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PhysicsListEmStandardTracking_h
#define PhysicsListEmStandardTracking_h 1
#include "G4VPhysicsConstructor.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PhysicsListEmStandardTracking : public G4VPhysicsConstructor
{
public:
PhysicsListEmStandardTracking(G4int ver = 1);
~PhysicsListEmStandardTracking();
public:
void ConstructParticle() override;
void ConstructProcess() override;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,62 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file PhysicsListMessenger.hh
/// \brief Definition of the PhysicsListMessenger class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PhysicsListMessenger_h
#define PhysicsListMessenger_h 1
#include "G4UImessenger.hh"
#include "globals.hh"
#include <memory>
class PhysicsList;
class G4UIcmdWithAString;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PhysicsListMessenger : public G4UImessenger
{
public:
PhysicsListMessenger(PhysicsList*);
~PhysicsListMessenger();
void SetNewValue(G4UIcommand*, G4String) override;
private:
PhysicsList* fPhysicsList;
std::unique_ptr<G4UIcmdWithAString> fModeCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,65 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file include/PrimaryGeneratorAction.hh
/// \brief Definition of the PrimaryGeneratorAction class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PrimaryGeneratorAction_h
#define PrimaryGeneratorAction_h 1
#include "G4ParticleGun.hh"
#include "G4VUserPrimaryGeneratorAction.hh"
#include "globals.hh"
#include <memory>
class G4Event;
class DetectorConstruction;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
PrimaryGeneratorAction(DetectorConstruction*);
public:
void SetDefaultKinematic();
void GeneratePrimaries(G4Event*) override;
G4ParticleGun* GetParticleGun() { return fParticleGun.get(); };
private:
std::unique_ptr<G4ParticleGun> fParticleGun;
DetectorConstruction* fDetector;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,86 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file include/Run.hh
/// \brief Definition of the Run class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef Run_h
#define Run_h 1
#include "DetectorConstruction.hh"
#include "G4Run.hh"
#include "globals.hh"
#include <map>
class DetectorConstruction;
class G4ParticleDefinition;
class G4Track;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class Run : public G4Run
{
public:
Run(DetectorConstruction*);
~Run();
public:
void SetPrimary(G4ParticleDefinition* particle, G4double energy);
void FillPerEvent(G4int, G4double, G4double);
void AddChargedStep();
void AddNeutralStep();
void AddSecondaryTrack(const G4Track*);
void Merge(const G4Run*) override;
void EndOfRun();
private:
DetectorConstruction* fDetector;
G4ParticleDefinition* fParticle;
G4double fEkin;
G4double fSumEAbs[kMaxAbsor], fSum2EAbs[kMaxAbsor];
G4double fSumLAbs[kMaxAbsor], fSum2LAbs[kMaxAbsor];
std::vector<G4double> fEnergyDeposit[kMaxAbsor];
G4double fChargedStep;
G4double fNeutralStep;
G4int fN_gamma;
G4int fN_elec;
G4int fN_pos;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,67 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file include/RunAction.hh
/// \brief Definition of the RunAction class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef RunAction_h
#define RunAction_h 1
#include "G4Timer.hh"
#include "G4UserRunAction.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class Run;
class DetectorConstruction;
class PrimaryGeneratorAction;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class RunAction : public G4UserRunAction
{
public:
RunAction(DetectorConstruction*, PrimaryGeneratorAction* prim = 0);
G4Run* GenerateRun() override;
void BeginOfRunAction(const G4Run*) override;
void EndOfRunAction(const G4Run*) override;
private:
G4Timer fTimer;
DetectorConstruction* fDetector;
PrimaryGeneratorAction* fPrimary;
Run* fRun;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,67 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file include/SpecializedTrackingManager.hh
/// \brief Definition of the SpecializedTrackingManager class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef SpecializedTrackingManager_h
#define SpecializedTrackingManager_h 1
#include "G4VTrackingManager.hh"
class G4Region;
#include <vector>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class SpecializedTrackingManager : public G4VTrackingManager
{
public:
SpecializedTrackingManager();
~SpecializedTrackingManager();
void BuildPhysicsTable(const G4ParticleDefinition&) override;
void PreparePhysicsTable(const G4ParticleDefinition&) override;
void HandOverOneTrack(G4Track* aTrack) override;
void FlushEvent() override;
private:
void StepInBackRegion(G4Track* aTrack);
void StepOutside(G4Track* aTrack);
std::vector<G4Track*> fBufferedTracks;
G4Region* fBackRegion = nullptr;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,58 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file include/SteppingAction.hh
/// \brief Definition of the SteppingAction class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef SteppingAction_h
#define SteppingAction_h 1
#include "G4UserSteppingAction.hh"
#include "globals.hh"
class DetectorConstruction;
class EventAction;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class SteppingAction : public G4UserSteppingAction
{
public:
SteppingAction(DetectorConstruction*, EventAction*);
void UserSteppingAction(const G4Step*) override;
private:
DetectorConstruction* fDetector;
EventAction* fEventAct;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,53 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file include/TrackingAction.hh
/// \brief Definition of the TrackingAction class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef TrackingAction_h
#define TrackingAction_h 1
#include "G4UserTrackingAction.hh"
#include "globals.hh"
class DetectorConstruction;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class TrackingAction : public G4UserTrackingAction
{
public:
TrackingAction();
void PreUserTrackingAction(const G4Track*) override;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,110 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// TrackingManagerHelper
//
// Class description:
//
// Helper class for reducing the effort required to implement a custom tracking
// manager. It implements a stepping loop that calls user actions as the generic
// tracking and stepping managers do, and it implements navigation for charged
// particles in energy-preserving fields and for neutral particles.
//
// Original author: Jonas Hahnfeld, 2021
#ifndef TrackingManagerHelper_hh
#define TrackingManagerHelper_hh 1
#include "G4TrackVector.hh"
#include "globals.hh"
class G4Step;
class G4Track;
class TrackingManagerHelper
{
public:
class Physics
{
public:
virtual void StartTracking(G4Track*) {}
virtual void EndTracking() {}
// Combines AlongStep and PostStep; the implementation needs to remember
// the right value to pass as previousStepSize to G4VProcess.
virtual G4double GetPhysicalInteractionLength(const G4Track& track) = 0;
// This method is called for every step after navigation. The updated
// position is stored in the G4Step's post-step point. Any particle change
// should be applied directly to the step, UpdateTrack() will be called
// automatically after this method returns. If secondaries should be given
// back to the G4EventManager, put them into the container passed as the
// last argument.
virtual void AlongStepDoIt(G4Track& track, G4Step& step,
G4TrackVector& secondaries) = 0;
// This method is called unless the track has been killed during this step.
// If secondaries should be given back to the G4EventManager, put them into
// the container passed as the last argument.
virtual void PostStepDoIt(G4Track& track, G4Step& step,
G4TrackVector& secondaries) = 0;
virtual bool HasAtRestProcesses() { return false; }
// This method is called when a track is stopped, but still alive. If
// secondaries should be given back to the G4EventManager, put them into
// the container passed as the last argument.
virtual void AtRestDoIt(G4Track& track, G4Step& step,
G4TrackVector& secondaries)
{
(void) track;
(void) step;
(void) secondaries;
}
};
class Navigation
{
public:
virtual G4double MakeStep(G4Track& track, G4Step& step,
G4double physicalStep) = 0;
virtual void FinishStep(G4Track& track, G4Step& step) = 0;
};
template <typename PhysicsImpl, typename NavigationImpl>
static void TrackParticle(G4Track* aTrack, PhysicsImpl& physics,
NavigationImpl& navigation);
template <typename PhysicsImpl>
static void TrackChargedParticle(G4Track* aTrack, PhysicsImpl& physics);
template <typename PhysicsImpl>
static void TrackNeutralParticle(G4Track* aTrack, PhysicsImpl& physics);
};
#include "TrackingManagerHelper.icc"
#endif
@@ -0,0 +1,596 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// TrackingManagerHelper
//
// Class description:
//
// Helper class for reducing the effort required to implement a custom tracking
// manager. It implements a stepping loop that calls user actions as the generic
// tracking and stepping managers do, and it implements navigation for charged
// particles in energy-preserving fields and for neutral particles.
//
// Original author: Jonas Hahnfeld, 2021
#include "G4EventManager.hh"
#include "G4Step.hh"
#include "G4StepPoint.hh"
#include "G4Track.hh"
#include "G4TrackVector.hh"
#include "G4UserSteppingAction.hh"
#include "G4UserTrackingAction.hh"
#include "G4VSensitiveDetector.hh"
#include "G4Field.hh"
#include "G4FieldManager.hh"
#include "G4FieldManagerStore.hh"
#include "G4GeometryTolerance.hh"
#include "G4LogicalVolume.hh"
#include "G4Navigator.hh"
#include "G4PropagatorInField.hh"
#include "G4Region.hh"
#include "G4SafetyHelper.hh"
#include "G4TouchableHandle.hh"
#include "G4TouchableHistory.hh"
#include "G4TransportationManager.hh"
#include "G4VPhysicalVolume.hh"
template <typename PhysicsImpl, typename NavigationImpl>
void TrackingManagerHelper::TrackParticle(G4Track* aTrack, PhysicsImpl& physics,
NavigationImpl& navigation)
{
// Prepare for calling the user action.
auto* evtMgr = G4EventManager::GetEventManager();
auto* userTrackingAction = evtMgr->GetUserTrackingAction();
auto* userSteppingAction = evtMgr->GetUserSteppingAction();
// Locate the track in geometry.
{
auto* transMgr = G4TransportationManager::GetTransportationManager();
auto* linearNavigator = transMgr->GetNavigatorForTracking();
const G4ThreeVector& pos = aTrack->GetPosition();
const G4ThreeVector& dir = aTrack->GetMomentumDirection();
// Do not assign directly, doesn't work if the handle is empty.
G4TouchableHandle touchableHandle;
if(aTrack->GetTouchableHandle())
{
touchableHandle = aTrack->GetTouchableHandle();
// FIXME: This assumes we only ever have G4TouchableHistorys!
auto* touchableHistory = (G4TouchableHistory*) touchableHandle();
G4VPhysicalVolume* oldTopVolume = touchableHandle->GetVolume();
G4VPhysicalVolume* newTopVolume =
linearNavigator->ResetHierarchyAndLocate(pos, dir, *touchableHistory);
// TODO: WHY?!
if(newTopVolume != oldTopVolume ||
oldTopVolume->GetRegularStructureId() == 1)
{
touchableHandle = linearNavigator->CreateTouchableHistory();
aTrack->SetTouchableHandle(touchableHandle);
}
}
else
{
linearNavigator->LocateGlobalPointAndSetup(pos, &dir, false, false);
touchableHandle = linearNavigator->CreateTouchableHistory();
aTrack->SetTouchableHandle(touchableHandle);
}
aTrack->SetNextTouchableHandle(touchableHandle);
}
// Prepare data structures used while tracking.
G4Step step;
step.NewSecondaryVector();
G4StepPoint& preStepPoint = *step.GetPreStepPoint();
step.InitializeStep(aTrack);
aTrack->SetStep(&step);
G4TrackVector secondaries;
// Start of tracking: Inform user and processes.
if(userTrackingAction)
{
userTrackingAction->PreUserTrackingAction(aTrack);
}
physics.StartTracking(aTrack);
while(aTrack->GetTrackStatus() == fAlive)
{
// Beginning of this step: Prepare data structures.
aTrack->IncrementCurrentStepNumber();
step.CopyPostToPreStepPoint();
step.ResetTotalEnergyDeposit();
aTrack->SetTouchableHandle(aTrack->GetNextTouchableHandle());
auto* lvol = aTrack->GetTouchable()->GetVolume()->GetLogicalVolume();
preStepPoint.SetMaterial(lvol->GetMaterial());
preStepPoint.SetMaterialCutsCouple(lvol->GetMaterialCutsCouple());
// Query step lengths from pyhsics and geometry, decide on limit.
G4double physicalStep = physics.GetPhysicalInteractionLength(*aTrack);
G4double geometryStep = navigation.MakeStep(*aTrack, step, physicalStep);
bool geometryLimitedStep = geometryStep < physicalStep;
G4double finalStep = geometryLimitedStep ? geometryStep : physicalStep;
step.SetStepLength(finalStep);
aTrack->SetStepLength(finalStep);
// Call AlongStepDoIt in every step.
physics.AlongStepDoIt(*aTrack, step, secondaries);
step.UpdateTrack();
if(aTrack->GetTrackStatus() == fAlive &&
aTrack->GetKineticEnergy() < DBL_MIN)
{
if(physics.HasAtRestProcesses())
{
aTrack->SetTrackStatus(fStopButAlive);
}
else
{
aTrack->SetTrackStatus(fStopAndKill);
}
}
navigation.FinishStep(*aTrack, step);
// Check if the track left the world.
if(aTrack->GetNextVolume() == nullptr)
{
aTrack->SetTrackStatus(fStopAndKill);
}
// The check should rather check for == fAlive and avoid calling
// PostStepDoIt for fStopButAlive, but the generic stepping loop
// does it like this...
if(aTrack->GetTrackStatus() != fStopAndKill)
{
physics.PostStepDoIt(*aTrack, step, secondaries);
}
// Need to get the true step length, not the geometry step length!
aTrack->AddTrackLength(step.GetStepLength());
// End of this step: Call sensitive detector and stepping actions.
if(step.GetControlFlag() != AvoidHitInvocation)
{
auto* sensitive = lvol->GetSensitiveDetector();
if(sensitive)
{
sensitive->Hit(&step);
}
}
if(userSteppingAction)
{
userSteppingAction->UserSteppingAction(&step);
}
auto* regionalAction = lvol->GetRegion()->GetRegionalSteppingAction();
if(regionalAction)
{
regionalAction->UserSteppingAction(&step);
}
}
if(aTrack->GetTrackStatus() == fStopButAlive &&
aTrack->GetNextVolume() != nullptr)
{
// Do one final step.
aTrack->IncrementCurrentStepNumber();
step.CopyPostToPreStepPoint();
step.ResetTotalEnergyDeposit();
physics.AtRestDoIt(*aTrack, step, secondaries);
// End of this step: Call sensitive detector and stepping actions.
auto* lvol = aTrack->GetTouchable()->GetVolume()->GetLogicalVolume();
if(step.GetControlFlag() != AvoidHitInvocation)
{
auto sensitive = lvol->GetSensitiveDetector();
if(sensitive)
{
sensitive->Hit(&step);
}
}
if(userSteppingAction)
{
userSteppingAction->UserSteppingAction(&step);
}
auto* regionalAction = lvol->GetRegion()->GetRegionalSteppingAction();
if(regionalAction)
{
regionalAction->UserSteppingAction(&step);
}
}
// End of tracking: Inform processes and user.
physics.EndTracking();
if(userTrackingAction)
{
userTrackingAction->PostUserTrackingAction(aTrack);
}
evtMgr->StackTracks(&secondaries);
step.DeleteSecondaryVector();
}
template <typename PhysicsImpl>
void TrackingManagerHelper::TrackChargedParticle(G4Track* aTrack,
PhysicsImpl& physics)
{
class ChargedNavigation final : public Navigation
{
public:
ChargedNavigation()
{
auto* transMgr = G4TransportationManager::GetTransportationManager();
fLinearNavigator = transMgr->GetNavigatorForTracking();
fFieldPropagator = transMgr->GetPropagatorInField();
fSafetyHelper = transMgr->GetSafetyHelper();
kCarTolerance =
0.5 * G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
// Reset sstate of field propagator and all chord finders.
fFieldPropagator->ClearPropagatorState();
auto* fieldMgrStore = G4FieldManagerStore::GetInstance();
fieldMgrStore->ClearAllChordFindersState();
}
G4double MakeStep(G4Track& track, G4Step& step,
G4double physicalStep) override
{
G4ThreeVector pos = track.GetPosition();
G4ThreeVector dir = track.GetMomentumDirection();
G4StepPoint& postStepPoint = *step.GetPostStepPoint();
bool fieldExertsForce = false;
if(auto* fieldMgr =
fFieldPropagator->FindAndSetFieldManager(track.GetVolume()))
{
fieldMgr->ConfigureForTrack(&track);
if(const G4Field* ptrField = fieldMgr->GetDetectorField())
{
fieldExertsForce = true;
}
}
G4double endpointDistance;
G4double safety = 0.0;
// Setting a fallback value for safety is required in case of where very
// short steps where the field propagator returns immediately without
// calling geometry.
const G4double shiftSquare = (pos - fSafetyOrigin).mag2();
if(shiftSquare < sqr(fSafety))
{
safety = fSafety - std::sqrt(shiftSquare);
}
if(fieldExertsForce)
{
const G4DynamicParticle* pParticle = track.GetDynamicParticle();
const G4double particleCharge = pParticle->GetCharge();
const G4double particleMass = pParticle->GetMass();
const G4double magneticMoment = pParticle->GetMagneticMoment();
const G4ThreeVector particleSpin = pParticle->GetPolarization();
const G4double kineticEnergy = pParticle->GetKineticEnergy();
const auto pParticleDef = pParticle->GetDefinition();
const auto particlePDGSpin = pParticleDef->GetPDGSpin();
const auto particlePDGMagM = pParticleDef->GetPDGMagneticMoment();
auto equationOfMotion = fFieldPropagator->GetCurrentEquationOfMotion();
equationOfMotion->SetChargeMomentumMass(
G4ChargeState(particleCharge, magneticMoment, particlePDGSpin),
pParticle->GetTotalMomentum(), particleMass);
const G4ThreeVector startPosition = pos;
const G4ThreeVector startDirection = dir;
G4FieldTrack aFieldTrack(startPosition,
track.GetGlobalTime(), // Lab.
dir, kineticEnergy, particleMass,
particleCharge, particleSpin, particlePDGMagM,
0.0, // Length along track
particlePDGSpin);
// Do the Transport in the field (non recti-linear)
//
fGeometryLimitedStep = false;
const G4double lengthAlongCurve = fFieldPropagator->ComputeStep(
aFieldTrack, physicalStep, safety, track.GetVolume(),
kineticEnergy < 250.0);
if(lengthAlongCurve < physicalStep)
{
physicalStep = lengthAlongCurve;
fGeometryLimitedStep = true;
}
fSafetyHelper->SetCurrentSafety(safety, pos);
fSafetyOrigin = pos;
fSafety = safety;
if(fFieldPropagator->IsParticleLooping())
{
track.SetTrackStatus(fStopAndKill);
}
pos = aFieldTrack.GetPosition();
dir = aFieldTrack.GetMomentumDir();
postStepPoint.SetPosition(pos);
postStepPoint.SetMomentumDirection(dir);
endpointDistance = (startPosition - pos).mag();
}
else
{
fGeometryLimitedStep = false;
G4double linearStepLength =
fLinearNavigator->ComputeStep(pos, dir, physicalStep, safety);
if(linearStepLength < physicalStep)
{
physicalStep = linearStepLength;
fGeometryLimitedStep = true;
}
fSafetyHelper->SetCurrentSafety(safety, pos);
fSafetyOrigin = pos;
fSafety = safety;
// Update the position.
pos += physicalStep * dir;
postStepPoint.SetPosition(pos);
endpointDistance = physicalStep;
}
// Update global, local, and proper time.
double velocity = track.GetVelocity();
double deltaTime = 0;
if(velocity > 0)
{
deltaTime = physicalStep / velocity;
}
postStepPoint.AddGlobalTime(deltaTime);
postStepPoint.AddLocalTime(deltaTime);
double restMass = track.GetDynamicParticle()->GetMass();
double deltaProperTime = deltaTime * (restMass / track.GetTotalEnergy());
postStepPoint.AddProperTime(deltaProperTime);
// Compute safety, including the call to safetyHelper, but don't set the
// safety in the post-step point to mimick the generic stepping loop.
if(safety > physicalStep)
{
safety -= physicalStep;
}
else if(safety < endpointDistance)
{
safety = fLinearNavigator->ComputeSafety(pos);
fSafetyHelper->SetCurrentSafety(safety, pos);
fSafetyOrigin = pos;
fSafety = safety;
}
else
{
safety = 0;
}
if(safety < kCarTolerance)
{
fPostStepSafety = kCarTolerance;
}
else
{
fPostStepSafety = safety;
}
return physicalStep;
}
void FinishStep(G4Track& track, G4Step& step) override
{
// Now set the safety that was computed in MakeStep.
G4StepPoint& postStepPoint = *step.GetPostStepPoint();
postStepPoint.SetSafety(fPostStepSafety);
G4TouchableHandle touchableHandle = track.GetTouchableHandle();
const G4ThreeVector& pos = track.GetPosition();
if(fGeometryLimitedStep)
{
// Relocate the particle.
fLinearNavigator->SetGeometricallyLimitedStep();
fLinearNavigator->LocateGlobalPointAndUpdateTouchableHandle(
pos, track.GetMomentumDirection(), touchableHandle, true);
const G4VPhysicalVolume* newVolume = touchableHandle->GetVolume();
if(newVolume == nullptr)
{
postStepPoint.SetStepStatus(fWorldBoundary);
}
else
{
postStepPoint.SetStepStatus(fGeomBoundary);
}
}
else
{
// Move the Navigator's location.
fLinearNavigator->LocateGlobalPointWithinVolume(pos);
}
postStepPoint.SetTouchableHandle(touchableHandle);
track.SetNextTouchableHandle(touchableHandle);
}
private:
G4Navigator* fLinearNavigator;
G4PropagatorInField* fFieldPropagator;
G4SafetyHelper* fSafetyHelper;
G4ThreeVector fSafetyOrigin;
G4double fSafety = 0;
G4double fPostStepSafety = 0;
G4double kCarTolerance;
G4bool fGeometryLimitedStep;
};
ChargedNavigation navigation;
TrackParticle(aTrack, physics, navigation);
}
template <typename PhysicsImpl>
void TrackingManagerHelper::TrackNeutralParticle(G4Track* aTrack,
PhysicsImpl& physics)
{
class NeutralNavigation final : public Navigation
{
public:
NeutralNavigation()
{
auto* transMgr = G4TransportationManager::GetTransportationManager();
fLinearNavigator = transMgr->GetNavigatorForTracking();
fSafetyHelper = transMgr->GetSafetyHelper();
kCarTolerance =
0.5 * G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
}
G4double MakeStep(G4Track& track, G4Step& step,
G4double physicalStep) override
{
G4ThreeVector pos = track.GetPosition();
G4ThreeVector dir = track.GetMomentumDirection();
G4StepPoint& postStepPoint = *step.GetPostStepPoint();
G4double safety = 0.0;
const G4double shiftSquare = (pos - fSafetyOrigin).mag2();
if(shiftSquare < sqr(fSafety))
{
safety = fSafety - std::sqrt(shiftSquare);
}
fGeometryLimitedStep = false;
G4double linearStepLength =
fLinearNavigator->ComputeStep(pos, dir, physicalStep, safety);
if(linearStepLength < physicalStep)
{
physicalStep = linearStepLength;
fGeometryLimitedStep = true;
}
fSafetyHelper->SetCurrentSafety(safety, pos);
fSafetyOrigin = pos;
fSafety = safety;
// Update the position.
pos += physicalStep * dir;
postStepPoint.SetPosition(pos);
// Update global, local, and proper time.
double velocity = track.GetVelocity();
double deltaTime = 0;
if(velocity > 0)
{
deltaTime = physicalStep / velocity;
}
postStepPoint.AddGlobalTime(deltaTime);
postStepPoint.AddLocalTime(deltaTime);
double restMass = track.GetDynamicParticle()->GetMass();
double deltaProperTime = deltaTime * (restMass / track.GetTotalEnergy());
postStepPoint.AddProperTime(deltaProperTime);
// Compute safety, but don't set the safety in the post-step point to
// mimick the generic stepping loop.
if(safety > physicalStep)
{
safety -= physicalStep;
}
else
{
safety = 0;
}
if(safety < kCarTolerance)
{
fPostStepSafety = kCarTolerance;
}
else
{
fPostStepSafety = safety;
}
return physicalStep;
}
void FinishStep(G4Track& track, G4Step& step) override
{
// Now set the safety that was computed in MakeStep.
G4StepPoint& postStepPoint = *step.GetPostStepPoint();
postStepPoint.SetSafety(fPostStepSafety);
G4TouchableHandle touchableHandle = track.GetTouchableHandle();
const G4ThreeVector& pos = track.GetPosition();
if(fGeometryLimitedStep)
{
// Relocate the particle.
fLinearNavigator->SetGeometricallyLimitedStep();
fLinearNavigator->LocateGlobalPointAndUpdateTouchableHandle(
pos, track.GetMomentumDirection(), touchableHandle, true);
const G4VPhysicalVolume* newVolume = touchableHandle->GetVolume();
if(newVolume == nullptr)
{
postStepPoint.SetStepStatus(fWorldBoundary);
}
else
{
postStepPoint.SetStepStatus(fGeomBoundary);
}
}
else
{
// Move the Navigator's location.
fLinearNavigator->LocateGlobalPointWithinVolume(pos);
}
postStepPoint.SetTouchableHandle(touchableHandle);
track.SetNextTouchableHandle(touchableHandle);
}
private:
G4Navigator* fLinearNavigator;
G4SafetyHelper* fSafetyHelper;
G4ThreeVector fSafetyOrigin;
G4double fSafety = 0;
G4double fPostStepSafety = 0;
G4double kCarTolerance;
G4bool fGeometryLimitedStep;
};
NeutralNavigation navigation;
TrackParticle(aTrack, physics, navigation);
}
@@ -0,0 +1,5 @@
/setMode processes
/run/numberOfThreads 1
/run/initialize
/run/beamOn 1000
@@ -0,0 +1,5 @@
/setMode specialized
/run/numberOfThreads 1
/run/initialize
/run/beamOn 1000
@@ -0,0 +1,74 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
/// \file ActionInitialization.cc
/// \brief Implementation of the ActionInitialization class
#include "ActionInitialization.hh"
#include "DetectorConstruction.hh"
#include "EventAction.hh"
#include "PrimaryGeneratorAction.hh"
#include "RunAction.hh"
#include "SteppingAction.hh"
#include "TrackingAction.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ActionInitialization::ActionInitialization(DetectorConstruction* det)
: G4VUserActionInitialization()
, fDetector(det)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ActionInitialization::~ActionInitialization() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ActionInitialization::BuildForMaster() const
{
SetUserAction(new RunAction(fDetector));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ActionInitialization::Build() const
{
PrimaryGeneratorAction* prim = new PrimaryGeneratorAction(fDetector);
SetUserAction(prim);
RunAction* run = new RunAction(fDetector, prim);
SetUserAction(run);
EventAction* event = new EventAction(fDetector);
SetUserAction(event);
SetUserAction(new TrackingAction);
SetUserAction(new SteppingAction(fDetector, event));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,379 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file src/DetectorConstruction.cc
/// \brief Implementation of the DetectorConstruction class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "DetectorConstruction.hh"
#include "DetectorMessenger.hh"
#include "G4Box.hh"
#include "G4LogicalVolume.hh"
#include "G4Material.hh"
#include "G4NistManager.hh"
#include "G4PVPlacement.hh"
#include "G4PVReplica.hh"
#include "G4ProductionCutsTable.hh"
#include "G4Region.hh"
#include "G4PhysicalConstants.hh"
#include "G4RunManager.hh"
#include "G4SystemOfUnits.hh"
#include "G4UnitsTable.hh"
#include <iomanip>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorConstruction::DetectorConstruction()
: fWorldMaterial(nullptr)
, fLogicWorld(nullptr)
, fPhysiWorld(nullptr)
, fLogicLayerFront(nullptr)
, fLogicLayerBack(nullptr)
{
for(G4int i = 0; i < kMaxAbsor; ++i)
{
fAbsorMaterial[i] = nullptr;
fAbsorThickness[i] = 0.0;
fLogicAbsorFront[i] = nullptr;
fLogicAbsorBack[i] = nullptr;
}
// default parameter values of the calorimeter
fNbOfAbsor = 2;
fAbsorThickness[1] = 2.3 * mm;
fAbsorThickness[2] = 5.7 * mm;
fNbOfLayers = 50;
fCalorSizeYZ = 40. * cm;
ComputeCalorParameters();
// materials
SetWorldMaterial("G4_Galactic");
SetAbsorMaterial(1, "G4_Pb");
SetAbsorMaterial(2, "G4_lAr");
// create commands for interactive definition of the calorimeter
fDetectorMessenger.reset(new DetectorMessenger(this));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::ComputeCalorParameters()
{
// Compute derived parameters of the calorimeter
fLayerThickness = 0.;
for(G4int iAbs = 1; iAbs <= fNbOfAbsor; iAbs++)
{
fLayerThickness += fAbsorThickness[iAbs];
}
fCalorThickness = fNbOfLayers * fLayerThickness;
fWorldSizeX = 1.2 * fCalorThickness;
fWorldSizeYZ = 1.2 * fCalorSizeYZ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VPhysicalVolume* DetectorConstruction::Construct()
{
if(fPhysiWorld)
{
return fPhysiWorld;
}
// complete the Calor parameters definition
ComputeCalorParameters();
//
// World
//
auto* solidWorld = new G4Box("World", // its name
fWorldSizeX / 2, fWorldSizeYZ / 2,
fWorldSizeYZ / 2); // its size
fLogicWorld = new G4LogicalVolume(solidWorld, // its solid
fWorldMaterial, // its material
"World"); // its name
fPhysiWorld = new G4PVPlacement(0, // no rotation
G4ThreeVector(), // at (0,0,0)
fLogicWorld, // its fLogical volume
"World", // its name
0, // its mother volume
false, // no boolean operation
0); // copy number
//
// Calorimeter
//
auto* solidCalor = new G4Box("Calorimeter", fCalorThickness / 2,
fCalorSizeYZ / 2, fCalorSizeYZ / 2);
auto* logicCalor =
new G4LogicalVolume(solidCalor, fWorldMaterial, "Calorimeter");
new G4PVPlacement(0, // no rotation
G4ThreeVector(), // at (0,0,0)
logicCalor, // its fLogical volume
"Calorimeter", // its name
fLogicWorld, // its mother volume
false, // no boolean operation
0); // copy number
//
// Layers
//
auto* solidLayer =
new G4Box("Layer", fLayerThickness / 2, fCalorSizeYZ / 2, fCalorSizeYZ / 2);
fLogicLayerFront =
new G4LogicalVolume(solidLayer, fWorldMaterial, "Layer-front");
fLogicLayerBack =
new G4LogicalVolume(solidLayer, fWorldMaterial, "Layer-back");
G4double xfront = -0.5 * fCalorThickness;
for(G4int l = 0; l < fNbOfLayers; ++l)
{
G4double xcenter = xfront + 0.5 * fLayerThickness;
xfront += fLayerThickness;
G4LogicalVolume* logicLayer = fLogicLayerFront;
if(xcenter > 0)
{
logicLayer = fLogicLayerBack;
}
new G4PVPlacement(0, G4ThreeVector(xcenter, 0, 0), logicLayer, "Layer",
logicCalor, false, l);
}
//
// Regions
//
auto* regionFront = new G4Region("Front");
regionFront->SetProductionCuts(G4ProductionCutsTable::GetProductionCutsTable()
->GetDefaultProductionCuts());
regionFront->AddRootLogicalVolume(fLogicLayerFront);
auto* regionBack = new G4Region("Back");
regionBack->SetProductionCuts(G4ProductionCutsTable::GetProductionCutsTable()
->GetDefaultProductionCuts());
regionBack->AddRootLogicalVolume(fLogicLayerBack);
//
// Absorbers
//
xfront = -0.5 * fLayerThickness;
for(G4int k = 1; k <= fNbOfAbsor; ++k)
{
auto* solidAbsor =
new G4Box("Absorber", // its name
fAbsorThickness[k] / 2, fCalorSizeYZ / 2, fCalorSizeYZ / 2);
fLogicAbsorFront[k] =
new G4LogicalVolume(solidAbsor, // its solid
fAbsorMaterial[k], // its material
fAbsorMaterial[k]->GetName());
fLogicAbsorBack[k] = new G4LogicalVolume(solidAbsor, // its solid
fAbsorMaterial[k], // its material
fAbsorMaterial[k]->GetName());
G4double xcenter = xfront + 0.5 * fAbsorThickness[k];
xfront += fAbsorThickness[k];
new G4PVPlacement(0, G4ThreeVector(xcenter, 0., 0.), fLogicAbsorFront[k],
fAbsorMaterial[k]->GetName(), fLogicLayerFront, false,
k); // copy number
new G4PVPlacement(0, G4ThreeVector(xcenter, 0., 0.), fLogicAbsorBack[k],
fAbsorMaterial[k]->GetName(), fLogicLayerBack, false,
k); // copy number
}
PrintCalorParameters();
// always return the fPhysical World
//
return fPhysiWorld;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::PrintCalorParameters()
{
G4cout << "\n-------------------------------------------------------------"
<< "\n ---> The calorimeter is " << fNbOfLayers << " layers of:";
for(G4int i = 1; i <= fNbOfAbsor; ++i)
{
G4cout << "\n \t" << std::setw(12) << fAbsorMaterial[i]->GetName() << ": "
<< std::setw(6) << G4BestUnit(fAbsorThickness[i], "Length");
}
G4cout << "\n-------------------------------------------------------------\n";
G4cout << "\n" << fWorldMaterial << G4endl;
for(G4int j = 1; j <= fNbOfAbsor; ++j)
{
G4cout << "\n" << fAbsorMaterial[j] << G4endl;
}
G4cout << "\n-------------------------------------------------------------\n";
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::SetWorldMaterial(const G4String& material)
{
// search the material by its name
G4Material* pttoMaterial =
G4NistManager::Instance()->FindOrBuildMaterial(material);
if(pttoMaterial)
{
fWorldMaterial = pttoMaterial;
if(fLogicWorld)
{
fLogicWorld->SetMaterial(fWorldMaterial);
fLogicLayerFront->SetMaterial(fWorldMaterial);
fLogicLayerBack->SetMaterial(fWorldMaterial);
G4RunManager::GetRunManager()->PhysicsHasBeenModified();
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::SetNbOfLayers(G4int ival)
{
// set the number of Layers
//
if(ival < 2)
{
G4cout << "\n --->warning from SetfNbOfLayers: " << ival
<< " must be at least 2. Command refused" << G4endl;
return;
}
fNbOfLayers = ival;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::SetNbOfAbsor(G4int ival)
{
// set the number of Absorbers
//
if(ival < 1 || ival > (kMaxAbsor - 1))
{
G4cout << "\n ---> warning from SetfNbOfAbsor: " << ival
<< " must be at least 1 and and most " << kMaxAbsor - 1
<< ". Command refused" << G4endl;
return;
}
fNbOfAbsor = ival;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::SetAbsorMaterial(G4int ival,
const G4String& material)
{
// search the material by its name
//
if(ival > fNbOfAbsor || ival <= 0)
{
G4cout << "\n --->warning from SetAbsorMaterial: absor number " << ival
<< " out of range. Command refused" << G4endl;
return;
}
G4Material* pttoMaterial =
G4NistManager::Instance()->FindOrBuildMaterial(material);
if(pttoMaterial)
{
fAbsorMaterial[ival] = pttoMaterial;
if(fLogicAbsorFront[ival])
{
fLogicAbsorFront[ival]->SetMaterial(pttoMaterial);
fLogicAbsorBack[ival]->SetMaterial(pttoMaterial);
G4RunManager::GetRunManager()->PhysicsHasBeenModified();
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::SetAbsorThickness(G4int ival, G4double val)
{
// change Absorber thickness
//
if(ival > fNbOfAbsor || ival <= 0)
{
G4cout << "\n --->warning from SetAbsorThickness: absor number " << ival
<< " out of range. Command refused" << G4endl;
return;
}
if(val <= DBL_MIN)
{
G4cout << "\n --->warning from SetAbsorThickness: thickness " << val
<< " out of range. Command refused" << G4endl;
return;
}
fAbsorThickness[ival] = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::SetCalorSizeYZ(G4double val)
{
// change the transverse size
//
if(val <= DBL_MIN)
{
G4cout << "\n --->warning from SetfCalorSizeYZ: thickness " << val
<< " out of range. Command refused" << G4endl;
return;
}
fCalorSizeYZ = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4AutoDelete.hh"
#include "G4GlobalMagFieldMessenger.hh"
void DetectorConstruction::ConstructSDandField()
{
if(fFieldMessenger.Get() == nullptr)
{
// Create global magnetic field messenger.
// Uniform magnetic field is then created automatically if
// the field value is not zero.
G4ThreeVector fieldValue = G4ThreeVector();
G4GlobalMagFieldMessenger* msg = new G4GlobalMagFieldMessenger(fieldValue);
// msg->SetVerboseLevel(1);
G4AutoDelete::Register(msg);
fFieldMessenger.Put(msg);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,140 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file src/DetectorMessenger.cc
/// \brief Implementation of the DetectorMessenger class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "DetectorMessenger.hh"
#include <sstream>
#include "DetectorConstruction.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4UIcmdWithAnInteger.hh"
#include "G4UIcmdWithoutParameter.hh"
#include "G4UIcommand.hh"
#include "G4UIdirectory.hh"
#include "G4UIparameter.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorMessenger::DetectorMessenger(DetectorConstruction* Det)
: G4UImessenger()
, fDetector(Det)
{
fDetDir.reset(new G4UIdirectory("/det/"));
fDetDir->SetGuidance("detector construction commands");
fSizeYZCmd.reset(new G4UIcmdWithADoubleAndUnit("/det/setSizeYZ", this));
fSizeYZCmd->SetGuidance("Set tranverse size of the calorimeter");
fSizeYZCmd->SetParameterName("Size", false);
fSizeYZCmd->SetRange("Size>0.");
fSizeYZCmd->SetUnitCategory("Length");
fSizeYZCmd->AvailableForStates(G4State_PreInit);
fSizeYZCmd->SetToBeBroadcasted(false);
fNbLayersCmd.reset(new G4UIcmdWithAnInteger("/det/setNbOfLayers", this));
fNbLayersCmd->SetGuidance("Set number of layers.");
fNbLayersCmd->SetParameterName("NbLayers", false);
fNbLayersCmd->SetRange("NbLayers>0");
fNbLayersCmd->AvailableForStates(G4State_PreInit);
fNbLayersCmd->SetToBeBroadcasted(false);
fNbAbsorCmd.reset(new G4UIcmdWithAnInteger("/det/setNbOfAbsor", this));
fNbAbsorCmd->SetGuidance("Set number of Absorbers.");
fNbAbsorCmd->SetParameterName("NbAbsor", false);
fNbAbsorCmd->SetRange("NbAbsor>0");
fNbAbsorCmd->AvailableForStates(G4State_PreInit);
fNbAbsorCmd->SetToBeBroadcasted(false);
fAbsorCmd.reset(new G4UIcommand("/det/setAbsor", this));
fAbsorCmd->SetGuidance("Set the absor nb, the material, the thickness.");
fAbsorCmd->SetGuidance(" absor number : from 1 to NbOfAbsor");
fAbsorCmd->SetGuidance(" material name");
fAbsorCmd->SetGuidance(" thickness (with unit) : t>0.");
//
G4UIparameter* AbsNbPrm = new G4UIparameter("AbsorNb", 'i', false);
AbsNbPrm->SetGuidance("absor number : from 1 to NbOfAbsor");
AbsNbPrm->SetParameterRange("AbsorNb>0");
fAbsorCmd->SetParameter(AbsNbPrm);
//
G4UIparameter* MatPrm = new G4UIparameter("material", 's', false);
MatPrm->SetGuidance("material name");
fAbsorCmd->SetParameter(MatPrm);
//
G4UIparameter* ThickPrm = new G4UIparameter("thickness", 'd', false);
ThickPrm->SetGuidance("thickness of absorber");
ThickPrm->SetParameterRange("thickness>0.");
fAbsorCmd->SetParameter(ThickPrm);
//
G4UIparameter* unitPrm = new G4UIparameter("unit", 's', false);
unitPrm->SetGuidance("unit of thickness");
G4String unitList = G4UIcommand::UnitsList(G4UIcommand::CategoryOf("mm"));
unitPrm->SetParameterCandidates(unitList);
fAbsorCmd->SetParameter(unitPrm);
//
fAbsorCmd->AvailableForStates(G4State_PreInit);
fAbsorCmd->SetToBeBroadcasted(false);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorMessenger::~DetectorMessenger() = default;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
{
if(command == fSizeYZCmd.get())
{
fDetector->SetCalorSizeYZ(fSizeYZCmd->GetNewDoubleValue(newValue));
}
else if(command == fNbLayersCmd.get())
{
fDetector->SetNbOfLayers(fNbLayersCmd->GetNewIntValue(newValue));
}
else if(command == fNbAbsorCmd.get())
{
fDetector->SetNbOfAbsor(fNbAbsorCmd->GetNewIntValue(newValue));
}
else if(command == fAbsorCmd.get())
{
G4int num;
G4double tick;
G4String unt, mat;
std::istringstream is(newValue);
is >> num >> mat >> tick >> unt;
G4String material = mat;
tick *= G4UIcommand::ValueOf(unt);
fDetector->SetAbsorMaterial(num, material);
fDetector->SetAbsorThickness(num, tick);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,790 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// Implementation of a custom tracking manager for e-/e+ and gamma, using
// the same processes as defined in G4EmStandardPhysics.
//
// Original author: Jonas Hahnfeld, 2021
#include "EmStandardPhysicsTrackingManager.hh"
#include "TrackingManagerHelper.hh"
#include "G4CoulombScattering.hh"
#include "G4UrbanMscModel.hh"
#include "G4WentzelVIModel.hh"
#include "G4eBremsstrahlung.hh"
#include "G4eCoulombScatteringModel.hh"
#include "G4eIonisation.hh"
#include "G4eMultipleScattering.hh"
#include "G4eplusAnnihilation.hh"
#include "G4ComptonScattering.hh"
#include "G4GammaConversion.hh"
#include "G4KleinNishinaModel.hh"
#include "G4LivermorePhotoElectricModel.hh"
#include "G4LivermorePolarizedRayleighModel.hh"
#include "G4PhotoElectricAngularGeneratorPolarized.hh"
#include "G4PhotoElectricEffect.hh"
#include "G4RayleighScattering.hh"
#include "G4EmParameters.hh"
#include "G4SystemOfUnits.hh"
#include "G4Electron.hh"
#include "G4Gamma.hh"
#include "G4Positron.hh"
EmStandardPhysicsTrackingManager*
EmStandardPhysicsTrackingManager::masterTrackingManager = nullptr;
EmStandardPhysicsTrackingManager::EmStandardPhysicsTrackingManager()
{
G4EmParameters* param = G4EmParameters::Instance();
G4double highEnergyLimit = param->MscEnergyLimit();
G4bool polar = param->EnablePolarisation();
// e-
{
G4eMultipleScattering* msc = new G4eMultipleScattering;
G4UrbanMscModel* msc1 = new G4UrbanMscModel;
G4WentzelVIModel* msc2 = new G4WentzelVIModel;
msc1->SetHighEnergyLimit(highEnergyLimit);
msc2->SetLowEnergyLimit(highEnergyLimit);
msc->SetEmModel(msc1);
msc->SetEmModel(msc2);
fElectronProcs.msc = msc;
fElectronProcs.ioni = new G4eIonisation;
fElectronProcs.brems = new G4eBremsstrahlung;
G4CoulombScattering* ss = new G4CoulombScattering;
G4eCoulombScatteringModel* ssm = new G4eCoulombScatteringModel;
ssm->SetLowEnergyLimit(highEnergyLimit);
ssm->SetActivationLowEnergyLimit(highEnergyLimit);
ss->SetEmModel(ssm);
ss->SetMinKinEnergy(highEnergyLimit);
fElectronProcs.ss = ss;
}
// e+
{
G4eMultipleScattering* msc = new G4eMultipleScattering;
G4UrbanMscModel* msc1 = new G4UrbanMscModel;
G4WentzelVIModel* msc2 = new G4WentzelVIModel;
msc1->SetHighEnergyLimit(highEnergyLimit);
msc2->SetLowEnergyLimit(highEnergyLimit);
msc->SetEmModel(msc1);
msc->SetEmModel(msc2);
fPositronProcs.msc = msc;
fPositronProcs.ioni = new G4eIonisation;
fPositronProcs.brems = new G4eBremsstrahlung;
fPositronProcs.annihilation = new G4eplusAnnihilation;
G4CoulombScattering* ss = new G4CoulombScattering;
G4eCoulombScatteringModel* ssm = new G4eCoulombScatteringModel;
ssm->SetLowEnergyLimit(highEnergyLimit);
ssm->SetActivationLowEnergyLimit(highEnergyLimit);
ss->SetEmModel(ssm);
ss->SetMinKinEnergy(highEnergyLimit);
fPositronProcs.ss = ss;
}
{
G4PhotoElectricEffect* pe = new G4PhotoElectricEffect;
G4VEmModel* peModel = new G4LivermorePhotoElectricModel;
if(polar)
{
peModel->SetAngularDistribution(
new G4PhotoElectricAngularGeneratorPolarized);
}
pe->SetEmModel(peModel);
fGammaProcs.pe = pe;
G4ComptonScattering* cs = new G4ComptonScattering;
if(polar)
{
cs->SetEmModel(new G4KleinNishinaModel);
}
fGammaProcs.compton = cs;
fGammaProcs.conversion = new G4GammaConversion;
G4RayleighScattering* rl = new G4RayleighScattering;
if(polar)
{
rl->SetEmModel(new G4LivermorePolarizedRayleighModel);
}
fGammaProcs.rayleigh = rl;
}
if(masterTrackingManager == nullptr)
{
masterTrackingManager = this;
}
else
{
fElectronProcs.msc->SetMasterProcess(
masterTrackingManager->fElectronProcs.msc);
fElectronProcs.ss->SetMasterProcess(
masterTrackingManager->fElectronProcs.ss);
fElectronProcs.ioni->SetMasterProcess(
masterTrackingManager->fElectronProcs.ioni);
fElectronProcs.brems->SetMasterProcess(
masterTrackingManager->fElectronProcs.brems);
fPositronProcs.msc->SetMasterProcess(
masterTrackingManager->fPositronProcs.msc);
fPositronProcs.ss->SetMasterProcess(
masterTrackingManager->fPositronProcs.ss);
fPositronProcs.ioni->SetMasterProcess(
masterTrackingManager->fPositronProcs.ioni);
fPositronProcs.brems->SetMasterProcess(
masterTrackingManager->fPositronProcs.brems);
fPositronProcs.annihilation->SetMasterProcess(
masterTrackingManager->fPositronProcs.annihilation);
fGammaProcs.pe->SetMasterProcess(masterTrackingManager->fGammaProcs.pe);
fGammaProcs.compton->SetMasterProcess(
masterTrackingManager->fGammaProcs.compton);
fGammaProcs.conversion->SetMasterProcess(
masterTrackingManager->fGammaProcs.conversion);
fGammaProcs.rayleigh->SetMasterProcess(
masterTrackingManager->fGammaProcs.rayleigh);
}
}
EmStandardPhysicsTrackingManager::~EmStandardPhysicsTrackingManager()
{
if(masterTrackingManager == this)
{
masterTrackingManager = nullptr;
}
}
void EmStandardPhysicsTrackingManager::BuildPhysicsTable(
const G4ParticleDefinition& part)
{
if(&part == G4Electron::Definition())
{
fElectronProcs.msc->BuildPhysicsTable(part);
fElectronProcs.ioni->BuildPhysicsTable(part);
fElectronProcs.brems->BuildPhysicsTable(part);
fElectronProcs.ss->BuildPhysicsTable(part);
}
else if(&part == G4Positron::Definition())
{
fPositronProcs.msc->BuildPhysicsTable(part);
fPositronProcs.ioni->BuildPhysicsTable(part);
fPositronProcs.brems->BuildPhysicsTable(part);
fPositronProcs.annihilation->BuildPhysicsTable(part);
fPositronProcs.ss->BuildPhysicsTable(part);
}
else if(&part == G4Gamma::Definition())
{
fGammaProcs.pe->BuildPhysicsTable(part);
fGammaProcs.compton->BuildPhysicsTable(part);
fGammaProcs.conversion->BuildPhysicsTable(part);
fGammaProcs.rayleigh->BuildPhysicsTable(part);
}
}
void EmStandardPhysicsTrackingManager::PreparePhysicsTable(
const G4ParticleDefinition& part)
{
if(&part == G4Electron::Definition())
{
fElectronProcs.msc->PreparePhysicsTable(part);
fElectronProcs.ioni->PreparePhysicsTable(part);
fElectronProcs.brems->PreparePhysicsTable(part);
fElectronProcs.ss->PreparePhysicsTable(part);
}
else if(&part == G4Positron::Definition())
{
fPositronProcs.msc->PreparePhysicsTable(part);
fPositronProcs.ioni->PreparePhysicsTable(part);
fPositronProcs.brems->PreparePhysicsTable(part);
fPositronProcs.annihilation->PreparePhysicsTable(part);
fPositronProcs.ss->PreparePhysicsTable(part);
}
else if(&part == G4Gamma::Definition())
{
fGammaProcs.pe->PreparePhysicsTable(part);
fGammaProcs.compton->PreparePhysicsTable(part);
fGammaProcs.conversion->PreparePhysicsTable(part);
fGammaProcs.rayleigh->PreparePhysicsTable(part);
}
}
void EmStandardPhysicsTrackingManager::TrackElectron(G4Track* aTrack)
{
class ElectronPhysics final : public TrackingManagerHelper::Physics
{
public:
ElectronPhysics(EmStandardPhysicsTrackingManager& mgr)
: fMgr(mgr)
{}
void StartTracking(G4Track* aTrack) override
{
auto& electronProcs = fMgr.fElectronProcs;
electronProcs.msc->StartTracking(aTrack);
electronProcs.ioni->StartTracking(aTrack);
electronProcs.brems->StartTracking(aTrack);
electronProcs.ss->StartTracking(aTrack);
fPreviousStepLength = 0;
}
void EndTracking() override
{
auto& electronProcs = fMgr.fElectronProcs;
electronProcs.msc->EndTracking();
electronProcs.ioni->EndTracking();
electronProcs.brems->EndTracking();
electronProcs.ss->EndTracking();
}
G4double GetPhysicalInteractionLength(const G4Track& track) override
{
auto& electronProcs = fMgr.fElectronProcs;
G4double physIntLength, proposedSafety = DBL_MAX;
G4ForceCondition condition;
G4GPILSelection selection;
fProposedStep = DBL_MAX;
fSelected = -1;
physIntLength =
electronProcs.ss->PostStepGPIL(track, fPreviousStepLength, &condition);
if(physIntLength < fProposedStep)
{
fProposedStep = physIntLength;
fSelected = 0;
}
physIntLength = electronProcs.brems->PostStepGPIL(
track, fPreviousStepLength, &condition);
if(physIntLength < fProposedStep)
{
fProposedStep = physIntLength;
fSelected = 1;
}
physIntLength = electronProcs.ioni->PostStepGPIL(
track, fPreviousStepLength, &condition);
if(physIntLength < fProposedStep)
{
fProposedStep = physIntLength;
fSelected = 2;
}
physIntLength = electronProcs.ioni->AlongStepGPIL(
track, fPreviousStepLength, fProposedStep, proposedSafety, &selection);
if(physIntLength < fProposedStep)
{
fProposedStep = physIntLength;
fSelected = -1;
}
physIntLength = electronProcs.msc->AlongStepGPIL(
track, fPreviousStepLength, fProposedStep, proposedSafety, &selection);
if(physIntLength < fProposedStep)
{
fProposedStep = physIntLength;
// Check if MSC actually wants to win, in most cases it only limits the
// step size.
if(selection == CandidateForSelection)
{
fSelected = -1;
}
}
return fProposedStep;
}
void AlongStepDoIt(G4Track& track, G4Step& step, G4TrackVector&) override
{
if(step.GetStepLength() == fProposedStep)
{
step.GetPostStepPoint()->SetStepStatus(fAlongStepDoItProc);
}
else
{
// Remember that the step was limited by geometry.
fSelected = -1;
}
auto& electronProcs = fMgr.fElectronProcs;
G4VParticleChange* particleChange;
particleChange = electronProcs.msc->AlongStepDoIt(track, step);
particleChange->UpdateStepForAlongStep(&step);
track.SetTrackStatus(particleChange->GetTrackStatus());
particleChange->Clear();
particleChange = electronProcs.ioni->AlongStepDoIt(track, step);
particleChange->UpdateStepForAlongStep(&step);
track.SetTrackStatus(particleChange->GetTrackStatus());
particleChange->Clear();
fPreviousStepLength = step.GetStepLength();
}
void PostStepDoIt(G4Track& track, G4Step& step,
G4TrackVector& secondaries) override
{
if(fSelected < 0)
{
return;
}
step.GetPostStepPoint()->SetStepStatus(fPostStepDoItProc);
auto& electronProcs = fMgr.fElectronProcs;
G4VProcess* process = nullptr;
G4VParticleChange* particleChange = nullptr;
switch(fSelected)
{
case 0:
process = electronProcs.ss;
particleChange = electronProcs.ss->PostStepDoIt(track, step);
break;
case 1:
process = electronProcs.brems;
particleChange = electronProcs.brems->PostStepDoIt(track, step);
break;
case 2:
process = electronProcs.ioni;
particleChange = electronProcs.ioni->PostStepDoIt(track, step);
break;
}
particleChange->UpdateStepForPostStep(&step);
step.UpdateTrack();
int numSecondaries = particleChange->GetNumberOfSecondaries();
for(int i = 0; i < numSecondaries; i++)
{
G4Track* secondary = particleChange->GetSecondary(i);
secondary->SetParentID(track.GetTrackID());
secondary->SetCreatorProcess(process);
secondaries.push_back(secondary);
}
track.SetTrackStatus(particleChange->GetTrackStatus());
particleChange->Clear();
}
private:
EmStandardPhysicsTrackingManager& fMgr;
G4double fPreviousStepLength;
G4double fProposedStep;
G4int fSelected;
};
ElectronPhysics physics(*this);
TrackingManagerHelper::TrackChargedParticle(aTrack, physics);
}
void EmStandardPhysicsTrackingManager::TrackPositron(G4Track* aTrack)
{
class PositronPhysics final : public TrackingManagerHelper::Physics
{
public:
PositronPhysics(EmStandardPhysicsTrackingManager& mgr)
: fMgr(mgr)
{}
void StartTracking(G4Track* aTrack) override
{
auto& positronProcs = fMgr.fPositronProcs;
positronProcs.msc->StartTracking(aTrack);
positronProcs.ioni->StartTracking(aTrack);
positronProcs.brems->StartTracking(aTrack);
positronProcs.annihilation->StartTracking(aTrack);
positronProcs.ss->StartTracking(aTrack);
fPreviousStepLength = 0;
}
void EndTracking() override
{
auto& positronProcs = fMgr.fPositronProcs;
positronProcs.msc->EndTracking();
positronProcs.ioni->EndTracking();
positronProcs.brems->EndTracking();
positronProcs.annihilation->EndTracking();
positronProcs.ss->EndTracking();
}
G4double GetPhysicalInteractionLength(const G4Track& track) override
{
auto& positronProcs = fMgr.fPositronProcs;
G4double physIntLength, proposedSafety = DBL_MAX;
G4ForceCondition condition;
G4GPILSelection selection;
fProposedStep = DBL_MAX;
fSelected = -1;
physIntLength =
positronProcs.ss->PostStepGPIL(track, fPreviousStepLength, &condition);
if(physIntLength < fProposedStep)
{
fProposedStep = physIntLength;
fSelected = 0;
}
physIntLength = positronProcs.annihilation->PostStepGPIL(
track, fPreviousStepLength, &condition);
if(physIntLength < fProposedStep)
{
fProposedStep = physIntLength;
fSelected = 1;
}
physIntLength = positronProcs.brems->PostStepGPIL(
track, fPreviousStepLength, &condition);
if(physIntLength < fProposedStep)
{
fProposedStep = physIntLength;
fSelected = 2;
}
physIntLength = positronProcs.ioni->PostStepGPIL(
track, fPreviousStepLength, &condition);
if(physIntLength < fProposedStep)
{
fProposedStep = physIntLength;
fSelected = 3;
}
physIntLength = positronProcs.ioni->AlongStepGPIL(
track, fPreviousStepLength, fProposedStep, proposedSafety, &selection);
if(physIntLength < fProposedStep)
{
fProposedStep = physIntLength;
fSelected = -1;
}
physIntLength = positronProcs.msc->AlongStepGPIL(
track, fPreviousStepLength, fProposedStep, proposedSafety, &selection);
if(physIntLength < fProposedStep)
{
fProposedStep = physIntLength;
// Check if MSC actually wants to win, in most cases it only limits the
// step size.
if(selection == CandidateForSelection)
{
fSelected = -1;
}
}
return fProposedStep;
}
void AlongStepDoIt(G4Track& track, G4Step& step, G4TrackVector&) override
{
if(step.GetStepLength() == fProposedStep)
{
step.GetPostStepPoint()->SetStepStatus(fAlongStepDoItProc);
}
else
{
// Remember that the step was limited by geometry.
fSelected = -1;
}
auto& positronProcs = fMgr.fPositronProcs;
G4VParticleChange* particleChange;
particleChange = positronProcs.msc->AlongStepDoIt(track, step);
particleChange->UpdateStepForAlongStep(&step);
track.SetTrackStatus(particleChange->GetTrackStatus());
particleChange->Clear();
particleChange = positronProcs.ioni->AlongStepDoIt(track, step);
particleChange->UpdateStepForAlongStep(&step);
track.SetTrackStatus(particleChange->GetTrackStatus());
particleChange->Clear();
fPreviousStepLength = step.GetStepLength();
}
void PostStepDoIt(G4Track& track, G4Step& step,
G4TrackVector& secondaries) override
{
if(fSelected < 0)
{
return;
}
step.GetPostStepPoint()->SetStepStatus(fPostStepDoItProc);
auto& positronProcs = fMgr.fPositronProcs;
G4VProcess* process;
G4VParticleChange* particleChange = nullptr;
switch(fSelected)
{
case 0:
process = positronProcs.ss;
particleChange = positronProcs.ss->PostStepDoIt(track, step);
break;
case 1:
process = positronProcs.annihilation;
particleChange =
positronProcs.annihilation->PostStepDoIt(track, step);
break;
case 2:
process = positronProcs.brems;
particleChange = positronProcs.brems->PostStepDoIt(track, step);
break;
case 3:
process = positronProcs.ioni;
particleChange = positronProcs.ioni->PostStepDoIt(track, step);
break;
}
particleChange->UpdateStepForPostStep(&step);
step.UpdateTrack();
int numSecondaries = particleChange->GetNumberOfSecondaries();
for(int i = 0; i < numSecondaries; i++)
{
G4Track* secondary = particleChange->GetSecondary(i);
secondary->SetParentID(track.GetTrackID());
secondary->SetCreatorProcess(process);
secondaries.push_back(secondary);
}
track.SetTrackStatus(particleChange->GetTrackStatus());
particleChange->Clear();
}
G4bool HasAtRestProcesses() override { return true; }
void AtRestDoIt(G4Track& track, G4Step& step,
G4TrackVector& secondaries) override
{
auto& positronProcs = fMgr.fPositronProcs;
// Annihilate the positron at rest.
G4VParticleChange* particleChange =
positronProcs.annihilation->AtRestDoIt(track, step);
particleChange->UpdateStepForAtRest(&step);
step.UpdateTrack();
int numSecondaries = particleChange->GetNumberOfSecondaries();
for(int i = 0; i < numSecondaries; i++)
{
G4Track* secondary = particleChange->GetSecondary(i);
secondary->SetParentID(track.GetTrackID());
secondary->SetCreatorProcess(positronProcs.annihilation);
secondaries.push_back(secondary);
}
track.SetTrackStatus(particleChange->GetTrackStatus());
particleChange->Clear();
}
private:
EmStandardPhysicsTrackingManager& fMgr;
G4double fPreviousStepLength;
G4double fProposedStep;
G4int fSelected;
};
PositronPhysics physics(*this);
TrackingManagerHelper::TrackChargedParticle(aTrack, physics);
}
void EmStandardPhysicsTrackingManager::TrackGamma(G4Track* aTrack)
{
class GammaPhysics final : public TrackingManagerHelper::Physics
{
public:
GammaPhysics(EmStandardPhysicsTrackingManager& mgr)
: fMgr(mgr)
{}
void StartTracking(G4Track* aTrack) override
{
auto& gammaProcs = fMgr.fGammaProcs;
gammaProcs.pe->StartTracking(aTrack);
gammaProcs.compton->StartTracking(aTrack);
gammaProcs.conversion->StartTracking(aTrack);
gammaProcs.rayleigh->StartTracking(aTrack);
fPreviousStepLength = 0;
}
void EndTracking() override
{
auto& gammaProcs = fMgr.fGammaProcs;
gammaProcs.pe->EndTracking();
gammaProcs.compton->EndTracking();
gammaProcs.conversion->EndTracking();
gammaProcs.rayleigh->EndTracking();
}
G4double GetPhysicalInteractionLength(const G4Track& track) override
{
auto& gammaProcs = fMgr.fGammaProcs;
G4double physIntLength;
G4ForceCondition condition;
fProposedStep = DBL_MAX;
fSelected = -1;
physIntLength = gammaProcs.rayleigh->PostStepGPIL(
track, fPreviousStepLength, &condition);
if(physIntLength < fProposedStep)
{
fProposedStep = physIntLength;
fSelected = 0;
}
physIntLength = gammaProcs.conversion->PostStepGPIL(
track, fPreviousStepLength, &condition);
if(physIntLength < fProposedStep)
{
fProposedStep = physIntLength;
fSelected = 1;
}
physIntLength = gammaProcs.compton->PostStepGPIL(
track, fPreviousStepLength, &condition);
if(physIntLength < fProposedStep)
{
fProposedStep = physIntLength;
fSelected = 2;
}
physIntLength =
gammaProcs.pe->PostStepGPIL(track, fPreviousStepLength, &condition);
if(physIntLength < fProposedStep)
{
fProposedStep = physIntLength;
fSelected = 3;
}
return fProposedStep;
}
void AlongStepDoIt(G4Track&, G4Step& step, G4TrackVector&) override
{
if(step.GetStepLength() == fProposedStep)
{
step.GetPostStepPoint()->SetStepStatus(fAlongStepDoItProc);
}
else
{
// Remember that the step was limited by geometry.
fSelected = -1;
}
fPreviousStepLength = step.GetStepLength();
}
void PostStepDoIt(G4Track& track, G4Step& step,
G4TrackVector& secondaries) override
{
if(fSelected < 0)
{
return;
}
step.GetPostStepPoint()->SetStepStatus(fPostStepDoItProc);
auto& gammaProcs = fMgr.fGammaProcs;
G4VProcess* process = nullptr;
G4VParticleChange* particleChange = nullptr;
switch(fSelected)
{
case 0:
process = gammaProcs.rayleigh;
particleChange = gammaProcs.rayleigh->PostStepDoIt(track, step);
break;
case 1:
process = gammaProcs.conversion;
particleChange = gammaProcs.conversion->PostStepDoIt(track, step);
break;
case 2:
process = gammaProcs.compton;
particleChange = gammaProcs.compton->PostStepDoIt(track, step);
break;
case 3:
process = gammaProcs.pe;
particleChange = gammaProcs.pe->PostStepDoIt(track, step);
break;
}
particleChange->UpdateStepForPostStep(&step);
step.UpdateTrack();
int numSecondaries = particleChange->GetNumberOfSecondaries();
for(int i = 0; i < numSecondaries; i++)
{
G4Track* secondary = particleChange->GetSecondary(i);
secondary->SetParentID(track.GetTrackID());
secondary->SetCreatorProcess(process);
secondaries.push_back(secondary);
}
track.SetTrackStatus(particleChange->GetTrackStatus());
particleChange->Clear();
}
private:
EmStandardPhysicsTrackingManager& fMgr;
G4double fPreviousStepLength;
G4double fProposedStep;
G4int fSelected;
};
GammaPhysics physics(*this);
TrackingManagerHelper::TrackNeutralParticle(aTrack, physics);
}
void EmStandardPhysicsTrackingManager::HandOverOneTrack(G4Track* aTrack)
{
const G4ParticleDefinition* part = aTrack->GetParticleDefinition();
if(part == G4Electron::Definition())
{
TrackElectron(aTrack);
}
else if(part == G4Positron::Definition())
{
TrackPositron(aTrack);
}
else if(part == G4Gamma::Definition())
{
TrackGamma(aTrack);
}
aTrack->SetTrackStatus(fStopAndKill);
delete aTrack;
}
@@ -0,0 +1,70 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file src/EventAction.cc
/// \brief Implementation of the EventAction class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "EventAction.hh"
#include "Run.hh"
#include "G4Event.hh"
#include "G4RunManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
EventAction::EventAction(DetectorConstruction* det)
: G4UserEventAction()
, fDetector(det)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void EventAction::BeginOfEventAction(const G4Event*)
{
for(G4int k = 0; k < kMaxAbsor; k++)
{
fEnergyDeposit[k] = fTrackLengthCh[k] = 0.0;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void EventAction::EndOfEventAction(const G4Event*)
{
Run* run =
static_cast<Run*>(G4RunManager::GetRunManager()->GetNonConstCurrentRun());
for(G4int k = 1; k <= fDetector->GetNbOfAbsor(); k++)
{
run->FillPerEvent(k, fEnergyDeposit[k], fTrackLengthCh[k]);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,107 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file PhysicsList.cc
/// \brief Implementation of the PhysicsList class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "PhysicsList.hh"
#include "PhysicsListMessenger.hh"
#include "PhysicsListEmSpecialized.hh"
#include "PhysicsListEmStandardTracking.hh"
#include "G4EmStandardPhysics.hh"
#include "G4BaryonConstructor.hh"
#include "G4BosonConstructor.hh"
#include "G4IonConstructor.hh"
#include "G4LeptonConstructor.hh"
#include "G4MesonConstructor.hh"
#include "G4ShortLivedConstructor.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsList::PhysicsList()
{
SetVerboseLevel(0);
fMessenger.reset(new PhysicsListMessenger(this));
// By default, use the standard physics list with processes.
fEmPhysicsList.reset(new G4EmStandardPhysics(GetVerboseLevel()));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::ConstructParticle()
{
G4BaryonConstructor::ConstructParticle();
G4BosonConstructor::ConstructParticle();
G4IonConstructor::ConstructParticle();
G4LeptonConstructor::ConstructParticle();
G4MesonConstructor::ConstructParticle();
G4ShortLivedConstructor::ConstructParticle();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::ConstructProcess()
{
AddTransportation();
fEmPhysicsList->ConstructProcess();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::SetMode(const G4String& name)
{
if(verboseLevel > -1)
{
G4cout << "PhysicsList::SetMode: <" << name << ">" << G4endl;
}
if(name == "processes")
{
fEmPhysicsList.reset(new G4EmStandardPhysics(GetVerboseLevel()));
}
else if(name == "tracking")
{
fEmPhysicsList.reset(new PhysicsListEmStandardTracking(GetVerboseLevel()));
}
else if(name == "specialized")
{
fEmPhysicsList.reset(new PhysicsListEmSpecialized(GetVerboseLevel()));
}
else
{
G4cout << "PhysicsList::SetMode: <" << name << ">"
<< " is not defined" << G4endl;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,57 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "PhysicsListEmSpecialized.hh"
#include "SpecializedTrackingManager.hh"
#include "G4Electron.hh"
#include "G4Gamma.hh"
#include "G4ParticleDefinition.hh"
#include "G4Positron.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsListEmSpecialized::PhysicsListEmSpecialized(G4int ver,
const G4String& name)
: G4EmStandardPhysics(ver, name)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsListEmSpecialized::~PhysicsListEmSpecialized() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsListEmSpecialized::ConstructProcess()
{
G4EmStandardPhysics::ConstructProcess();
G4Electron::Definition()->SetTrackingManager(new SpecializedTrackingManager);
}
@@ -0,0 +1,74 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "PhysicsListEmStandardTracking.hh"
#include "EmStandardPhysicsTrackingManager.hh"
#include "G4Electron.hh"
#include "G4EmBuilder.hh"
#include "G4Gamma.hh"
#include "G4ParticleDefinition.hh"
#include "G4Positron.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsListEmStandardTracking::PhysicsListEmStandardTracking(G4int ver)
: G4VPhysicsConstructor("EmStandardTracking")
{
SetVerboseLevel(ver);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsListEmStandardTracking::~PhysicsListEmStandardTracking() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsListEmStandardTracking::ConstructParticle()
{
// Taken care of in PhysicsList.cc
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsListEmStandardTracking::ConstructProcess()
{
G4EmBuilder::PrepareEMPhysics();
// Register custom tracking manager for e-/e+ and gammas. Note that tracking
// managers take precendence over processes registered in the G4ProcessManager
// and hides them, so additional physics constructors like G4EmExtraPhysics
// will not work!
auto* trackingManager = new EmStandardPhysicsTrackingManager;
G4Electron::Definition()->SetTrackingManager(trackingManager);
G4Positron::Definition()->SetTrackingManager(trackingManager);
G4Gamma::Definition()->SetTrackingManager(trackingManager);
}
@@ -0,0 +1,66 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file PhysicsListMessenger.cc
/// \brief Implementation of the PhysicsListMessenger class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "PhysicsListMessenger.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIdirectory.hh"
#include "PhysicsList.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsListMessenger::PhysicsListMessenger(PhysicsList* pPhys)
: G4UImessenger()
, fPhysicsList(pPhys)
{
fModeCmd.reset(new G4UIcmdWithAString("/setMode", this));
fModeCmd->SetGuidance("Add physics mode.");
fModeCmd->SetParameterName("mode", false);
fModeCmd->AvailableForStates(G4State_PreInit);
fModeCmd->SetToBeBroadcasted(false);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsListMessenger::~PhysicsListMessenger() = default;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsListMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
{
if(command == fModeCmd.get())
{
fPhysicsList->SetMode(newValue);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,70 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file src/PrimaryGeneratorAction.cc
/// \brief Implementation of the PrimaryGeneratorAction class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "PrimaryGeneratorAction.hh"
#include "DetectorConstruction.hh"
#include "G4Electron.hh"
#include "G4ParticleGun.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PrimaryGeneratorAction::PrimaryGeneratorAction(DetectorConstruction* det)
: fDetector(det)
{
G4int numberOfParticles = 1;
fParticleGun.reset(new G4ParticleGun(numberOfParticles));
SetDefaultKinematic();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PrimaryGeneratorAction::SetDefaultKinematic()
{
G4ParticleDefinition* particle = G4Electron::Definition();
fParticleGun->SetParticleDefinition(particle);
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(1, 0, 0));
fParticleGun->SetParticleEnergy(1 * GeV);
G4double position = -0.5 * fDetector->GetWorldSizeX();
fParticleGun->SetParticlePosition(G4ThreeVector(position, 0, 0));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
fParticleGun->GeneratePrimaryVertex(anEvent);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,229 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file src/Run.cc
/// \brief Implementation of the Run class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "Run.hh"
#include "DetectorConstruction.hh"
#include "PrimaryGeneratorAction.hh"
#include "G4Electron.hh"
#include "G4Gamma.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleTable.hh"
#include "G4Positron.hh"
#include "G4Track.hh"
#include "G4SystemOfUnits.hh"
#include "G4UnitsTable.hh"
#include <iomanip>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Run::Run(DetectorConstruction* det)
: G4Run()
, fDetector(det)
, fParticle(nullptr)
, fEkin(0.)
, fChargedStep(0)
, fNeutralStep(0)
, fN_gamma(0)
, fN_elec(0)
, fN_pos(0)
{
// initialize cumulative quantities
//
for(G4int k = 0; k < kMaxAbsor; k++)
{
fSumEAbs[k] = fSum2EAbs[k] = fSumLAbs[k] = fSum2LAbs[k] = 0.;
fEnergyDeposit[k].clear();
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Run::~Run() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Run::SetPrimary(G4ParticleDefinition* particle, G4double energy)
{
fParticle = particle;
fEkin = energy;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Run::FillPerEvent(G4int kAbs, G4double EAbs, G4double LAbs)
{
// accumulate statistic with restriction
//
fEnergyDeposit[kAbs].push_back(EAbs);
fSumEAbs[kAbs] += EAbs;
fSum2EAbs[kAbs] += EAbs * EAbs;
fSumLAbs[kAbs] += LAbs;
fSum2LAbs[kAbs] += LAbs * LAbs;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Run::AddChargedStep() { fChargedStep += 1.0; }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Run::AddNeutralStep() { fNeutralStep += 1.0; }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Run::AddSecondaryTrack(const G4Track* track)
{
const G4ParticleDefinition* d = track->GetDefinition();
if(d == G4Gamma::Gamma())
{
++fN_gamma;
}
else if(d == G4Electron::Electron())
{
++fN_elec;
}
else if(d == G4Positron::Positron())
{
++fN_pos;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Run::Merge(const G4Run* run)
{
const Run* localRun = static_cast<const Run*>(run);
// pass information about primary particle
fParticle = localRun->fParticle;
fEkin = localRun->fEkin;
// accumulate sums
//
for(G4int k = 0; k < kMaxAbsor; k++)
{
fSumEAbs[k] += localRun->fSumEAbs[k];
fSum2EAbs[k] += localRun->fSum2EAbs[k];
fSumLAbs[k] += localRun->fSumLAbs[k];
fSum2LAbs[k] += localRun->fSum2LAbs[k];
}
fChargedStep += localRun->fChargedStep;
fNeutralStep += localRun->fNeutralStep;
fN_gamma += localRun->fN_gamma;
fN_elec += localRun->fN_elec;
fN_pos += localRun->fN_pos;
G4Run::Merge(run);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Run::EndOfRun()
{
G4int nEvt = numberOfEvent;
G4double norm = G4double(nEvt);
if(norm > 0)
norm = 1. / norm;
G4double qnorm = std::sqrt(norm);
fChargedStep *= norm;
fNeutralStep *= norm;
// compute and print statistic
//
G4double beamEnergy = fEkin;
G4double sqbeam = std::sqrt(beamEnergy / GeV);
G4double MeanEAbs, MeanEAbs2, rmsEAbs, resolution, rmsres;
G4double MeanLAbs, MeanLAbs2, rmsLAbs;
std::ios::fmtflags mode = G4cout.flags();
G4int prec = G4cout.precision(2);
G4cout << "\n------------------------------------------------------------\n";
G4cout << std::setw(14) << "material" << std::setw(17) << "Edep RMS"
<< std::setw(33) << "sqrt(E0(GeV))*rmsE/Emean" << std::setw(23)
<< "total tracklen \n \n";
for(G4int k = 1; k <= fDetector->GetNbOfAbsor(); k++)
{
MeanEAbs = fSumEAbs[k] * norm;
MeanEAbs2 = fSum2EAbs[k] * norm;
rmsEAbs = std::sqrt(std::abs(MeanEAbs2 - MeanEAbs * MeanEAbs));
resolution = 100. * sqbeam * rmsEAbs / MeanEAbs;
rmsres = resolution * qnorm;
// Save mean and RMS
fSumEAbs[k] = MeanEAbs;
fSum2EAbs[k] = rmsEAbs;
MeanLAbs = fSumLAbs[k] * norm;
MeanLAbs2 = fSum2LAbs[k] * norm;
rmsLAbs = std::sqrt(std::abs(MeanLAbs2 - MeanLAbs * MeanLAbs));
// print
//
G4cout << std::setw(14) << fDetector->GetAbsorMaterial(k)->GetName() << ": "
<< std::setprecision(5) << std::setw(6)
<< G4BestUnit(MeanEAbs, "Energy") << " : " << std::setprecision(4)
<< std::setw(5) << G4BestUnit(rmsEAbs, "Energy") << std::setw(10)
<< resolution << " +- " << std::setw(5) << rmsres << " %"
<< std::setprecision(3) << std::setw(10)
<< G4BestUnit(MeanLAbs, "Length") << " +- " << std::setw(4)
<< G4BestUnit(rmsLAbs, "Length") << G4endl;
}
G4cout << "\n------------------------------------------------------------\n";
G4cout << " Beam particle " << fParticle->GetParticleName()
<< " E = " << G4BestUnit(beamEnergy, "Energy") << G4endl;
G4cout << " Mean number of gamma " << (G4double) fN_gamma * norm
<< G4endl;
G4cout << " Mean number of e- " << (G4double) fN_elec * norm
<< G4endl;
G4cout << " Mean number of e+ " << (G4double) fN_pos * norm
<< G4endl;
G4cout << std::setprecision(6) << " Mean number of charged steps "
<< fChargedStep << G4endl;
G4cout << " Mean number of neutral steps " << fNeutralStep << G4endl;
G4cout << "------------------------------------------------------------\n"
<< G4endl;
G4cout.setf(mode, std::ios::floatfield);
G4cout.precision(prec);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,98 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file src/RunAction.cc
/// \brief Implementation of the RunAction class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "RunAction.hh"
#include "DetectorConstruction.hh"
#include "G4RunManager.hh"
#include "G4Timer.hh"
#include "PrimaryGeneratorAction.hh"
#include "Randomize.hh"
#include "Run.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RunAction::RunAction(DetectorConstruction* det, PrimaryGeneratorAction* prim)
: G4UserRunAction()
, fDetector(det)
, fPrimary(prim)
, fRun(nullptr)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4Run* RunAction::GenerateRun()
{
fRun = new Run(fDetector);
return fRun;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::BeginOfRunAction(const G4Run*)
{
// keep run condition
if(fPrimary)
{
G4ParticleDefinition* particle =
fPrimary->GetParticleGun()->GetParticleDefinition();
G4double energy = fPrimary->GetParticleGun()->GetParticleEnergy();
fRun->SetPrimary(particle, energy);
}
if(isMaster)
{
fTimer.Start();
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::EndOfRunAction(const G4Run*)
{
// compute and print statistic
if(isMaster)
{
fTimer.Stop();
if(!((G4RunManager::GetRunManager()->GetRunManagerType() ==
G4RunManager::sequentialRM)))
{
G4cout << "\n"
<< "Total number of events: " << fRun->GetNumberOfEvent()
<< G4endl;
G4cout << "Master thread time: " << fTimer << G4endl;
}
fRun->EndOfRun();
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,257 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "SpecializedTrackingManager.hh"
#include "G4EventManager.hh"
#include "G4ProcessManager.hh"
#include "G4RegionStore.hh"
#include "G4StackManager.hh"
#include "G4TrackingManager.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
SpecializedTrackingManager::SpecializedTrackingManager() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
SpecializedTrackingManager::~SpecializedTrackingManager() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SpecializedTrackingManager::BuildPhysicsTable(
const G4ParticleDefinition& part)
{
if(fBackRegion == nullptr)
{
fBackRegion = G4RegionStore::GetInstance()->GetRegion("Back", false);
}
G4ProcessManager* pManager = part.GetProcessManager();
G4ProcessManager* pManagerShadow = part.GetMasterProcessManager();
G4ProcessVector* pVector = pManager->GetProcessList();
for(std::size_t j = 0; j < pVector->size(); ++j)
{
if(pManagerShadow == pManager)
{
(*pVector)[j]->BuildPhysicsTable(part);
}
else
{
(*pVector)[j]->BuildWorkerPhysicsTable(part);
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SpecializedTrackingManager::PreparePhysicsTable(
const G4ParticleDefinition& part)
{
G4ProcessManager* pManager = part.GetProcessManager();
G4ProcessManager* pManagerShadow = part.GetMasterProcessManager();
G4ProcessVector* pVector = pManager->GetProcessList();
for(std::size_t j = 0; j < pVector->size(); ++j)
{
if(pManagerShadow == pManager)
{
(*pVector)[j]->PreparePhysicsTable(part);
}
else
{
(*pVector)[j]->PrepareWorkerPhysicsTable(part);
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SpecializedTrackingManager::HandOverOneTrack(G4Track* aTrack)
{
if(aTrack->GetKineticEnergy() < 100 * MeV)
{
// If the particle energy is lower than 100 MeV, track it immediately by
// passing to the generic G4TrackingManager. This avoids storing lower
// energy particles in the buffer and feeding it through the specialized
// tracking.
G4EventManager* eventManager = G4EventManager::GetEventManager();
G4TrackingManager* trackManager = eventManager->GetTrackingManager();
trackManager->ProcessOneTrack(aTrack);
if(aTrack->GetTrackStatus() != fStopAndKill)
{
G4Exception("SpecializedTrackingManager::HandOverOneTrack", "NotStopped",
FatalException, "track was not stopped");
}
G4TrackVector* secondaries = trackManager->GimmeSecondaries();
eventManager->StackTracks(secondaries);
delete aTrack;
return;
}
fBufferedTracks.push_back(aTrack);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SpecializedTrackingManager::FlushEvent()
{
G4EventManager* eventManager = G4EventManager::GetEventManager();
G4TrackingManager* trackManager = eventManager->GetTrackingManager();
G4SteppingManager* steppingManager = trackManager->GetSteppingManager();
G4TrackVector* secondaries = trackManager->GimmeSecondaries();
for(G4Track* aTrack : fBufferedTracks)
{
// Clear secondary particle vector
for(std::size_t itr = 0; itr < secondaries->size(); ++itr)
{
delete(*secondaries)[itr];
}
secondaries->clear();
steppingManager->SetInitialStep(aTrack);
G4UserTrackingAction* userTrackingAction =
trackManager->GetUserTrackingAction();
if(userTrackingAction != nullptr)
{
userTrackingAction->PreUserTrackingAction(aTrack);
}
// Give SteppingManger the maxmimum number of processes
steppingManager->GetProcessNumber();
// Give track the pointer to the Step
aTrack->SetStep(steppingManager->GetStep());
// Inform beginning of tracking to physics processes
aTrack->GetDefinition()->GetProcessManager()->StartTracking(aTrack);
// Track the particle Step-by-Step while it is alive
while((aTrack->GetTrackStatus() == fAlive) ||
(aTrack->GetTrackStatus() == fStopButAlive))
{
G4Region* region = aTrack->GetVolume()->GetLogicalVolume()->GetRegion();
if(region == fBackRegion)
{
StepInBackRegion(aTrack);
}
else
{
StepOutside(aTrack);
}
}
aTrack->GetDefinition()->GetProcessManager()->EndTracking();
if(userTrackingAction != nullptr)
{
userTrackingAction->PostUserTrackingAction(aTrack);
}
eventManager->StackTracks(secondaries);
delete aTrack;
}
fBufferedTracks.clear();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SpecializedTrackingManager::StepInBackRegion(G4Track* aTrack)
{
G4EventManager* eventManager = G4EventManager::GetEventManager();
G4TrackingManager* trackManager = eventManager->GetTrackingManager();
G4SteppingManager* steppingManager = trackManager->GetSteppingManager();
// Track the particle Step-by-Step while it is alive and inside the "Back"
// region of the detector. Implement a low-energy cut-off for particles
// below 100 MeV. More specialized handling would also be possible, such
// as only killing particles in non-sensitive materials / volumes.
while((aTrack->GetTrackStatus() == fAlive) ||
(aTrack->GetTrackStatus() == fStopButAlive))
{
aTrack->IncrementCurrentStepNumber();
steppingManager->Stepping();
if(aTrack->GetTrackStatus() != fStopAndKill)
{
// Switch the touchable to update the volume, which is checked in the
// condition below and at the call site.
aTrack->SetTouchableHandle(aTrack->GetNextTouchableHandle());
G4Region* region = aTrack->GetVolume()->GetLogicalVolume()->GetRegion();
if(region != fBackRegion)
{
return;
}
if(aTrack->GetKineticEnergy() < 100 * MeV)
{
// Kill the particle.
aTrack->SetTrackStatus(fStopAndKill);
}
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SpecializedTrackingManager::StepOutside(G4Track* aTrack)
{
G4EventManager* eventManager = G4EventManager::GetEventManager();
G4TrackingManager* trackManager = eventManager->GetTrackingManager();
G4SteppingManager* steppingManager = trackManager->GetSteppingManager();
// Track the particle Step-by-Step while it is alive and still outside of
// the "Back" region.
while((aTrack->GetTrackStatus() == fAlive) ||
(aTrack->GetTrackStatus() == fStopButAlive))
{
aTrack->IncrementCurrentStepNumber();
steppingManager->Stepping();
if(aTrack->GetTrackStatus() != fStopAndKill)
{
// Switch the touchable to update the volume, which is checked in the
// condition below and at the call site.
aTrack->SetTouchableHandle(aTrack->GetNextTouchableHandle());
G4Region* region = aTrack->GetVolume()->GetLogicalVolume()->GetRegion();
if(region == fBackRegion)
{
return;
}
}
}
}
@@ -0,0 +1,98 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file src/SteppingAction.cc
/// \brief Implementation of the SteppingAction class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "SteppingAction.hh"
#include "DetectorConstruction.hh"
#include "EventAction.hh"
#include "Run.hh"
#include "G4PhysicalConstants.hh"
#include "G4Positron.hh"
#include "G4RunManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
SteppingAction::SteppingAction(DetectorConstruction* det, EventAction* evt)
: G4UserSteppingAction()
, fDetector(det)
, fEventAct(evt)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SteppingAction::UserSteppingAction(const G4Step* aStep)
{
// track informations
const G4StepPoint* prePoint = aStep->GetPreStepPoint();
// if World, return
//
G4VPhysicalVolume* volume = prePoint->GetTouchableHandle()->GetVolume();
// if sum of absorbers do not fill exactly a layer: check material, not
// volume.
const G4Material* mat = volume->GetLogicalVolume()->GetMaterial();
if(mat == fDetector->GetWorldMaterial())
return;
const G4ParticleDefinition* particle = aStep->GetTrack()->GetDefinition();
// here we are in an absorber. Locate it
//
G4int absorNum = prePoint->GetTouchableHandle()->GetCopyNumber(0);
// G4int layerNum = prePoint->GetTouchableHandle()->GetCopyNumber(1);
// get Run
Run* run =
static_cast<Run*>(G4RunManager::GetRunManager()->GetNonConstCurrentRun());
// collect energy deposit taking into account track weight
G4double edep =
aStep->GetTotalEnergyDeposit() * aStep->GetTrack()->GetWeight();
// collect step length of charged particles
G4double stepl = 0.;
if(particle->GetPDGCharge() != 0.)
{
stepl = aStep->GetStepLength();
run->AddChargedStep();
}
else
{
run->AddNeutralStep();
}
// sum up per event
fEventAct->SumEnergy(absorNum, edep, stepl);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,62 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file src/TrackingAction.cc
/// \brief Implementation of the TrackingAction class
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "TrackingAction.hh"
#include "Run.hh"
#include "G4PhysicalConstants.hh"
#include "G4Positron.hh"
#include "G4RunManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
TrackingAction::TrackingAction()
: G4UserTrackingAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void TrackingAction::PreUserTrackingAction(const G4Track* track)
{
// get Run
Run* run =
static_cast<Run*>(G4RunManager::GetRunManager()->GetNonConstCurrentRun());
if(track->GetTrackID() != 1)
{
run->AddSecondaryTrack(track);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,5 @@
/setMode tracking
/run/numberOfThreads 1
/run/initialize
/run/beamOn 1000
-61
View File
@@ -1,61 +0,0 @@
Geant4 extended examples - run and event
----------------------------------------
Examples in this directory demonstrate the use of some features in
Run and Event categories. Since these categories are on the top of
hierarchy of Geant4 structure to control the full functionarities of
Geant4, some examples contain features in other categories such as
Tracking, Track, Particles, Detector responces, and even some cases
Geometry and Processes.
RE01
----
This example demonstrates how to connect the information between
primary particles and hits. It also utilizes some user-information
classes. Readout geometry is implemented as a parallel world.
Decay of "Unknown" particle (that may represent whatever a particle
Geant4 does not know how to deal with) is taken care as "pre-assigned
decay products".
RE02
----
This example demonstrates how to accumulate the physics quantities
such as energy deposition and dose for a run. It also demonstrates
the use of primitive scorers.
RE03
----
This example demonstrates how to use UI-command base scoring.
It create parallel world(s) for defining scoring mesh(es).
RE04
----
This example demonstrates how to define layered mass geometry in
a parallel world and use it in a simulation.
RE05
----
Defines a simplified collider detector setup.
Demonstrates interfacing to the PYTHIA primary generator. Includes
the definition of a 'readout' geometry. Exercises event filtering using
the stacking mechanism. Includes visualization.
It was moved in extended examples from novice/N04 with removal of
novice examples.
RE06
----
Implements three simplified sandwitch calorimeters.
Shows how to modify part of the geometry setup at run-time. Includes
detector description parameterisation by materials. Demonstrates
sharing of a sensitive detector definition for different sub-detectors.
Defines different geometrical regions with different production
thresholds. Shows customization of the G4Run.
It was moved in extended examples from novice/N07 with removal of
novice examples.