11 #ifndef Pythia8_ColourReconnection_H 12 #define Pythia8_ColourReconnection_H 14 #include "Pythia8/Basics.h" 15 #include "Pythia8/BeamParticle.h" 16 #include "Pythia8/Event.h" 17 #include "Pythia8/FragmentationFlavZpT.h" 18 #include "Pythia8/Info.h" 19 #include "Pythia8/ParticleData.h" 20 #include "Pythia8/StringFragmentation.h" 21 #include "Pythia8/PartonDistributions.h" 22 #include "Pythia8/PartonSystems.h" 23 #include "Pythia8/PythiaStdlib.h" 24 #include "Pythia8/Settings.h" 25 #include "Pythia8/StringLength.h" 26 #include "Pythia8/StringInteractions.h" 42 int colReconnectionIn = 0,
bool isJunIn =
false,
bool isAntiJunIn =
false,
43 bool isActiveIn =
true,
bool isRealIn =
false) :
col(colIn), iCol(iColIn),
44 iAcol(iAcolIn), colReconnection(colReconnectionIn), isJun(isJunIn),
45 isAntiJun(isAntiJunIn),isActive(isActiveIn), isReal(isRealIn)
46 {iColLeg = 0; iAcolLeg = 0; printed =
false; p1p2 = 0.;}
48 double mDip(
Event & event) {
49 if (isJun || isAntiJun)
return 1E9;
50 else return m(event[iCol].p(),event[iAcol].p());
54 int col, iCol, iAcol, iColLeg, iAcolLeg, colReconnection;
55 bool isJun, isAntiJun, isActive, isReal, printed;
56 weak_ptr<ColourDipole> leftDip{}, rightDip{};
57 vector<weak_ptr<ColourDipole> > colDips, acolDips;
62 int ciCol{-1}, ciAcol{-1};
63 bool pCalculated{
false};
72 inline bool operator<(
const ColourDipolePtr& d1,
const ColourDipolePtr& d2) {
73 return ( d1 && d2 ? d1->index < d2->index : !d1 );}
87 dipsOrig() {
for(
int i = 0;i < 3;++i) {
88 dips[i] = ju.dips[i]; dipsOrig[i] = ju.dipsOrig[i];}
91 this->Junction::operator=(ju);
92 for(
int i = 0;i < 3;++i) {
93 dips[i] = ju.dips[i]; dipsOrig[i] = ju.dipsOrig[i];
98 ColourDipolePtr getColDip(
int i) {
return dips[i];}
99 void setColDip(
int i, ColourDipolePtr dip) {dips[i] = dip;}
100 ColourDipolePtr dips[3];
101 ColourDipolePtr dipsOrig[3];
117 ColourDipolePtr dip3In = 0, ColourDipolePtr dip4In = 0,
int modeIn = 0,
118 double lambdaDiffIn = 0) {
119 dips.push_back(dip1In); dips.push_back(dip2In);
120 dips.push_back(dip3In); dips.push_back(dip4In);
121 mode = modeIn; lambdaDiff = lambdaDiffIn;
125 cout <<
"mode: " << mode <<
" " <<
"lambdaDiff: " << lambdaDiff << endl;
126 for (
int i = 0;i < int(dips.size()) && dips[i] != 0;++i) {
127 cout <<
" "; dips[i]->list(); }
130 vector<ColourDipolePtr> dips;
148 vector<vector<ColourDipolePtr> > dips;
149 vector<bool> colEndIncluded, acolEndIncluded;
150 vector<ColourDipolePtr> activeDips;
156 void listActiveDips();
173 singleReconOnly(), lowerLambdaOnly(), allowDiqJunCR(), nSys(),
174 nReconCols(), swap1(), swap2(), reconnectMode(), flipMode(),
175 timeDilationMode(), eCM(), sCM(), pT0(), pT20Rec(), pT0Ref(), ecmRef(),
176 ecmPow(), reconnectRange(), m0(), mPseudo(), m2Lambda(), fracGluon(),
177 dLambdaCut(), timeDilationPar(), timeDilationParGeV(), tfrag(), blowR(),
178 blowT(), rHadron(), kI(), dipMaxDist(), nColMove() {}
185 {beamAPtr = beamAPtrIn; beamBPtr = beamBPtrIn;}
188 bool next(
Event & event,
int oldSize);
193 static const double MINIMUMGAIN, MINIMUMGAINJUN, TINYP1P2;
194 static const int MAXRECONNECTIONS;
197 bool allowJunctions, sameNeighbourCol, singleReconOnly, lowerLambdaOnly;
199 int nSys, nReconCols, swap1, swap2, reconnectMode, flipMode,
201 double eCM, sCM, pT0, pT20Rec, pT0Ref, ecmRef, ecmPow, reconnectRange,
202 m0, mPseudo, m2Lambda, fracGluon, dLambdaCut, timeDilationPar,
203 timeDilationParGeV, tfrag, blowR, blowT, rHadron, kI;
207 vector<ColourDipolePtr> dipoles, usedDipoles;
213 void addDipole(
int colIn = 0,
int iColIn = 0,
int iAcolIn = 0,
214 int colReconnectionIn = 0,
bool isJunIn =
false,
bool isAntiJunIn =
false,
215 bool isActiveIn =
true,
bool isRealIn =
false) {
216 dipoles.push_back(make_shared<ColourDipole>(colIn, iColIn, iAcolIn,
217 colReconnectionIn, isJunIn, isAntiJunIn, isActiveIn, isRealIn));
218 dipoles.back()->index = ++dipoleIndex;
223 dipoles.push_back(make_shared<ColourDipole>(dipole));
224 dipoles.back()->index = ++dipoleIndex;
228 vector<ColourJunction> junctions;
229 vector<ColourParticle> particles;
230 vector<TrialReconnection> junTrials, dipTrials;
231 vector<vector<int> > iColJun;
232 vector<double> formationTimes;
241 bool nextNew(
Event & event,
int oldSize);
244 void swapDipoles(ColourDipolePtr& dip1, ColourDipolePtr& dip2,
248 void setupDipoles(
Event& event,
int iFirst = 0);
251 void makePseudoParticle(ColourDipolePtr& dip,
int status,
252 bool setupDone =
false);
256 bool getJunctionIndices(
const ColourDipolePtr& dip,
int &iJun,
int &i0,
257 int &i1,
int &i2,
int &junLeg0,
int &junLeg1,
int &junLeg2)
const;
260 void makeAllPseudoParticles(
Event & event,
int iFirst = 0);
263 void updateEvent(
Event& event,
int iFirst = 0);
265 double calculateStringLength(
const ColourDipolePtr& dip,
266 vector<ColourDipolePtr> & dips);
269 double calculateStringLength(
int i,
int j)
const;
273 double calculateJunctionLength(
const int i,
const int j,
const int k)
const;
278 double calculateDoubleJunctionLength(
const int i,
const int j,
const int k,
284 bool findJunctionParticles(
int iJun, vector<int>& iParticles,
285 vector<bool> &usedJuns,
int &nJuns, vector<ColourDipolePtr> &dips);
288 void singleReconnection( ColourDipolePtr& dip1, ColourDipolePtr& dip2);
291 void singleJunction(ColourDipolePtr& dip1, ColourDipolePtr& dip2);
294 void singleJunction(
const ColourDipolePtr& dip1,
const ColourDipolePtr& dip2,
295 const ColourDipolePtr& dip3);
298 void listChain(ColourDipolePtr& dip);
301 void listAllChains();
304 void listDipoles(
bool onlyActive =
false,
bool onlyReal =
false)
const;
307 void listParticles()
const;
310 void listJunctions()
const;
316 void checkRealDipoles(
Event& event,
int iFirst);
319 double mDip(
const ColourDipolePtr& dip)
const;
324 Vec4 getVProd(
const ColourDipolePtr& dip,
bool anti)
const;
328 Vec4 getVProd(
int iJun,
const ColourDipolePtr& dip,
bool anti)
const;
332 bool checkDist(
const ColourDipolePtr& dip1,
const ColourDipolePtr& dip2)
337 bool findAntiNeighbour(ColourDipolePtr& dip);
341 bool findColNeighbour(ColourDipolePtr& dip);
344 bool checkJunctionTrials();
359 double getLambdaDiff(
const ColourDipolePtr& dip1,
360 const ColourDipolePtr& dip2,
const ColourDipolePtr& dip3,
361 const ColourDipolePtr& dip4,
const int mode)
const;
364 double getLambdaDiff(ColourDipolePtr& dip1, ColourDipolePtr& dip2);
367 void updateDipoleTrials();
370 void updateJunctionTrials();
373 bool checkTimeDilation(
const ColourDipolePtr& dip1 = 0,
374 const ColourDipolePtr& dip2 = 0,
const ColourDipolePtr& dip3 = 0,
375 const ColourDipolePtr& dip4 = 0)
const;
378 bool checkTimeDilation(
const Vec4& p1,
const Vec4& p2,
const double t1,
379 const double t2)
const;
382 Vec4 getDipoleMomentum(
const ColourDipolePtr& dip)
const;
385 void addJunctionIndices(
const int iSinglePar, set<int> &iPar,
386 set<int> &usedJuncs)
const;
389 void setupFormationTimes(
Event & event);
392 double getJunctionMass(
Event & event,
int col);
395 void addJunctionIndices(
const Event & event,
const int iSinglePar,
396 set<int> &iPar, set<int> &usedJuncs)
const;
399 bool reconnectMPIs(
Event& event,
int oldSize);
404 vector<int> iReduceCol, iExpandCol;
408 vector<double> lambdaijMove;
411 double lambda12Move(
int i,
int j) {
412 int iAC = iReduceCol[i];
int jAC = iReduceCol[j];
413 return lambdaijMove[nColMove * min( iAC, jAC) + max( iAC, jAC)];
417 double lambda123Move(
int i,
int j,
int k) {
418 int iAC = iReduceCol[i];
int jAC = iReduceCol[j];
int kAC = iReduceCol[k];
419 return lambdaijMove[nColMove * min( iAC, jAC) + max( iAC, jAC)]
420 + lambdaijMove[nColMove * min( iAC, kAC) + max( iAC, kAC)]
421 - lambdaijMove[nColMove * min( jAC, kAC) + max( jAC, kAC)];
425 bool reconnectMove(
Event& event,
int oldSize);
428 bool reconnectTypeCommon(
Event& event,
int oldSize);
431 map<double,pair<int,int> > reconnectTypeI(
Event& event,
432 vector<vector<ColourDipole> > &dips,
Vec4 decays[2]);
436 map<double,pair<int,int> > reconnectTypeII(
Event& event,
437 vector<vector<ColourDipole> > &dips,
Vec4 decays[2]);
441 double determinant3(vector<vector< double> >& vec);
void list() const
Printing function, mainly intended for debugging.
Definition: ColourReconnection.cc:38
Definition: ColourReconnection.h:36
TrialReconnection class.
Definition: ColourReconnection.h:112
The Event class holds all info on the generated event.
Definition: Event.h:453
Definition: BeamParticle.h:133
void reassignBeamPtrs(BeamParticle *beamAPtrIn, BeamParticle *beamBPtrIn)
New beams possible for handling of hard diffraction.
Definition: ColourReconnection.h:184
Definition: StringFragmentation.h:119
int col
Members.
Definition: ColourReconnection.h:54
Definition: StringInteractions.h:78
ColourDipole(int colIn=0, int iColIn=0, int iAcolIn=0, int colReconnectionIn=0, bool isJunIn=false, bool isAntiJunIn=false, bool isActiveIn=true, bool isRealIn=false)
Constructor.
Definition: ColourReconnection.h:41
StringLength class. It is used to calculate the lambda measure.
Definition: StringLength.h:23
Pythia8::Vec4 dipoleMomentum
Information for caching dipole momentum.
Definition: ColourReconnection.h:61
ColourParticle class.
Definition: ColourReconnection.h:142
Definition: ColourReconnection.h:80
The ColourReconnection class handles the colour reconnection.
Definition: ColourReconnection.h:167
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
double m(const Vec4 &v1)
Invariant mass and its square.
Definition: Basics.cc:595
bool operator<(const ColourDipolePtr &d1, const ColourDipolePtr &d2)
Comparison operator by index for two dipole pointers.
Definition: ColourReconnection.h:72
ColourReconnection()
Constructor.
Definition: ColourReconnection.h:172