Import Geant4 11.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2021-12-12 17:16:06 +01:00
parent 80e2389dd8
commit 84f33a068c
593 changed files with 68589 additions and 1 deletions
@@ -0,0 +1,165 @@
///\file "parameterisations/gflash/.README.txt"
///\brief Examples gflash README page
/*! \page Examples_gflash Category "parameterisations/gflash"
These examples demonstrate the use of the GFLASH parameterisation library.
They use the GFLASH equations (hep-ex/0001020, Grindhammer & Peters)
to parametrise electromagnetic showers in matter.
In these examples the calorimeter is a simple cube,
which consists of 10 x 10 crystals of PbWO4 (CMS like).
Briefly, whenever a e-/e+ enters the calorimeter, it is parametrised if it
has a minimum energy and the shower is expected to be contained
in the calorimeter (so called " parameterisation envelope").
If this is fullfilled the particle is killed, as well as all secondaries,
and the energy is deposited according to the GFLASH equations.
The examples show how to interface GFLASH to your application.
The simulation time is measured, so the user can see immediately
the speed up by using GFLASH.
Geometry and parametrisation is defined in different ways in the set of three equivalent
(in terms of produced showers) examples: gflash1, gflash2 and gflash3, to demonstrate
how to use the parametrisation, sensitive detectors and parallel geometry.
The classes which are the same in all three examples have the names with ExGflash prefix while
the names of classes specific to each example have the prexix ExGflash[1,2,3].
The <a href="../html_gflasha/html/Examplegflasha.html"> gflasha </a>
example - allow histogramming of show profiles and fine tuning
of gflash parametrization for homogeneous medium.
Note: Instead of particle gun the gps class is used here for particle generation.
\section Examples_gflash_s1 Briefly
Table below presents in which world/geometry (mass or parallel) each of the elements is defined.
| Example | gflash1 | gflash2 | gflash3 |
|------------------------------|----------|--------------|--------------|
| Block of material | mass geo | mass geo | mass geo |
| Crystals (readout geometry) | mass geo | mass geo | parallel geo |
| Sensitive detector | mass geo | mass geo | parallel geo |
| Envelope for parametrisation | mass geo | parallel geo | mass geo |
\subsection Examples_gflash_s1_sub1 Example gflash1:
Uses only the mass geometry, with each crystal defined as a volume,
with parametrisation attached to the envelope in the mass geometry.
Geometry and sensitive detector are defined in:
- ExGflash1DetectorConstruction
- ExGflash1SensitiveDetector
\subsection Examples_gflash_s1_sub2 Example gflash2:
Uses mass geometry to create volumes and to create a sensitive detector
for storing hits, but parametrisation is attached to the envelope
in the parallel geometry (see also examples/extended/parametrisations/Par01).
Geometry and sensitive detector are defined in:
- ExGflash2DetectorConstruction
- ExGflash2ParallelWorld
- ExGflash2SensitiveDetector
\subsection Examples_gflash_s1_sub3 Example gflash3:
Uses mass geometry to create the main volume (homogeneous material) and use it
as an envelope for the parametrisation, but the readout geometry (crystals)
are defined in the parallel geometry, together with the sensitive detector
to store the hits.
Geometry and sensitive detector are defined in:
- ExGflash3DetectorConstruction
- ExGflash3ParallelWorld
- ExGflash3SensitiveDetector
\section Examples_gflash_s2 Details of implementation:
\subsection Examples_gflash_s2_sub1 Example gflash1:
To use GFLASH the user has to implement the following:
- ExGflash1DetectorConstruction::ConstructSDandField() : \n
Here GFLASH has to be initialized and assigend to the envelope,
where it should be active (here our calorimeter = caloLog )
\code{.cpp}
// **********************************************
// * Initializing shower modell
// ***********************************************
G4cout << "Creating shower parameterization models" << G4endl;
fFastShowerModel = new GFlashShowerModel("fFastShowerModel", fRegion);
fParameterisation = new GFlashHomoShowerParameterisation(pbWO4);
fFastShowerModel->SetParameterisation(*fParameterisation);
fParticleBounds = new GFlashParticleBounds();
fFastShowerModel->SetParticleBounds(*fParticleBounds);
fHitMaker = new GFlashHitMaker();
fFastShowerModel->SetHitMaker(*fHitMaker);
G4cout<<"end shower parameterization."<<G4endl;
// **********************************************
\endcode
- ExGflash1SensitiveDetector: \n
It is mandatory to use G4VGFlashSensitiveDetector as (additional)
base class for the sensitive detector.
Here it is necessary to implement a seperate
interface, where the GFlash spots are processed.
(ProcessHits(G4GFlashSpot*aSpot ,G4TouchableHistory* ROhist))
The separate interface is used, because the GFLASH spots contains
(naturally) less information than the full simulation.
\subsection Examples_gflash_s2_sub2 Example gflash2:
- ExGflash2.cc:
Parallel world needs to be registered;
Fast simulation is activated for parallel world (where envelope is);
- ExGflash2DetectorConstruction:
Only main geometry and SD are created;
- ExGflash2ParallelWorld:
Construction of identical volume for the main box as in the mass geometry,
but with dummy material (it is not used anyway);
Creation of G4Region associated to G4LogicalVolume;
Initialization of GFlash, attaching it to the envelope (G4Region);
- ExGflash2SensitiveDetector:
Uses pointer to ExGflash2ParallelWorld to get the crystals for the readout;
\subsection Examples_gflash_s2_sub3 Example gflash3:
- ExGflash3.cc:
Parallel world needs to be registered;
Physics of the parallel world needs to be registered so sensitive detector can
collect hits;
Fast simulation is activated for mass world (where envelope is);
- ExGflash3DetectorConstruction:
Only main volume (box) with material is created;
Creation of G4Region associated to G4LogicalVolume of that box;
Initialization of GFlash, attaching it to the envelope (G4Region);
- ExGflash3ParallelWorld:
Construction of identical volume for the main box as in the mass geometry,
but with dummy material (it is not used anyway);
Construction of individual crystals for the readout geometry;
Creation of the sensitive detector;
- ExGflash3SensitiveDetector:
Uses pointer to ExGflash3DetectorConstruction to get the crystals for the readout;
\section Examples_gflash_s3 Macros
- vis.mac - macro for use in interactive mode (default, if no arguments are specified)
- test.mac - macro for tests: 50 GeV electrons are shot in the direction of the detector
(along z axis), 10 times. As they enter the parametrisation envelope,
the GFlash parametrisation is invoked and energy is deposited.
The results are printed out:
- energy in the most central crystal
- energy in 3x3 crystals
- energy in 5x5 crystals
- number of created deposits
- simulation time per event
*/
@@ -0,0 +1,175 @@
$README, v 1.0 26.11.2004 Joanna Weng $
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
GFLASH Examples
--------------
These examples demonstrate the use of the GFLASH parameterisation library.
They use the GFLASH equations (hep-ex/0001020, Grindhammer & Peters)
to parametrise electromagnetic showers in matter.
In these examples the calorimeter is a simple cube,
which consists of 10 x 10 crystals of PbWO4 (CMS like).
Briefly, whenever a e-/e+ enters the calorimeter, it is parametrised if it
has a minimum energy and the shower is expected to be contained
in the calorimeter (so called " parameterisation envelope").
If this is fullfilled the particle is killed, as well as all secondaries,
and the energy is deposited according to the GFLASH equations.
The examples show how to interface GFLASH to your application.
The simulation time is measured, so the user can see immediately
the speed up by using GFLASH.
Geometry and parametrisation is defined in different ways in the set of three equivalent
(in terms of produced showers) examples: gflash1, gflash2 and gflash3, to demonstrate
how to use the parametrisation, sensitive detectors and parallel geometry.
The classes which are the same in all three examples have the names with ExGflash prefix while
the names of classes specific to each example have the prexix ExGflash[1,2,3].
The gflasha example - allow histogramming of show profiles and fine tuning
of gflash parametrization for homogeneous medium. This examples has a standalone documentation.
Note: Instead of particle gun the gps class is used here for particle generation.
Briefly
-------
Table below presents in which world/geometry (mass or parallel) each of the elements is defined.
+------------------------------+----------+--------------+--------------+
| Example | gflash1 | gflash2 | gflash3 |
+------------------------------+----------+--------------+--------------+
| Block of material | mass geo | mass geo | mass geo |
+------------------------------+----------+--------------+--------------+
| Crystals (readout geometry) | mass geo | mass geo | parallel geo |
+------------------------------+----------+--------------+--------------+
| Sensitive detector | mass geo | mass geo | parallel geo |
+------------------------------+----------+--------------+--------------+
| Envelope for parametrisation | mass geo | parallel geo | mass geo |
+------------------------------+----------+--------------+--------------+
Example gflash1:
Uses only the mass geometry, with each crystal defined as a volume,
with parametrisation attached to the envelope in the mass geometry.
Geometry and sensitive detector are defined in:
ExGflash1DetectorConstruction
ExGflash1SensitiveDetector
Example gflash2:
Uses mass geometry to create volumes and to create a sensitive detector
for storing hits, but parametrisation is attached to the envelope
in the parallel geometry (see also examples/extended/parametrisations/Par01).
Geometry and sensitive detector are defined in:
ExGflash2DetectorConstruction
ExGflash2ParallelWorld
ExGflash2SensitiveDetector
Example gflash3:
Uses mass geometry to create the main volume (homogeneous material) and use it
as an envelope for the parametrisation, but the readout geometry (crystals)
are defined in the parallel geometry, together with the sensitive detector
to store the hits.
Geometry and sensitive detector are defined in:
ExGflash3DetectorConstruction
ExGflash3ParallelWorld
ExGflash3SensitiveDetector
Details of implementation:
-------
Example gflash1:
To use GFLASH the user has to implement the following:
- ExGflash1DetectorConstruction::ConstructSD() :
Here GFLASH has to be initialized and assigend to the envelope,
where it should be active (here our calorimeter = fCalo_log )
// **********************************************
// * Initializing shower modell
// ***********************************************
G4cout << "Creating shower parameterization models" << G4endl;
fFastShowerModel = new GFlashShowerModel("fFastShowerModel", fRegion);
fParameterisation = new GFlashHomoShowerParameterisation(pbWO4);
fFastShowerModel->SetParameterisation(*fParameterisation);
fParticleBounds = new GFlashParticleBounds();
fFastShowerModel->SetParticleBounds(*fParticleBounds);
fHitMaker = new GFlashHitMaker();
fFastShowerModel->SetHitMaker(*fHitMaker);
G4cout<<"end shower parameterization."<<G4endl;
- ExGflash1SensitiveDetector:
It is mandatory to use G4VGFlashSensitiveDetector as (additional)
base class for the sensitive detector.
Here it is necessary to implement a seperate
interface, where the GFlash spots are processed.
(ProcessHits(G4GFlashSpot*aSpot ,G4TouchableHistory* ROhist))
The separate interface is used, because the GFLASH spots contains
(naturally) less information than the full simulation.
Example gflash2:
- ExGflash2.cc:
Parallel world needs to be registered;
Fast simulation is activated for parallel world (where envelope is);
- ExGflash2DetectorConstruction:
Only main geometry and SD are created;
- ExGflash2ParallelWorld:
Construction of identical volume for the main box as in the mass geometry,
but with dummy material (it is not used anyway);
Creation of G4Region associated to G4LogicalVolume;
Initialization of GFlash, attaching it to the envelope (G4Region);
- ExGflash2SensitiveDetector:
Uses pointer to ExGflash2ParallelWorld to get the crystals for the readout;
Example gflash3:
- ExGflash3.cc:
Parallel world needs to be registered;
Physics of the parallel world needs to be registered so sensitive detector can
collect hits;
Fast simulation is activated for mass world (where envelope is);
- ExGflash3DetectorConstruction:
Only main volume (box) with material is created;
Creation of G4Region associated to G4LogicalVolume of that box;
Initialization of GFlash, attaching it to the envelope (G4Region);
- ExGflash3ParallelWorld:
Construction of identical volume for the main box as in the mass geometry,
but with dummy material (it is not used anyway);
Construction of individual crystals for the readout geometry;
Creation of the sensitive detector;
- ExGflash3SensitiveDetector:
Uses pointer to ExGflash3DetectorConstruction to get the crystals for the readout;
Macros
-------
vis.mac - macro for use in interactive mode (default, if no arguments are specified)
test.mac - macro for tests: 50 GeV electrons are shot in the direction of the detector
(along z axis), 10 times. As they enter the parametrisation envelope,
the GFlash parametrisation is invoked and energy is deposited.
The results are printed out:
- energy in the most central crystal
- energy in 3x3 crystals
- energy in 5x5 crystals
- number of created deposits
- simulation time per event
@@ -0,0 +1,119 @@
///\file "parameterisations/gflash/gflasha/.README.txt"
///\brief Example gflasha README page
/*! \page Examplegflasha Example gflasha
This example demonstrates usage 'gflash' shower parameterisation
in homogeneous calorimeter. Compare with glash1,2,3 in this
example histograms was added. This makes it possible to use this
example for fine tuning of GFLASH parameters.
This example allows to compare the shower profiles from fast simulation
with full simulation by histograming of longitudinal (slice)
and radial profiles with different "binning".
Then GFlash fast simulation can be "tuned" via modification
of the model parameters file:
include/ExGflashHomoShowerTuning.hh
in this example.
\section gflasha_s1 Geometry Definition
In this example the calorimeter is a simple cube,
which consists of 10 x 10 crystals of PbWO4 (CMS like).
Geometry, sensitive detector and hits are defined respectively in:
- ExGflashDetectorConstruction
- ExGflashSensitiveDetector
- ExGflashHit
Materials can be choosen from Nist Materials: G4_Air G4_WATER ...
eg:
\verbatim
/exgflash/det/setMat G4_PbWO4
\endverbatim
see also: csi1.mac
\section gflasha_s2 Hit Scoring
The virtual cylinder sliced longitudinally (slice) and radially (ring) was used.
The size of the slices and rings are expressed in radiation
length units and can be changed.
eg:
\verbatim
/exgflash/det/setLbin 20 1. ---> 20 slices of 1. radl
/exgflash/det/setRbin 5 0.25 ---> 5 rings of 0.25 radl
(MaxBin = 500 in both directions)
\endverbatim
In ExGflashEventAction class the arrays corresponded slices and rings was
created and filled with hists information. This arrays was use to fill
histograms later.
\section gflasha_s3 Visualization
The Visualization Manager is set in the main().
The initialization of the drawing is done via the commands /vis/...
in the macro vis.mac. To get visualization:
\verbatim
/control/execute vis.mac
\endverbatim
\section gflasha_s4 How to start ?
- Execute ExGflasha in 'batch' mode from macro files
\verbatim
% ExGflasha test.mac
\endverbatim
- Execute ExGflasha in 'interactive mode' with visualization
\verbatim
% ExGflasha
....
Idle> type your commands
....
Idle> exit
\endverbatim
The GFLASH activated via:
\verbatim
/GFlash/flag 1
\endverbatim
\section gflasha_s5 Histograms
ExGflasha produces several histograms:
The histograms defined in ExGflashHistoManager class
Content of these histo:
- h0 : energy deposit per event
- h1 : the number of hits per event
- h2 : the energy per hit ( in MeV )
- p0 : longitudinal energy profile
- p1 : radial energy profile
- p2 : cumulated longitudinal energy profile
- p3 : cumulated radial energy profile
To define the output file name with histograms, use the UI command :
\verbatim
/analysys/setFileName name
\endverbatim
\section gflasha_s6 Macros
The macros to run in batch mode:
- test.mac - default macro for example testing
- run01.mac - show how redefine the histograms
- csi1.mac - macro which produce profiles in CsI Material
- test0.mac - profile caparison, long run without GFLASH
- test1.mac - profile comprising, long run with GFLASH on
*/
@@ -0,0 +1,110 @@
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
GFLASHa Example
---------------
The Example demonstrating usage 'gflash' shower parameterisation
in homogeneous calorimeter.Compare with glash1,2,3 in this
example histograms was added. This makes it possible to use this
example for fine tuning of GFLASH parameters.
This example allow compare the shower profiles from fast simulation
with full simulation by histograming of longitudinal (slice)
and radial profiles with different "binning".
Then GFlash fast simulation can be "tuned" via modification
of the model parameters file:
include/ExGflashHomoShowerTuning.hh
in this example.
GEOMETRY DEFINITION
-------------------
In this example the calorimeter is a simple cube,
which consists of 10 x 10 crystals of PbWO4 (CMS like).
Geometry, sensitive detector and hits are defined respectively in:
ExGflashDetectorConstruction
ExGflashSensitiveDetector
ExGflashHit
Materials can be choosen from Nist Materials: G4_Air G4_WATER ...
eg: /exgflash/det/setMat G4_PbWO4 see also: csi1.mac
HIT SCORING
-----------
The virtual cylinder sliced longitudinally (slice) and radially (ring) was used.
The size of the slices and rings are expressed in radiation
length units and can be changed.
eg: /exgflash/det/setLbin 20 1. ---> 20 slices of 1. radl
/exgflash/det/setRbin 5 0.25 ---> 5 rings of 0.25 radl
(MaxBin = 500 in both directions)
In ExGflashEventAction class the arrays corresponded slices and rings was
created and filled with hists information. This arrays was use to fill
histograms later.
VISUALIZATION
-------------
The Visualization Manager is set in the main().
The initialization of the drawing is done via the commands /vis/...
in the macro vis.mac. To get visualization:
/control/execute vis.mac
HOW TO START ?
--------------
- Execute ExGflasha in 'batch' mode from macro files
% ExGflasha test.mac
- Execute ExGflasha in 'interactive mode' with visualization
% ExGflasha
....
Idle> type your commands
....
Idle> exit
The GFLASH activated via:
/GFlash/flag 1
HISTOGRAMS
----------
ExGflasha produces several histograms:
The histograms defined in ExGflashHistoManager class
Content of these histo:
h0 : energy deposit per event
h1 : the number of hits per event
h2 : the energy per hit ( in MeV )
p0 : longitudinal energy profile
p1 : radial energy profile
p2 : cumulated longitudinal energy profile
p3 : cumulated radial energy profile
To define the output file name with histograms, use the UI command :
"/analysys/setFileName name"
MACROS
------
The macros to run in batch mode:
test.mac - default macro for example testing
run01.mac - show how redefine the histograms
csi1.mac - macro which produce profiles in CsI Material
test0.mac - profile comparison, long run without GFLASH
test1.mac - profile comparison, long run with GFLASH on