15 #ifndef Pythia8_Ropewalk_H
16 #define Pythia8_Ropewalk_H
18 #include "Pythia8/Basics.h"
19 #include "Pythia8/Event.h"
20 #include "Pythia8/FragmentationSystems.h"
21 #include "Pythia8/Info.h"
22 #include "Pythia8/ParticleData.h"
23 #include "Pythia8/Settings.h"
24 #include "Pythia8/PythiaStdlib.h"
25 #include "Pythia8/StringInteractions.h"
40 RopeDipoleEnd() : e(NULL), ne(-1) { }
41 RopeDipoleEnd(
Event* eIn,
int neIn) : e(eIn), ne(neIn) { }
44 Particle* getParticlePtr() {
if (!e)
return NULL;
return &(*e)[ne]; }
47 int getNe() {
return ne;}
50 double labrap() {
return getParticlePtr()->y(); }
51 double rap(
double m0){
return getParticlePtr()->y(m0); }
52 double rap(
double m0, RotBstMatrix& r) {
return getParticlePtr()->y(m0, r); }
70 class OverlappingRopeDipole {
75 OverlappingRopeDipole(RopeDipole* d,
double m0, RotBstMatrix& r);
78 bool overlap(
double y, Vec4 ba,
double r0);
109 RopeDipole(RopeDipoleEnd d1In, RopeDipoleEnd d2In,
int iSubIn,
113 void addExcitation(
double ylab, Particle* ex);
116 RopeDipoleEnd* d1Ptr() {
return &d1; }
117 RopeDipoleEnd* d2Ptr() {
return &d2; }
120 RotBstMatrix getDipoleRestFrame();
121 RotBstMatrix getDipoleLabFrame();
124 Vec4 dipoleMomentum();
127 Vec4 bInterpolateDip(
double y,
double m0);
129 Vec4 bInterpolateLab(
double y,
double m0);
131 Vec4 bInterpolate(
double y, RotBstMatrix
rb,
double m0);
135 pair<int, int> getOverlaps(
double yfrac,
double m0,
double r0);
138 void addOverlappingDipole(OverlappingRopeDipole& d) {
139 overlaps.push_back(d); }
142 double maxRapidity(
double m0) {
return (max(d1.rap(m0), d2.rap(m0))); }
143 double minRapidity(
double m0) {
return (min(d1.rap(m0), d2.rap(m0))); }
146 double maxRapidity(
double m0, RotBstMatrix& r) {
return (max(d1.rap(m0,r),
148 double minRapidity(
double m0, RotBstMatrix& r) {
return (min(d1.rap(m0,r),
152 void propagateInit(
double deltat);
155 void propagate(
double deltat,
double m0);
158 void splitMomentum(Vec4 mom, Particle* p1, Particle* p2,
double frac = 0.5);
161 void excitationsToString(
double m0,
Event& event);
164 bool hadronized() {
return isHadronized; }
167 int index() {
return iSub; }
172 bool recoil(Vec4& pg,
bool dummy =
false);
175 void hadronized(
bool h) { isHadronized = h; }
178 int nExcitations() {
return int(excitations.size()); }
183 RopeDipoleEnd d1, d2;
192 RotBstMatrix rotFrom, rotTo;
193 bool hasRotFrom, hasRotTo;
196 vector<OverlappingRopeDipole> overlaps;
199 map<double, Particle*> excitations;
211 class Ropewalk :
public StringInteractions {
216 Ropewalk() : r0(), m0(), pTcut(),
217 shoveJunctionStrings(),
218 shoveMiniStrings(), shoveGluonLoops(), mStringMin(), limitMom(), rCutOff(),
219 gAmplitude(), gExponent(), deltay(), deltat(), tShove(), tInit(),
220 showerCut(), alwaysHighest() {}
226 bool extractDipoles(
Event& event, ColConfig& colConfig);
229 bool calculateOverlaps();
233 double getKappaHere(
int e1,
int e2,
double yfrac);
236 double multiplicity(
double p,
double q) {
237 return ( p < 0 || q < 0 || p + q == 0 )
238 ? 0.0 : 0.5 * (p + 1) * (q + 1) * (p + q + 2);
243 double averageKappa();
246 pair<int, int> select(
int m,
int n, Rndm* rndm);
249 void shoveTheDipoles(
Event& event);
254 double r0, m0, pTcut;
256 bool shoveJunctionStrings;
258 bool shoveMiniStrings;
260 bool shoveGluonLoops;
268 double gAmplitude, gExponent;
284 typedef multimap<pair<int,int>, RopeDipole> DMap;
288 vector< vector<Particle> > eParticles;
291 vector<pair<int, int> > states;
292 vector<double> weights;
295 Ropewalk& operator=(
const Ropewalk) =
delete;
304 class RopeFragPars :
public PhysicsBase {
309 RopeFragPars() : aIn(), adiqIn(), bIn(), rhoIn(), xIn(),
310 yIn(), xiIn(), sigmaIn(), kappaIn(), aEff(), adiqEff(), bEff(),
311 rhoEff(), xEff(), yEff(), xiEff(), sigmaEff(), kappaEff(),
319 map<string,double> getEffectiveParameters(
double h);
324 static const double DELTAA, ACONV, ZCUT;
327 double getEffectiveA(
double thisb,
double mT2,
bool isDiquark);
330 bool calculateEffectiveParameters(
double h);
333 bool insertEffectiveParameters(
double h);
336 double aEffective(
double aOrig,
double thisb,
double mT2);
339 double fragf(
double z,
double a,
double b,
double mT2);
342 double integrateFragFun(
double a,
double b,
double mT2);
345 double trapIntegrate(
double a,
double b,
double mT2,
double sOld,
int n);
348 map<double, map<string, double> > parameters;
351 map<double, double> aMap;
354 map<double, double> aDiqMap;
357 double aIn, adiqIn, bIn, rhoIn, xIn, yIn, xiIn, sigmaIn, kappaIn;
360 double aEff, adiqEff, bEff, rhoEff, xEff, yEff, xiEff, sigmaEff, kappaEff;
374 class FlavourRope :
public FragmentationModifierBase {
379 FlavourRope(Ropewalk & rwIn) : rwPtr(&rwIn), ePtr(), doBuffon(),
380 rapiditySpan(), stringProtonRatio(), fixedKappa(), h() {}
383 virtual bool init()
override {
387 h = parm(
"Ropewalk:presetKappa");
388 fixedKappa = flag(
"Ropewalk:setFixedKappa");
389 doBuffon = flag(
"Ropewalk:doBuffon");
390 rapiditySpan = parm(
"Ropewalk:rapiditySpan");
391 stringProtonRatio = parm(
"Ropewalk:stringProtonRatio");
398 bool doChangeFragPar(StringFlav* flavPtr, StringZ* zPtr,
399 StringPT * pTPtr,
double m2Had, vector<int> iParton,
int endId)
override;
402 void setEnhancement(
double hIn) { h = hIn;}
405 void setEventPtr(
Event& event) { ePtr = &event;}
409 virtual bool initEvent(
Event& event, ColConfig& colConfig)
override;
413 virtual void onInitInfoPtr()
override {
414 registerSubObject(fp);
421 map<string, double> fetchParameters(
double m2Had, vector<int> iParton,
424 map<string, double> fetchParametersBuffon(
double m2Had, vector<int> iParton,
440 double rapiditySpan, stringProtonRatio;
443 vector<int> hadronized;
462 friend class RopeWalk;
470 virtual bool stringRepulsion(
Event & event,
ColConfig & colConfig);
481 #endif // Pythia8_Ropewalk_H