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"
40 ColourDipole(
int colIn = 0,
int iColIn = 0,
int iAcolIn = 0,
41 int colReconnectionIn = 0,
bool isJunIn =
false,
bool isAntiJunIn =
false,
42 bool isActiveIn =
true,
bool isRealIn =
false) : col(colIn), iCol(iColIn),
43 iAcol(iAcolIn), colReconnection(colReconnectionIn), isJun(isJunIn),
44 isAntiJun(isAntiJunIn),isActive(isActiveIn), isReal(isRealIn)
45 {leftDip = 0; rightDip = 0; iColLeg = 0; iAcolLeg = 0; printed =
false;
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;
57 vector<ColourDipole *> colDips, acolDips;
75 for(
int i = 0;i < 3;++i) {
76 dips[i] = 0; dipsOrig[i] = 0;}
79 for(
int i = 0;i < 3;++i) {
80 dips[i] = ju.dips[i]; dipsOrig[i] = ju.dipsOrig[i];}
83 this->Junction::operator=(ju);
84 for(
int i = 0;i < 3;++i) {
85 dips[i] = ju.dips[i]; dipsOrig[i] = ju.dipsOrig[i];
91 void setColDip(
int i,
ColourDipole * dip) {dips[i] = dip;}
110 double lambdaDiffIn = 0) {
111 dips.push_back(dip1In); dips.push_back(dip2In);
112 dips.push_back(dip3In); dips.push_back(dip4In);
113 mode = modeIn; lambdaDiff = lambdaDiffIn;
117 cout <<
"mode: " << mode <<
" " <<
"lambdaDiff: " << lambdaDiff << endl;
118 for (
int i = 0;i < int(dips.size()) && dips[i] != 0;++i) {
119 cout <<
" "; dips[i]->list(); }
122 vector<ColourDipole*> dips;
140 vector<vector<ColourDipole *> > dips;
141 vector<bool> colEndIncluded, acolEndIncluded;
142 vector<ColourDipole *> activeDips;
148 void listActiveDips();
173 {beamAPtr = beamAPtrIn; beamBPtr = beamBPtrIn;}
176 bool next(
Event & event,
int oldSize);
181 static const double MINIMUMGAIN, MINIMUMGAINJUN, HBAR, TINYP1P2;
182 static const int MAXRECONNECTIONS;
185 bool allowJunctions, sameNeighbourCol, singleReconOnly, lowerLambdaOnly;
186 int nSys, nReconCols, swap1, swap2, reconnectMode, flipMode,
188 double eCM, sCM, pT0, pT20Rec, pT0Ref, ecmRef, ecmPow, reconnectRange,
189 m0, m0sqr, m2Lambda, fracGluon, dLambdaCut, timeDilationPar,
190 timeDilationParGeV, tfrag, blowR, blowT, rHadron, kI;
193 vector<ColourDipole*> dipoles, usedDipoles;
194 vector<ColourJunction> junctions;
195 vector<ColourParticle> particles;
196 vector<TrialReconnection> junTrials, dipTrials;
197 vector<vector<int> > iColJun;
198 map<int,double> formationTimes;
223 bool nextNew(
Event & event,
int oldSize);
229 void setupDipoles(
Event& event,
int iFirst = 0);
233 bool setupDone =
false);
237 bool getJunctionIndices(
ColourDipole* dip,
int &iJun,
int &i0,
int &i1,
238 int &i2,
int &junLeg0,
int &junLeg1,
int &junLeg2);
241 void makeAllPseudoParticles(
Event & event,
int iFirst = 0);
244 void updateEvent(
Event& event,
int iFirst = 0);
247 vector<ColourDipole*> & dips);
250 double calculateStringLength(
int i,
int j);
254 double calculateJunctionLength(
int i,
int j,
int k);
259 double calculateDoubleJunctionLength(
int i,
int j,
int k,
int l);
264 bool findJunctionParticles(
int iJun, vector<int>& iParticles,
265 vector<bool> &usedJuns,
int &nJuns, vector<ColourDipole*> &dips);
281 void listAllChains();
284 void listDipoles(
bool onlyActive =
false,
bool onlyReal =
false);
287 void listParticles();
290 void listJunctions();
296 void checkRealDipoles(
Event& event,
int iFirst);
310 bool checkJunctionTrials();
332 void updateDipoleTrials();
335 void updateJunctionTrials();
342 bool checkTimeDilation(
Vec4 p1,
Vec4 p2,
double t1,
double t2);
348 void addJunctionIndices(
int iSinglePar, vector<int> &iPar,
349 vector<int> &usedJuncs);
352 void setupFormationTimes(
Event & event);
355 double getJunctionMass(
Event & event,
int col);
358 void addJunctionIndices(
Event & event,
int iSinglePar,
359 vector<int> &iPar, vector<int> &usedJuncs);
362 bool reconnectMPIs(
Event& event,
int oldSize);
367 vector<int> iReduceCol, iExpandCol;
371 vector<double> lambdaijMove;
374 double lambda12Move(
int i,
int j) {
375 int iAC = iReduceCol[i];
int jAC = iReduceCol[j];
376 return lambdaijMove[nColMove * min( iAC, jAC) + max( iAC, jAC)];
380 double lambda123Move(
int i,
int j,
int k) {
381 int iAC = iReduceCol[i];
int jAC = iReduceCol[j];
int kAC = iReduceCol[k];
382 return lambdaijMove[nColMove * min( iAC, jAC) + max( iAC, jAC)]
383 + lambdaijMove[nColMove * min( iAC, kAC) + max( iAC, kAC)]
384 - lambdaijMove[nColMove * min( jAC, kAC) + max( jAC, kAC)];
388 bool reconnectMove(
Event& event,
int oldSize);
391 bool reconnectTypeCommon(
Event& event,
int oldSize);
394 map<double,pair<int,int> > reconnectTypeI(
Event& event,
395 vector<vector<ColourDipole> > &dips,
Vec4 decays[2]);
399 map<double,pair<int,int> > reconnectTypeII(
Event& event,
400 vector<vector<ColourDipole> > &dips,
Vec4 decays[2]);
404 double determinant3(vector<vector< double> >& vec);
411 #endif // Pythia8_ColourReconnection_H