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/PhysicsBase.h"
20 #include "Pythia8/PythiaStdlib.h"
21 #include "Pythia8/Ropewalk.h"
22 #include "Pythia8/Settings.h"
23 #include "Pythia8/UserHooks.h"
38 StringEnd() : particleDataPtr(), flavSelPtr(), pTSelPtr(), zSelPtr(),
39 fromPos(), thermalModel(), mT2suppression(), iEnd(), iMax(), idHad(),
40 iPosOld(), iNegOld(), iPosNew(), iNegNew(), hadSoFar(), colOld(), colNew(),
41 pxOld(), pyOld(), pxNew(), pyNew(), pxHad(), pyHad(), mHad(), mT2Had(),
42 zHad(), GammaOld(), GammaNew(), xPosOld(), xPosNew(), xPosHad(), xNegOld(),
43 xNegNew(), xNegHad(), aLund(), bLund() {}
46 void init( ParticleData* particleDataPtrIn, StringFlav* flavSelPtrIn,
47 StringPT* pTSelPtrIn, StringZ* zSelPtrIn, Settings& settings) {
48 particleDataPtr = particleDataPtrIn; flavSelPtr = flavSelPtrIn;
49 pTSelPtr = pTSelPtrIn; zSelPtr = zSelPtrIn;
50 bLund = zSelPtr->bAreaLund(); aLund = zSelPtr->aAreaLund();
51 thermalModel = settings.flag(
"StringPT:thermalModel");
52 mT2suppression = settings.flag(
"StringPT:mT2suppression"); }
55 void setUp(
bool fromPosIn,
int iEndIn,
int idOldIn,
int iMaxIn,
56 double pxIn,
double pyIn,
double GammaIn,
double xPosIn,
57 double xNegIn,
int colIn);
60 void newHadron(
double nNSP = 0.0);
64 Vec4 kinematicsHadron(StringSystem& system,
65 vector<StringVertex>& stringVertices,
bool useInputZ =
false,
70 Vec4 kinematicsHadronTmp(StringSystem system, Vec4 pRem,
double phi,
77 static const double TINY, PT2SAME, MEANMMIN, MEANM, MEANPT;
80 ParticleData* particleDataPtr;
83 StringFlav* flavSelPtr;
88 bool fromPos, thermalModel, mT2suppression;
89 int iEnd, iMax, idHad, iPosOld, iNegOld, iPosNew, iNegNew, hadSoFar,
91 double pxOld, pyOld, pxNew, pyNew, pxHad, pyHad, mHad, mT2Had, zHad,
92 GammaOld, GammaNew, xPosOld, xPosNew, xPosHad, xNegOld, xNegNew,
93 xNegHad, aLund, bLund;
94 FlavContainer flavOld, flavNew;
104 class StringFragmentation :
public PhysicsBase {
109 StringFragmentation() :
110 flavSelPtr(), pTSelPtr(), zSelPtr(), flavRopePtr(),
111 closePacking(), setVertices(), constantTau(), smearOn(),
112 traceColours(false), hadronVertex(), stopMass(), stopNewFlav(),
113 stopSmear(), eNormJunction(), eBothLeftJunction(), eMaxLeftJunction(),
114 eMinLeftJunction(), mJoin(), bLund(), pT20(), xySmear(), maxSmear(),
115 maxTau(), kappaVtx(), mc(), mb(), hasJunction(), isClosed(), iPos(),
116 iNeg(), w2Rem(), stopMassNow(), idDiquark(), legMin(), legMid() {}
119 void init(StringFlav* flavSelPtrIn, StringPT* pTSelPtrIn, StringZ* zSelPtrIn,
120 FragModPtr fragModPtrIn = NULL);
123 bool fragment(
int iSub, ColConfig& colConfig,
Event& event);
126 RotBstMatrix junctionRestFrame(Vec4& p0, Vec4& p1, Vec4& p2);
131 static const int NTRYFLAV, NTRYJOIN, NSTOPMASS, NTRYJNREST,
132 NTRYJNMATCH, NTRYJRFEQ, NTRYSMEAR;
133 static const double FACSTOPMASS, CLOSEDM2MAX, CLOSEDM2FRAC, EXPMAX,
134 MATCHPOSNEG, EJNWEIGHTMAX, CONVJNREST, M2MAXJRF,
135 M2MINJRF, EEXTRAJNMATCH, MDIQUARKMIN, CONVJRFEQ,
139 StringFlav* flavSelPtr;
144 FragModPtr flavRopePtr;
147 bool closePacking, setVertices, constantTau, smearOn,
150 double stopMass, stopNewFlav, stopSmear, eNormJunction,
151 eBothLeftJunction, eMaxLeftJunction, eMinLeftJunction,
152 mJoin, bLund, pT20, xySmear, maxSmear, maxTau, kappaVtx, mc, mb;
155 bool hasJunction, isClosed;
157 double w2Rem, stopMassNow;
158 Vec4 pSum, pRem, pJunctionHadrons;
161 vector<int> iParton, iPartonMinLeg, iPartonMidLeg, iPartonMax;
164 vector<StringVertex> stringVertices, legMinVertices, legMidVertices;
167 RotBstMatrix MfromJRF, MtoJRF;
173 Vec4 pMinEnd, pMidEnd;
179 StringSystem system, systemMin, systemMid;
182 StringEnd posEnd, negEnd;
185 vector<int> findFirstRegion(
int iSub, ColConfig& colConfig,
Event& event);
188 void setStartEnds(
int idPos,
int idNeg, StringSystem systemNow,
192 bool energyUsedUp(
bool fromPos);
195 bool finalTwo(
bool fromPos,
Event& event,
bool usedPosJun,
bool usedNegJun,
199 Vec4 pPosFinalReg, pNegFinalReg, eXFinalReg, eYFinalReg;
202 bool setHadronVertices(
Event& event);
205 StringRegion finalRegion();
208 void store(
Event& event);
211 bool fragmentToJunction(
Event& event);
217 int extraJoin(
double facExtra,
Event& event);
220 double nearStringPieces(StringEnd end,
221 vector< vector< pair<double,double> > >& rapPairs);
229 #endif // Pythia8_StringFragmentation_H