1 // HadronLevel.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2013 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"
17 #include "HadronScatter.h"
18 #include "HiddenValleyFragmentation.h"
20 #include "MiniStringFragmentation.h"
21 #include "ParticleData.h"
22 #include "ParticleDecays.h"
23 #include "PythiaStdlib.h"
26 #include "StringFragmentation.h"
27 #include "TimeShower.h"
31 //==========================================================================
33 // The HadronLevel class contains the top-level routines to generate
34 // the transition from the partonic to the hadronic stage of an event.
43 // Initialize HadronLevel classes as required.
44 bool init(Info* infoPtrIn, Settings& settings,
45 ParticleData* particleDataPtrIn, Rndm* rndmPtrIn,
46 Couplings* couplingsPtrIn, TimeShower* timesDecPtr,
47 RHadrons* rHadronsPtrIn, DecayHandler* decayHandlePtr,
48 vector<int> handledParticles);
50 // Get pointer to StringFlav instance (needed by BeamParticle).
51 StringFlav* getStringFlavPtr() {return &flavSel;}
53 // Generate the next event.
54 bool next(Event& event);
56 // Special routine to allow more decays if on/off switches changed.
57 bool moreDecays(Event& event);
61 // Constants: could only be changed in the code itself.
62 static const int NTRYJNREST;
63 static const double JJSTRINGM2MAX, JJSTRINGM2FRAC, CONVJNREST, MTHAD;
65 // Initialization data, read from Settings.
66 bool doHadronize, doDecay, doBoseEinstein, allowRH;
67 double mStringMin, eNormJunction, widthSepBE;
69 // Settings for hadron scattering --rjc
70 bool doHadronScatter, hsAfterDecay;
72 // Pointer to various information on the generation.
75 // Pointer to the particle data table.
76 ParticleData* particleDataPtr;
78 // Pointer to the random number generator.
81 // Pointers to Standard Model couplings.
82 Couplings* couplingsPtr;
84 // Configuration of colour-singlet systems.
87 // Colour information.
88 vector<int> iColEnd, iAcolEnd, iColAndAcol, iParton, iPartonJun,
89 iPartonAntiJun, iJunLegA, iJunLegB, iJunLegC,
90 iAntiLegA, iAntiLegB, iAntiLegC, iGluLeg;
91 vector<double> m2Pair;
93 // The generator class for normal string fragmentation.
94 StringFragmentation stringFrag;
96 // The generator class for special low-mass string fragmentation.
97 MiniStringFragmentation ministringFrag;
99 // The generator class for normal decays.
100 ParticleDecays decays;
102 // The generator class for hadron scattering --rjc
103 HadronScatter hadronScatter;
105 // The generator class for Bose-Einstein effects.
106 BoseEinstein boseEinstein;
108 // Classes for flavour, pT and z generation.
113 // The RHadrons class is used to fragment off and decay R-hadrons.
114 RHadrons* rHadronsPtr;
116 // Special class for Hidden-Valley hadronization. Not always used.
117 HiddenValleyFragmentation hiddenvalleyFrag;
118 bool useHiddenValley;
120 // Special case: colour-octet onium decays, to be done initially.
121 bool decayOctetOnia(Event& event);
123 // Trace colour flow in the event to form colour singlet subsystems.
124 bool findSinglets(Event& event);
126 // Trace a colour line, from a colour, from an anticolour, or in loop.
127 bool traceFromCol(int indxCol, Event& event, int iJun = -1, int iCol = -1);
128 bool traceFromAcol(int indxCol, Event& event, int iJun = -1, int iCol = -1);
129 bool traceInLoop(int indxCol, int indxAcol, Event& event);
131 // Split junction-antijunction system into two, or simplify other way.
132 bool splitJunctionPair(Event& event);
136 //==========================================================================
138 } // end namespace Pythia8
140 #endif // Pythia8_HadronLevel_H