Import Geant4 11.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2021-12-12 17:16:06 +01:00
parent 80e2389dd8
commit 84f33a068c
593 changed files with 68589 additions and 1 deletions
+63
View File
@@ -0,0 +1,63 @@
///\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.
\link ExampleRE07 RE07 \endlink
Based on extended/electromagnetic/TestEm3, this example demonstrates
how to register specialized tracking managers for a particle or a set
of particles.
*/
@@ -0,0 +1,70 @@
///\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.
*/
+66
View File
@@ -0,0 +1,66 @@
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.
@@ -0,0 +1,250 @@
///\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
*/
+238
View File
@@ -0,0 +1,238 @@
-------------------------------------------------------------------
=========================================================
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
@@ -0,0 +1,59 @@
///\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.
*/
+55
View File
@@ -0,0 +1,55 @@
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.
@@ -0,0 +1,97 @@
///\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.
*/
+92
View File
@@ -0,0 +1,92 @@
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.
@@ -0,0 +1,64 @@
///\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
*/
+61
View File
@@ -0,0 +1,61 @@
-------------------------------------------------------------------
=========================================================
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
@@ -0,0 +1,213 @@
///\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>
*/
+222
View File
@@ -0,0 +1,222 @@
-------------------------------------------------------------------
=========================================================
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
@@ -0,0 +1,54 @@
///\file "runAndEvent/RE07/.README.txt"
///\brief Example RE07 README page
/*! \page ExampleRE07 Example RE07
This example is based on extended/electromagnetic/TestEm3 and
demonstrates how to register specialized tracking managers for
a particle or a set of particles.
\section RE07_s1 Geometry definition
The geometry of a simplified sampling calorimeter is used as
in \link ExampleTestEm3 TestEm3 \endlink, please refer to its
documentation for more details.
The same UI commands exist for modifying the geometry (number
of layers and absorbers, material and its thickness), without
the /testem/ prefix.
In addition to the definition of the volumes, this example adds
two regions, "Front" and "Back", which contain the front and
rear half of the calorimeter.
\section RE07_s2 Physics lists
By default, the example uses G4EmStandardPhysics and registers
processes to the G4ProcessManager. This can be changed with the
/setMode UI command. Possible values are:
- processes: use G4EmStandardPhysics, the default
- tracking: use the same physics as G4EmStandardPhysics, but
implemented as a specialized tracking manager for
electrons, positrons, and gammas; see the file
EmStandardPhysicsTrackingManager.cc for details.
- specialized: use a specialized tracking manager for gammas; for
the purpose of demonstration,
- it uses G4EmStandardPhysics as the basis,
- defers processing of gammas with a kinetic energy
of more than 100 MeV,
- implement a specialized stepping loop for the
"Back" region of the detector.
See the file SpecializedTrackingManager.cc for more
details on the exact implementation.
\section RE07_s3 How to start?
This example comes with one macro file for each of the described
modes that can be passed as a parameter to the executable:
\verbatim
% exampleRE07 processes.mac
\endverbatim
*/
+52
View File
@@ -0,0 +1,52 @@
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
ExampleRE07
-----------
This example is based on extended/electromagnetic/TestEm3 and
demonstrates how to register specialized tracking managers for
a particle or a set of particles.
1- Geometry definition
The geometry of a simplified sampling calorimeter is used as
in TestEm3, please refer to its documentation for more details.
The same UI commands exist for modifying the geometry (number
of layers and absorbers, material and its thickness), without
the /testem/ prefix.
In addition to the definition of the volumes, this example adds
two regions, "Front" and "Back", which contain the front and
rear half of the calorimeter.
2- Physics lists
By default, the example uses G4EmStandardPhysics and registers
processes to the G4ProcessManager. This can be changed with the
/setMode UI command. Possible values are:
processes: use G4EmStandardPhysics, the default
tracking: use the same physics as G4EmStandardPhysics, but
implemented as a specialized tracking manager for
electrons, positrons, and gammas; see the file
EmStandardPhysicsTrackingManager.cc for details.
specialized: use a specialized tracking manager for gammas; for
the purpose of demonstration,
- it uses G4EmStandardPhysics as the basis,
- defers processing of gammas with a kinetic energy
of more than 100 MeV,
- implement a specialized stepping loop for the
"Back" region of the detector.
See the file SpecializedTrackingManager.cc for more
details on the exact implementation.
3- How to start?
This example comes with one macro file for each of the described
modes that can be passed as a parameter to the executable:
% exampleRE07 processes.mac
+68
View File
@@ -0,0 +1,68 @@
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.
RE07
----
Based on extended/electromagnetic/TestEm3, this example demonstrates
how to register specialized tracking managers for a particle or a set
of particles.