1 // HadronLevel.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2008 Torbjorn Sjostrand.
3 // PYTHIA is licenced under the GNU GPL version 2, see COPYING for details.
4 // Please respect the MCnet Guidelines, see GUIDELINES for details.
6 // This file contains the main class for hadron-level generation.
7 // HadronLevel: handles administration of fragmentation and decay.
9 #ifndef Pythia8_HadronLevel_H
10 #define Pythia8_HadronLevel_H
13 #include "BoseEinstein.h"
15 #include "FragmentationFlavZpT.h"
16 #include "FragmentationSystems.h"
18 #include "MiniStringFragmentation.h"
19 #include "ParticleData.h"
20 #include "ParticleDecays.h"
21 #include "PythiaStdlib.h"
23 #include "StringFragmentation.h"
24 #include "TimeShower.h"
28 //**************************************************************************
30 // The HadronLevel class contains the top-level routines to generate
31 // the transition from the partonic to the hadronic stage of an event.
40 // Initialize HadronLevel classes as required.
41 bool init(Info* infoPtrIn, TimeShower* timesDecPtr,
42 DecayHandler* decayHandlePtr, vector<int> handledParticles);
44 // Get pointer to StringFlav instance (needed by BeamParticle).
45 StringFlav* getStringFlavPtr() {return &flavSel;}
47 // Generate the next event.
48 bool next(Event& event);
50 // Special routine to allow more decays if on/off switches changed.
51 bool moreDecays(Event& event);
55 // Constants: could only be changed in the code itself.
56 static const int NTRYJNREST;
57 static const double JJSTRINGM2MAX, JJSTRINGM2FRAC, CONVJNREST, MTHAD;
59 // Initialization data, read from Settings.
60 bool doHadronize, doDecay, doBoseEinstein;
61 double mStringMin, eNormJunction, widthSepBE;
63 // Pointer to various information on the generation.
66 // Configuration of colour-singlet systems.
69 // Colour information.
70 vector<int> iColEnd, iAcolEnd, iColAndAcol, iParton, iPartonJun,
71 iPartonAntiJun, iJunLegA, iJunLegB, iJunLegC,
72 iAntiLegA, iAntiLegB, iAntiLegC, iGluLeg;
73 vector<double> m2Pair;
75 // The generator class for normal string fragmentation.
76 StringFragmentation stringFrag;
78 // The generator class for special low-mass string fragmentation.
79 MiniStringFragmentation ministringFrag;
81 // The generator class for normal decays.
82 ParticleDecays decays;
84 // The generator class for Bose-Einstein effects.
85 BoseEinstein boseEinstein;
87 // Classes for flavour, pT and z generation.
92 // Special case: colour-octet onium decays, to be done initially.
93 bool decayOctetOnia(Event& event);
95 // Trace colour flow in the event to form colour singlet subsystems.
96 bool findSinglets(Event& event);
98 // Trace a colour line, from a colour, from an anticolour, or in loop.
99 bool traceFromCol(int indxCol, Event& event, int iJun = -1, int iCol = -1);
100 bool traceFromAcol(int indxCol, Event& event, int iJun = -1, int iCol = -1);
101 bool traceInLoop(int indxCol, int indxAcol, Event& event);
103 // Split junction-antijunction system into two, or simplify other way.
104 bool splitJunctionPair(Event& event);
108 //**************************************************************************
110 } // end namespace Pythia8
112 #endif // Pythia8_HadronLevel_H