File indexing completed on 2025-01-18 10:06:32
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef Pythia8_StringFragmentation_H
0011 #define Pythia8_StringFragmentation_H
0012
0013 #include "Pythia8/Basics.h"
0014 #include "Pythia8/Event.h"
0015 #include "Pythia8/Info.h"
0016 #include "Pythia8/FragmentationFlavZpT.h"
0017 #include "Pythia8/FragmentationSystems.h"
0018 #include "Pythia8/ParticleData.h"
0019 #include "Pythia8/PhysicsBase.h"
0020 #include "Pythia8/PythiaStdlib.h"
0021 #include "Pythia8/Ropewalk.h"
0022 #include "Pythia8/Settings.h"
0023 #include "Pythia8/UserHooks.h"
0024
0025 namespace Pythia8 {
0026
0027
0028
0029
0030
0031
0032
0033 class StringEnd {
0034
0035 public:
0036
0037
0038 StringEnd() : particleDataPtr(), flavSelPtr(), pTSelPtr(), zSelPtr(),
0039 fromPos(), thermalModel(), mT2suppression(), iEnd(), iMax(), idHad(),
0040 iPosOld(), iNegOld(), iPosNew(), iNegNew(), hadSoFar(), colOld(), colNew(),
0041 pxOld(), pyOld(), pxNew(), pyNew(), pxHad(), pyHad(), mHad(), mT2Had(),
0042 zHad(), GammaOld(), GammaNew(), xPosOld(), xPosNew(), xPosHad(), xNegOld(),
0043 xNegNew(), xNegHad(), aLund(), bLund(), iPosOldPrev(), iNegOldPrev(),
0044 colOldPrev(), pxOldPrev(), pyOldPrev(), GammaOldPrev(), xPosOldPrev(),
0045 xNegOldPrev() {}
0046
0047
0048 void init( ParticleData* particleDataPtrIn, StringFlav* flavSelPtrIn,
0049 StringPT* pTSelPtrIn, StringZ* zSelPtrIn, Settings& settings) {
0050 particleDataPtr = particleDataPtrIn; flavSelPtr = flavSelPtrIn;
0051 flavSelNow = *flavSelPtr;
0052 pTSelPtr = pTSelPtrIn; zSelPtr = zSelPtrIn;
0053 bLund = zSelPtr->bAreaLund(); aLund = zSelPtr->aAreaLund();
0054 thermalModel = settings.flag("StringPT:thermalModel");
0055 mT2suppression = settings.flag("StringPT:mT2suppression");
0056 closePacking = settings.flag("ClosePacking:doClosePacking"); }
0057
0058
0059 void setUp(bool fromPosIn, int iEndIn, int idOldIn, int iMaxIn,
0060 double pxIn, double pyIn, double GammaIn, double xPosIn,
0061 double xNegIn, int colIn);
0062
0063
0064 void newHadron(double kappaRatio, bool forbidPopcornNow = false,
0065 bool allowPop = true, double strangeFac = 0., double probQQmod = 1.);
0066
0067
0068 void pearlHadron(StringSystem& system, int idPearlIn, Vec4 pPearlIn);
0069
0070
0071
0072 Vec4 kinematicsHadron(StringSystem& system, StringVertex& newVertex,
0073 bool useInputZ = false, double zHadIn = 0., bool pearlIn = false,
0074 Vec4 pPearlIn = { 0., 0., 0., 0.});
0075
0076
0077
0078 Vec4 kinematicsHadronTmp(StringSystem system, Vec4 pRem, double phi,
0079 double mult);
0080
0081
0082 void update();
0083 void storePrev();
0084 void updateToPrev();
0085
0086
0087 static const double TINY, PT2SAME, MEANMMIN, MEANM, MEANPT;
0088
0089
0090 ParticleData* particleDataPtr;
0091
0092
0093 StringFlav* flavSelPtr;
0094 StringPT* pTSelPtr;
0095 StringZ* zSelPtr;
0096
0097
0098 StringFlav flavSelNow;
0099
0100
0101 bool fromPos, thermalModel, mT2suppression, closePacking;
0102 int iEnd, iMax, idHad, iPosOld, iNegOld, iPosNew, iNegNew, hadSoFar,
0103 colOld, colNew;
0104 double pxOld, pyOld, pxNew, pyNew, pxHad, pyHad, mHad, mT2Had, zHad,
0105 GammaOld, GammaNew, xPosOld, xPosNew, xPosHad, xNegOld, xNegNew,
0106 xNegHad, aLund, bLund;
0107 int iPosOldPrev, iNegOldPrev, colOldPrev;
0108 double pxOldPrev, pyOldPrev, GammaOldPrev, xPosOldPrev, xNegOldPrev;
0109 FlavContainer flavOld, flavNew, flavOldPrev;
0110 Vec4 pHad, pSoFar;
0111
0112 };
0113
0114
0115
0116
0117
0118
0119 class StringFragmentation : public PhysicsBase {
0120
0121 public:
0122
0123
0124 StringFragmentation() :
0125 flavSelPtr(), pTSelPtr(), zSelPtr(), flavRopePtr(),
0126 closePacking(), setVertices(), constantTau(), smearOn(),
0127 traceColours(false), hadronVertex(), stopMass(), stopNewFlav(),
0128 stopSmear(), pNormJunction(), pMaxJunction(), eBothLeftJunction(),
0129 eMaxLeftJunction(), eMinLeftJunction(), mJoin(), bLund(),
0130 closePackingTension(0.), closePackingTensionRatio(1.),
0131 closePackingPT20(1.), pT20(), xySmear(), maxSmear(),
0132 maxTau(), kappaVtx(), mc(), mb(), hasJunction(), isClosed(), iPos(),
0133 iNeg(), nExtraJoin(), w2Rem(), stopMassNow(), idDiquark(),
0134 legMin(), legMid() {}
0135
0136
0137 void init(StringFlav* flavSelPtrIn, StringPT* pTSelPtrIn, StringZ* zSelPtrIn,
0138 FragModPtr fragModPtrIn = nullptr);
0139
0140
0141 StringFlav flavSelNow;
0142
0143
0144 bool fragment( int iSub, const ColConfig& colConfig, Event& event);
0145
0146
0147 Vec4 junctionRestFrame(const Vec4& p0, const Vec4& p1, const Vec4& p2,
0148 const bool angleCheck = true) const;
0149
0150 private:
0151
0152
0153 static const int NTRYFLAV, NTRYJOIN, NSTOPMASS,
0154 NTRYJNMATCH, NTRYJRFEQ, NTRYSMEAR;
0155 static const double FACSTOPMASS, CLOSEDM2MAX, CLOSEDM2FRAC, EXPMAX,
0156 MATCHPOSNEG, M2MINJRF, EMINJRF, EEXTRAJNMATCH,
0157 MDIQUARKMIN, CONVJRFEQ, CHECKPOS;
0158
0159
0160 StringFlav* flavSelPtr;
0161 StringPT* pTSelPtr;
0162 StringZ* zSelPtr;
0163
0164
0165 FragModPtr flavRopePtr;
0166
0167
0168 bool closePacking, setVertices, constantTau, smearOn,
0169 traceColours, hardRemn, gluonPearl, strangeJunc;
0170 int hadronVertex;
0171 double stopMass, stopNewFlav, stopSmear, pNormJunction, pMaxJunction,
0172 eBothLeftJunction, eMaxLeftJunction, eMinLeftJunction,
0173 mJoin, bLund, closePackingTension, closePackingTensionRatio,
0174 closePackingPT20, qqFacP, qqFacQ, pT20, xySmear, maxSmear, maxTau,
0175 kappaVtx, mc, mb, dampPopcorn, aRemn, bRemn, pearlFac,
0176 strangeParm, strangePearl;
0177
0178
0179 bool hasJunction, isClosed;
0180 int iPos, iNeg, nExtraJoin;
0181 double w2Rem, stopMassNow, kappaRatio, probQQmod;
0182 Vec4 pSum, pRem, pJunctionHadrons;
0183
0184
0185 vector<int> iParton, iPartonMinLeg, iPartonMidLeg, iPartonMax;
0186
0187
0188 vector<StringVertex> stringVertices, legMinVertices, legMidVertices;
0189 StringVertex newVertex;
0190
0191
0192 vector<Vec4> listJRF;
0193 vector<double> weightJRF;
0194 int iLeg[3], idLeg[3], legEnd[3];
0195 double weightSum, pSumJRF, m2Leg[3];
0196 Vec4 pLeg[3];
0197 bool lastJRF, endpoint[3];
0198
0199
0200 bool pearlFrag;
0201 Vec4 gPearl, pPearl;
0202 int idPearl, legPearl;
0203 double vPearl, eCutoff;
0204
0205
0206 RotBstMatrix MfromJRF, MtoJRF;
0207
0208
0209 int idDiquark;
0210
0211
0212 Vec4 pMinEnd, pMidEnd;
0213
0214
0215 Event hadrons;
0216
0217
0218 StringSystem system, systemMin, systemMid;
0219
0220
0221 StringEnd posEnd, negEnd;
0222
0223
0224 vector<int> findFirstRegion(int iSub, const ColConfig& colConfig,
0225 const Event& event) const;
0226
0227
0228 void setStartEnds(int idPos, int idNeg, const StringSystem& systemNow,
0229 int legNow = 3);
0230
0231
0232 bool energyUsedUp(bool fromPos);
0233
0234
0235 bool finalTwo(bool fromPos, const Event& event, bool usedPosJun,
0236 bool usedNegJun, bool usedPearlIn, Vec4 pPearlIn);
0237
0238
0239 Vec4 pPosFinalReg, pNegFinalReg, eXFinalReg, eYFinalReg;
0240
0241
0242 bool setHadronVertices(Event& event);
0243
0244
0245 StringRegion finalRegion();
0246
0247
0248 void store(Event& event);
0249
0250
0251 bool fragmentToJunction(Event& event,
0252 vector< vector< pair<double,double> > >& rapPairs);
0253
0254
0255 int legMin, legMid;
0256
0257
0258 bool collinearPair(Event& event);
0259 bool perturbedJRF(Event& event);
0260 int updateLegs(Event& event, Vec4 vJunIn, bool juncCoM = false);
0261 double updateWeights(double pSmall, Vec4 vJunIn);
0262 bool pearlOnAString(Event& event, int iMin);
0263 void nextParton(Event& event, int leg);
0264
0265
0266 int extraJoin(double facExtra, Event& event);
0267
0268
0269 void kappaEffRatio(StringSystem& systemNow,
0270 StringEnd end, bool fromPos, vector<int> partonList,
0271 vector< vector< pair<double,double> > >& rapPairs,
0272 double mRem, Event& event);
0273
0274 double yMax(Particle pIn, double mTiny) {
0275 double temp = log( ( pIn.e() + abs(pIn.pz()) ) / max( mTiny, pIn.mT()) );
0276 return (pIn.pz() > 0) ? temp : -temp; }
0277
0278 };
0279
0280
0281
0282 }
0283
0284 #endif