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,27 @@
///\file "eventgenerator/pythia/.README.txt"
///\brief Examples pythia README page
/*! \page Examples_pythia Category "eventgenerator/pythia"
Examples for Pythia-Geant4 interface.
This directory contains examples for using Pythia as Monte Carlo event
generator, interfaced with Geant4, and showing how to implement an external
decayer.
\section pythia_s1 Requirements for external software packages
\subsection PYTHIA
- Tested versions 6.4.28 (decayer6) and 8.3.0.5 (py8decayer)
- URL: https://pythia.org/
\section pythia_s2 Example decayer6
The \link Exampledecayer6 decayer6 \endlink example demonstrates the use
of Pythia6 as an external decayer.
\section pythia_s3 Example py8decayer
The \link Examplepy8decayer py8decayer \endlink example demonstrates the use
of Pythia8 as an external decayer.
*/
@@ -0,0 +1,16 @@
Examples for Pythia-Geant4 interface
------------------------------------
This directory contains examples for using Pythia as Monte Carlo event
generator, interfaced with Geant4, and showing how to implement an external
decayer.
Requirements for external software packages
-------------------------------------------
PYTHIA
Tested version 6.4.28
URL: http://www.thep.lu.se/~torbjorn/Pythia.html
Example decayer6
This example demonstrates the use of Pythia6 as an external decayer.
@@ -0,0 +1,96 @@
///\file "eventgenerator/pythia/decayer6/.README.txt"
///\brief Example decayer6 page
/*! \page Exampledecayer6 Example decayer6
This is an example of the external decayer implementation
with PYTHIA6.
The complete PYTHIA6 documentation can be found at:
http://home.thep.lu.se/~torbjorn/pythiaaux/recent.html
The PYTHIA6 external decayer was originally developed within
the AliRoot framework, by Andreas Morsch (CERN). \n
The dependence on the ALICE software was taken off
by Christian Holm Christensen. \n
The dependence on the Root framework and the integration in
the Geant4 framework was done by Ivana Hrivnacova (IPN Orsay).
<hr>
The use of the external decayer is demonstrated with using the
classes from common examples repository, see below their complete
list.
The G4Pythia6Decayer class provides the implementation of the
G4VExternalDecayer interface with using PYTHIA6. In order
to be able to use PYTHIA6, which is written in FORTRAN,
a C++ interface class Pythia6 is provided. This class
interfaces only the PYTHIA6 functions relevant to decay.
The G4Pythia6Decayer is instantiated in the
P6DExtDecayerPhysics::ConstructProcess() function where the external
decayer is set to G4Decay process for all particles.
To demonstrate the decay with external decayer,
the B- meson is defined in ExG4PrimaryGeneratorAction01,
as it has no own decay table defined within Geant4.
With PYTHIA6, it is possible to force a selected decay
type. This selection can be chosen interactively via
the implemented Geant4 UI command:
\verbatim
/pythia6Decayer/forceDecayType decayType
\endverbatim
where the available decay types are listed in the EDecayType
enumaration.
The classes Pythia6, G4Pythia6Decayer, G4Pythia6DecayerMessenger
are independent from the example classes and can be reused
in another user application.
Installation:
- 1. Download the PYTHIA6 source file from the PYTHIA6 download site:\n
http://www.hepforge.org/downloads/pythia6
- 2A. With CMake: Build pythia6 library
For a convenience a CMake file for building Pythia6 library from
the source is provided in
examples/extended/eventgenerator/CMakeLists.txt.pythia6.
Build the pythia6 library following the instructions in this file
and then define the environment variables:
\verbatim
PYTHIA6 the path where pythia6 library is installed
PYTHIA6_VERSION the pythia version
\endverbatim
- 2B. With GNUmake: Define the environment variables: \n
\verbatim
PYTHIA6 the path to pythia-versionX.f source code
PYTHIA6_VERSION the pythia version
\endverbatim
e.g. If you download pythia-6.4.26.f.gz and unzip it in $HOME,
then you have to set:
export PYTHIA6=$HOME
export PYTHIA6_VERSION="6.4.26"
pythia6 will be then compiled together with example code.
- 3. Compilation:\n
Then the example is compiled in a standard way, see \ref README_HowToRun. \n
Note that with GNUmake build, an additional step 'gmake setup' is
needed before 'gmake'.
- 4. Execution:
\verbatim
% pythia6_decayer pythia6_decayer.in
\endverbatim
This example uses the following user action classes from the extended examples common
repository available in common subdirectory:
- DetectorConstruction
- GunPrimaryGeneratorAction
*/
@@ -0,0 +1,85 @@
------------------------------------------------------------
Example of the external decayer implementation with PYTHIA6
-----------------------------------------------------------
The complete PYTHIA6 documentation can be found at:
http://home.thep.lu.se/~torbjorn/pythiaaux/recent.html
The PYTHIA6 external decayer was originally developed within
the AliRoot framework, by Andreas Morsch (CERN).
The dependence on the ALICE software was taken off
by Christian Holm Christensen,
The dependence on the Root framework and the integration in
the Geant4 framework was done by Ivana Hrivnacova (IPN Orsay).
------------------------------------------------------------
The use of the external decayer is demonstrated with using the
classes from common examples repository, see below their complete list.
The G4Pythia6Decayer class provides the implementation of the
G4VExternalDecayer interface with using PYTHIA6. In order
to be able to use PYTHIA6, which is written in FORTRAN,
a C++ interface class Pythia6 is provided. This class
interfaces only the PYTHIA6 functions relevant to decay.
The G4Pythia6Decayer is instantiated in the P6DExtDecayerPhysics builder,
in the ConstructProcess() function where the external decayer is set
to G4Decay process for all particles.
To demonstrate the decay with external decayer,
the B- meson is defined in ExG4PrimaryGeneratorAction01,
as it has no own decay table defined within Geant4.
With PYTHIA6, it is possible to force a selected decay
type. This selection can be chosen interactively via
the implemented Geant4 UI command:
/pythia6Decayer/forceDecayType decayType
where the available decay types are listed in the EDecayType
enumaration.
The classes Pythia6, G4Pythia6Decayer, G4Pythia6DecayerMessenger
are independent from the example classes and can be reused
in another user application.
Installation:
1. Download the PYTHIA6 source file from the PYTHIA6 download site:
http://www.hepforge.org/downloads/pythia6
2A.) With CMake: Build pythia6 library
For a convenience a CMake file for building Pythia6 library from
the source is provided in
examples/extended/eventgenerator/CMakeLists.txt.pythia6.
Build the pythia6 library following the instructions in this file
and then define the environment variables:
PYTHIA6 the path where pythia6 library is installed
PYTHIA6_VERSION the pythia version
2B.) With GNUmake: Define the environment variables:
PYTHIA6 the path to pythia-versionX.f source code
PYTHIA6_VERSION the pythia version
e.g. If you download pythia-6.4.26.f.gz and unzip it in $HOME,
then you have to set:
export PYTHIA6=$HOME
export PYTHIA6_VERSION="6.4.26"
Pythia6 will be then compiled together with example code.
3. Compilation:
Then the example is compiled in a standard way, see examples/README_HowToRun.
Note that with GNUmake build, an additional step 'gmake setup' is
needed before 'gmake'.
Execution:
% pythia6_decayer pythia6_decayer.in
This example uses the following user action classes from the extended examples common
repository available in common subdirectory:
DetectorConstruction
GunPrimaryGeneratorAction
@@ -0,0 +1,24 @@
///\file "common/.README.txt"
///\brief Common classes README page
/*! \page Examples_common Category "common"
In order to reduce code duplication and to reduce the number of variants of
the code of same kind, we define a set of common classes which
can be reused in "feature" examples demonstrating just a particular feature.
This module may be enhanced in future. Currently it provides
the following sets of classes:
- Detector construction classes
- two simple detector construction classes with a messenger
- Physics list classes
- GeantinoPhysicsList - physics list with geantino and chargedgeantino only
- Primary generator classes
- two simple primary generator classes (with G4ParticleGun and
G4ParticleGeneralSource)
*/
@@ -0,0 +1,26 @@
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
Common Classes for Extended Examples
-------------------------------------
In order to reduce code duplication and to reduce the number of variants of
the code of same kind, we define a set of common classes which
can be reused in "feature" examples demonstrating just a particular feature.
This module may be enhanced in future. Currently it provides
the following sets of classes:
- Detector construction classes
- two simple detector construction classes with a messenger
- Physics list classes
- GeantinoPhysicsList - physics list with geantino and chargedgeantino only
- Primary generator classes
- two simple primary generator classes (with G4ParticleGun and
G4ParticleGeneralSource)
@@ -0,0 +1,128 @@
///\file "eventgenerator/pythia/py8decayer/.README.txt"
///\brief Example py8decayer page
/*! \page Examplepy8decayer Example py8decayer
This example demonstrates how to outfit Pythia8-based decay features
to those resonances in Geant4 where decay tables are not implemented
by default. In addition, it showns how to replace existing
Geant4 decay tables to such resonances as tau+/- or B+/- with
the Pythia8-based ones.
This example is activated by setting up PYTHIA8 environment variable
to point to the area where Pythia8 is installed.
The complete Pythia8 information, including on download, and documentation
is available from the following site:
https://pythia.org
The original version of this example has been implemented by Julia Yarba
(FNAL, USA)
<hr>
For the complete list of the classes that compose this example please
see later in this document.
Location of example:
examples/extended/eventgenerator/pythia/py8decayer
Installation of Pythia8:
NOTE: As of June 2021, pythia8.3.0.5 is the most current version,
this it is used in this example.
In the future, please check updates at Pythia8 site: https://pythia.org
- 1. cd path/to/your/pythia8/area
- 2. Download desired version of Pythia8 and un-tar it, e.g.
\verbatim
wget http://home.thep.lu.se/~torbjorn/pythia8/pythia8305.tgz
tar xzf pythia8305.tgz
\endverbatim
- 3. Build/install Pythia8
\verbatim
cd pythia8305
export CXX=\`which g++\`
./configure --prefix=$PWD --cxx=$CXX
make
\endverbatim
NOTE: By default, Pythia8 (as of 8.3.0.5) builds with C++11 standards.
If one wants to turn to e.g. C++17 standard, one needs to override flags
via --cxx-common argument to configure script.
4. Setup PYTHIA8 environment variable to point to the area where Pythia8
is built/installed:
\verbatim
export PYTHIA8=$PWD
\endverbatim
Building example:
Upon setup of PYTHIA8 environment variable to point to the area where
Pythia8 package is installed, the pythia/py8decayer example will be
compiled together with several other features of the eventgenerator example.
Description of classes:
Py8Decayer class provides implementation of the G4VExternalDecayer interface
with the use of PYTHIA8.
It is reasonably annotated, and demonstrates what features of Pythia8 need
to be activated and/or disactivated in order to make Pythia8 work only in
the decay mode.
It also illustrated how to control several other features of Pythia8, including
some reduction of Pythia8 verbosity (by default, Pythia8 produces quite a large
amount of printouts, thus reducing it could be useful in some cases).
Last but not least, it also shown how to deactivate decays of pi0's by Pythia8
as the idea is to handle pi0's back to Geant4 for decays.
Py8DecayerPhysics class implements a G4VPhysicsConstructor type of component
with the use of Py8Decayer; this component can later be used with a ddsired
physics list (see main program).
Specifically, in the Py8DecayerPhysics::ConstructProcess() the Py8Decayer is
instantiated and is used to
a) replace existing decay tables of such resonances as tau+/- and B+/-
b) supplement decay features to those resonances in Geant4 where the decay
tables are not implemnted by defaukt
In principle, classes Py8Decayer and Py8DecayerPhysics can be directly reused with
another user application.
Alternatively, they can be used as an inspiration to implement similar, or perhaps
even more extensive Pythia8-based functionalities of user's choice.
Class DetConstruction demostrates how to implement minimalistic detector geometry.
Class SingleParticleGun demonstrates how to implement generaton of the primary
particle.
Main program:
pythia8_decayer.cc
Executable:
pythia8_decayer
Execution:
At present, the pythia8_decayer executable does not take any input arguments.
Everything, including the choine of primary particle, is hardcoded in the main.
Although in the future some configurability may be added.
By default it'll run 5 single tau events using Pythia8 to decays them.
It should print some Pythia8 event information, including on decays.
Once again, please bear in mind that the decay of pi0's by Pythia8 is disabled
(see Py8Decayer constructor) since the idea is to hand the pi0's back to Geant4
and make Geant4 decay them.
*/
@@ -0,0 +1,120 @@
------------------------------------------------------------
Example of the external decayer implementation with Pythia8
------------------------------------------------------------
This example demonstrates how to outfit Pythia8-based decay features
to those resonances in Geant4 where decay tables are not implemented
by default. In addition, it showns how to replace existing
Geant4 decay tables to such resonances as tau+/- or B+/- with
the Pythia8-based ones.
This example is activated by setting up PYTHIA8 environment variable
to point to the area where Pythia8 is installed.
The complete Pythia8 information, including on download, and documentation
is available from the following site:
https://pythia.org
The original version of this example has been implemented by Julia Yarba
(FNAL, USA)
For the complete list of the classes that compose this example please
see later in this document.
Location of example:
examples/extended/eventgenerator/pythia/py8decayer
Installation of Pythia8:
NOTE: As of June 2021, pythia8.3.0.5 is the most current version,
this it is used in this example.
In the future, please check updates at Pythi8 site: https://pythia.org
1. cd path/to/your/pythia8/area
2. Download desired version of Pythia8 and un-tar it, e.g.
wget http://home.thep.lu.se/~torbjorn/pythia8/pythia8305.tgz
tar xzf pythia8305.tgz
3. Build/install Pythia8
cd pythia8305
export CXX=\`which g++\`
./configure --prefix=$PWD --cxx=$CXX
make
NOTE: By default, Pythia8 (as of 8.3.0.5) builds with C++11 standards.
If one wants to turn to e.g. C++17 standard, one needs to override flags
via --cxx-common argument to configure script.
4. Setup PYTHIA8 environment variable to point to the area where Pythia8
is built/installed:
export PYTHIA8=$PWD
Building example:
Upon setup of PYTHIA8 environment variable to point to the area where
Pythia8 package is installed, the pythia/py8decayer example will be
compiled together with several other features of the eventgenerator example.
Description of classes:
Py8Decayer class provides implementation of the G4VExternalDecayer interface
with the use of PYTHIA8.
It is reasonably annotated, and demonstrates what features of Pythia8 need
to be activated and/or disactivated in order to make Pythia8 work only in
the decay mode.
It also illustrated how to control several other features of Pythia8, including
some reduction of Pythia8 verbosity (by default, Pythia8 produces quite a large
amount of printouts, thus reducing it could be useful in some cases).
Last but not least, it also shown how to deactivate decays of pi0's by Pythia8
as the idea is to handle pi0's back to Geant4 for decays.
Py8DecayerPhysics class implements a G4VPhysicsConstructor type of component
with the use of Py8Decayer; this component can later be used with a ddsired
physics list (see main program).
Specifically, in the Py8DecayerPhysics::ConstructProcess() the Py8Decayer is
instantiated and is used to
a) replace existing decay tables of such resonances as tau+/- and B+/-
b) supplement decay features to those resonances in Geant4 where the decay
tables are not implemnted by defaukt
In principle, classes Py8Decayer and Py8DecayerPhysics can be directly reused with
another user application.
Alternatively, they can be used as an inspiration to implement similar, or perhaps
even more extensive Pythia8-based functionalities of user's choice.
Class DetConstruction demostrates how to implement minimalistic detector geometry.
Class SingleParticleGun demonstrates how to implement generaton of the primary
particle.
Main program:
pythia8_decayer.cc
Executable:
pythia8_decayer
Execution:
At present, the pythia8_decayer executable does not take any input arguments.
Everything, including the choine of primary particle, is hardcoded in the main.
Although in the future some configurability may be added.
By default it'll run 5 single tau events using Pythia8 to decays them.
It should print some Pythia8 event information, including on decays.
Once again, please bear in mind that the decay of pi0's by Pythia8 is disabled
(see Py8Decayer constructor) since the idea is to hand the pi0's back to Geant4
and make Geant4 decay them.