8 #include "HadronLevel.h"
22 const double HadronLevel::JJSTRINGM2MAX = 25.;
23 const double HadronLevel::JJSTRINGM2FRAC = 0.1;
26 const double HadronLevel::CONVJNREST = 1e-5;
27 const int HadronLevel::NTRYJNREST = 20;
30 const double HadronLevel::MTHAD = 0.9;
36 bool HadronLevel::init(Info* infoPtrIn, Settings& settings,
37 ParticleData* particleDataPtrIn, Rndm* rndmPtrIn,
38 Couplings* couplingsPtrIn, TimeShower* timesDecPtr,
39 RHadrons* rHadronsPtrIn, DecayHandler* decayHandlePtr,
40 vector<int> handledParticles) {
44 particleDataPtr = particleDataPtrIn;
46 couplingsPtr = couplingsPtrIn;
47 rHadronsPtr = rHadronsPtrIn;
50 doHadronize = settings.flag(
"HadronLevel:Hadronize");
51 doDecay = settings.flag(
"HadronLevel:Decay");
52 doBoseEinstein = settings.flag(
"HadronLevel:BoseEinstein");
55 mStringMin = settings.parm(
"HadronLevel:mStringMin");
58 eNormJunction = settings.parm(
"StringFragmentation:eNormJunction");
61 allowRH = settings.flag(
"RHadrons:allow");
64 widthSepBE = settings.parm(
"BoseEinstein:widthSep");
67 doHadronScatter = settings.flag(
"HadronScatter:scatter");
68 hsAfterDecay = settings.flag(
"HadronScatter:afterDecay");
71 flavSel.init(settings, rndmPtr);
72 pTSel.init(settings, *particleDataPtr, rndmPtr);
73 zSel.init(settings, *particleDataPtr, rndmPtr);
76 colConfig.init(infoPtr, settings, &flavSel);
79 stringFrag.init(infoPtr, settings, particleDataPtr, rndmPtr,
80 &flavSel, &pTSel, &zSel);
81 ministringFrag.init(infoPtr, settings, particleDataPtr, rndmPtr,
82 &flavSel, &pTSel, &zSel);
85 decays.init(infoPtr, settings, particleDataPtr, rndmPtr, couplingsPtr,
86 timesDecPtr, &flavSel, decayHandlePtr, handledParticles);
89 boseEinstein.init(infoPtr, settings, *particleDataPtr);
93 hadronScatter.init(infoPtr, settings, rndmPtr, particleDataPtr);
96 useHiddenValley = hiddenvalleyFrag.init(infoPtr, settings,
97 particleDataPtr, rndmPtr);
100 rHadronsPtr->fragPtrs( &flavSel, &zSel);
111 bool HadronLevel::next(
Event& event) {
114 if (useHiddenValley) hiddenvalleyFrag.fragment(event);
117 if (!decayOctetOnia(event))
return false;
121 bool moreToDo, firstPass =
true;
122 bool doBoseEinsteinNow = doBoseEinstein;
130 if (!findSinglets( event))
return false;
133 if (allowRH && !rHadronsPtr->produce( colConfig, event))
137 for (
int iSub = 0; iSub < colConfig.size(); ++iSub) {
140 colConfig.collect(iSub, event);
143 if ( colConfig[iSub].massExcess > mStringMin ) {
144 if (!stringFrag.fragment( iSub, colConfig, event))
return false;
148 bool isDiff = infoPtr->isDiffractiveA()
149 || infoPtr->isDiffractiveB();
150 if (!ministringFrag.fragment( iSub, colConfig, event, isDiff))
157 if (doHadronScatter && !hsAfterDecay && firstPass)
158 hadronScatter.scatter(event);
166 Particle& decayer =
event[iDec];
167 if ( decayer.isFinal() && decayer.canDecay() && decayer.mayDecay()
168 && (decayer.mWidth() > widthSepBE || decayer.idAbs() == 311) ) {
169 decays.decay( iDec, event);
170 if (decays.moreToDo()) moreToDo =
true;
172 }
while (++iDec < event.size());
176 if (doHadronScatter && hsAfterDecay && firstPass)
177 hadronScatter.scatter(event);
180 if (doBoseEinsteinNow) {
181 if (!boseEinstein.shiftEvent(event))
return false;
182 doBoseEinsteinNow =
false;
191 Particle& decayer =
event[iDec];
192 if ( decayer.isFinal() && decayer.canDecay() && decayer.mayDecay() ) {
193 decays.decay( iDec, event);
194 if (decays.moreToDo()) moreToDo =
true;
196 }
while (++iDec < event.size());
212 bool HadronLevel::moreDecays(
Event& event) {
215 if (!decayOctetOnia(event))
return false;
220 if ( event[iDec].isFinal() && event[iDec].canDecay()
221 && event[iDec].mayDecay() ) decays.decay( iDec, event);
222 }
while (++iDec < event.size());
233 bool HadronLevel::decayOctetOnia(
Event& event) {
236 int idOnium[6] = { 9900443, 9900441, 9910441,
237 9900553, 9900551, 9910551 };
240 for (
int iDec = 0; iDec <
event.size(); ++iDec)
241 if (event[iDec].isFinal()) {
242 int id =
event[iDec].id();
243 bool isOnium =
false;
244 for (
int j = 0; j < 6; ++j)
if (
id == idOnium[j]) isOnium =
true;
248 if (!decays.decay( iDec, event))
return false;
251 int iGlu =
event.size() - 1;
252 event[iGlu].cols( event[iDec].col(), event[iDec].acol() );
265 bool HadronLevel::findSinglets(
Event& event) {
270 iColAndAcol.resize(0);
271 for (
int i = 0; i <
event.size(); ++i)
if (event[i].isFinal()) {
272 if (event[i].col() > 0 &&
event[i].acol() > 0) iColAndAcol.push_back(i);
273 else if (event[i].col() > 0) iColEnd.push_back(i);
274 else if (event[i].acol() > 0) iAcolEnd.push_back(i);
279 iPartonJun.resize(0);
280 iPartonAntiJun.resize(0);
283 for (
int iJun = 0; iJun <
event.sizeJunction(); ++iJun)
284 if (event.remainsJunction(iJun)) {
285 event.remainsJunction(iJun,
false);
286 int kindJun =
event.kindJunction(iJun);
290 for (
int iCol = 0; iCol < 3; ++iCol) {
291 int indxCol =
event.colJunction(iJun, iCol);
292 iParton.push_back( -(10 + 10 * iJun + iCol) );
294 if (kindJun % 2 == 1 && !traceFromAcol(indxCol, event, iJun, iCol))
297 if (kindJun % 2 == 0 && !traceFromCol(indxCol, event, iJun, iCol))
303 for (
unsigned int i=0; i<iParton.size(); ++i)
if (iParton[i]<0) ++nJun;
305 infoPtr->errorMsg(
"Error in HadronLevel::findSinglets: "
306 "too many junction-junction connections");
313 for (
int i = 0; i < int(iParton.size()); ++i)
if (iParton[i] < 0)
315 if (nNeg > 3 && kindJun % 2 == 1) {
316 for (
int i = 0; i < int(iParton.size()); ++i)
317 iPartonJun.push_back(iParton[i]);
318 }
else if (nNeg > 3 && kindJun % 2 == 0) {
319 for (
int i = 0; i < int(iParton.size()); ++i)
320 iPartonAntiJun.push_back(iParton[i]);
323 int nJunOld =
event.sizeJunction();
324 if (!colConfig.insert(iParton, event))
return false;
325 if (event.sizeJunction() < nJunOld) --iJun;
331 if (iPartonJun.size() > 0 && iPartonAntiJun.size() > 0) {
332 if (!splitJunctionPair(event))
return false;
333 if (!colConfig.insert(iPartonJun, event))
return false;
334 if (iPartonAntiJun.size() > 0)
335 if (!colConfig.insert(iPartonAntiJun, event))
return false;
337 }
else if (iPartonJun.size() > 0 || iPartonAntiJun.size() > 0) {
338 infoPtr->errorMsg(
"Error in HadronLevel::findSinglets: "
339 "unmatched (anti)junction");
344 for (
int iEnd = 0; iEnd < int(iColEnd.size()); ++iEnd) {
346 iParton.push_back( iColEnd[iEnd] );
347 int indxCol =
event[ iColEnd[iEnd] ].col();
348 if (!traceFromCol(indxCol, event))
return false;
351 if (!colConfig.insert(iParton, event))
return false;
355 while (iColAndAcol.size() > 0) {
357 iParton.push_back( iColAndAcol[0] );
358 int indxCol =
event[ iColAndAcol[0] ].col();
359 int indxAcol =
event[ iColAndAcol[0] ].acol();
360 iColAndAcol[0] = iColAndAcol.back();
361 iColAndAcol.pop_back();
362 if (!traceInLoop(indxCol, indxAcol, event))
return false;
365 if (!colConfig.insert(iParton, event))
return false;
377 bool HadronLevel::traceFromCol(
int indxCol,
Event& event,
int iJun,
381 int kindJun = (iJun >= 0) ? event.kindJunction(iJun) : 0;
385 int loopMax = iColAndAcol.size() + 2;
386 bool hasFound =
false;
392 for (
int i = 0; i < int(iAcolEnd.size()); ++i)
393 if (event[ iAcolEnd[i] ].acol() == indxCol) {
394 iParton.push_back( iAcolEnd[i] );
396 iAcolEnd[i] = iAcolEnd.back();
404 for (
int i = 0; i < int(iColAndAcol.size()); ++i)
405 if (event[ iColAndAcol[i] ].acol() == indxCol) {
406 iParton.push_back( iColAndAcol[i] );
409 indxCol =
event[ iColAndAcol[i] ].col();
410 if (kindJun > 0)
event.endColJunction(iJun, iCol, indxCol);
411 iColAndAcol[i] = iColAndAcol.back();
412 iColAndAcol.pop_back();
419 if (!hasFound && kindJun % 2 == 0 && event.sizeJunction() > 1)
420 for (
int iAntiJun = 0; iAntiJun <
event.sizeJunction(); ++iAntiJun)
421 if (iAntiJun != iJun && event.kindJunction(iAntiJun) %2 == 1)
422 for (
int iColAnti = 0; iColAnti < 3; ++iColAnti)
423 if (event.endColJunction(iAntiJun, iColAnti) == indxCol) {
424 iParton.push_back( -(10 + 10 * iAntiJun + iColAnti) );
431 }
while (hasFound && indxCol > 0 && loop < loopMax);
434 if (!hasFound || loop == loopMax) {
435 infoPtr->errorMsg(
"Error in HadronLevel::traceFromCol: "
436 "colour tracing failed");
449 bool HadronLevel::traceFromAcol(
int indxCol,
Event& event,
int iJun,
453 int kindJun = (iJun >= 0) ? event.kindJunction(iJun) : 0;
457 int loopMax = iColAndAcol.size() + 2;
458 bool hasFound =
false;
464 for (
int i = 0; i < int(iColEnd.size()); ++i)
465 if (event[ iColEnd[i] ].col() == indxCol) {
466 iParton.push_back( iColEnd[i] );
468 iColEnd[i] = iColEnd.back();
476 for (
int i = 0; i < int(iColAndAcol.size()); ++i)
477 if (event[ iColAndAcol[i] ].col() == indxCol) {
478 iParton.push_back( iColAndAcol[i] );
480 indxCol =
event[ iColAndAcol[i] ].acol();
481 if (kindJun > 0)
event.endColJunction(iJun, iCol, indxCol);
482 iColAndAcol[i] = iColAndAcol.back();
483 iColAndAcol.pop_back();
490 if (!hasFound && kindJun % 2 == 1 && event.sizeJunction() > 1)
491 for (
int iAntiJun = 0; iAntiJun <
event.sizeJunction(); ++iAntiJun)
492 if (iAntiJun != iJun && event.kindJunction(iAntiJun) % 2 == 0)
493 for (
int iColAnti = 0; iColAnti < 3; ++iColAnti)
494 if (event.endColJunction(iAntiJun, iColAnti) == indxCol) {
495 iParton.push_back( -(10 + 10 * iAntiJun + iColAnti) );
502 }
while (hasFound && indxCol > 0 && loop < loopMax);
505 if (!hasFound || loop == loopMax) {
506 infoPtr->errorMsg(
"Error in HadronLevel::traceFromAcol: "
507 "colour tracing failed");
520 bool HadronLevel::traceInLoop(
int indxCol,
int indxAcol,
Event& event) {
524 int loopMax = iColAndAcol.size() + 2;
525 bool hasFound =
false;
531 for (
int i = 0; i < int(iColAndAcol.size()); ++i)
532 if (event[ iColAndAcol[i] ].acol() == indxCol) {
533 iParton.push_back( iColAndAcol[i] );
534 indxCol =
event[ iColAndAcol[i] ].col();
535 iColAndAcol[i] = iColAndAcol.back();
536 iColAndAcol.pop_back();
540 }
while (hasFound && indxCol != indxAcol && loop < loopMax);
543 if (!hasFound || loop == loopMax) {
544 infoPtr->errorMsg(
"Error in HadronLevel::traceInLoop: "
545 "colour tracing failed");
558 bool HadronLevel::splitJunctionPair(
Event& event) {
561 int identJun = (-iPartonJun[0])/10;
566 for (
int i = 0; i < int(iPartonJun.size()); ++ i) {
567 if ( (-iPartonJun[i])/10 == identJun) ++leg;
568 if (leg == 0) iJunLegA.push_back( iPartonJun[i] );
569 else if (leg == 1) iJunLegB.push_back( iPartonJun[i] );
570 else iJunLegC.push_back( iPartonJun[i] );
574 int identAnti = (-iPartonAntiJun[0])/10;
579 for (
int i = 0; i < int(iPartonAntiJun.size()); ++ i) {
580 if ( (-iPartonAntiJun[i])/10 == identAnti) ++leg;
581 if (leg == 0) iAntiLegA.push_back( iPartonAntiJun[i] );
582 else if (leg == 1) iAntiLegB.push_back( iPartonAntiJun[i] );
583 else iAntiLegC.push_back( iPartonAntiJun[i] );
588 int legJun[3], legAnti[3], nGluLeg[3];
589 if (iJunLegA.back() < 0) { legJun[nMatch] = 0;
590 legAnti[nMatch] = (-iJunLegA.back())%10; ++nMatch;}
591 if (iJunLegB.back() < 0) { legJun[nMatch] = 1;
592 legAnti[nMatch] = (-iJunLegB.back())%10; ++nMatch;}
593 if (iJunLegC.back() < 0) { legJun[nMatch] = 2;
594 legAnti[nMatch] = (-iJunLegC.back())%10; ++nMatch;}
597 for (
int iMatch = 0; iMatch < nMatch; ++iMatch) {
598 vector<int>& iJunLeg = (legJun[iMatch] == 0) ? iJunLegA
599 : ( (legJun[iMatch] == 1) ? iJunLegB : iJunLegC );
600 vector<int>& iAntiLeg = (legAnti[iMatch] == 0) ? iAntiLegA
601 : ( (legAnti[iMatch] == 1) ? iAntiLegB : iAntiLegC );
604 nGluLeg[iMatch] = iJunLeg.size() + iAntiLeg.size() - 4;
605 if (nGluLeg[iMatch] == 0)
continue;
609 for (
int i = 1; i < int(iJunLeg.size()) - 1; ++i)
610 iGluLeg.push_back( iJunLeg[i] );
611 for (
int i =
int(iAntiLeg.size()) - 2; i > 0; --i)
612 iGluLeg.push_back( iAntiLeg[i] );
619 int idQ = flavSel.pickLightQ();
623 if (iGluLeg.size() == 1) {
626 colQ =
event[ iGluLeg[0] ].col();
627 acolQ =
event[ iGluLeg[0] ].acol();
628 Vec4 pQ = 0.5 *
event[ iGluLeg[0] ].p();
629 double mQ = 0.5 *
event[ iGluLeg[0] ].m();
630 int iQ =
event.append( idQ, 75, iGluLeg[0], 0, 0, 0, colQ, 0, pQ, mQ );
631 int iQbar =
event.append( -idQ, 75, iGluLeg[0], 0, 0, 0, 0, acolQ,
635 event[ iGluLeg[0] ].statusNeg();
636 event[ iGluLeg[0] ].daughters( iQ, iQbar);
637 iJunLeg.push_back(iQ);
638 iAntiLeg.push_back(iQbar);
646 for (
int i = 0; i < int(iGluLeg.size()) - 1; ++i) {
647 double m2Now = 0.5 *
event[ iGluLeg[i] ].p()
648 *
event[ iGluLeg[i + 1] ].p();
649 m2Pair.push_back(m2Now);
654 double m2Reg = m2Sum * rndmPtr->flat();
656 do m2Reg -= m2Pair[++iReg];
657 while (m2Reg > 0. && iReg <
int(iGluLeg.size()) - 1);
658 m2Reg = m2Pair[iReg];
661 double m2Temp = min( JJSTRINGM2MAX, JJSTRINGM2FRAC * m2Reg);
665 double zTemp = zSel.zFrag( idQ, 0, m2Temp);
667 xNeg = m2Temp / (zTemp * m2Reg);
669 if (rndmPtr->flat() > 0.5) swap(xPos, xNeg);
672 Particle& gJun =
event[ iGluLeg[iReg] ];
673 Particle& gAnti =
event[ iGluLeg[iReg + 1] ];
676 int dau1 =
event.size();
677 gJun.daughters(dau1, dau1 + 3);
678 gAnti.daughters(dau1, dau1 + 3);
679 int mother1 = min( iGluLeg[iReg], iGluLeg[iReg + 1]);
680 int mother2 = max( iGluLeg[iReg], iGluLeg[iReg + 1]);
684 acolQ =
event.nextColTag();
687 int iGjun =
event.append( 21, 75, mother1, mother2, 0, 0,
688 gJun.col(), gJun.acol(), (1. - 0.5 * xPos) * gJun.p(),
689 (1. - 0.5 * xPos) * gJun.m());
690 int iGanti =
event.append( 21, 75, mother1, mother2, 0, 0,
691 acolQ, gAnti.acol(), (1. - 0.5 * xNeg) * gAnti.p(),
692 (1. - 0.5 * xNeg) * gAnti.m());
695 int iQ =
event.append( idQ, 75, mother1, mother2, 0, 0,
696 colQ, 0, 0.5 * xNeg * gAnti.p(), 0.5 * xNeg * gAnti.m() );
697 int iQbar =
event.append( -idQ, 75, mother1, mother2, 0, 0,
698 0, acolQ, 0.5 * xPos * gJun.p(), 0.5 * xPos * gJun.m() );
701 for (
int i = 0; i < iReg; ++i)
702 iJunLeg.push_back( iGluLeg[i] );
703 iJunLeg.push_back(iGjun);
704 iJunLeg.push_back(iQ);
705 for (
int i =
int(iGluLeg.size()) - 1; i > iReg + 1; --i)
706 iAntiLeg.push_back( iGluLeg[i] );
707 iAntiLeg.push_back(iGanti);
708 iAntiLeg.push_back(iQbar);
712 event.endColJunction(identJun - 1, legJun[iMatch], colQ);
713 event.endColJunction(identAnti - 1, legAnti[iMatch], acolQ);
718 while (iMatchUp < nMatch) {
719 if (nGluLeg[iMatchUp] > 0) {
720 for (
int i = iMatchUp; i < nMatch - 1; ++i) {
721 legJun[i] = legJun[i + 1];
722 legAnti[i] = legAnti[i + 1];
723 nGluLeg[i] = nGluLeg[i + 1];
730 infoPtr->errorMsg(
"Error in HadronLevel::splitJunctionPair: "
731 "three empty junction-junction legs");
737 int legJunLeft = 3 - legJun[0] - legJun[1];
738 int legAntiLeft = 3 - legAnti[0] - legAnti[1];
739 vector<int>& iJunLeg = (legJunLeft == 0) ? iJunLegA
740 : ( (legJunLeft == 1) ? iJunLegB : iJunLegC );
741 vector<int>& iAntiLeg = (legAntiLeft == 0) ? iAntiLegA
742 : ( (legAntiLeft == 1) ? iAntiLegB : iAntiLegC );
743 iPartonJun.resize(0);
744 for (
int i =
int(iJunLeg.size()) - 1; i > 0; --i)
745 iPartonJun.push_back( iJunLeg[i] );
746 for (
int i = 1; i < int(iAntiLeg.size()); ++i)
747 iPartonJun.push_back( iAntiLeg[i] );
750 int iColJoin = iJunLeg[1];
751 int iAcolJoin = iAntiLeg[1];
752 event[iAcolJoin].acol( event[iColJoin].col() );
755 iPartonAntiJun.resize(0);
756 event.eraseJunction( max(identJun, identAnti) - 1);
757 event.eraseJunction( min(identJun, identAnti) - 1);
767 vector<int>& iJunLeg0 = (legJun[0] == 0) ? iJunLegB : iJunLegA;
768 vector<int>& iJunLeg1 = (legJun[0] == 2) ? iJunLegB : iJunLegC;
769 vector<int>& iAntiLeg0 = (legAnti[0] == 0) ? iAntiLegB : iAntiLegA;
770 vector<int>& iAntiLeg1 = (legAnti[0] == 2) ? iAntiLegB : iAntiLegC;
773 Vec4 pJunLeg0 =
event[ iJunLeg0[1] ].p();
774 Vec4 pJunLeg1 =
event[ iJunLeg1[1] ].p();
775 Vec4 pAntiLeg0 =
event[ iAntiLeg0[1] ].p();
776 Vec4 pAntiLeg1 =
event[ iAntiLeg1[1] ].p();
779 Vec4 pStart = pJunLeg0 / pJunLeg0.e() + pJunLeg1 / pJunLeg1.e()
780 + pAntiLeg0 / pAntiLeg0.e() + pAntiLeg1 / pAntiLeg1.e();
783 RotBstMatrix MtoJRF, MtoARF;
784 Vec4 pInJRF[3], pInARF[3];
785 for (
int iJun = 0; iJun < 2; ++iJun) {
786 int offset = (iJun == 0) ? 0 : 2;
789 RotBstMatrix MtoRF, Mstep;
790 MtoRF.bstback(pStart);
798 pInRF[0 + offset] = pJunLeg0;
799 pInRF[1 + offset] = pJunLeg1;
800 pInRF[2 - offset] = pAntiLeg0;
801 pInRF[3 - offset] = pAntiLeg1;
802 for (
int i = 0; i < 4; ++i) pInRF[i].rotbst(MtoRF);
805 double wt2 = 1. - exp( -pInRF[2].e() / eNormJunction);
806 double wt3 = 1. - exp( -pInRF[3].e() / eNormJunction);
807 pInRF[2] = wt2 * pInRF[2] + wt3 * pInRF[3];
810 Mstep = stringFrag.junctionRestFrame( pInRF[0], pInRF[1], pInRF[2]);
811 MtoRF.rotbst( Mstep );
812 }
while (iter < 3 || (Mstep.deviation() > CONVJNREST
813 && iter < NTRYJNREST) );
818 for (
int i = 0; i < 3; ++i) pInJRF[i] = pInRF[i];
821 for (
int i = 0; i < 3; ++i) pInARF[i] = pInRF[i];
826 RotBstMatrix MfromJRF = MtoJRF;
828 RotBstMatrix MfromARF = MtoARF;
832 Vec4 vJun(0., 0., 0., 1.);
833 vJun.rotbst(MfromJRF);
834 Vec4 vAnti(0., 0., 0., 1.);
835 vAnti.rotbst(MfromARF);
836 Vec4 pLabJ[3], pLabA[3];
837 for (
int i = 0; i < 3; ++i) {
838 pLabJ[i] = pInJRF[i];
839 pLabJ[i].rotbst(MfromJRF);
840 pLabA[i] = pInARF[i];
841 pLabA[i].rotbst(MfromARF);
845 double vJvA = vJun * vAnti;
846 double vJvAe2y = vJvA + sqrt(vJvA*vJvA - 1.);
847 double LambdaJA = (2. * pInJRF[0].e()) * (2. * pInJRF[1].e())
848 * (2. * pInARF[0].e()) * (2. * pInARF[1].e()) * vJvAe2y;
849 double Lambda00 = (2. * pLabJ[0] * pLabA[0])
850 * (2. * pLabJ[1] * pLabA[1]);
851 double Lambda01 = (2. * pLabJ[0] * pLabA[1])
852 * (2. * pLabJ[1] * pLabA[0]);
855 if (LambdaJA > min( Lambda00, Lambda01)) {
856 vector<int>& iAntiMatch0 = (Lambda00 < Lambda01)
857 ? iAntiLeg0 : iAntiLeg1;
858 vector<int>& iAntiMatch1 = (Lambda00 < Lambda01)
859 ? iAntiLeg1 : iAntiLeg0;
862 iPartonJun.resize(0);
863 for (
int i =
int(iJunLeg0.size()) - 1; i > 0; --i)
864 iPartonJun.push_back( iJunLeg0[i] );
865 for (
int i = 1; i < int(iAntiMatch0.size()); ++i)
866 iPartonJun.push_back( iAntiMatch0[i] );
867 iPartonAntiJun.resize(0);
868 for (
int i =
int(iJunLeg1.size()) - 1; i > 0; --i)
869 iPartonAntiJun.push_back( iJunLeg1[i] );
870 for (
int i = 1; i < int(iAntiMatch1.size()); ++i)
871 iPartonAntiJun.push_back( iAntiMatch1[i] );
874 int iColJoin = iJunLeg0[1];
875 int iAcolJoin = iAntiMatch0[1];
876 event[iAcolJoin].acol( event[iColJoin].col() );
877 iColJoin = iJunLeg1[1];
878 iAcolJoin = iAntiMatch1[1];
879 event[iAcolJoin].acol( event[iColJoin].col() );
882 event.eraseJunction( max(identJun, identAnti) - 1);
883 event.eraseJunction( min(identJun, identAnti) - 1);
891 double eShift = MTHAD / (3. * sqrt(vJvAe2y));
892 double fracJ0 = min(0.5, eShift / pInJRF[0].e());
893 double fracJ1 = min(0.5, eShift / pInJRF[0].e());
894 Vec4 pFromJun = fracJ0 * pJunLeg0 + fracJ1 * pJunLeg1;
895 double fracA0 = min(0.5, eShift / pInARF[0].e());
896 double fracA1 = min(0.5, eShift / pInARF[0].e());
897 Vec4 pFromAnti = fracA0 * pAntiLeg0 + fracA1 * pAntiLeg1;
900 int iNew =
event.copy(iJunLeg0[1], 76);
901 event[iNew].rescale5(1. - fracJ0);
903 iNew =
event.copy(iJunLeg1[1], 76);
904 event[iNew].rescale5(1. - fracJ1);
906 iNew =
event.copy(iAntiLeg0[1], 76);
907 event[iNew].rescale5(1. - fracA0);
909 iNew =
event.copy(iAntiLeg1[1], 76);
910 event[iNew].rescale5(1. - fracA1);
914 int idQ = flavSel.pickLightQ();
917 int colQ =
event.nextColTag();
918 int acolQ =
event.nextColTag();
919 event.endColJunction(identJun - 1, legJun[0], colQ);
920 event.endColJunction(identAnti - 1, legAnti[0], acolQ);
923 int mother1 = min(iJunLeg0[1], iJunLeg1[1]);
924 int mother2 = max(iJunLeg0[1], iJunLeg1[1]);
925 int iNewJ =
event.append( idQ, 76, mother1, mother2, 0, 0,
926 colQ, 0, pFromAnti, pFromAnti.mCalc() );
927 mother1 = min(iAntiLeg0[1], iAntiLeg1[1]);
928 mother2 = max(iAntiLeg0[1], iAntiLeg1[1]);
929 int iNewA =
event.append( -idQ, 76, mother1, mother2, 0, 0,
930 0, acolQ, pFromJun, pFromJun.mCalc() );
933 if (legJun[0] == 0) iJunLegA[1] = iNewJ;
934 else if (legJun[0] == 1) iJunLegB[1] = iNewJ;
935 else iJunLegC[1] = iNewJ;
936 if (legAnti[0] == 0) iAntiLegA[1] = iNewA;
937 else if (legAnti[0] == 1) iAntiLegB[1] = iNewA;
938 else iAntiLegC[1] = iNewA;
944 iPartonJun.resize(0);
945 for (
int i = 0; i < int(iJunLegA.size()); ++i)
946 iPartonJun.push_back( iJunLegA[i] );
947 for (
int i = 0; i < int(iJunLegB.size()); ++i)
948 iPartonJun.push_back( iJunLegB[i] );
949 for (
int i = 0; i < int(iJunLegC.size()); ++i)
950 iPartonJun.push_back( iJunLegC[i] );
953 iPartonAntiJun.resize(0);
954 for (
int i = 0; i < int(iAntiLegA.size()); ++i)
955 iPartonAntiJun.push_back( iAntiLegA[i] );
956 for (
int i = 0; i < int(iAntiLegB.size()); ++i)
957 iPartonAntiJun.push_back( iAntiLegB[i] );
958 for (
int i = 0; i < int(iAntiLegC.size()); ++i)
959 iPartonAntiJun.push_back( iAntiLegC[i] );