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" 39 int idPopIn = 0,
int idVtxIn = 0) :
id(idIn), rank(rankIn),
40 nPop(nPopIn), idPop(idPopIn), idVtx(idVtxIn) {}
44 id = flav.
id; rank = flav.rank; nPop = flav.nPop; idPop = flav.idPop;
49 id = flav.
id; rank = flav.rank; nPop = flav.nPop; idPop = flav.idPop;
50 idVtx = flav.idVtx; }
return *
this; }
57 id = flav.
id; rank = flav.rank; nPop = flav.nPop; idPop = flav.idPop;
58 idVtx = flav.idVtx; }
return *
this; }
60 id = -flav.
id; rank = flav.rank; nPop = flav.nPop; idPop = flav.idPop;
61 idVtx = flav.idVtx; }
return *
this; }
65 return (idAbs > 1000 && idAbs < 10000 && (idAbs/10)%10 == 0);}
68 int id, rank, nPop, idPop, idVtx;
81 StringFlav() : suppressLeadingB(), probQQtoQ(), probStoUD(), probSQtoQQ(),
82 probQQ1toQQ0(), probQandQQ(), probQandS(), probQandSinQQ(), probQQ1corr(),
83 probQQ1corrInv(), probQQ1norm(), probQQ1join(), mesonRate(),
84 mesonRateSum(), mesonMix1(), mesonMix2(), etaSup(), etaPrimeSup(),
85 decupletSup(), baryonCGSum(), baryonCGMax(), popcornRate(), popcornSpair(),
86 popcornSmeson(), barCGMax(), scbBM(), popFrac(), popS(), dWT(),
87 lightLeadingBSup(), heavyLeadingBSup(), probStoUDSav(), probQQtoQSav(),
88 probSQtoQQSav(), probQQ1toQQ0Sav(), alphaQQSav(), closePacking(),
89 doEnhanceDiquark(), enhanceStrange(), enhancePT(), enhanceDiquark(),
90 exponentMPI(), exponentNSP() {}
99 virtual void init(
double kappaModifier,
double strangeJunc,
103 int pickLightQ() {
double rndmFlav = probQandS * rndmPtr->flat();
104 if (rndmFlav < 1.)
return 1;
105 if (rndmFlav < 2.)
return 2;
111 double = -1.,
double = -1.,
bool allowPop =
true);
117 virtual int combineId(
int id1,
int id2,
bool keepTrying =
true) {
119 for (
int i = 0; i < 100; ++i) {
int idNew = combine( flag1, flag2);
120 if (idNew != 0 || !keepTrying)
return idNew;}
return 0;}
123 virtual pair<int,int> combineDiquarkJunction(
int id1,
int id2,
int id3);
126 virtual int combineToLightest(
int id1,
int id2);
134 double = -1.0,
double = -1.0,
bool =
false) {
135 return combine(flav1, flav2); }
139 return particleDataPtr->mSel(idHad); }
145 int makeDiquark(
int id1,
int id2,
int idHad = 0);
149 int qID,
int diqID,
int hadronID) {
151 for (
int iCombi = 0; iCombi < int(quarkCombis.size()); iCombi++)
152 if ( (qID == quarkCombis[iCombi].first ) &&
153 (diqID == quarkCombis[iCombi].second) ) allowed =
false;
154 if (allowed) quarkCombis.push_back( (hadronID > 0) ?
155 make_pair( qID, diqID) : make_pair(-qID, -diqID) ); }
159 int j = (hadronID % 10);
160 if (hadronID < 1000)
return ((j==1) ? 0 : ( (j==3) ? 1 : 5 ));
161 if (hadronID < 20000)
return ((j==1) ? 3 : 2);
162 if (hadronID > 20000)
return 4;
171 return (i < 3 && j < 7) ? dWT[i][j] : -1.0;}
176 virtual void initDerived();
179 static const int mesonMultipletCode[6];
180 static const double baryonCGOct[6], baryonCGDec[6];
184 double probQQtoQ, probStoUD, probSQtoQQ, probQQ1toQQ0, probQandQQ,
185 probQandS, probQandSinQQ, probQQ1corr, probQQ1corrInv, probQQ1norm,
186 probQQ1join[4], mesonRate[4][6], mesonRateSum[4], mesonMix1[2][6],
187 mesonMix2[2][6], etaSup, etaPrimeSup, decupletSup, baryonCGSum[6],
188 baryonCGMax[6], popcornRate, popcornSpair, popcornSmeson, barCGMax[8],
189 scbBM[3], popFrac, popS[3], dWT[3][7], lightLeadingBSup,
192 double probStoUDSav, probQQtoQSav, probSQtoQQSav, probQQ1toQQ0Sav,
197 double enhanceStrange, enhancePT, enhanceDiquark, exponentMPI, exponentNSP;
209 double LundFFRaw(
double z,
double a,
double b,
double c,
double mT2);
211 double LundFFAvg(
double a,
double b,
double mT2,
double tol);
213 double LundFFRms(
double a,
double b,
double mT2,
double tol);
226 StringZ() : useNonStandC(), useNonStandB(), useNonStandH(), usePetersonC(),
227 usePetersonB(), usePetersonH(), useOldAExtra(), mc2(), mb2(),
228 aLund(), bLund(), aExtraSQuark(), aExtraDiquark(), rFactC(),
229 rFactB(), rFactH(), aNonC(), aNonB(), aNonH(), bNonC(), bNonB(),
230 bNonH(), epsilonC(), epsilonB(), epsilonH(), stopM(), stopNF(),
231 stopS(), zHead(), posthoc() {}
240 virtual double zFrag(
int idOld,
int idNew = 0,
double mT2 = 1.);
243 virtual double zLund(
double a,
double b,
double c = 1.,
245 virtual double zPeterson(
double epsilon);
246 virtual double zLundMax(
double a,
double b,
double c = 1.);
250 virtual double stopNewFlav() {
return stopNF;}
251 virtual double stopSmear() {
return stopS;}
255 virtual double bAreaLund() {
return bLund;}
258 bool deriveABLund(
bool derivaA =
false,
bool deriveAExtraDiquark =
false,
259 bool deriveAExtraSQuark =
false);
261 double deriveBLund(
double avgZ,
double a,
double mT2ref);
266 static const double CFROMUNITY, AFROMZERO, AFROMC,
EXPMAX;
270 usePetersonC, usePetersonB, usePetersonH, useOldAExtra;
271 double mc2, mb2, aLund, bLund, aExtraSQuark, aExtraDiquark, rFactC,
272 rFactB, rFactH, aNonC, aNonB, aNonH, bNonC, bNonB, bNonH,
273 epsilonC, epsilonB, epsilonH, stopM, stopNF, stopS, zHead;
279 void initFlav(
int idOld,
int idNew);
280 void initShape(
double mT2);
281 void initFunc(
double a,
double b,
double c,
double z,
double zMax,
282 double fPrel,
double head);
286 bool isOldSQuark, isNewSQuark, isOldDiquark, isNewDiquark;
287 double aShape, bShape, cShape, bNow, fVal, fPrb;
291 int idOldNow, idNewNow;
307 StringPT() : sigmaQ(), enhancedFraction(), enhancedWidth(), sigma2Had(),
308 closePacking(), enhancePT(), exponentMPI(), exponentNSP(), posthoc() {}
317 virtual pair<double, double> pxy(
int idIn = 0,
double kappaModifier = -1.0);
320 virtual double suppressPT2(
double pT2) {
return exp(-pT2/sigma2Had); }
328 double sigmaQ, enhancedFraction, enhancedWidth, sigma2Had;
330 bool useWidthPre{
false};
331 double widthPreStrange{1.}, widthPreQQ0{1.}, widthPreQQ1{1.};
334 double enhancePT, exponentMPI, exponentNSP;
virtual int getHadronID(FlavContainer &flav1, FlavContainer &flav2, double=-1.0, double=-1.0, bool=false)
Definition: FragmentationFlavZpT.h:133
double LundFFRms(double a, double b, double mT2, double tol)
Definition: FragmentationFlavZpT.cc:738
FlavContainer & operator=(const FlavContainer &flav)
Overloaded equal operator.
Definition: FragmentationFlavZpT.h:48
virtual double aAreaLund()
a and b fragmentation parameters needed in some operations.
Definition: FragmentationFlavZpT.h:254
Definition: PhysicsBase.h:26
virtual double getHadronMassWin(int idHad)
Return hadron mass.
Definition: FragmentationFlavZpT.h:138
int getMesonSpinCounter(int hadronID)
Get spin counter for mesons.
Definition: FragmentationFlavZpT.h:158
static const double SIGMAMIN
Constants: could only be changed in the code itself.
Definition: FragmentationFlavZpT.h:325
The StringPT class is used to select select transverse momenta.
Definition: FragmentationFlavZpT.h:300
virtual ~StringPT()
Destructor.
Definition: FragmentationFlavZpT.h:311
double LundFFAvg(double a, double b, double mT2, double tol)
Definition: FragmentationFlavZpT.cc:704
bool isDiquark()
Check whether is diquark.
Definition: FragmentationFlavZpT.h:64
Wave4 epsilon(Wave4 w1, Wave4 w2, Wave4 w3)
Permutation operator.
Definition: HelicityBasics.cc:56
virtual ~StringZ()
Destructor.
Definition: FragmentationFlavZpT.h:234
virtual ~StringFlav()
Destructor.
Definition: FragmentationFlavZpT.h:93
void addQuarkDiquark(vector< pair< int, int > > &quarkCombis, int qID, int diqID, int hadronID)
Check if quark-diquark combination should be added. If so add.
Definition: FragmentationFlavZpT.h:148
virtual double suppressPT2(double pT2)
Gaussian suppression of given pT2; used in MiniStringFragmentation.
Definition: FragmentationFlavZpT.h:320
The StringZ class is used to sample the fragmentation function f(z).
Definition: FragmentationFlavZpT.h:219
FlavContainer & anti()
Invert flavour.
Definition: FragmentationFlavZpT.h:53
FlavContainer(int idIn=0, int rankIn=0, int nPopIn=0, int idPopIn=0, int idVtxIn=0)
Constructor.
Definition: FragmentationFlavZpT.h:38
int id
Stored properties.
Definition: FragmentationFlavZpT.h:68
double getFlavourSpinRatios(int i, int j)
Definition: FragmentationFlavZpT.h:170
double sigmaQ
Initialization data, to be read from Settings.
Definition: FragmentationFlavZpT.h:328
bool suppressLeadingB
Settings for default Gaussian model.
Definition: FragmentationFlavZpT.h:183
virtual int combineId(int id1, int id2, bool keepTrying=true)
Ditto, simplified input argument for simple configurations.
Definition: FragmentationFlavZpT.h:117
FlavContainer & copy(const FlavContainer &flav)
Read in a container into another, without/with id sign flip.
Definition: FragmentationFlavZpT.h:56
virtual int idLightestNeutralMeson()
Lightest flavour-neutral meson.
Definition: FragmentationFlavZpT.h:129
FlavContainer(const FlavContainer &flav)
Copy constructor.
Definition: FragmentationFlavZpT.h:43
bool posthoc
Store the information needed for post-hoc reweighting.
Definition: FragmentationFlavZpT.h:290
double LundFFRaw(double z, double a, double b, double c, double mT2)
Functions for the Lund symmetric FF: unnormalised, average, and RMSD.
Definition: FragmentationFlavZpT.cc:689
StringZ()
Constructor.
Definition: FragmentationFlavZpT.h:226
virtual double stopMass()
Parameters for stopping in the middle; overloaded for Hidden Valley.
Definition: FragmentationFlavZpT.h:249
Definition: FragmentationFlavZpT.h:33
Definition: Weights.h:355
static const double EXPMAX
Do not take exponent of too large or small number.
Definition: FragmentationFlavZpT.h:266
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
bool closePacking
Special for closepacking.
Definition: FragmentationFlavZpT.h:333
The StringFlav class is used to select quark and hadron flavours.
Definition: FragmentationFlavZpT.h:76
bool closePacking
Settings for closepacking.
Definition: FragmentationFlavZpT.h:196
bool useNonStandC
Initialization data, to be read from Settings.
Definition: FragmentationFlavZpT.h:269
int pickLightQ()
Pick a light d, u or s quark according to fixed ratios.
Definition: FragmentationFlavZpT.h:103
StringPT()
Constructor.
Definition: FragmentationFlavZpT.h:307
StringFlav()
Constructor.
Definition: FragmentationFlavZpT.h:81
int idFrag
Objects needed for the post-hoc kinematic reweighting.
Definition: FragmentationFlavZpT.h:285