]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PYTHIA8/pythia8140/include/FragmentationFlavZpT.h
4af59d9261c7327c0a156337097ecb4e9a00b238
[u/mrichter/AliRoot.git] / PYTHIA8 / pythia8140 / include / FragmentationFlavZpT.h
1 // FragmentationFlavZpT.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 helper classes for fragmentation.
7 // StringFlav is used to select quark and hadron flavours.
8 // StringPT is used to select transverse momenta.
9 // StringZ is used to sample the fragmentation function f(z).
10
11 #ifndef Pythia8_FragmentationFlavZpT_H
12 #define Pythia8_FragmentationFlavZpT_H
13
14 #include "Basics.h"
15 #include "ParticleData.h"
16 #include "PythiaStdlib.h"
17 #include "Settings.h"
18
19 namespace Pythia8 {
20
21
22 //==========================================================================
23
24 // The FlavContainer class is a simple container for flavour, 
25 // including the extra properties needed for popcorn baryon handling.
26 // id = current flavour. 
27 // rank = current rank; 0 for endpoint flavour and then increase by 1.
28 // nPop = number of popcorn mesons yet to be produced (1 or 0).
29 // idPop = (absolute sign of) popcorn quark, shared between B and Bbar.
30 // idVtx = (absolute sign of) vertex (= non-shared) quark in diquark.
31
32 class FlavContainer {
33
34 public:
35
36   // Constructor. 
37   FlavContainer(int idIn = 0, int rankIn = 0, int nPopIn = 0, 
38     int idPopIn = 0, int idVtxIn = 0) : id(idIn), rank(rankIn), 
39     nPop(nPopIn), idPop(idPopIn), idVtx(idVtxIn) {}
40
41   // Overloaded equal operator.
42   FlavContainer& operator=(const FlavContainer& flav) { if (this != &flav) { 
43     id = flav.id; rank = flav.rank; nPop = flav.nPop; idPop = flav.idPop;
44     idVtx = flav.idVtx; } return *this; }
45
46   // Invert flavour.
47   FlavContainer& anti() {id = -id; return *this;}
48
49   // Read in a container into another, without/with id sign flip.
50   FlavContainer& copy(const FlavContainer& flav) { if (this != &flav) { 
51     id = flav.id; rank = flav.rank; nPop = flav.nPop; idPop = flav.idPop;
52     idVtx = flav.idVtx; } return *this; }
53   FlavContainer& anti(const FlavContainer& flav) { if (this != &flav) { 
54     id = -flav.id; rank = flav.rank; nPop = flav.nPop; idPop = flav.idPop;
55     idVtx = flav.idVtx; } return *this; }
56
57   // Stored properties.
58   int id, rank, nPop, idPop, idVtx;
59   
60 };
61
62 //==========================================================================
63
64 // The StringFlav class is used to select quark and hadron flavours.
65
66 class StringFlav {
67
68 public:
69
70   // Constructor. 
71   StringFlav() {}
72
73   // Initialize data members.
74   void init(Settings& settings, Rndm* rndmPtrIn);
75
76   // Pick a light d, u or s quark according to fixed ratios.
77   int pickLightQ() { double rndmFlav = probQandS * rndmPtr->flat();
78     if (rndmFlav < 1.) return 1; if (rndmFlav < 2.) return 2; return 3; }
79
80   // Pick a new flavour (including diquarks) given an incoming one.
81   FlavContainer pick(FlavContainer& flavOld);
82
83   // Combine two flavours (including diquarks) to produce a hadron.
84   int combine(FlavContainer& flav1, FlavContainer& flav2);
85
86   // Assign popcorn quark inside an original (= rank 0) diquark.
87   void assignPopQ(FlavContainer& flav);
88
89   // Combine two quarks to produce a diquark.
90   int makeDiquark(int id1, int id2, int idHad = 0);
91
92 private: 
93
94   // Constants: could only be changed in the code itself.
95   static const int    mesonMultipletCode[6];
96   static const double baryonCGOct[6], baryonCGDec[6]; 
97
98   // Initialization data, to be read from Settings.
99   bool   suppressLeadingB;
100   double probQQtoQ, probStoUD, probSQtoQQ, probQQ1toQQ0, probQandQQ, 
101          probQandS, probQandSinQQ, probQQ1corr, probQQ1corrInv, probQQ1norm, 
102          mesonRate[4][6], mesonRateSum[4], mesonMix1[2][6], mesonMix2[2][6], 
103          etaSup, etaPrimeSup, decupletSup, baryonCGSum[6], baryonCGMax[6], 
104          popcornRate, popcornSpair, popcornSmeson, scbBM[3], popFrac, 
105          popS[3], dWT[3][7], lightLeadingBSup, heavyLeadingBSup;
106
107   // Pointer to the random number generator.
108   Rndm*  rndmPtr;
109
110 };
111  
112 //==========================================================================
113
114 // The StringZ class is used to sample the fragmentation function f(z).
115
116 class StringZ {
117
118 public:
119
120   // Constructor. 
121   StringZ() {}
122
123   // Initialize data members.
124   void init(Settings& settings, ParticleData& particleData, Rndm* rndmPtrIn);
125   
126   // Fragmentation function: top-level to determine parameters.
127   double zFrag( int idOld, int idNew = 0, double mT2 = 1.);
128
129 private: 
130
131   // Constants: could only be changed in the code itself.
132   static const double CFROMUNITY, AFROMZERO, AFROMC, EXPMAX;
133
134   // Initialization data, to be read from Settings.
135   bool   usePetersonC, usePetersonB, usePetersonH;
136   double mc2, mb2, aLund, bLund, aExtraDiquark, rFactC, rFactB, rFactH, 
137          epsilonC, epsilonB, epsilonH;
138
139   // Fragmentation function: select z according to provided parameters.
140   double zLund( double a, double b, double c = 1.);
141   double zPeterson( double epsilon);
142
143   // Pointer to the random number generator.
144   Rndm*  rndmPtr;
145
146 };
147  
148 //==========================================================================
149
150 // The StringPT class is used to select select transverse momenta.
151
152 class StringPT {
153
154 public:
155
156   // Constructor. 
157   StringPT() {}
158
159   // Initialize data members.
160   void init(Settings& settings, Rndm* rndmPtrIn);
161
162   // Return px and py as a pair in the same call.
163   pair<double, double>  pxy();
164
165 private: 
166
167   // Initialization data, to be read from Settings.
168   double sigmaQ, enhancedFraction, enhancedWidth;
169
170   // Pointer to the random number generator.
171   Rndm*  rndmPtr;
172
173 };
174  
175 //==========================================================================
176
177 } // end namespace Pythia8
178
179 #endif // Pythia8_FragmentationFlavZpT_H