Warning, /geant4/examples/extended/eventgenerator/pythia/py8decayer/README is written in an unsupported language. File is not indexed.
0001
0002 ------------------------------------------------------------
0003
0004 Example of the external decayer implementation with Pythia8
0005 ------------------------------------------------------------
0006
0007 This example demonstrates how to outfit Pythia8-based decay features
0008 to those resonances in Geant4 where decay tables are not implemented
0009 by default. In addition, it showns how to replace existing
0010 Geant4 decay tables to such resonances as tau+/- or B+/- with
0011 the Pythia8-based ones.
0012
0013 This example is activated by setting up PYTHIA8 environment variable
0014 to point to the area where Pythia8 is installed.
0015
0016 The complete Pythia8 information, including on download, and documentation
0017 is available from the following site:
0018 https://pythia.org
0019
0020 The original version of this example has been implemented by Julia Yarba
0021 (FNAL, USA)
0022
0023 For the complete list of the classes that compose this example please
0024 see later in this document.
0025
0026 Location of example:
0027
0028 examples/extended/eventgenerator/pythia/py8decayer
0029
0030
0031 Installation of Pythia8:
0032
0033 NOTE: As of December 2023, pythia8.3.10 is the most current version,
0034 thus it is used in this example.
0035 In the future, please check updates at Pythia8 site: https://pythia.org
0036
0037 1. cd path/to/your/pythia8/area
0038
0039 2. Download desired version of Pythia8 and un-tar it, e.g.
0040 wget https://pythia.org/download/pythia83/pythia8310.tgz
0041 tar xzf pythia8310.tgz
0042
0043 3. Build/install Pythia8
0044 cd pythia8310
0045 export CXX=\`which g++\`
0046 ./configure --prefix=$PWD --cxx=$CXX
0047 make
0048 NOTE: By default, Pythia8 (as of 8.3.10) builds with C++11 standards.
0049 If one wants to turn to e.g. C++17 standard, one needs to override flags
0050 via --cxx-common argument to configure script.
0051 Alternatively, one can setup CXX_COMMON environment variable.
0052 As of pythia8310, the default flags are the following:
0053 -O2 -std=c++11 -pedantic -W -Wall -Wshadow -pthread
0054 Please note use of -pthread which was not among default flags in earlier
0055 relesaes of Pythia8.
0056 Example of specifying C++17 standards by overriding the default flags via
0057 use of --cxx_common argument to configure script:
0058 ./configure --prefix=$PWD --cxx=$CXX \
0059 --cxx-common='-O2 -std=c++17 -pedantic -W -Wall -Wshadow -fPIC -pthread'
0060
0061 4. Setup Pythia8_ROOT environment variable to point to the area where Pythia8
0062 is built/installed:
0063 export Pythia8_ROOT=$PWD
0064
0065
0066 Building example:
0067
0068 Upon setup of PYTHIA8 environment variable to point to the area where
0069 Pythia8 package is installed, the pythia/py8decayer example will be
0070 compiled together with several other features of the eventgenerator example.
0071
0072
0073 Description of classes:
0074
0075 Py8Decayer class provides implementation of the G4VExternalDecayer interface
0076 with the use of PYTHIA8.
0077 It is reasonably annotated, and demonstrates what features of Pythia8 need
0078 to be activated and/or disactivated in order to make Pythia8 work only in
0079 the decay mode.
0080 It also illustrated how to control several other features of Pythia8, including
0081 some reduction of Pythia8 verbosity (by default, Pythia8 produces quite a large
0082 amount of printouts, thus reducing it could be useful in some cases).
0083 It also shown how to deactivate decays of pi0's by Pythia8 as the idea is to handle
0084 pi0's back to Geant4 for decays.
0085 Last but not least, it shows how to outfit Pythia8 with a custom random engine,
0086 i.e. Py8DecayerEngine.
0087
0088 Py8DecayerEngine class inherits from Pythia8::RndmEngine which in its turns is
0089 provided by the Pythia8 package in order to allow replacing the generator's native
0090 random engine with the one of user's choice.
0091 In this specific case Py8DecayerEngine allows to replace Pythia8 native random engine
0092 with the same engine that Geant4 uses (i.e. CLHEP::RanecuEngine as in this application).
0093 The feature is important for running the example in the MT/Tasking mode.
0094
0095 Py8DecayerPhysics class implements a G4VPhysicsConstructor type of component
0096 with the use of Py8Decayer; this component can later be used with a ddsired
0097 physics list (see main program).
0098 Specifically, in the Py8DecayerPhysics::ConstructProcess() the Py8Decayer is
0099 instantiated and is used to
0100 a) replace existing decay tables of such resonances as tau+/- and B+/-
0101 b) supplement decay features to those resonances in Geant4 where the decay
0102 tables are not implemnted by defaukt
0103
0104 In principle, classes Py8Decayer, Py8DecayerEngine, and Py8DecayerPhysics can be
0105 directly reused with another user application.
0106 Alternatively, they can be used as an inspiration to implement similar, or perhaps
0107 even more extensive Pythia8-based functionalities of user's choice.
0108
0109 Class DetConstruction demostrates how to implement minimalistic detector geometry.
0110
0111 Class SingleParticleGun demonstrates how to implement generaton of the primary
0112 particle.
0113
0114 Class ActionInitialization instantiates and registers to Geant4 kernel all user
0115 action classes; in this case it is SingleParticleGun.
0116
0117 Main program:
0118
0119 pythia8_decayer.cc
0120
0121 This application currently uses the default RunManager which is Tasking and is
0122 initialized with 5 threads.
0123 It will then run 5 events, one per thread.
0124 SerialOnly RunManager can also be employed should the user choose so.
0125
0126
0127 Executable:
0128
0129 pythia8_decayer
0130
0131
0132 Execution:
0133
0134 At present, the pythia8_decayer executable does not take any input arguments.
0135 Everything, including the choine of primary particle, is hardcoded.
0136 Although in the future some configurability may be added.
0137
0138 As mentioned earlier, it will run 5 single tau events using Pythia8 to decays them.
0139
0140 It should print some Pythia8 event information, including on decays.
0141 Once again, please bear in mind that the decay of pi0's by Pythia8 is disabled
0142 (see Py8Decayer constructor) since the idea is to hand the pi0's back to Geant4
0143 and make Geant4 decay them.
0144
0145
0146 Additional notes on the contents of Geant4 and Pythia8 Particle Data Tables (PDT) :
0147
0148 In their default form, PDT's in Geant4 and Pythia8 have a number of differences
0149 that need to be kept in mind.
0150
0151 In the case of the Geant4 py8decayer example those differences are unlikely
0152 to cause any major issues.
0153
0154 But Pythia8 can, in principle, be used within Geant4 in more ways that just
0155 as an external decayer.
0156 Thus, if one is potentially interested in more sophisticated use of Pythia8
0157 in Geant4, one may want to consider whatever differences exist between (default)
0158 Geant4 and Pythia8 PDT's.
0159
0160 Both Geant4 and Pythia8 codes are evolving, and specific numbers may be different
0161 in earlier and/or in future releases.
0162
0163 To be more precise, by default Pythia8.3.10 PDT contains 677 entries, of which
0164 531 particles have an antiparticle (it looks like antiparticles do not make
0165 separate entries in Pythia8 PDT, but the total number of available species
0166 should be considered as 1208).
0167
0168 Geant4 PDT contains 508 entries.
0169
0170 Of those, 239 particles/antiparticles match by Particle ID's (on the Geant4 side
0171 it is explicitly called "PDG encoding" while on Pythia8 side it is just "id").
0172
0173 Many of Pythia8 PDT's entries are not available in Geant4 PDT, e.g. Z or W bosons
0174 are not in Geant4.
0175
0176 Some of the species in the Geant4 PDT do not seem to be in the Pythia8 PDT
0177 (e.g. excited nucleons do not seem to be in the Pythia8 PDT).
0178
0179 Also, there are entries in both PDT's that mean the same particles but are
0180 marked with different ID's.
0181 For example, excited Delta(s) are present in both PDT's but in Geant4 each one
0182 is marked with a 4-digit number as an ID (PDG encoding) while in Pythia8 an ID
0183 for such particle would be a 6-digit number starting with "20" and the last
0184 4 digits would be the same as the Geant4 ID for such particle.
0185
0186 Speaking of the particles that match by ID (PDG ID), there may be further differences,
0187 e.g. by mass, either central value or width, or both (there might be other aspects but
0188 they have not been checked for).
0189
0190 Starting October 2022, checks have been made from time to time for differences
0191 larger that 1 keV in either mass central value or width.
0192
0193 The largest differences have been observed for quarks/diquarks.
0194 It appears that Geant4 sets (at least) masses of quarks as listed in PDG.
0195 For details on default settings for the quark masses in Pythia8 please refer
0196 to the Pythia8 manual:
0197 https://pythia.org/manuals/pythia8310/Welcome.html
0198 See Particles and Decays section, Particle Data subsection.
0199
0200 Beyond quarks/diquarks some differences in mass central values or width have also
0201 been observed, mainly for resonances.
0202 But even for such particles as proton or muon there may be differences on the order
0203 of a few keV (e.g. central value of the proton mass is 938.27 MeV in Pythia8 and
0204 938.272 MeV in Geant4)