File indexing completed on 2025-01-18 10:06:29
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef Pythia8_Ropewalk_H
0016 #define Pythia8_Ropewalk_H
0017
0018 #include "Pythia8/Basics.h"
0019 #include "Pythia8/Event.h"
0020 #include "Pythia8/FragmentationSystems.h"
0021 #include "Pythia8/Info.h"
0022 #include "Pythia8/ParticleData.h"
0023 #include "Pythia8/Settings.h"
0024 #include "Pythia8/PythiaStdlib.h"
0025 #include "Pythia8/StringInteractions.h"
0026
0027 namespace Pythia8 {
0028
0029
0030
0031
0032
0033
0034
0035 class RopeDipoleEnd {
0036
0037 public:
0038
0039
0040 RopeDipoleEnd() : e(nullptr), ne(-1) { }
0041 RopeDipoleEnd(Event* eIn, int neIn) : e(eIn), ne(neIn) { }
0042
0043
0044 Particle* getParticlePtr() { if (!e) return nullptr; return &(*e)[ne]; }
0045
0046
0047 int getNe() {return ne;}
0048
0049
0050 double labrap() { return getParticlePtr()->y(); }
0051 double rap(double m0){ return getParticlePtr()->y(m0); }
0052 double rap(double m0, RotBstMatrix& r) { return getParticlePtr()->y(m0, r); }
0053
0054 private:
0055
0056
0057 Event* e;
0058 int ne;
0059
0060 };
0061
0062
0063
0064
0065
0066
0067
0068 class RopeDipole;
0069
0070 class OverlappingRopeDipole {
0071
0072 public:
0073
0074
0075 OverlappingRopeDipole(RopeDipole* d, double m0, RotBstMatrix& r);
0076
0077
0078 bool overlap(double y, Vec4 ba, double r0);
0079
0080
0081 bool hadronized();
0082
0083 private:
0084
0085
0086 RopeDipole* dipole;
0087
0088
0089
0090 public:
0091
0092 int dir;
0093 double y1, y2;
0094 Vec4 b1, b2;
0095
0096 };
0097
0098
0099
0100
0101
0102
0103 class RopeDipole {
0104
0105 public:
0106
0107
0108
0109 RopeDipole(RopeDipoleEnd d1In, RopeDipoleEnd d2In, int iSubIn,
0110 Logger* loggerPtrIn);
0111
0112
0113 void addExcitation(double ylab, Particle* ex);
0114
0115
0116 RopeDipoleEnd* d1Ptr() { return &d1; }
0117 RopeDipoleEnd* d2Ptr() { return &d2; }
0118
0119
0120 RotBstMatrix getDipoleRestFrame();
0121 RotBstMatrix getDipoleLabFrame();
0122
0123
0124 Vec4 dipoleMomentum();
0125
0126
0127 Vec4 bInterpolateDip(double y, double m0);
0128
0129 Vec4 bInterpolateLab(double y, double m0);
0130
0131 Vec4 bInterpolate(double y, RotBstMatrix rb, double m0);
0132
0133
0134
0135 pair<int, int> getOverlaps(double yfrac, double m0, double r0);
0136
0137
0138 void addOverlappingDipole(OverlappingRopeDipole& d) {
0139 overlaps.push_back(d); }
0140
0141
0142 double maxRapidity(double m0) { return (max(d1.rap(m0), d2.rap(m0))); }
0143 double minRapidity(double m0) { return (min(d1.rap(m0), d2.rap(m0))); }
0144
0145
0146 double maxRapidity(double m0, RotBstMatrix& r) { return (max(d1.rap(m0,r),
0147 d2.rap(m0,r))); }
0148 double minRapidity(double m0, RotBstMatrix& r) { return (min(d1.rap(m0,r),
0149 d2.rap(m0,r))); }
0150
0151
0152 void propagateInit(double deltat);
0153
0154
0155 void propagate(double deltat, double m0);
0156
0157
0158 void splitMomentum(Vec4 mom, Particle* p1, Particle* p2, double frac = 0.5);
0159
0160
0161 void excitationsToString(double m0, Event& event);
0162
0163
0164 bool hadronized() { return isHadronized; }
0165
0166
0167 int index() { return iSub; }
0168
0169
0170
0171
0172 bool recoil(Vec4& pg, bool dummy = false);
0173
0174
0175 void hadronized(bool h) { isHadronized = h; }
0176
0177
0178 int nExcitations() { return int(excitations.size()); }
0179
0180 private:
0181
0182
0183 RopeDipoleEnd d1, d2;
0184
0185
0186 Vec4 b1, b2;
0187
0188
0189 int iSub;
0190
0191
0192 RotBstMatrix rotFrom, rotTo;
0193 bool hasRotFrom, hasRotTo;
0194
0195
0196 vector<OverlappingRopeDipole> overlaps;
0197
0198
0199 map<double, Particle*> excitations;
0200
0201 bool isHadronized;
0202 Logger* loggerPtr;
0203
0204 };
0205
0206
0207
0208
0209
0210
0211 class Ropewalk : public StringInteractions {
0212
0213 public:
0214
0215
0216 Ropewalk() : r0(), m0(), pTcut(),
0217 shoveJunctionStrings(),
0218 shoveMiniStrings(), shoveGluonLoops(), mStringMin(), limitMom(), rCutOff(),
0219 gAmplitude(), gExponent(), deltay(), deltat(), tShove(), tInit(),
0220 showerCut(), alwaysHighest() {}
0221
0222
0223 virtual bool init();
0224
0225
0226 bool extractDipoles(Event& event, ColConfig& colConfig);
0227
0228
0229 bool calculateOverlaps();
0230
0231
0232
0233 double getKappaHere(int e1, int e2, double yfrac);
0234
0235
0236 double multiplicity(double p, double q) {
0237 return ( p < 0 || q < 0 || p + q == 0 )
0238 ? 0.0 : 0.5 * (p + 1) * (q + 1) * (p + q + 2);
0239 }
0240
0241
0242
0243 double averageKappa();
0244
0245
0246 pair<int, int> select(int m, int n, Rndm* rndm);
0247
0248
0249 void shoveTheDipoles(Event& event);
0250
0251 private:
0252
0253
0254 double r0, m0, pTcut;
0255
0256 bool shoveJunctionStrings;
0257
0258 bool shoveMiniStrings;
0259
0260 bool shoveGluonLoops;
0261
0262 double mStringMin;
0263
0264 bool limitMom;
0265
0266 double rCutOff;
0267
0268 double gAmplitude, gExponent;
0269
0270 double deltay;
0271
0272 double deltat;
0273
0274 double tShove;
0275
0276 double tInit;
0277
0278 double showerCut;
0279
0280 bool alwaysHighest;
0281
0282
0283
0284 typedef multimap<pair<int,int>, RopeDipole> DMap;
0285 DMap dipoles;
0286
0287
0288 vector< vector<Particle> > eParticles;
0289
0290
0291 vector<pair<int, int> > states;
0292 vector<double> weights;
0293
0294
0295 Ropewalk& operator=(const Ropewalk) = delete;
0296
0297 };
0298
0299
0300
0301
0302
0303
0304 class RopeFragPars : public PhysicsBase {
0305
0306 public:
0307
0308
0309 RopeFragPars() : aIn(), adiqIn(), bIn(), rhoIn(), xIn(),
0310 yIn(), xiIn(), sigmaIn(), kappaIn(), aEff(), adiqEff(), bEff(),
0311 rhoEff(), xEff(), yEff(), xiEff(), sigmaEff(), kappaEff(),
0312 beta() {}
0313
0314
0315 bool init();
0316
0317
0318
0319 map<string,double> getEffectiveParameters(double h);
0320
0321 private:
0322
0323
0324 static const double DELTAA, ACONV, ZCUT;
0325
0326
0327 double getEffectiveA(double thisb, double mT2, bool isDiquark);
0328
0329
0330 bool calculateEffectiveParameters(double h);
0331
0332
0333 bool insertEffectiveParameters(double h);
0334
0335
0336 double aEffective(double aOrig, double thisb, double mT2);
0337
0338
0339 double fragf(double z, double a, double b, double mT2);
0340
0341
0342 double integrateFragFun(double a, double b, double mT2);
0343
0344
0345 double trapIntegrate(double a, double b, double mT2, double sOld, int n);
0346
0347
0348 map<double, map<string, double> > parameters;
0349
0350
0351 map<double, double> aMap;
0352
0353
0354 map<double, double> aDiqMap;
0355
0356
0357 double aIn, adiqIn, bIn, rhoIn, xIn, yIn, xiIn, sigmaIn, kappaIn;
0358
0359
0360 double aEff, adiqEff, bEff, rhoEff, xEff, yEff, xiEff, sigmaEff, kappaEff;
0361
0362
0363 double beta;
0364
0365 };
0366
0367
0368
0369
0370
0371
0372
0373
0374 class FlavourRope : public FragmentationModifierBase {
0375
0376 public:
0377
0378
0379 FlavourRope(Ropewalk & rwIn) : rwPtr(&rwIn), ePtr(), doBuffon(),
0380 rapiditySpan(), stringProtonRatio(), fixedKappa(), h() {}
0381
0382
0383 virtual bool init() override {
0384
0385
0386 ePtr = nullptr;
0387 h = parm("Ropewalk:presetKappa");
0388 fixedKappa = flag("Ropewalk:setFixedKappa");
0389 doBuffon = flag("Ropewalk:doBuffon");
0390 rapiditySpan = parm("Ropewalk:rapiditySpan");
0391 stringProtonRatio = parm("Ropewalk:stringProtonRatio");
0392
0393 fp.init();
0394 return true;
0395 }
0396
0397
0398 bool doChangeFragPar(StringFlav* flavPtr, StringZ* zPtr,
0399 StringPT * pTPtr, double m2Had, vector<int> iParton, int endId) override;
0400
0401
0402 void setEnhancement(double hIn) { h = hIn;}
0403
0404
0405 void setEventPtr(Event& event) { ePtr = &event;}
0406
0407
0408
0409 virtual bool initEvent(Event& event, ColConfig& colConfig) override;
0410
0411 protected:
0412
0413 virtual void onInitInfoPtr() override {
0414 registerSubObject(fp);
0415 }
0416
0417 private:
0418
0419
0420
0421 map<string, double> fetchParameters(double m2Had, vector<int> iParton,
0422 int endId);
0423
0424 map<string, double> fetchParametersBuffon(double m2Had, vector<int> iParton,
0425 int endId);
0426
0427
0428 Ropewalk* rwPtr;
0429
0430
0431 Event* ePtr;
0432
0433
0434 RopeFragPars fp;
0435
0436
0437 bool doBuffon;
0438
0439
0440 double rapiditySpan, stringProtonRatio;
0441
0442
0443 vector<int> hadronized;
0444
0445
0446 bool fixedKappa;
0447
0448
0449 double h;
0450
0451 };
0452
0453
0454
0455
0456
0457 class RopewalkShover : public StringRepulsionBase {
0458
0459 public:
0460
0461
0462 friend class RopeWalk;
0463
0464
0465 RopewalkShover(Ropewalk & rwIn) : rwPtr(&rwIn) {}
0466
0467
0468 virtual ~RopewalkShover() {};
0469
0470 virtual bool stringRepulsion(Event & event, ColConfig & colConfig);
0471
0472 private:
0473
0474
0475 Ropewalk * rwPtr;
0476
0477 };
0478
0479
0480
0481 }
0482
0483 #endif