Back to home page

EIC code displayed by LXR

 
 

    


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