]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PYTHIA8/pythia8130/include/FragmentationFlavZpT.h
using option '-treename HLTesdTree' for EsdCollector, adding default parameter for...
[u/mrichter/AliRoot.git] / PYTHIA8 / pythia8130 / include / FragmentationFlavZpT.h
1 // FragmentationFlavZpT.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.
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();
75
76   // Pick a light d, u or s quark according to fixed ratios.
77   int pickLightQ() { double rndmFlav = probQandS * Rndm::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  
108 //**************************************************************************
109
110 // The StringZ class is used to sample the fragmentation function f(z).
111
112 class StringZ {
113
114 public:
115
116   // Constructor. 
117   StringZ() {}
118
119   // Initialize data members.
120   void init();
121   
122   // Fragmentation function: top-level to determine parameters.
123   double zFrag( int idOld, int idNew = 0, double mT2 = 1.);
124
125 private: 
126
127   // Constants: could only be changed in the code itself.
128   static const double CFROMUNITY, AFROMZERO, AFROMC, EXPMAX;
129
130   // Initialization data, to be read from Settings.
131   bool   usePetersonC, usePetersonB, usePetersonH;
132   double mc2, mb2, aLund, bLund, aExtraDiquark, rFactC, rFactB, rFactH, 
133          epsilonC, epsilonB, epsilonH;
134
135   // Fragmentation function: select z according to provided parameters.
136   double zLund( double a, double b, double c = 1.);
137   double zPeterson( double epsilon);
138
139 };
140  
141 //**************************************************************************
142
143 // The StringPT class is used to select select transverse momenta.
144
145 class StringPT {
146
147 public:
148
149   // Constructor. 
150   StringPT() {}
151
152   // Initialize data members.
153   void init();
154
155   // Return px and py separately, but really same routine.
156   double px() {return pxy();}
157   double py() {return pxy();}
158
159 private: 
160
161   // Initialization data, to be read from Settings.
162   double sigmaQ, enhancedFraction, enhancedWidth;
163
164   // pT fragmentation spectrum.
165   double pxy();
166
167 };
168  
169 //**************************************************************************
170
171 } // end namespace Pythia8
172
173 #endif // Pythia8_FragmentationFlavZpT_H