11 #ifndef Pythia8_FragmentationFlavZpT_H
12 #define Pythia8_FragmentationFlavZpT_H
14 #include "Pythia8/Basics.h"
15 #include "Pythia8/MathTools.h"
16 #include "Pythia8/ParticleData.h"
17 #include "Pythia8/PhysicsBase.h"
18 #include "Pythia8/PythiaStdlib.h"
19 #include "Pythia8/Settings.h"
27 double LundFFRaw(
double z,
double a,
double b,
double c,
double mT2);
29 double LundFFAvg(
double a,
double b,
double c,
double mT2,
double tol);
46 FlavContainer(
int idIn = 0,
int rankIn = 0,
int nPopIn = 0,
47 int idPopIn = 0,
int idVtxIn = 0) : id(idIn), rank(rankIn),
48 nPop(nPopIn), idPop(idPopIn), idVtx(idVtxIn) {}
51 FlavContainer(
const FlavContainer& flav) {
52 id = flav.id; rank = flav.rank; nPop = flav.nPop; idPop = flav.idPop;
56 FlavContainer& operator=(
const FlavContainer& flav) {
if (
this != &flav) {
57 id = flav.id; rank = flav.rank; nPop = flav.nPop; idPop = flav.idPop;
58 idVtx = flav.idVtx; }
return *
this; }
61 FlavContainer& anti() {
id = -id;
return *
this;}
64 FlavContainer& copy(
const FlavContainer& flav) {
if (
this != &flav) {
65 id = flav.id; rank = flav.rank; nPop = flav.nPop; idPop = flav.idPop;
66 idVtx = flav.idVtx; }
return *
this; }
67 FlavContainer& anti(
const FlavContainer& flav) {
if (
this != &flav) {
68 id = -flav.id; rank = flav.rank; nPop = flav.nPop; idPop = flav.idPop;
69 idVtx = flav.idVtx; }
return *
this; }
72 bool isDiquark() {
int idAbs = abs(
id);
73 return (idAbs > 1000 && idAbs < 10000 && (idAbs/10)%10 == 0);}
76 int id, rank, nPop, idPop, idVtx;
84 class StringFlav :
public PhysicsBase {
91 mT2suppression(), useWidthPre(), probQQtoQ(), probStoUD(), probSQtoQQ(),
92 probQQ1toQQ0(), probQandQQ(), probQandS(), probQandSinQQ(), probQQ1corr(),
93 probQQ1corrInv(), probQQ1norm(), probQQ1join(), mesonRate(),
94 mesonRateSum(), mesonMix1(), mesonMix2(), etaSup(), etaPrimeSup(),
95 decupletSup(), baryonCGSum(), baryonCGMax(), popcornRate(), popcornSpair(),
96 popcornSmeson(), scbBM(), popFrac(), popS(), dWT(), lightLeadingBSup(),
97 heavyLeadingBSup(), sigmaHad(), widthPreStrange(), widthPreDiquark(),
98 thermalModel(), mesonNonetL1(), temperature(), tempPreFactor(),
99 nNewQuark(), mesMixRate1(), mesMixRate2(), mesMixRate3(),
100 baryonOctWeight(), baryonDecWeight(), closePacking(), exponentMPI(),
101 exponentNSP(), hadronIDwin(0), idNewWin(0), hadronMassWin(-1.0) {}
104 virtual ~StringFlav() {}
110 int pickLightQ() {
double rndmFlav = probQandS * rndmPtr->flat();
111 if (rndmFlav < 1.)
return 1;
112 if (rndmFlav < 2.)
return 2;
117 virtual FlavContainer pick(FlavContainer& flavOld,
double pT = -1.0,
118 double nNSP = 0.0,
bool allowPop =
true) {
119 hadronIDwin = 0; idNewWin = 0; hadronMassWin = -1.0;
120 if ( (thermalModel || mT2suppression) && (pT >= 0.0) )
121 return pickThermal(flavOld, pT, nNSP);
122 return pickGauss(flavOld, allowPop); }
123 virtual FlavContainer pickGauss(FlavContainer& flavOld,
124 bool allowPop =
true);
125 virtual FlavContainer pickThermal(FlavContainer& flavOld,
126 double pT,
double nNSP);
129 virtual int combine(FlavContainer& flav1, FlavContainer& flav2);
132 virtual int combineId(
int id1,
int id2,
bool keepTrying =
true) {
133 FlavContainer flag1(id1); FlavContainer flag2(id2);
134 for (
int i = 0; i < 100; ++i) {
int idNew = combine( flag1, flag2);
135 if (idNew != 0 || !keepTrying)
return idNew;}
return 0;}
138 virtual int combineToLightest(
int id1,
int id2);
141 virtual int getHadronIDwin() {
return hadronIDwin; }
145 virtual int combineLastThermal(FlavContainer& flav1, FlavContainer& flav2,
146 double pT,
double nNSP);
150 virtual int getHadronID(FlavContainer& flav1, FlavContainer& flav2,
151 double pT = -1.0,
double nNSP = 0,
bool finalTwo =
false) {
152 if (finalTwo)
return ((thermalModel || mT2suppression) ?
153 combineLastThermal(flav1, flav2, pT, nNSP) : combine(flav1, flav2));
154 if ((thermalModel || mT2suppression)&& (hadronIDwin != 0)
155 && (idNewWin != 0))
return getHadronIDwin();
156 return combine(flav1, flav2); }
159 virtual double getHadronMassWin(
int idHad) {
return
160 ((hadronMassWin < 0.0) ? particleDataPtr->mSel(idHad) : hadronMassWin); }
163 void assignPopQ(FlavContainer& flav);
166 int makeDiquark(
int id1,
int id2,
int idHad = 0);
169 void addQuarkDiquark(vector< pair<int,int> >& quarkCombis,
170 int qID,
int diqID,
int hadronID) {
172 for (
int iCombi = 0; iCombi < int(quarkCombis.size()); iCombi++)
173 if ( (qID == quarkCombis[iCombi].first ) &&
174 (diqID == quarkCombis[iCombi].second) ) allowed =
false;
175 if (allowed) quarkCombis.push_back( (hadronID > 0) ?
176 make_pair( qID, diqID) : make_pair(-qID, -diqID) ); }
179 int getMesonSpinCounter(
int hadronID) { hadronID = abs(hadronID);
180 int j = (hadronID % 10);
181 if (hadronID < 1000)
return ((j==1) ? 0 : ( (j==3) ? 1 : 5 ));
182 if (hadronID < 20000)
return ((j==1) ? 3 : 2);
183 if (hadronID > 20000)
return 4;
189 static const int mesonMultipletCode[6];
190 static const double baryonCGOct[6], baryonCGDec[6];
193 bool suppressLeadingB, mT2suppression, useWidthPre;
194 double probQQtoQ, probStoUD, probSQtoQQ, probQQ1toQQ0, probQandQQ,
195 probQandS, probQandSinQQ, probQQ1corr, probQQ1corrInv, probQQ1norm,
196 probQQ1join[4], mesonRate[4][6], mesonRateSum[4], mesonMix1[2][6],
197 mesonMix2[2][6], etaSup, etaPrimeSup, decupletSup, baryonCGSum[6],
198 baryonCGMax[6], popcornRate, popcornSpair, popcornSmeson, scbBM[3],
199 popFrac, popS[3], dWT[3][7], lightLeadingBSup, heavyLeadingBSup;
200 double sigmaHad, widthPreStrange, widthPreDiquark;
203 bool thermalModel, mesonNonetL1;
204 double temperature, tempPreFactor;
206 double mesMixRate1[2][6], mesMixRate2[2][6], mesMixRate3[2][6];
207 double baryonOctWeight[6][6][6][2], baryonDecWeight[6][6][6][2];
211 double exponentMPI, exponentNSP;
214 map< int, vector< pair<int,int> > > hadronConstIDs;
217 map< int, vector< pair<int,int> > > possibleHadrons;
219 map< int, vector<double> > possibleRatePrefacs;
221 map< pair<int,int>, vector< pair<int,int> > > possibleHadronsLast;
222 map< pair<int,int>, vector<double> > possibleRatePrefacsLast;
225 int hadronIDwin, idNewWin;
226 double hadronMassWin;
234 class StringZ :
public PhysicsBase {
239 StringZ() : useNonStandC(), useNonStandB(), useNonStandH(), usePetersonC(),
240 usePetersonB(), usePetersonH(), mc2(), mb2(), aLund(), bLund(),
241 aExtraSQuark(), aExtraDiquark(), rFactC(), rFactB(), rFactH(), aNonC(),
242 aNonB(), aNonH(), bNonC(), bNonB(), bNonH(), epsilonC(), epsilonB(),
243 epsilonH(), stopM(), stopNF(), stopS() {}
246 virtual ~StringZ() {}
252 virtual double zFrag(
int idOld,
int idNew = 0,
double mT2 = 1.);
255 virtual double stopMass() {
return stopM;}
256 virtual double stopNewFlav() {
return stopNF;}
257 virtual double stopSmear() {
return stopS;}
260 virtual double aAreaLund() {
return aLund;}
261 virtual double bAreaLund() {
return bLund;}
269 static const double CFROMUNITY, AFROMZERO, AFROMC, EXPMAX;
272 bool useNonStandC, useNonStandB, useNonStandH,
273 usePetersonC, usePetersonB, usePetersonH;
274 double mc2, mb2, aLund, bLund, aExtraSQuark, aExtraDiquark, rFactC,
275 rFactB, rFactH, aNonC, aNonB, aNonH, bNonC, bNonB, bNonH,
276 epsilonC, epsilonB, epsilonH, stopM, stopNF, stopS;
279 double zLund(
double a,
double b,
double c = 1.);
280 double zPeterson(
double epsilon);
288 class StringPT :
public PhysicsBase {
293 StringPT() : useWidthPre(), sigmaQ(), enhancedFraction(), enhancedWidth(),
294 sigma2Had(), widthPreStrange(), widthPreDiquark(), thermalModel(),
295 temperature(), tempPreFactor(), fracSmallX(), closePacking(),
296 exponentMPI(), exponentNSP() {}
299 virtual ~StringPT() {}
306 pair<double, double> pxy(
int idIn,
double nNSP = 0.0) {
307 return (thermalModel ? pxyThermal(idIn, nNSP) :
308 pxyGauss(idIn, nNSP)); }
309 pair<double, double> pxyGauss(
int idIn = 0,
double nNSP = 0.0);
310 pair<double, double> pxyThermal(
int idIn,
double nNSP = 0.0);
313 double suppressPT2(
double pT2) {
return (thermalModel ?
314 exp(-sqrt(pT2)/temperature) : exp(-pT2/sigma2Had)); }
319 static const double SIGMAMIN;
324 double sigmaQ, enhancedFraction, enhancedWidth, sigma2Had,
325 widthPreStrange, widthPreDiquark;
328 double temperature, tempPreFactor, fracSmallX;
331 double exponentMPI, exponentNSP;
336 double BesselK14(
double x);
344 #endif // Pythia8_FragmentationFlavZpT_H