]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PYTHIA8/pythia8145/include/FragmentationSystems.h
New pythia8 version
[u/mrichter/AliRoot.git] / PYTHIA8 / pythia8145 / include / FragmentationSystems.h
1 // FragmentationSystems.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2010 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 auxiliary classes in the fragmentation process.
7 // ColSinglet contains info on an individual singlet.
8 // ColConfig describes the colour configuration of the whole event.
9 // StringRegion keeps track on string momenta and directions.
10 // StringSystem contains all the StringRegions of the colour singlet.
11
12 #ifndef Pythia8_FragmentationSystems_H
13 #define Pythia8_FragmentationSystems_H
14
15 #include "Basics.h"
16 #include "Event.h"
17 #include "FragmentationFlavZpT.h"
18 #include "Info.h"
19 #include "ParticleData.h"
20 #include "PythiaStdlib.h"
21 #include "Settings.h"
22
23 namespace Pythia8 {
24  
25 //==========================================================================
26
27 // The ColSinglet class contains info on an individual singlet.
28 // Only to be used inside ColConfig, so no private members. 
29
30 class ColSinglet {
31   
32 public:
33
34   // Constructors.
35   ColSinglet() : pSum(0., 0., 0., 0.), mass(0.), massExcess(0.), 
36     hasJunction(false), isClosed(false), isCollected(false) {}
37   ColSinglet(vector<int>& iPartonIn, Vec4 pSumIn, double massIn, 
38     double massExcessIn, bool hasJunctionIn = false,
39     bool isClosedIn = false, bool isCollectedIn = false) 
40     : iParton(iPartonIn), pSum(pSumIn), mass(massIn), 
41     massExcess(massExcessIn), hasJunction(hasJunctionIn),
42     isClosed(isClosedIn), isCollected(isCollectedIn) {}
43
44   // Size of iParton array.
45   int size() const { return iParton.size();}
46
47   // Stored quantities. 
48   vector<int> iParton;
49   Vec4   pSum;
50   double mass, massExcess;
51   bool   hasJunction, isClosed, isCollected;
52   
53 };
54  
55 //==========================================================================
56
57 // The ColConfig class describes the colour configuration of the whole event. 
58
59 class ColConfig {
60
61 public:
62
63   // Constructor.
64   ColConfig() {singlets.resize(0);}
65
66   // Initialize and save pointers.
67   void init(Info* infoPtrIn, Settings& settings, StringFlav* flavSelPtrIn);
68
69   // Number of colour singlets.
70   int size() const {return singlets.size();}
71
72   // Overload index operator to access separate colour singlets.
73   ColSinglet& operator[](int iSub) {return singlets[iSub];}
74
75   // Clear contents.
76   void clear() {singlets.resize(0);} 
77
78   // Insert a new colour singlet system in ascending mass order. 
79   // Calculate its properties. Join nearby partons.
80   bool insert( vector<int>& iPartonIn, Event& event); 
81
82   // Collect all partons of singlet to be consecutively ordered.
83   void collect(int iSub, Event& event); 
84
85   // List all currently identified singlets.
86   void list(ostream& os = cout) const;
87
88 private:
89
90   // Constants: could only be changed in the code itself.
91   static const double CONSTITUENTMASS;
92
93   // Pointer to various information on the generation.
94   Info* infoPtr;
95
96   // Pointer to class for flavour generation.
97   StringFlav* flavSelPtr;
98
99   // Initialization data, to be read from Settings.
100   double mJoin, mJoinJunction, mStringMin;
101  
102   // List of all separate colour singlets.
103   vector<ColSinglet> singlets;
104
105   // Join two legs of junction to a diquark for small invariant masses.
106   bool joinJunction( vector<int>& iPartonIn, Event& event, 
107     double massExcessIn); 
108
109 };
110  
111 //==========================================================================
112
113 // The StringRegion class contains the information related to 
114 // one string section in the evolution of a multiparton system. 
115 // Only to be used inside StringFragmentation and MiniStringFragmentation,
116 // so no private members.
117
118 class StringRegion {
119
120 public:
121
122   // Constructor. 
123   StringRegion() : isSetUp(false), isEmpty(true) {}
124
125   // Constants: could only be changed in the code itself.
126   static const double MJOIN, TINY;
127
128   // Data members.
129   bool   isSetUp, isEmpty;
130   Vec4   pPos, pNeg, eX, eY;
131   double w2, xPosProj, xNegProj, pxProj, pyProj;
132
133   // Set up four-vectors for longitudinal and transverse directions.
134   void setUp(Vec4 p1, Vec4 p2, bool isMassless = false);
135
136   // Construct a four-momentum from (x+, x-, px, py).
137   Vec4 pHad( double xPosIn, double xNegIn, double pxIn, double pyIn) 
138     { return xPosIn * pPos + xNegIn * pNeg + pxIn * eX + pyIn * eY; }
139
140   // Project a four-momentum onto (x+, x-, px, py). Read out projection.
141   void project(Vec4 pIn);
142   void project( double pxIn, double pyIn, double pzIn, double eIn) 
143     { project( Vec4( pxIn, pyIn, pzIn, eIn) ); }
144   double xPos() const {return xPosProj;} 
145   double xNeg() const {return xNegProj;} 
146   double px() const {return pxProj;} 
147   double py() const {return pyProj;} 
148
149 };
150  
151 //==========================================================================
152
153 // The StringSystem class contains the complete set of all string regions.
154 // Only to be used inside StringFragmentation, so no private members.
155
156 class StringSystem {
157
158 public:
159
160   // Constructor. 
161   StringSystem() {}
162
163   // Set up system from parton list.
164   void setUp(vector<int>& iSys, Event& event);
165
166   // Calculate string region from (iPos, iNeg) pair.
167   int iReg( int iPos, int iNeg) const 
168     {return (iPos * (indxReg - iPos)) / 2 + iNeg;}
169
170   // Reference to string region specified by (iPos, iNeg) pair.
171   StringRegion& region(int iPos, int iNeg) {return system[iReg(iPos, iNeg)];} 
172
173   // Reference to low string region specified either by iPos or iNeg.
174   StringRegion& regionLowPos(int iPos) {return system[iReg(iPos, iMax - iPos)];} 
175   StringRegion& regionLowNeg(int iNeg) {return system[iReg(iMax - iNeg, iNeg)];} 
176
177   // Main content: a vector with all the string regions of the system. 
178   vector<StringRegion> system;
179
180   // Other data members.
181   int    sizePartons, sizeStrings, sizeRegions, indxReg, iMax; 
182   double mJoin, m2Join;
183
184 };
185  
186 //==========================================================================
187
188 } // end namespace Pythia8
189
190 #endif // Pythia8_FragmentationSystems_H