10 #ifndef Pythia8_StringFragmentation_H
11 #define Pythia8_StringFragmentation_H
13 #include "Pythia8/Basics.h"
14 #include "Pythia8/Event.h"
15 #include "Pythia8/Info.h"
16 #include "Pythia8/FragmentationFlavZpT.h"
17 #include "Pythia8/FragmentationSystems.h"
18 #include "Pythia8/ParticleData.h"
19 #include "Pythia8/PythiaStdlib.h"
20 #include "Pythia8/Ropewalk.h"
21 #include "Pythia8/Settings.h"
22 #include "Pythia8/UserHooks.h"
40 void init( ParticleData* particleDataPtrIn, StringFlav* flavSelPtrIn,
41 StringPT* pTSelPtrIn, StringZ* zSelPtrIn, Settings& settings) {
42 particleDataPtr = particleDataPtrIn; flavSelPtr = flavSelPtrIn;
43 pTSelPtr = pTSelPtrIn; zSelPtr = zSelPtrIn;
44 bLund = zSelPtr->bAreaLund(); aLund = zSelPtr->aAreaLund();
45 thermalModel = settings.flag(
"StringPT:thermalModel");
46 mT2suppression = settings.flag(
"StringPT:mT2suppression"); }
49 void setUp(
bool fromPosIn,
int iEndIn,
int idOldIn,
int iMaxIn,
50 double pxIn,
double pyIn,
double GammaIn,
double xPosIn,
double xNegIn);
53 void newHadron(
double nNSP = 0.0);
57 Vec4 kinematicsHadron(StringSystem& system,
58 vector<StringVertex>& stringVertices,
bool useInputZ =
false,
63 Vec4 kinematicsHadronTmp(StringSystem system, Vec4 pRem,
double phi,
70 static const double TINY, PT2SAME, MEANMMIN, MEANM, MEANPT;
73 ParticleData* particleDataPtr;
76 StringFlav* flavSelPtr;
81 bool fromPos, thermalModel, mT2suppression;
82 int iEnd, iMax, idHad, iPosOld, iNegOld, iPosNew, iNegNew, hadSoFar;
83 double pxOld, pyOld, pxNew, pyNew, pxHad, pyHad, mHad, mT2Had, zHad,
84 GammaOld, GammaNew, xPosOld, xPosNew, xPosHad, xNegOld, xNegNew,
85 xNegHad, aLund, bLund;
86 FlavContainer flavOld, flavNew;
96 class StringFragmentation {
101 StringFragmentation() {}
104 void init(Info* infoPtrIn, Settings& settings,
105 ParticleData* particleDataPtrIn, Rndm* rndmPtrIn,
106 StringFlav* flavSelPtrIn, StringPT* pTSelPtrIn, StringZ* zSelPtrIn,
107 FlavourRope* flavRopePtrIn = NULL, UserHooks* userHooksPtrIn = NULL);
110 bool fragment(
int iSub, ColConfig& colConfig,
Event& event);
113 RotBstMatrix junctionRestFrame(Vec4& p0, Vec4& p1, Vec4& p2);
118 static const int NTRYFLAV, NTRYJOIN, NSTOPMASS, NTRYJNREST,
119 NTRYJNMATCH, NTRYJRFEQ;
120 static const double FACSTOPMASS, CLOSEDM2MAX, CLOSEDM2FRAC, EXPMAX,
121 MATCHPOSNEG, EJNWEIGHTMAX, CONVJNREST, M2MAXJRF,
122 M2MINJRF, EEXTRAJNMATCH, MDIQUARKMIN, CONVJRFEQ,
129 ParticleData* particleDataPtr;
135 StringFlav* flavSelPtr;
140 FlavourRope* flavRopePtr;
143 UserHooks* userHooksPtr;
146 bool closePacking, doFlavRope, setVertices, constantTau, smearOn;
148 double stopMass, stopNewFlav, stopSmear, eNormJunction,
149 eBothLeftJunction, eMaxLeftJunction, eMinLeftJunction,
150 mJoin, bLund, pT20, xySmear, kappaVtx, mc, mb;
153 bool hasJunction, isClosed;
155 double w2Rem, stopMassNow;
156 Vec4 pSum, pRem, pJunctionHadrons;
159 vector<int> iParton, iPartonMinLeg, iPartonMidLeg, iPartonMax;
162 vector<StringVertex> stringVertices, legMinVertices, legMidVertices;
165 RotBstMatrix MfromJRF, MtoJRF;
171 Vec4 pMinEnd, pMidEnd;
177 StringSystem system, systemMin, systemMid;
180 StringEnd posEnd, negEnd;
183 vector<int> findFirstRegion(
int iSub, ColConfig& colConfig,
Event& event);
186 void setStartEnds(
int idPos,
int idNeg, StringSystem systemNow,
190 bool energyUsedUp(
bool fromPos);
193 bool finalTwo(
bool fromPos,
Event& event,
bool usedPosJun,
bool usedNegJun,
197 Vec4 pPosFinalReg, pNegFinalReg, eXFinalReg, eYFinalReg;
200 void setHadronVertices(
Event& event);
203 StringRegion finalRegion();
206 void store(
Event& event);
209 bool fragmentToJunction(
Event& event);
215 int extraJoin(
double facExtra,
Event& event);
218 double nearStringPieces(StringEnd end,
219 vector< vector< pair<double,double> > >& rapPairs);
227 #endif // Pythia8_StringFragmentation_H