StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
HadronLevel.h
1 // HadronLevel.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2014 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.
5 
6 // This file contains the main class for hadron-level generation.
7 // HadronLevel: handles administration of fragmentation and decay.
8 
9 #ifndef Pythia8_HadronLevel_H
10 #define Pythia8_HadronLevel_H
11 
12 #include "Pythia8/Basics.h"
13 #include "Pythia8/BoseEinstein.h"
14 #include "Pythia8/Event.h"
15 #include "Pythia8/FragmentationFlavZpT.h"
16 #include "Pythia8/FragmentationSystems.h"
17 #include "Pythia8/HadronScatter.h"
18 #include "Pythia8/HiddenValleyFragmentation.h"
19 #include "Pythia8/Info.h"
20 #include "Pythia8/MiniStringFragmentation.h"
21 #include "Pythia8/ParticleData.h"
22 #include "Pythia8/ParticleDecays.h"
23 #include "Pythia8/PythiaStdlib.h"
24 #include "Pythia8/RHadrons.h"
25 #include "Pythia8/Settings.h"
26 #include "Pythia8/StringFragmentation.h"
27 #include "Pythia8/TimeShower.h"
28 
29 namespace Pythia8 {
30 
31 //==========================================================================
32 
33 // The HadronLevel class contains the top-level routines to generate
34 // the transition from the partonic to the hadronic stage of an event.
35 
36 class HadronLevel {
37 
38 public:
39 
40  // Constructor.
41  HadronLevel() {}
42 
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);
49 
50  // Get pointer to StringFlav instance (needed by BeamParticle).
51  StringFlav* getStringFlavPtr() {return &flavSel;}
52 
53  // Generate the next event.
54  bool next(Event& event);
55 
56  // Special routine to allow more decays if on/off switches changed.
57  bool moreDecays(Event& event);
58 
59 private:
60 
61  // Constants: could only be changed in the code itself.
62  static const int NTRYJNREST;
63  static const double JJSTRINGM2MAX, JJSTRINGM2FRAC, CONVJNREST, MTHAD;
64 
65  // Initialization data, read from Settings.
66  bool doHadronize, doDecay, doBoseEinstein, allowRH;
67  double mStringMin, eNormJunction, widthSepBE;
68 
69  // Settings for hadron scattering --rjc
70  bool doHadronScatter, hsAfterDecay;
71 
72  // Pointer to various information on the generation.
73  Info* infoPtr;
74 
75  // Pointer to the particle data table.
76  ParticleData* particleDataPtr;
77 
78  // Pointer to the random number generator.
79  Rndm* rndmPtr;
80 
81  // Pointers to Standard Model couplings.
82  Couplings* couplingsPtr;
83 
84  // Configuration of colour-singlet systems.
85  ColConfig colConfig;
86 
87  // Colour information.
88  vector<int> iColEnd, iAcolEnd, iColAndAcol, iParton,
89  iJunLegA, iJunLegB, iJunLegC,
90  iAntiLegA, iAntiLegB, iAntiLegC, iGluLeg;
91 
92  vector< vector<int > > iPartonJun, iPartonAntiJun;
93 
94  vector<double> m2Pair;
95 
96  // The generator class for normal string fragmentation.
97  StringFragmentation stringFrag;
98 
99  // The generator class for special low-mass string fragmentation.
100  MiniStringFragmentation ministringFrag;
101 
102  // The generator class for normal decays.
103  ParticleDecays decays;
104 
105  // The generator class for hadron scattering --rjc
106  HadronScatter hadronScatter;
107 
108  // The generator class for Bose-Einstein effects.
109  BoseEinstein boseEinstein;
110 
111  // Classes for flavour, pT and z generation.
112  StringFlav flavSel;
113  StringPT pTSel;
114  StringZ zSel;
115 
116  // The RHadrons class is used to fragment off and decay R-hadrons.
117  RHadrons* rHadronsPtr;
118 
119  // Special class for Hidden-Valley hadronization. Not always used.
120  HiddenValleyFragmentation hiddenvalleyFrag;
121  bool useHiddenValley;
122 
123  // Special case: colour-octet onium decays, to be done initially.
124  bool decayOctetOnia(Event& event);
125 
126  // Trace colour flow in the event to form colour singlet subsystems.
127  bool findSinglets(Event& event);
128 
129  // Trace a colour line, from a colour, from an anticolour, or in loop.
130  bool traceFromCol(int indxCol, Event& event, int iJun = -1, int iCol = -1);
131  bool traceFromAcol(int indxCol, Event& event, int iJun = -1, int iCol = -1);
132  bool traceInLoop(int indxCol, int indxAcol, Event& event);
133 
134  // Split junction-antijunction system into two, or simplify other way.
135  bool splitJunctionPair(Event& event);
136 
137 };
138 
139 //==========================================================================
140 
141 } // end namespace Pythia8
142 
143 #endif // Pythia8_HadronLevel_H
Definition: AgUStep.h:26