10 #include "Pythia8/VinciaAntennaFunctions.h"
37 double DGLAP::Pg2gg(
double z,
int hA,
int hB,
int hC) {
40 if (hA == 9)
return 2*pow2(1. - z*(1. - z))/z/(1. - z);
43 if (hA == -1) {hB *= -1; hC *= -1;}
44 if (hB == 1 && hC == 1)
return 1./z/(1. - z);
45 else if (hB == -1 && hC == 1)
return pow3(1. - z)/z;
46 else if (hB == 1 && hC == -1)
return pow3(z)/(1. - z);
56 double DGLAP::Pg2qq(
double z,
int hA,
int hB,
int hC,
double mu2) {
59 if (hA == 9)
return pow2(z) + pow2(1. - z) + 2.0*mu2;
62 if (hB != -hC || abs(hB) != 1)
return 0.;
65 if (hA == -1) {hB *= -1; hC *= -1;}
66 if (hB == -1 && hC == 1)
return pow2(1. - z);
67 else if (hB == 1 && hC == -1)
return pow2(z);
77 double DGLAP::Pq2qg(
double z,
int hA,
int hB,
int hC,
double mu2) {
80 if (hA == 9)
return (1. + pow2(z))/(1. - z) - 2.0*mu2;
83 if (hA != hB || abs(hB) != 1)
return 0.;
86 if (hA == -1) {hB *= -1; hC *= -1;}
87 if (hB == 1 && hC == -1)
return pow2(z)/(1. - z);
88 else if (hB == 1 && hC == 1)
return 1./(1. - z);
98 double DGLAP::Pq2gq(
double z,
int hA,
int hB,
int hC,
double mu) {
99 return Pq2qg(1-z,hA,hC,hB,mu);}
115 double DGLAP::Pg2ggLin(
double z,
int polA,
int polB,
int polC) {
118 if (polA == 9)
return (1. - z + pow2(z))/z/(1 - z);
121 else if (polA == 1) {
122 if (polB == 1 && polC == 1)
return (1. - z)/z + z/(1. - z) + z*(1. - z);
123 else if (polB == -1 && polC == -1)
return z*(1. - z);
127 else if (polA == -1) {
128 if (polB == 1 && polC == -1)
return (1. - z)/z;
129 else if (polB == -1 && polC == 1)
return z/(1. - z);
140 double DGLAP::Pg2qqLin(
double z,
int polA,
int hB,
int hC,
double mu) {
143 if (polA == 9)
return Pg2qq(z,9,9,9,mu);
146 if (hB != -hC || abs(hB) != 1)
return 0.;
149 else if (polA == 1)
return pow2(1. - 2*z);
152 else if (polA == -1)
return 1.;
162 double DGLAP::Pq2qgLin(
double z,
int hA,
int hB,
int polC,
double mu) {
165 if (hA == 9)
return Pq2qg(z, 9, 9, 9, mu);
168 if (hA != hB || abs(hB) != 1)
return 0.;
171 else if (polC == 1)
return pow2(1. + z)/(1. - z);
174 else if (polC == -1)
return 1. - z;
184 double DGLAP::Pq2gqLin(
double z,
int hA,
int polB,
int hC,
double mu) {
185 return Pq2qgLin(1 - z, hA, hC, polB, mu);}
195 bool AntennaFunction::init() {
198 if (!isInitPtr)
return false;
201 verbose = settingsPtr->mode(
"Vincia:verbose");
204 if (vinciaName() ==
"Vincia:GQEmitFF")
205 chargeFacSav = settingsPtr->parm(
"Vincia:QGEmitFF:chargeFactor");
207 chargeFacSav = settingsPtr->parm(vinciaName() +
":chargeFactor");
208 if (chargeFacSav < 0.) chargeFacSav = 0.0;
214 modeSLC = settingsPtr->mode(
"Vincia:modeSLC");
215 if (modeSLC == 0 && id1() == 21) chargeFacSav = CA;
216 if (modeSLC == 2 && id1() == 21) {
217 if (idA() == 21 && idB() == 21) chargeFacSav = CA;
218 else if (idA() == 21 || idB() == 21) chargeFacSav = (CA + CF)/2.;
219 else chargeFacSav = CF;
223 if (settingsPtr->isMode(vinciaName() +
":kineMap"))
224 kineMapSav = settingsPtr->mode(vinciaName()+
":kineMap");
228 kineMapSav = settingsPtr->mode(
"Vincia:kineMapFFemit");
232 kineMapSav = settingsPtr->mode(
"Vincia:kineMapFFsplit");
234 if (kineMapSav == 2) kineMapSav = -1;
239 alphaSav = settingsPtr->parm(
"Vincia:octetPartitioning");
242 sectorShower = settingsPtr->flag(
"Vincia:sectorShower");
243 sectorDampSav = settingsPtr->parm(
"Vincia:sectorDamp");
256 int AntennaFunction::initHel(vector<int>* helBef, vector<int>* helNew) {
259 hA = 9; hB = 9; hi = 9; hj = 9; hk = 9;
262 if (helNew->size() >= 3) {
263 hi = helNew->at(0); hj = helNew->at(1); hk = helNew->at(2);
265 if (helBef->size() >= 2) {
266 hA = helBef->at(0); hB = helBef->at(1);
271 if (hA != 1 && hA != -1 && hA != 9) physHel =
false;
272 if (hB != 1 && hB != -1 && hB != 9) physHel =
false;
273 if (hi != 1 && hi != -1 && hi != 9) physHel =
false;
274 if (hj != 1 && hj != -1 && hj != 9) physHel =
false;
275 if (hk != 1 && hk != -1 && hk != 9) physHel =
false;
277 if (verbose >= normal){
279 ss << hA <<
" " << hB <<
" -> " << hi <<
" " << hj <<
" " << hk;
280 infoPtr->errorMsg(
"Warning in "+__METHOD_NAME__+
281 ": unphysical helicity configuration.",ss.str());
288 if (hA == 9) nAvg *= 2;
289 if (hB == 9) nAvg *= 2;
298 bool AntennaFunction::check() {
302 if (id1() == 21 || id1() == 22) {
303 vector<double> invariants;
306 for (
int iTest = 0; iTest <= 1; ++iTest) {
308 double yij = 1.0e-3 * pow(10.0,iTest);
309 double yjk = 1.0e-3 / pow(10.0,iTest);
313 invariants.resize(3);
315 invariants[1] = yij*sIK;
316 invariants[2] = yjk*sIK;
318 double eik = 2.*(1. - yij - yjk)/yij/yjk*(1./sIK);
320 int modeSLCsave = modeSLC;
322 double ant = antFun(invariants);
323 modeSLC = modeSLCsave;
325 double ratio = ant/eik;
326 if (abs(ratio - 1.) >= 0.001) {
328 if (verbose >= quiet) {
329 infoPtr->errorMsg(
"Warning in "+__METHOD_NAME__+
": Failed eikonal.",
330 "("+num2str(iTest,1) +
")");
332 }
else if (verbose >= verylouddebug) printOut(__METHOD_NAME__,
333 vinciaName() +
" OK (eikonal " + num2str(iTest, 1) +
")");
338 string helString =
" 9 9 -> 9 9 9";
339 for (
int iHel = -1; iHel < 32; ++iHel) {
342 hi = 1 - 2*((iHel/2)%2);
343 hk = 1 - 2*((iHel/4)%2);
344 hA = 1 - 2*((iHel/8)%2);
345 hB = 1 - 2*((iHel/16)%2);
346 helString = num2str(hA,2) + num2str(hB,2) +
" ->"
347 + num2str(hi,2) + num2str(hj,2) + num2str(hk,2);
349 else {hA = 9; hB = 9; hi = 9; hj = 9; hk = 9;}
350 vector<int> helBef, helNew;
351 helBef.push_back(hA);
352 helBef.push_back(hB);
353 helNew.push_back(hi);
354 helNew.push_back(hj);
355 helNew.push_back(hk);
358 for (
int iTest = 0; iTest <= 4; ++iTest) {
361 double y2 = 0.1 + iTest*0.2;
362 vector<double> invariants1;
365 invariants1.resize(3);
371 vector<double> invariants2 = invariants1;
376 double AP1 = AltarelliParisi(invariants1, mDum, helBef, helNew);
377 double AP2 = AltarelliParisi(invariants2, mDum, helBef, helNew);
380 if (abs(id1()) <= 9) {
382 if (AP1 > AP2) AP2 = -1;
386 if (hB != hk) AP1 = -1.;
387 if (hA != hi) AP2 = -1.;
391 if (hA != hi || hB != hk) {
398 if (AP1 < 0. && AP2 < 0.)
continue;
401 int modeSLCsave = modeSLC;
403 double ant1 = antFun(invariants1,mDum,helBef,helNew);
404 double ant2 = antFun(invariants2,mDum,helBef,helNew);
406 if (!sectorShower && idA() == 21) {
408 invariants1[2] = 1. - y1 -y2;
410 helComp.push_back(hj);
411 helComp.push_back(hi);
412 helComp.push_back(hk);
413 ant1 += antFun(invariants1, mDum, helBef, helComp);
415 if (!sectorShower && idB() == 21) {
416 invariants2[1] = 1 - y1 - y2;
419 helComp.push_back(hi);
420 helComp.push_back(hk);
421 helComp.push_back(hj);
422 ant2 += antFun(invariants2, mDum, helBef, helComp);
425 modeSLC = modeSLCsave;
429 double ratio = ant1/AP1;
431 if (abs(ratio-1.) >= 0.05 && abs(ant1 - AP1) > 10.) {
433 if (verbose >= normal){
434 printOut(__METHOD_NAME__,
"WARNING:" + vinciaName() +
435 " FAILED (collinear ij " + num2str(iTest,1) +
" " +
438 if (verbose >= quiteloud) {
439 cout << setprecision(6);
440 printOut(__METHOD_NAME__,
" ant = " + num2str(ant1, 9) +
441 " y1 = " + num2str(y1, 9) +
" y2 = " + num2str(y2, 9));
442 printOut(__METHOD_NAME__,
" P(z) = "+num2str(AP1, 9) +
443 " zi = " + num2str(zA(invariants1), 9));
445 }
else if (verbose >= verylouddebug) {
446 printOut(__METHOD_NAME__, vinciaName() +
" OK (collinear ij " +
447 num2str(iTest, 1) +
" " + helString +
" )");
453 double ratio = ant2/AP2;
454 if (abs(ratio - 1.) >= 0.05 && abs(ant2 - AP2) > 10.) {
456 if (verbose >= quiet) {
457 printOut(__METHOD_NAME__,
"WARNING:" + vinciaName() +
458 " FAILED (collinear jk " + num2str(iTest, 1) +
" " +
461 if (verbose >= quiteloud) {
462 cout << setprecision(6);
463 printOut(__METHOD_NAME__,
" ant = " + num2str(ant2, 9) +
464 " y1 = "+num2str(y2, 9) +
" y2 = " + num2str(y1, 9));
465 printOut(__METHOD_NAME__,
" P(z) = " + num2str(AP2, 9) +
466 " zk = " + num2str(zB(invariants1), 9));
468 }
else if (verbose >= verylouddebug) {
469 printOut(__METHOD_NAME__, vinciaName() +
" OK (collinear jk "
470 + num2str(iTest, 1) +
" " + helString+
" )");
476 int nPointsCheck = settingsPtr->mode(
"Vincia:nPointsCheck");
477 bool isPositive =
true;
479 bool hasDeadZone =
false;
480 double deadZoneAvoidance = settingsPtr->parm(
"Vincia:deadZoneAvoidance");
481 for (
int iTest = 0; iTest < nPointsCheck; ++iTest) {
484 double y1 = rndmPtr->flat();
485 double y2 = rndmPtr->flat();
490 vector<double> invariants;
491 invariants.resize(3);
495 double ant = antFun(invariants,mDum,helBef,helNew);
500 if (verbose >= quiteloud){
501 printOut(__METHOD_NAME__,
"ERROR:" + vinciaName() +
" ant("
502 + num2str(y1, 9) +
"," + num2str(y2, 9) +
" ; " + helString
503 +
") = " + num2str(ant) +
" < 0");
505 }
else if (ant > 0.) isZero =
false;
507 if (1-y1-y2 > 0.05 && y1 > 0.05 && y2 > 0.05
508 && ant < deadZoneAvoidance) hasDeadZone =
true;
511 isOK = isOK && isPositive;
514 if (!isPositive && verbose >= quiet)
515 printOut(__METHOD_NAME__,
"ERROR" + vinciaName() +
516 " (ant < 0 encountered " + helString +
" )");
517 else if (isPositive && !isZero && verbose >= verylouddebug)
518 printOut(__METHOD_NAME__, vinciaName() +
" OK (is positive "
521 if (hasDeadZone && verbose >= quiet)
522 printOut(__METHOD_NAME__,
"WARNING" + vinciaName()
523 +
" (dead zone encountered " + helString+
" )");
524 else if (!hasDeadZone && verbose >= verylouddebug)
525 printOut(__METHOD_NAME__, vinciaName() +
" OK (no dead zones "
540 void AntennaFunction::initPtr(Info* infoPtrIn, DGLAP* dglapPtrIn) {
543 particleDataPtr = infoPtr->particleDataPtr;
544 settingsPtr = infoPtr->settingsPtr;
545 rndmPtr = infoPtr->rndmPtr;
546 dglapPtr = dglapPtrIn;
557 string AntennaFunction::id2str(
int id)
const {
560 if (
id == 21)
return "g";
561 else if (
id == 22)
return "gamma";
562 else if (
id == 23)
return "Z";
563 else if (abs(
id) == 24)
return "W";
566 else if (
id >= 1 &&
id <= 4)
return "q";
567 else if (-
id >= 1 && -
id <= 4)
return "qbar";
568 else if (
id == 5)
return "b";
569 else if (
id == -5)
return "bbar";
570 else if (
id == 6)
return "t";
571 else if (
id == -6)
return "tbar";
572 else if (
id >= 11 &&
id <= 20 &&
id%2 == 1)
return "l-";
573 else if (
id >= 11 &&
id <= 20 &&
id%2 == 0)
return "nu";
574 else if (-
id >= 11 && -
id <= 20 &&
id%2 == 1)
return "l+";
575 else if (-
id >= 11 && -
id <= 20 &&
id%2 == 0)
return "nubar";
578 else if (
id == 1000021)
return "~g";
580 else if (
id == 37)
return "H+";
581 else if (
id == -37)
return "H-";
583 else if (
id >= 1000000 &&
id <= 1000010)
return "~q";
584 else if (-
id >= 1000000 && -
id <= 1000010)
return "~q*";
598 double QQEmitFF::antFun(vector<double> invariants, vector<double> masses,
599 vector<int> helBef, vector<int> helNew) {
602 if (invariants.size() <= 2)
return 0.;
603 double sIK = invariants[0];
604 double sij = invariants[1];
605 double sjk = invariants[2];
609 int nAvg = initHel(&helBef, &helNew);
610 if (nAvg <= 0)
return 0.;
613 if (mi <= 0. && hi == -hA)
return 0.0;
614 else if (mk <= 0. && hk == -hB)
return 0.0;
617 double yij = sij/sIK;
618 double yjk = sjk/sIK;
621 double eik = 1./yij/yjk;
622 double mTermI = (mi > 0.) ? pow2(mi)/sij/yij : 0.0;
623 double mTermK = (mk > 0.) ? pow2(mk)/sjk/yjk : 0.0;
629 if (hA * hB > 0 || hA == 9 || hB == 9) {
632 term = eik - mTermI/(1. - yjk) - mTermK/(1. - yij);
633 if (RH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
634 if (LH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
637 term = eik * pow2(1. - yij - yjk) - mTermI*(1. - yjk) - mTermK*(1. - yij);
638 if (RH[hA] && RH[hB] && RH[hi] && LH[hj] && RH[hk]) hSum += term;
639 if (LH[hA] && LH[hB] && LH[hi] && RH[hj] && LH[hk]) hSum += term;
643 term = mTermI * pow2(yjk)/(1. - yjk);
644 if (RH[hA] && RH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += term;
645 if (LH[hA] && LH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += term;
650 term = mTermK * pow2(yij)/(1. - yij);
651 if (RH[hA] && RH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += term;
652 if (LH[hA] && LH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += term;
657 if (hA * hB < 0 || hA == 9 || hB == 9) {
660 term = eik * pow2(1. - yij) - mTermI/(1. - yjk) - mTermK*(1. - yij);
661 if (RH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
662 if (LH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
665 term = eik * pow2(1. - yjk) - mTermI*(1. - yjk) - mTermK/(1. - yij);
666 if (RH[hA] && LH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += term;
667 if (LH[hA] && RH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += term;
671 term = mTermI * pow2(yjk)/(1. - yjk);
672 if (RH[hA] && LH[hB] && LH[hi] && RH[hj] && LH[hk]) hSum += term;
673 if (LH[hA] && RH[hB] && RH[hi] && LH[hj] && RH[hk]) hSum += term;
678 term = mTermK * pow2(yij)/(1. - yij);
679 if (RH[hA] && LH[hB] && RH[hi] && LH[hj] && RH[hk]) hSum += term;
680 if (LH[hA] && RH[hB] && LH[hi] && RH[hj] && LH[hk]) hSum += term;
685 return hSum/nAvg/sIK;
694 double QQEmitFF::AltarelliParisi(vector<double> invariants,
695 vector<double>, vector<int> helBef, vector<int> helNew) {
697 int h0Now = helNew[0];
698 int h1Now = helNew[1];
699 int h2Now = helNew[2];
700 int hANow = helBef[0];
701 int hBNow = helBef[1];
704 if (hANow != h0Now || hBNow != h2Now)
return -1.;
705 else return dglapPtr->Pq2qg(zA(invariants),hANow,h0Now,h1Now)/invariants[1]
706 + dglapPtr->Pq2qg(zB(invariants),hBNow,h2Now,h1Now)/invariants[2];
718 double QGEmitFF::antFun(vector<double> invariants, vector<double> masses,
719 vector<int> helBef, vector<int> helNew) {
722 if (invariants.size() <= 2)
return 0.;
723 double sIK = invariants[0];
724 double sij = invariants[1];
725 double sjk = invariants[2];
729 int nAvg = initHel(&helBef, &helNew);
730 if (nAvg <= 0)
return 0.;
733 if (mi <= 0. && hi == -hA)
return 0.0;
734 else if (hk == -hB)
return 0.0;
737 double yij = sij/sIK;
738 double yjk = sjk/sIK;
741 double yik = max(0., 1. - yij - yjk);
742 double eik = 1./yij/yjk;
743 double mTerm = pow2(mi)/sij/yij;
744 double a = 1. - alphaSav;
745 if (alphaSav == 0.0) a = 1.;
746 else if (alphaSav == 1.0) a = 0.;
752 if (hA * hB > 0 || hA == 9 || hB == 9) {
755 term = eik - mTerm/(1. - yjk);
756 if (a != 0.) term += a * (1. - yjk) * ( 1. - 2*yij - yjk )/yjk;
757 if (RH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
758 if (LH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
761 term = eik * pow2(yik) * (1. - yij) - mTerm*(1. - yjk);
762 if (RH[hA] && RH[hB] && RH[hi] && LH[hj] && RH[hk]) hSum += term;
763 if (LH[hA] && LH[hB] && LH[hi] && RH[hj] && LH[hk]) hSum += term;
767 term = mTerm*pow2(yjk)/(1. - yjk);
768 if (RH[hA] && RH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += term;
769 if (LH[hA] && LH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += term;
774 if (hA * hB < 0 || hA == 9 || hB == 9) {
777 term = eik * pow3(1. - yij) - mTerm/(1. - yjk);
778 if (RH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
779 if (LH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
782 term = eik * pow2(1. - yjk) - mTerm*(1. - yjk);
783 if (a != 0.) term += a * (1. - yjk) * ( 1. - 2*yij - yjk )/yjk;
784 if (RH[hA] && LH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += term;
785 if (LH[hA] && RH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += term;
789 term = mTerm * pow2(yjk)/(1. - yjk);
790 if (RH[hA] && LH[hB] && LH[hi] && RH[hj] && LH[hk]) hSum += term;
791 if (LH[hA] && RH[hB] && RH[hi] && LH[hj] && RH[hk]) hSum += term;
796 if (modeSLC >= 2) hSum *= CF/chargeFacSav * (1 - yij)/(2 - yij - yjk)
797 + CA/chargeFacSav * (1 - yjk)/(2 - yij - yjk);
800 return hSum/nAvg/sIK;
808 double QGEmitFF::AltarelliParisi(vector<double> invariants,
809 vector<double>, vector<int> helBef, vector<int> helNew) {
811 int h0Now = helNew[0];
812 int h1Now = helNew[1];
813 int h2Now = helNew[2];
814 int hANow = helBef[0];
815 int hBNow = helBef[1];
816 if (h0Now != hANow)
return -1;
821 sum += dglapPtr->Pq2qg(zA(invariants), hANow, h0Now, h1Now)/invariants[1];
822 return sum + dglapPtr->Pg2gg(zB(invariants), hBNow, h2Now, h1Now)
835 double GQEmitFF::antFun(vector<double> invariants,
836 vector<double> mNew, vector<int> helBef, vector<int> helNew) {
838 swap(invariants[1], invariants[2]);
839 swap(mNew[0], mNew[2]);
840 swap(helBef[0], helBef[1]);
841 swap(helNew[0], helNew[2]);
842 return QGEmitFF::antFun(invariants, mNew, helBef, helNew);
850 double GQEmitFF::AltarelliParisi(vector<double> invariants,
851 vector<double>, vector<int> helBef, vector<int> helNew) {
853 int h0Now = helNew[0];
854 int h1Now = helNew[1];
855 int h2Now = helNew[2];
856 int hANow = helBef[0];
857 int hBNow = helBef[1];
858 if (h2Now != hBNow)
return -1;
863 sum += dglapPtr->Pq2qg(zB(invariants), hBNow, h2Now, h1Now)/invariants[2];
864 return sum + dglapPtr->Pg2gg(zA(invariants), hANow, h0Now, h1Now)
877 double GGEmitFF::antFun(vector<double> invariants, vector<double>,
878 vector<int> helBef, vector<int> helNew) {
881 if (invariants.size() <= 2)
return 0.;
882 double sIK = invariants[0];
883 double sij = invariants[1];
884 double sjk = invariants[2];
887 double yij = sij/sIK;
888 double yjk = sjk/sIK;
891 int nAvg = initHel(&helBef, &helNew);
892 if (nAvg <= 0)
return 0.;
895 if (hi == -hA)
return 0.0;
896 else if (hk == -hB)
return 0.0;
899 double eik = 1./yij/yjk;
900 double yik = max(0.,1. - yij - yjk);
902 if (alphaSav == 0.0) a = 1.;
903 else if (alphaSav == 1.0) a = 0.;
904 else a = 1. - alphaSav;
910 if (hA * hB > 0 || hA == 9 || hB == 9) {
914 if (a != 0.0) term += a * ((1. - yjk)*(1. - 2*yij - yjk)/yjk
915 + (1. - yij)*(1. - 2*yjk - yij)/yij);
916 if (RH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
917 if (LH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
920 term = eik * pow3(yik);
921 if (RH[hA] && RH[hB] && RH[hi] && LH[hj] && RH[hk]) hSum += term;
922 if (LH[hA] && LH[hB] && LH[hi] && RH[hj] && LH[hk]) hSum += term;
927 if (hA * hB < 0 || hA == 9 || hB == 9) {
930 term = eik * pow3(1 - yij);
931 if (a != 0.) term += a * (1. - yij)*(1. - 2*yjk)/yij;
932 if (RH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
933 if (LH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
936 term = eik * pow3(1 - yjk);
937 if (a != 0.) term += a * (1. - yjk)*(1. - 2*yij)/yjk;
938 if (RH[hA] && LH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += term;
939 if (LH[hA] && RH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += term;
943 return hSum/nAvg/sIK;
951 double GGEmitFF::AltarelliParisi(vector<double> invariants,
952 vector<double>, vector<int> helBef, vector<int> helNew) {
954 int h0Now = helNew[0];
955 int h1Now = helNew[1];
956 int h2Now = helNew[2];
957 int hANow = helBef[0];
958 int hBNow = helBef[1];
963 sum += dglapPtr->Pg2gg(zA(invariants), hANow, h0Now, h1Now)/invariants[1];
965 sum += dglapPtr->Pg2gg(zB(invariants), hBNow, h2Now, h1Now)/invariants[2];
978 double GXSplitFF::antFun(vector<double> invariants, vector<double> masses,
979 vector<int> helBef, vector<int> helNew) {
982 if (invariants.size() <= 2)
return 0.;
983 double sIK = invariants[0];
984 double sij = invariants[1];
985 double sjk = invariants[2];
989 int nAvg = initHel(&helBef,&helNew);
990 if (nAvg <= 0)
return 0.;
993 double yij = sij/sIK;
994 double yjk = sjk/sIK;
995 double yik = 1. - yij - yjk - pow2(mi)/sIK - pow2(mj)/sIK;
998 if (yij <= 0.0 || yjk <= 0.0 || yik <= 0.0)
return 0.0;
1001 double mu2q = mj*mi/sIK;
1002 double mu2ij = yij + 2 * mu2q;
1003 double termQ = 0.5 * (pow2(yik) - mu2q/mu2ij * yik/(1. - yik)) / mu2ij;
1004 double termA = 0.5 * (pow2(yjk) - mu2q/mu2ij * yjk/(1. - yjk)) / mu2ij;
1005 double termF = (mu2q <= 0.) ? 0
1006 : 0.5 * mu2q/pow2(mu2ij)*(yik/(1. - yik) + yjk/(1. - yjk) + 2.);
1012 if (hA * hB > 0 || hA == 9 || hB == 9) {
1015 if (RH[hA] && RH[hB] && RH[hi] && LH[hj] && RH[hk]) hSum += termQ;
1016 if (LH[hA] && LH[hB] && LH[hi] && RH[hj] && LH[hk]) hSum += termQ;
1019 if (RH[hA] && RH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += termA;
1020 if (LH[hA] && LH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += termA;
1024 if (RH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += termF;
1025 if (LH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += termF;
1030 if ( hA * hB < 0 || hA == 9 || hB == 9) {
1033 if (RH[hA] && LH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += termQ;
1034 if (LH[hA] && RH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += termQ;
1037 if (RH[hA] && LH[hB] && LH[hi] && RH[hj] && LH[hk]) hSum += termA;
1038 if (LH[hA] && RH[hB] && RH[hi] && LH[hj] && RH[hk]) hSum += termA;
1042 if (RH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += termF;
1043 if (LH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += termF;
1048 return hSum/nAvg/sIK;
1056 double GXSplitFF::AltarelliParisi(vector<double> invariants,
1057 vector<double>, vector<int> helBef, vector<int> helNew) {
1059 int h0Now = helNew[0];
1060 int h1Now = helNew[1];
1061 int h2Now = helNew[2];
1062 int hANow = helBef[0];
1063 int hBNow = helBef[1];
1066 return hBNow != h2Now ? 0.0 : dglapPtr->Pg2qq(zA(invariants), hANow, h0Now,
1067 h1Now)/invariants[1];
1080 double QGEmitFFsec::antFun(vector<double> invariants,
1081 vector<double> mNew, vector<int> helBef, vector<int> helNew) {
1084 double ant = QGEmitFF::antFun(invariants, mNew, helBef, helNew);
1085 if (helBef.size() < 2) {helBef.push_back(9); helBef.push_back(9);}
1086 if (helNew.size() < 3) {
1087 helNew.push_back(9); helNew.push_back(9); helNew.push_back(9);}
1091 int hjNow = helNew[1];
1092 if ( hG == hjNow ) {
1094 vector<double> invariantsSym = invariants;
1095 double s02 = invariants[0] - invariants[1] - invariants[2];
1096 vector<int> helSym = helNew;
1097 invariantsSym[1] = s02 + sectorDampSav * invariants[2];
1098 helSym[1] = helNew[2];
1099 helSym[2] = helNew[1];
1100 ant += QGEmitFF::antFun(invariantsSym, mNew, helBef, helSym);
1114 double GQEmitFFsec::antFun(vector<double> invariants,
1115 vector<double> mNew, vector<int> helBef, vector<int> helNew) {
1117 swap(invariants[1], invariants[2]);
1118 swap(mNew[0], mNew[2]);
1119 swap(helBef[0], helBef[1]);
1120 swap(helNew[0], helNew[2]);
1121 return QGEmitFFsec::antFun(invariants, mNew, helBef, helNew);
1129 double GQEmitFFsec::AltarelliParisi(vector<double> invariants,
1130 vector<double>, vector<int> helBef, vector<int> helNew) {
1132 int h0Now = helNew[0];
1133 int h1Now = helNew[1];
1134 int h2Now = helNew[2];
1135 int hANow = helBef[0];
1136 int hBNow = helBef[1];
1137 if (h2Now != hBNow)
return -1;
1142 sum += dglapPtr->Pq2qg(zB(invariants), hBNow, h2Now, h1Now)/invariants[2];
1143 return sum + dglapPtr->Pg2gg(zA(invariants), hANow, h0Now, h1Now)
1157 double GGEmitFFsec::antFun(vector<double> invariants, vector<double> mNew,
1158 vector<int> helBef, vector<int> helNew) {
1161 double ant = GGEmitFF::antFun(invariants, mNew, helBef, helNew);
1162 if (helBef.size() < 2) {helBef.push_back(9); helBef.push_back(9);}
1163 if (helNew.size() < 3) {
1164 helNew.push_back(9); helNew.push_back(9); helNew.push_back(9);}
1167 int hjNow = helNew[1];
1168 if (helBef[0] == hjNow) {
1170 vector<double> invariantsSym = invariants;
1171 double s02 = invariants[0] - invariants[1] - invariants[2];
1172 vector<int> helSym = helNew;
1173 helSym[0] = helNew[1];
1174 helSym[1] = helNew[0];
1175 invariantsSym[2] = s02 + sectorDampSav * invariants[1];
1176 ant += GGEmitFF::antFun(invariantsSym, mNew, helBef, helSym);
1180 if (helBef[1] == hjNow) {
1182 vector<double> invariantsSym = invariants;
1183 double s02 = invariants[0] - invariants[1] - invariants[2];
1184 vector<int> helSym = helNew;
1185 helSym[1] = helNew[2];
1186 helSym[2] = helNew[1];
1187 invariantsSym[1] = s02 + sectorDampSav * invariants[2];
1188 ant += GGEmitFF::antFun(invariantsSym, mNew, helBef, helSym);
1203 double GXSplitFFsec::antFun(vector<double> invariants, vector<double> mNew,
1204 vector<int> helBef, vector<int> helNew) {
1205 return 2*GXSplitFF::antFun(invariants,mNew,helBef,helNew);}
1215 bool AntennaFunctionIX::init() {
1218 if (!isInitPtr)
return false;
1219 verbose = settingsPtr->mode(
"Vincia:verbose");
1220 chargeFacSav = settingsPtr->parm(vinciaName()+
":chargeFactor");
1221 if (chargeFacSav < 0.) chargeFacSav = 0.0;
1227 modeSLC = settingsPtr->mode(
"Vincia:modeSLC");
1228 if (modeSLC == 0 && id1() == 21) chargeFacSav = CA;
1229 if (modeSLC == 2 && id1() == 21) {
1230 if (idA() == 21 && idB() == 21 ) chargeFacSav = CA;
1231 else if (idA() == 21 || idB() == 21) chargeFacSav = (CA + CF)/2.;
1232 else chargeFacSav = CF;
1236 alphaSav = settingsPtr->parm(
"Vincia:octetPartitioning");
1239 sectorShower = settingsPtr->flag(
"Vincia:sectorShower");
1240 sectorDampSav = settingsPtr->parm(
"Vincia:sectorDamp");
1253 bool AntennaFunctionIX::check() {
1257 int nPointsCheck = settingsPtr->mode(
"Vincia:nPointsCheck");
1258 double shhMax = pow2(14000.0);
1259 double deadZoneAvoidance = settingsPtr->parm(
"Vincia:deadZoneAvoidance");
1262 double sAB[2] = {pow2(91.0), pow2(125.0)};
1265 if (id1() == 21 || id1() == 22) {
1267 for (
int iTest = 0; iTest <= 1; ++iTest) {
1269 for (
int isAB = 0; isAB <= 1; ++isAB) {
1271 double yaj = 1.0e-3 * pow(10.0,iTest);
1272 double yjb = 1.0e-3 / pow(10.0,iTest);
1273 double sab = sAB[isAB]/(1.0-yaj-yjb);
1274 double saj = yaj*sab;
1275 double sjb = yjb*sab;
1278 double eik = 2.0*sab/saj/sjb;
1281 vector<double> invariants;
1282 invariants.push_back(sAB[isAB]);
1283 invariants.push_back(saj);
1284 invariants.push_back(sjb);
1285 int modeSLCsave = modeSLC;
1287 double ant = antFun(invariants);
1288 modeSLC = modeSLCsave;
1291 double ratio = ant/eik;
1292 if (abs(ratio - 1.0) >= 0.001) {
1294 if (verbose >= quiet)
1295 printOut(vinciaName() +
":check",
"WARNING: FAILED "
1296 "(eikonal " + num2str(iTest, 1) +
" and sAB = " +
1297 num2str((
int)sqrt(sAB[isAB])) +
"^2)");
1298 }
else if (verbose >= verylouddebug) {
1299 printOut(vinciaName() +
":check",
"OK (eikonal " + num2str(iTest, 1)
1300 +
" and sAB = " + num2str((
int)sqrt(sAB[isAB])) +
"^2)");
1308 for (
int iTest = 0; iTest <= 2; ++iTest) {
1310 for (
int isAB = 0; isAB <= 1; ++isAB) {
1313 double y2 = 0.2 + iTest*0.3;
1314 double sab = sAB[isAB]/(1.0-y1-y2);
1317 vector<double> invariants1 = {sAB[isAB], s1, s2};
1318 vector<double> invariants2 = {sAB[isAB], s2, s1};
1321 double AP1 = AltarelliParisi(invariants1);
1322 double AP2 = AltarelliParisi(invariants2);
1325 int modeSLCsave = modeSLC;
1327 double ant1 = antFun(invariants1);
1328 double ant2 = antFun(invariants2);
1329 modeSLC = modeSLCsave;
1332 double zs1 = zA(invariants1);
1333 double zs2 = zB(invariants1);
1335 double ratio = ant1/AP1;
1336 if (abs(ratio - 1.0) >= 0.01) {
1338 if (verbose >= quiet)
1339 printOut(vinciaName() +
":check",
"WARNING: FAILED "
1340 "(collinear aj " + num2str(iTest, 1) +
" and sAB = " +
1341 num2str((
int)sqrt(sAB[isAB])) +
"^2)");
1343 cout << setprecision(6) <<
" ant = " << num2str(ant1, 9)
1344 <<
" y1 = " << num2str(y1,9) <<
" y2 = " << num2str(y2, 9)
1345 <<
" " << endl <<
" P(z) = " << num2str(AP1, 9) <<
" z = "
1346 << num2str(zs1, 9) << endl;
1347 }
else if (verbose >= 6)
1348 printOut(vinciaName() +
":check",
"OK (collinear aj " +
1349 num2str(iTest, 1) +
" and sAB = " +
1350 num2str((
int)sqrt(sAB[isAB])) +
"^2)");
1353 double ratio = ant2/AP2;
1354 if (abs(ratio - 1.0) >= 0.01) {
1357 printOut(vinciaName() +
":check",
"WARNING: FAILED "
1358 "(collinear jb " + num2str(iTest, 1) +
" and sAB = " +
1359 num2str((
int)sqrt(sAB[isAB])) +
"^2)");
1361 cout << setprecision(6) <<
" ant = " << num2str(ant1, 9)
1362 <<
" y1 = " << num2str(y1, 9) <<
" y2 = " << num2str(y2, 9)
1363 <<
" " << endl <<
" P(z) = " << num2str(AP2,9) <<
" z = "
1364 << num2str(zs2, 9) << endl;
1365 }
else if (verbose >= 6)
1366 printOut(vinciaName() +
":check",
"OK (collinear jb" +
1367 num2str(iTest, 1) +
" and sAB = " +
1368 num2str((
int)sqrt(sAB[isAB])) +
"^2)");
1374 string helString =
" 9 9 -> 9 9 9";
1375 for (
int iHel = -1; iHel < 32; ++iHel) {
1376 bool isPositive =
true;
1378 bool hasDeadZone =
false;
1380 hj = 1 - 2*(iHel%2);
1381 hi = 1 - 2*((iHel/2)%2);
1382 hk = 1 - 2*((iHel/4)%2);
1383 hA = 1 - 2*((iHel/8)%2);
1384 hB = 1 - 2*((iHel/16)%2);
1385 helString = num2str(hA,2) + num2str(hB,2) +
" ->" +
1386 num2str(hi,2) + num2str(hj,2) + num2str(hk,2);
1388 vector<int> helBef = {hA, hB};
1389 vector<int> helNew = {hi, hj, hk};
1394 if (idA() != 21 && hi != hA)
continue;
1395 if (idB() != 21 && hk != hB)
continue;
1397 if (idA() == 21 && (hi != hA && hj != -hA))
continue;
1398 if (idB() == 21 && (hk != hB && hj != -hB))
continue;
1400 if (hi != hA && hk != hB)
continue;
1403 else if (idA() == 21) {
1405 if (hk != hB)
continue;
1407 if (hi != hj)
continue;
1412 if (hk != hB)
continue;
1414 if (hA == hj)
continue;
1418 for (
int iTest = 0; iTest <= nPointsCheck; ++iTest) {
1420 double sABnow = pow2(1.0+rndmPtr->flat()*999.0);
1422 double yaj = rndmPtr->flat();
1423 double yjb = rndmPtr->flat();
1424 if (yaj + yjb > 1.0) {
1430 double sab = sABnow/(1.0-yaj-yjb);
1433 if (sab > shhMax)
continue;
1434 double saj = yaj*sab;
1435 double sjb = yjb*sab;
1436 vector<double> invariants = {sABnow, saj, sjb};
1439 double ant = antFun(invariants, mDum, helBef, helNew);
1445 printOut(vinciaName() +
":check",
"ERROR ant(" +
1446 num2str((
int)sqrt(saj)) +
"^2," + num2str((
int)sqrt(sjb)) +
"^2," +
1447 num2str((
int)sqrt(sABnow)) +
"^2 ; " + helString +
") < 0");
1448 }
else if (ant > 0.0) isZero =
false;
1451 if ((1.0 - yaj - yjb > 0.05) && (yaj > 0.05) && (yjb > 0.05)
1452 && (ant*sABnow < deadZoneAvoidance)) hasDeadZone =
true;
1454 isOK = isOK && isPositive;
1457 if (!isPositive && verbose >= 1) printOut(vinciaName() +
":check",
1458 "ERROR (ant < 0 encountered " + helString +
" )");
1459 else if (isPositive && !isZero && verbose >= 6)
1460 printOut(vinciaName() +
":check",
"OK (is positive " + helString +
" )");
1462 if (hasDeadZone && verbose >= 1) printOut(vinciaName() +
":check",
1463 "WARNING (dead zone encountered " + helString +
" )");
1464 else if (!hasDeadZone && verbose >= 6) printOut(vinciaName() +
":check",
1465 "OK (no dead zones " + helString+
" )");
1480 double QQEmitII::antFun(vector<double> invariants, vector<double> masses,
1481 vector<int> helBef, vector<int> helNew) {
1484 double sAB = invariants[0];
1485 double saj = invariants[1];
1486 double sjb = invariants[2];
1489 if ((saj <= 0.0) || (sjb <= 0.0) || (sAB <= 0.0))
return 0.0;
1492 initMasses(&masses);
1493 int nAvg = initHel(&helBef,&helNew);
1494 if (nAvg <= 0)
return 0.;
1497 double sab = saj+sjb+sAB;
1498 double yaj = saj/sab;
1499 double yjb = sjb/sab;
1500 double yAB = sAB/sab;
1501 double eikJ = 1./(sAB*yaj*yjb);
1504 double facMa = (mi != 0.) ? pow2(mi) / sab / pow2(yaj) / sAB : 0.;
1505 double facMb = (mk != 0.) ? pow2(mk) / sab / pow2(yjb) / sAB : 0.;
1511 if (hA * hB > 0 || hA == 9 || hB == 9) {
1513 term = eikJ - facMa - facMb;
1514 if (RH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
1515 if (LH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
1518 term = pow2(yAB)*eikJ - pow2(1-yjb)*facMa - pow2(1-yaj)*facMb;
1519 if (RH[hA] && RH[hB] && RH[hi] && LH[hj] && RH[hk]) hSum += term;
1520 if (LH[hA] && LH[hB] && LH[hi] && RH[hj] && LH[hk]) hSum += term;
1524 term = facMa * pow2(yjb);
1525 if (RH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
1526 if (LH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
1531 term = facMb * pow2(yaj);
1532 if (RH[hA] && RH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += term;
1533 if (LH[hA] && LH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += term;
1538 if (hA * hB < 0 || hA == 9 || hB == 9) {
1540 term = pow2(1. - yaj)*eikJ;
1541 if (RH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
1542 if (LH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
1545 term = pow2(1. - yjb)*eikJ;
1546 if (RH[hA] && LH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += term;
1547 if (LH[hA] && RH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += term;
1551 term = facMa * pow2(yjb);
1552 if (RH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
1553 if (LH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
1558 term = facMb * pow2(yaj);
1559 if (RH[hA] && LH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += term;
1560 if (LH[hA] && RH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += term;
1573 double QQEmitII::AltarelliParisi(vector<double> invariants, vector<double>,
1574 vector<int>, vector<int>) {
1577 double sAB = invariants[0];
1578 double saj = invariants[1];
1579 double sjb = invariants[2];
1580 if ((saj <= 0.0) || (sjb <= 0.0) || (sAB <= 0.0))
return 0.0;
1583 double z = ( saj < sjb ? zA(invariants) : zB(invariants) );
1584 double Q2 = min(saj,sjb);
1585 double AP = 1.0/z * (1.0 + pow2(z))/(1.0 - z);
1602 double GQEmitII::antFun(vector<double> invariants, vector<double> masses,
1603 vector<int> helBef, vector<int> helNew) {
1606 double sAB = invariants[0];
1607 double saj = invariants[1];
1608 double sjb = invariants[2];
1611 if ((saj <= 0.0) || (sjb <= 0.0) || (sAB <= 0.0))
return 0.0;
1614 initMasses(&masses);
1615 int nAvg = initHel(&helBef, &helNew);
1616 if (nAvg <= 0)
return 0.;
1619 double sab = saj+sjb+sAB;
1620 double yaj = saj/sab;
1621 double yjb = sjb/sab;
1622 double yAB = sAB/sab;
1623 double eikJ = 1./(sAB*yaj*yjb);
1624 double collA = 1./(sAB*yaj*(1. - yjb));
1627 double facMb = (mk != 0.) ? pow2(mk) / sab / pow2(yjb) / sAB : 0.;
1633 if (hA * hB > 0 || hA == 9 || hB == 9) {
1635 term = eikJ + collA - facMb;
1636 if (RH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
1637 if (LH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
1640 term = (1. - yjb)*pow2(yAB)*eikJ - pow2(1-yaj) * facMb;
1641 if (RH[hA] && RH[hB] && RH[hi] && LH[hj] && RH[hk]) hSum += term;
1642 if (LH[hA] && LH[hB] && LH[hi] && RH[hj] && LH[hk]) hSum += term;
1645 term = pow3(yjb)*collA;
1646 if (RH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
1647 if (LH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
1651 term = facMb * pow2(yaj);
1652 if (RH[hA] && RH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += term;
1653 if (LH[hA] && LH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += term;
1658 if (hA * hB < 0 || hA == 9 || hB == 9) {
1660 term = pow2(1. - yaj)*eikJ + collA - pow2(1-yaj)*facMb;
1661 if (RH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
1662 if (LH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
1665 term = pow3(1. - yjb)*eikJ - facMb;
1666 if (RH[hA] && LH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += term;
1667 if (LH[hA] && RH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += term;
1670 term = pow3(yjb)*collA;
1671 if (RH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
1672 if (LH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
1676 term = facMb * pow2(yaj);
1677 if (RH[hA] && LH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
1678 if (LH[hA] && RH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
1683 if (modeSLC >= 2) hSum *= CF/chargeFacSav * (1 - yjb)/(2 - yaj - yjb)
1684 + CA/chargeFacSav * (1 - yaj)/(2 - yaj - yjb);
1695 double GQEmitII::AltarelliParisi(vector<double> invariants,
1696 vector<double>, vector<int>, vector<int>) {
1699 double sAB = invariants[0];
1700 double saj = invariants[1];
1701 double sjb = invariants[2];
1704 if ((saj <= 0.0) || (sjb <= 0.0) || (sAB <= 0.0))
return 0.0;
1707 double z = ( saj < sjb ? zA(invariants) : zB(invariants));
1708 double Q2 = min(saj,sjb);
1713 AP = 1.0/z*(pow(z, 4.0) + 1.0 + pow(1 - z, 4.0))/z/(1.0 - z);
1721 AP = 1.0/z * (1.0+pow2(z))/(1.0-z);
1739 double GGEmitII::antFun(vector<double> invariants, vector<double>,
1740 vector<int> helBef, vector<int> helNew) {
1743 double sAB = invariants[0];
1744 double saj = invariants[1];
1745 double sjb = invariants[2];
1748 if ((saj <= 0.0) || (sjb <= 0.0) || (sAB <= 0.0))
return 0.0;
1751 int nAvg = initHel(&helBef, &helNew);
1752 if (nAvg <= 0)
return 0.;
1755 double sab = saj+sjb+sAB;
1756 double yaj = saj/sab;
1757 double yjb = sjb/sab;
1758 double yAB = sAB/sab;
1759 double eikJ = 1./(sAB*yaj*yjb);
1760 double collA = 1./(sAB*yaj*(1.-yjb));
1761 double collB = 1./(sAB*yjb*(1.-yaj));
1767 if ( hA * hB > 0 || hA == 9 || hB == 9) {
1769 term = eikJ + collA + collB;
1770 if (RH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
1771 if (LH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
1774 term = pow3(yAB)*eikJ;
1775 if (RH[hA] && RH[hB] && RH[hi] && LH[hj] && RH[hk]) hSum += term;
1776 if (LH[hA] && LH[hB] && LH[hi] && RH[hj] && LH[hk]) hSum += term;
1779 term = pow3(yjb)*collA;
1780 if (RH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
1781 if (LH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
1784 term = pow3(yaj)*collB;
1785 if (RH[hA] && RH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += term;
1786 if (LH[hA] && LH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += term;
1790 if (hA * hB < 0 || hA == 9 || hB == 9) {
1792 term = pow3(1.-yaj)*eikJ + collA;
1793 if (RH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
1794 if (LH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
1797 term = pow3(1 - yjb)*eikJ + collB;
1798 if (RH[hA] && LH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += term;
1799 if (LH[hA] && RH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += term;
1802 term = pow3(yaj)*collB;
1803 if (RH[hA] && LH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
1804 if (LH[hA] && RH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
1807 term = pow3(yjb)*collA;
1808 if (RH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
1809 if (LH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
1821 double GGEmitII::AltarelliParisi(vector<double> invariants, vector<double>,
1822 vector<int>, vector<int>) {
1825 double sAB = invariants[0];
1826 double saj = invariants[1];
1827 double sjb = invariants[2];
1830 if ((saj <= 0.0) || (sjb <= 0.0) || (sAB <= 0.0))
return 0.0;
1833 double z = ( saj < sjb ? zA(invariants) : zB(invariants) );
1834 double Q2 = min(saj,sjb);
1835 double AP = 1.0/z*(pow(z, 4.0) + 1.0+pow(1 - z, 4.0))/z/(1.0 - z);
1852 double QXSplitII::antFun(vector<double> invariants, vector<double> masses,
1853 vector<int> helBef, vector<int> helNew) {
1856 double sAB = invariants[0];
1857 double saj = invariants[1];
1858 double sjb = invariants[2];
1861 if ((saj <= 0.0) || (sjb <= 0.0) || (sAB <= 0.0))
return 0.0;
1864 initMasses(&masses);
1865 int nAvg = initHel(&helBef,&helNew);
1866 if (nAvg <= 0)
return 0.;
1869 double sab = sAB + saj + sjb;
1870 double yaj = saj/sab;
1871 double yAB = sAB/sab;
1872 double splitA = 1.0/sAB/yaj;
1873 double facMj = (mj != 0. ) ? pow2(mj) / sab / pow2(yaj) / sAB : 0.0;
1879 if (hA * hB > 0 || hA == 9 || hB == 9) {
1881 term = pow2(yAB) * splitA - pow2(yAB)/(1. - yAB) * facMj;
1882 if (RH[hA] && RH[hB] && RH[hi] && LH[hj] && RH[hk]) hSum += term;
1883 if (LH[hA] && LH[hB] && LH[hi] && RH[hj] && LH[hk]) hSum += term;
1886 term = pow2(1. - yAB) * splitA - (1. - yAB) * facMj;
1887 if (RH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
1888 if (LH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
1892 term = facMj / (1. - yAB);
1893 if (RH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
1894 if (LH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
1899 if (hA * hB < 0 || hA == 9 || hB == 9) {
1901 term = pow2(yAB) * splitA - pow2(yAB)/(1. - yAB) * facMj;
1902 if (RH[hA] && LH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += term;
1903 if (LH[hA] && RH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += term;
1906 term = pow2(1. - yAB) * splitA - (1. - yAB) * facMj;
1907 if (RH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
1908 if (LH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
1912 term = facMj / (1. - yAB);
1913 if (RH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
1914 if (LH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
1927 double QXSplitII::AltarelliParisi(vector<double> invariants, vector<double>,
1928 vector<int>, vector<int>) {
1931 double sAB = invariants[0];
1932 double saj = invariants[1];
1933 double sjb = invariants[2];
1936 if ((saj <= 0.0) || (sjb <= 0.0) || (sAB <= 0.0))
return 0.0;
1939 double z = zA(invariants);
1941 double AP = 1.0/z * (pow2(z)+pow2(1 - z));
1958 double GXConvII::antFun(vector<double> invariants, vector<double> masses,
1959 vector<int> helBef, vector<int> helNew) {
1962 double sAB = invariants[0];
1963 double saj = invariants[1];
1964 double sjb = invariants[2];
1967 if ((saj <= 0.0) || (sjb <= 0.0) || (sAB <= 0.0))
return 0.0;
1970 initMasses(&masses);
1971 int nAvg = initHel(&helBef, &helNew);
1972 if (nAvg <= 0)
return 0.;
1975 double sab = sAB + saj + sjb - 2*pow2(mj);
1976 double yaj = saj/sab;
1977 double yAB = sAB/sab;
1978 double mu2j = (mj != 0.) ? pow2(mj)/sab : 0.;
1979 double convA = 1.0/(2.*sAB*(yaj - 2.*mu2j)*yAB);
1980 double facMj = (mj != 0.) ? mu2j/(2.*sAB*pow2(yaj - 2.*mu2j)) : 0.;
1986 if (hA * hB > 0 || hA == 9 || hB == 9) {
1988 term = convA - facMj*yAB/(1. - yAB);
1989 if (RH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
1990 if (LH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
1993 term = pow2(1 - yAB)*convA - facMj*yAB*(1. - yAB);
1994 if (RH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
1995 if (LH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
1999 term = facMj*pow3(yAB)/(1. - yAB);
2000 if (RH[hA] && RH[hB] && RH[hi] && LH[hj] && RH[hk]) hSum += term;
2001 if (LH[hA] && LH[hB] && LH[hi] && RH[hj] && LH[hk]) hSum += term;
2006 if (hA * hB < 0 || hA == 9 || hB == 9) {
2008 term = convA - facMj*yAB/(1. - yAB);
2009 if (RH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
2010 if (LH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
2013 term = pow2(1 - yAB)*convA - facMj*yAB*(1. - yAB);
2014 if (RH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
2015 if (LH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
2018 term = facMj*pow3(yAB)/(1. - yAB);
2019 if (RH[hA] && LH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += term;
2020 if (LH[hA] && RH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += term;
2032 double GXConvII::AltarelliParisi(vector<double> invariants, vector<double>,
2033 vector<int>, vector<int>) {
2036 double sAB = invariants[0];
2037 double saj = invariants[1];
2038 double sjb = invariants[2];
2041 if ((saj <= 0.0) || (sjb <= 0.0) || (sAB <= 0.0))
return 0.0;
2044 double z = zA(invariants);
2046 double AP = 1.0/z * (1.0+pow2(1.0-z))/z;
2064 bool AntennaFunctionIF::init() {
2067 if (!isInitPtr)
return false;
2068 verbose = settingsPtr->mode(
"Vincia:verbose");
2069 chargeFacSav = settingsPtr->parm(vinciaName()+
":chargeFactor");
2070 if (chargeFacSav < 0.) chargeFacSav = 0.0;
2076 modeSLC = settingsPtr->mode(
"Vincia:modeSLC");
2077 if (modeSLC == 0 && id1() == 21) chargeFacSav = CA;
2078 if (modeSLC == 2 && id1() == 21) {
2079 if (idA() == 21 && idB() == 21 ) chargeFacSav = CA;
2080 else if (idA() == 21 || idB() == 21) chargeFacSav = (CA + CF)/2.;
2081 else chargeFacSav = CF;
2085 if (settingsPtr->isMode(vinciaName() +
":kineMap"))
2086 kineMapSav = settingsPtr->mode(vinciaName()+
":kineMap");
2087 else if (isRFant()) {
2089 if (id1() == 21) kineMapSav = settingsPtr->mode(
"Vincia:kineMapRFemit");
2091 else kineMapSav = settingsPtr->mode(
"Vincia:kineMapRFsplit");
2094 else kineMapSav = settingsPtr->mode(
"Vincia:kineMapIF");
2097 alphaSav = settingsPtr->parm(
"Vincia:octetPartitioning");
2100 sectorShower = settingsPtr->flag(
"Vincia:sectorShower");
2101 sectorDampSav = settingsPtr->parm(
"Vincia:sectorDamp");
2113 bool AntennaFunctionIF::check() {
2117 int nPointsCheck = settingsPtr->mode(
"Vincia:nPointsCheck");
2118 double shhMax = pow2(14000.0);
2119 double deadZoneAvoidance = settingsPtr->parm(
"Vincia:deadZoneAvoidance");
2122 if (isRFant())
return checkRes();
2128 double sAK[2] = {pow2(50.0), pow2(150.0)};
2131 if (id1() == 21 || id1() == 22) {
2133 for (
int iTest = 0; iTest <= 1; ++iTest) {
2135 for (
int isAK = 0; isAK <= 1; ++isAK) {
2137 double yaj = 1.0e-3 * pow(10.0, iTest);
2138 double yjk = 1.0e-3 / pow(10.0, iTest);
2139 double sak = sAK[isAK]*(1.0 + yjk - yaj);
2140 double saj = yaj*sAK[isAK];
2141 double sjk = yjk*sAK[isAK];
2142 vector<double> invariants ={sAK[isAK], saj, sjk};
2144 double eik = 2.0*sak/saj/sjk;
2146 int modeSLCsave = modeSLC;
2148 double ant = antFun(invariants);
2149 modeSLC = modeSLCsave;
2151 double ratio = ant/eik;
2152 if (abs(ratio - 1.0) >= 0.001) {
2154 if (verbose >= 1) printOut(vinciaName() +
":check",
2155 "WARNING: FAILED (eikonal " + num2str(iTest, 1) +
2156 " and sAK = " + num2str((
int)sqrt(sAK[isAK])) +
"^2)");
2157 }
else if (verbose >= 6) printOut(vinciaName() +
":check",
2158 "OK (eikonal " + num2str(iTest, 1) +
" and sAK = " +
2159 num2str((
int)sqrt(sAK[isAK])) +
"^2)");
2166 for (
int iTest = 0; iTest <= 2; ++iTest) {
2168 for (
int isAK = 0; isAK <= 1; ++isAK) {
2171 double y2 = 0.2 + iTest*0.3;
2172 double s1 = y1*sAK[isAK];
2173 double s2 = y2*sAK[isAK];
2174 vector<double> invariants1 = {sAK[isAK], s1, s2};
2175 vector<double> invariants2 = invariants1;
2176 invariants2[1] = invariants1[2];
2177 invariants2[2] = invariants1[1];
2179 double AP1 = AltarelliParisi(invariants1);
2180 double AP2 = AltarelliParisi(invariants2);
2182 int modeSLCsave = modeSLC;
2184 double ant1 = antFun(invariants1);
2185 double ant2 = antFun(invariants2);
2186 modeSLC = modeSLCsave;
2188 double zs1 = zA(invariants1);
2189 double zs2 = zB(invariants1);
2191 double ratio = ant1/AP1;
2192 if (abs(ratio - 1.0) >= 0.01) {
2195 printOut(vinciaName() +
":check",
"WARNING: FAILED "
2196 "(collinear aj " + num2str(iTest, 1) +
" and sAK = " +
2197 num2str((
int)sqrt(sAK[isAK])) +
"^2)");
2198 if (verbose >= 3) cout << setprecision(6) <<
" ant = "
2199 << num2str(ant1, 9) <<
" y1 = " << num2str(y1, 9)
2200 <<
" y2 = " << num2str(y2, 9) <<
" " <<endl
2201 <<
" P(z) = " << num2str(AP1, 9)
2202 <<
" z = " << num2str(zs1, 9) << endl;
2203 }
else if (verbose >= 6) printOut(vinciaName() +
":check",
2204 "OK (collinear aj " + num2str(iTest, 1)
2205 +
" and sAK = " + num2str((
int)sqrt(sAK[isAK])) +
"^2)");
2208 double ratio = ant2/AP2;
2209 if (abs(ratio - 1.0) >= 0.01) {
2211 if (verbose >= 1) printOut(vinciaName() +
":check",
2212 "WARNING: FAILED (collinear jk " + num2str(iTest, 1) +
2213 " and sAK = " + num2str((
int)sqrt(sAK[isAK]))+
"^2)");
2214 if (verbose >= 3) cout << setprecision(6) <<
" ant = "
2215 << num2str(ant1, 9) <<
" y1 = " << num2str(y1, 9) <<
" y2 = "
2216 << num2str(y2, 9) <<
" " << endl <<
" P(z) = "
2217 << num2str(AP2,9) <<
" z = " << num2str(zs2, 9) << endl;
2218 }
else if (verbose >= 6) printOut(vinciaName() +
":check",
2219 "OK (collinear jk " + num2str(iTest, 1) +
2220 " and sAK = " + num2str((
int)sqrt(sAK[isAK])) +
"^2)");
2226 string helString =
" 9 9 -> 9 9 9";
2227 for (
int iHel = -1; iHel < 32; ++iHel) {
2228 bool isPositive =
true;
2230 bool hasDeadZone =
false;
2232 hj = 1 - 2*(iHel%2);
2233 hi = 1 - 2*((iHel/2)%2);
2234 hk = 1 - 2*((iHel/4)%2);
2235 hA = 1 - 2*((iHel/8)%2);
2236 hB = 1 - 2*((iHel/16)%2);
2237 helString = num2str(hA,2) + num2str(hB,2) +
" ->" +
2238 num2str(hi,2) + num2str(hj,2) + num2str(hk,2);
2240 vector<int> helBef = {hA, hB};
2241 vector<int> helNew = {hi, hj, hk};
2244 if (id1() == 21 || id1() == 22)
2245 if (hA != hi || hB != hk)
continue;
2248 for (
int iTest = 0; iTest <= nPointsCheck; ++iTest) {
2250 double sAKnow = pow2(1.0+rndmPtr->flat()*999.0);
2252 double xA = rndmPtr->flat();
2254 double sjk = rndmPtr->flat()*sAKnow*(1.0-xA)/xA;
2255 double saj = rndmPtr->flat()*(sAKnow+sjk);
2256 double sak = sAKnow+sjk-saj;
2257 vector<double> invariants = {sAKnow, saj, sjk};
2259 if (saj > shhMax || sjk > shhMax || sak > shhMax || sAKnow > shhMax)
2262 double pT2 = saj * sjk / (sAKnow + sjk);
2263 if (pT2 > sAKnow)
continue;
2265 double ant = antFun(invariants, mDum, helBef, helNew);
2268 cout <<
"ant = "<<ant * sAKnow << endl;
2270 if (verbose >= 3) printOut(vinciaName() +
":check",
2271 "ERROR ant(" + num2str((
int)sqrt(saj))
2272 +
"^2," + num2str((
int)sqrt(sjk)) +
"^2,"
2273 + num2str((
int)sqrt(sAKnow)) +
"^2 ; " + helString +
") < 0");
2274 }
else if (ant > 0.0) isZero =
false;
2277 double yjk = sjk / (sAKnow + sjk);
2278 double yAK = sAKnow / (sAKnow + sjk);
2279 double yaj = saj / (sAKnow + sjk);
2280 double yak = sak / (sAKnow + sjk);
2281 double yMin = 5*sqrt(deadZoneAvoidance);
2282 if ((sjk < 0.95*sAKnow*(1.0-xA)/xA)
2283 && yjk > yMin && yaj > yMin && yak > yMin && yAK > yMin
2284 && (ant*(sAKnow+sjk) < deadZoneAvoidance)) {
2288 isOK = isOK && isPositive;
2291 if (!isPositive && verbose >= 1) printOut(vinciaName() +
":check",
2292 "ERROR (ant < 0 encountered " + helString +
" )");
2293 else if (isPositive && !isZero && verbose >= 6) printOut(vinciaName() +
2294 ":check",
"OK (is positive " + helString +
" )");
2296 if (hasDeadZone && verbose >= 1) printOut(vinciaName() +
":check",
2297 "WARNING (dead zone encountered " + helString +
" )");
2298 else if (!hasDeadZone && verbose >= 6) printOut(vinciaName()
2299 +
":check",
"OK (no dead zones " + helString+
" )");
2311 bool AntennaFunctionIF::checkRes() {
2314 vector<double> masses;
2315 getTestMasses(masses);
2319 if (id1() == 21 || id1() == 22) {
2322 double yjk = 0.0001;
2325 vector<double> invariants;
2326 if (!getTestInvariants(invariants, masses, yaj, yjk))
return false;
2329 double antSoft = massiveEikonal(invariants, masses);
2332 double antNow = antFun(invariants, masses);
2335 double ratio= antNow/antSoft;
2336 if (abs(ratio - 1.) >= 0.001) {
2337 if (verbose >= quiet) {
2339 ss <<
"WARNING:" + vinciaName() <<
" FAILED soft eikonal: ratio to "
2340 <<
"soft = " << ratio;
2341 printOut(__METHOD_NAME__, ss.str());
2345 else if (verbose >= verylouddebug)
2346 printOut(__METHOD_NAME__, vinciaName() +
" OK (soft eikonal)");
2352 for (
int iTest = 0; iTest < 4; ++iTest) {
2354 double yaj = 0.2 + double(iTest)*0.2;
2358 vector<double> invariants;
2359 if (!getTestInvariants(invariants, masses, yaj, yjk)) {
2360 if (verbose>=normal) infoPtr->errorMsg(
"Error in "+__METHOD_NAME__
2361 +
": Failed to get test invariants!");
2366 double gramdet = gramDet(invariants, masses);
2368 if (verbose >= verylouddebug) printOut(__METHOD_NAME__,
2369 vinciaName() +
" not in phase space. Continue.");
2375 double antNow = antFunCollLimit(invariants, masses);
2378 double AP = AltarelliParisi(invariants, masses);
2380 double ratio = antNow/AP;
2382 if (abs(ratio - 1.) >= 0.01 && abs(antNow - AP) > 10.) {
2383 if (verbose >= 1) printOut(__METHOD_NAME__,
"WARNING:" + vinciaName() +
2384 "Failed (collinear ij " + num2str(iTest, 1)+
" )");
2385 if (verbose >= 3) cout << setprecision(6) <<
" ant = "
2386 << num2str(antNow, 9) <<
" yaj = " << num2str(yaj, 9)
2387 <<
" yjk = " << num2str(yjk, 9) <<
" " << endl <<
" P(z) = "
2388 << num2str(AP, 9) << endl;
2391 else if (verbose >= verylouddebug) printOut(__METHOD_NAME__, vinciaName()
2392 +
" OK (collinear ij " + num2str(iTest, 1) +
" )");
2403 bool AntennaFunctionIF::getTestInvariants(vector<double> &invariants,
2404 vector<double> masses,
double yaj,
double yjk) {
2406 if (masses.size() != 4)
return false;
2407 double mA = masses[0];
2408 double mK = masses[2];
2409 double mAK = masses[3];
2410 double sAK = mA*mA + mK*mK - mAK*mAK;
2411 double sjk = sAK*yjk/(1. - yjk);
2412 if((sjk+sAK)==0.0)
return false;
2413 double saj = yaj*(sAK+sjk);
2414 double sak = sAK + sjk -saj;
2415 double det = saj*sjk*sak - saj*saj*mK*mK - sjk*sjk*mA*mA;
2416 if (det <0.)
return false;
2417 invariants = {sAK, saj, sjk, sak};
2427 double AntennaFunctionIF::antFunCollLimit(vector<double> invariants,
2428 vector<double> masses){
2430 double ant = antFun(invariants,masses);
2432 vector<double> flipped_invariants = {
2433 invariants[0], invariants[3], invariants[2], invariants[1]};
2434 ant += antFun(flipped_invariants,masses);
2448 double QQEmitIF::antFun(vector<double> invariants, vector<double> masses,
2449 vector<int> helBef, vector<int> helNew) {
2452 double sAK = invariants[0];
2453 double saj = invariants[1];
2454 double sjk = invariants[2];
2457 if ((saj <= 0.0) || (sjk <= 0.0) || (sAK <= 0.0))
return 0.0;
2460 initMasses(&masses);
2461 int nAvg = initHel(&helBef, &helNew);
2462 if (nAvg <= 0)
return 0.;
2465 double s = sAK + sjk;
2468 double eikJ = 1./(sAK*yaj*yjk);
2469 double facMa = (mi != 0.) ? pow2(mi)/s/sAK/pow2(yaj) : 0.;
2470 double facMk = (mk != 0.) ? pow2(mk)/s/sAK/pow2(yjk) : 0.;
2476 if (hA * hB > 0 || hA == 9 || hB == 9) {
2478 term = eikJ - facMa - facMk/(1. - yaj);
2479 if (RH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
2480 if (LH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
2483 term = (pow2(1. - yaj) + (pow2(1. - yjk) - 1.)*pow2(1. - yaj)) * eikJ
2484 - facMa*pow2(1. - yjk-yaj) - facMk*(1. - yaj)*pow2(1. - yjk);
2485 if (RH[hA] && RH[hB] && RH[hi] && LH[hj] && RH[hk]) hSum += term;
2486 if (LH[hA] && LH[hB] && LH[hi] && RH[hj] && LH[hk]) hSum += term;
2490 term = facMa * pow2(yjk);
2491 if (RH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
2492 if (LH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
2497 term = facMk * pow2(yaj)/(1. - yaj);
2498 if (RH[hA] && RH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
2499 if (LH[hA] && LH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
2504 if (hA * hB < 0 || hA == 9 || hB == 9) {
2505 term = pow2(1.-yaj) * eikJ - facMa*(1. - yaj) - facMk*(1. - yaj);
2508 if (RH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
2509 if (LH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
2512 term = pow2(1.-yjk) * eikJ - facMa*pow2(1. - yjk)
2513 - facMk*pow2(1. - yjk)/(1. - yaj);
2514 if (RH[hA] && LH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += term;
2515 if (LH[hA] && RH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += term;
2519 term = facMa * pow2(yjk);
2520 if (RH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
2521 if (LH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
2526 term = facMk * pow2(yaj) / (1. - yaj);
2527 if (RH[hA] && LH[hB] && RH[hi] && LH[hj] && RH[hk]) hSum += term;
2528 if (LH[hA] && RH[hB] && LH[hi] && RH[hj] && LH[hk]) hSum += term;
2541 double QQEmitIF::AltarelliParisi(vector<double> invariants, vector<double>,
2542 vector<int>, vector<int>) {
2545 double sAK = invariants[0];
2546 double saj = invariants[1];
2547 double sjk = invariants[2];
2548 if ((saj <= 0.0) || (sjk <= 0.0) || (sAK <= 0.0))
return 0.0;
2551 double z = ( saj < sjk ? zA(invariants) : zB(invariants) );
2552 double Q2 = min(saj,sjk);
2557 AP = 1.0/z * (1.0 + pow2(z))/(1.0 - z);
2565 AP = (1.0 + pow2(z))/(1.0 - z);
2583 double QGEmitIF::antFun(vector<double> invariants, vector<double> masses,
2584 vector<int> helBef, vector<int> helNew) {
2587 double sAK = invariants[0];
2588 double saj = invariants[1];
2589 double sjk = invariants[2];
2592 if ((saj <= 0.0) || (sjk <= 0.0) || (sAK <= 0.0))
return 0.0;
2595 initMasses(&masses);
2596 int nAvg = initHel(&helBef, &helNew);
2597 if (nAvg <= 0)
return 0.;
2600 double s = sAK + sjk;
2603 double eikJ = 1./(sAK*yaj*yjk);
2604 double colK = (1. - alphaSav) * (1. - 2.*yaj) / (sAK * yjk);
2605 double facMa = (mi != 0.) ? pow2(mi)/s/sAK/pow2(yaj) : 0.;
2611 if (hA * hB > 0 || hA == 9 || hB == 9) {
2613 term = eikJ + colK - facMa;
2614 if (RH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
2615 if (LH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
2618 term = (pow3(1. - yaj)+pow2(1. - yjk)-1) * eikJ
2619 - facMa*pow2(1. - yjk - yaj)*(1. - yaj) + (3. - pow2(yaj))/sAK;
2620 if (RH[hA] && RH[hB] && RH[hi] && LH[hj] && RH[hk]) hSum += term;
2621 if (LH[hA] && LH[hB] && LH[hi] && RH[hj] && LH[hk]) hSum += term;
2625 term = facMa*pow2(yjk);
2626 if (RH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
2627 if (LH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
2632 if (hA * hB < 0 || hA == 9 || hB == 9) {
2634 term = pow3(1. - yaj) * eikJ - facMa*pow2(1. - yaj);
2635 if (RH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
2636 if (LH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
2639 term = pow2(1. - yjk) * eikJ + colK - facMa*pow2(1. - yjk)
2640 + (2*yaj - yjk)/sAK;
2641 if (RH[hA] && LH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += term;
2642 if (LH[hA] && RH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += term;
2646 term = facMa * pow2(yjk);
2647 if (RH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
2648 if (LH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
2653 if (modeSLC >= 2) hSum *= CF/chargeFacSav * (1 - yaj)/(2 - yaj - yjk)
2654 + CA/chargeFacSav * (1 - yjk)/(2 - yaj - yjk);
2665 double QGEmitIF::AltarelliParisi(vector<double> invariants, vector<double>,
2666 vector<int>, vector<int>) {
2669 double sAK = invariants[0];
2670 double saj = invariants[1];
2671 double sjk = invariants[2];
2672 if ((saj <= 0.0) || (sjk <= 0.0) || (sAK <= 0.0))
return 0.0;
2675 double z = ( saj < sjk ? zA(invariants) : zB(invariants) );
2676 double Q2 = min(saj, sjk);
2681 AP = 1.0/z * (1.0 + pow2(z))/(1.0 - z);
2689 AP = (2.0*z/(1.0 - z)+z*(1.0 - z));
2707 double GQEmitIF::antFun(vector<double> invariants, vector<double> masses,
2708 vector<int> helBef, vector<int> helNew) {
2711 double sAK = invariants[0];
2712 double saj = invariants[1];
2713 double sjk = invariants[2];
2716 if ((saj <= 0.0) || (sjk <= 0.0) || (sAK <= 0.0))
return 0.0;
2719 initMasses(&masses);
2720 int nAvg = initHel(&helBef, &helNew);
2721 if (nAvg <= 0)
return 0.;
2724 double s = sAK + sjk;
2727 double eikJ = 1./(sAK*yaj*yjk);
2728 double colA = 1./(sAK*yaj*(1. - yjk));
2729 double facMk = (mk != 0.) ? pow2(mk)/s/sAK/pow2(yjk) : 0.;
2735 if (hA * hB > 0 || hA == 9 || hB == 9) {
2737 term = eikJ + colA - facMk/(1. - yaj);
2738 if (RH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
2739 if (LH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
2742 term = (pow2(1. - yaj)+(pow3(1. - yjk) - 1)*(pow2(1. - yaj)))* eikJ
2743 - facMk*(1. - yaj)*pow3(1 - yjk);
2744 if (RH[hA] && RH[hB] && RH[hi] && LH[hj] && RH[hk]) hSum += term;
2745 if (LH[hA] && LH[hB] && LH[hi] && RH[hj] && LH[hk]) hSum += term;
2748 term = pow3(yjk) * colA;
2749 if (RH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
2750 if (LH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
2754 term = facMk * pow2(yaj)/(1. - yaj);
2755 if (RH[hA] && RH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
2756 if (LH[hA] && LH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
2761 if (hA * hB < 0 || hA == 9 || hB == 9) {
2763 term = pow2(1 - yaj) * eikJ + colA - facMk*(1. - yaj);
2764 if (RH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
2765 if (LH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
2768 term = pow3(1. - yjk) * eikJ - facMk*pow3(1. - yjk)/(1. - yaj);
2769 if (RH[hA] && LH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += term;
2770 if (LH[hA] && RH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += term;
2773 term = pow3(yjk) * colA;
2774 if (RH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
2775 if (LH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
2779 term = facMk * pow2(yaj)/(1. - yaj);
2780 if (RH[hA] && LH[hB] && RH[hi] && LH[hj] && RH[hk]) hSum += term;
2781 if (LH[hA] && RH[hB] && LH[hi] && RH[hj] && LH[hk]) hSum += term;
2786 if (modeSLC >= 2) hSum *= CF/chargeFacSav * (1 - yjk)/(2 - yaj - yjk)
2787 + CA/chargeFacSav * (1 - yaj)/(2 - yaj - yjk);
2798 double GQEmitIF::AltarelliParisi(vector<double> invariants, vector<double>,
2799 vector<int>, vector<int>) {
2802 double sAK = invariants[0];
2803 double saj = invariants[1];
2804 double sjk = invariants[2];
2805 if ((saj <= 0.0) || (sjk <= 0.0) || (sAK <= 0.0))
return 0.0;
2808 double z = ( saj < sjk ? zA(invariants) : zB(invariants) );
2809 double Q2 = min(saj,sjk);
2814 AP = 1.0/z*(pow(z, 4.0) + 1.0 + pow(1 - z, 4.0))/z/(1.0 - z);
2822 AP = (1.0 + pow2(z))/(1.0 - z);
2840 double GGEmitIF::antFun(vector<double> invariants, vector<double>,
2841 vector<int> helBef, vector<int> helNew) {
2844 double sAK = invariants[0];
2845 double saj = invariants[1];
2846 double sjk = invariants[2];
2849 if ((saj <= 0.0) || (sjk <= 0.0) || (sAK <= 0.0))
return 0.0;
2852 int nAvg = initHel(&helBef, &helNew);
2855 double s = sAK + sjk;
2859 double eikJ = 1./(sAK*yaj*yjk);
2860 double colA = 1./(sAK*yaj*yAK);
2861 double colK = (1.-alphaSav) * (1.-2.*yaj) / (sAK * yjk);
2867 if (hA * hB > 0 || hA == 9 || hB == 9) {
2869 term = eikJ + colA + colK;
2870 if (RH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
2871 if (LH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
2874 term = (pow3(1. - yaj) + pow3(1. - yjk) - 1.) * eikJ
2875 + ( 6. - 3.*(yaj+yjk) + yaj*yjk )/sAK;
2876 if (RH[hA] && RH[hB] && RH[hi] && LH[hj] && RH[hk]) hSum += term;
2877 if (LH[hA] && LH[hB] && LH[hi] && RH[hj] && LH[hk]) hSum += term;
2880 term = pow3(yjk) * colA;
2881 if (RH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
2882 if (LH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
2886 if (hA * hB < 0 || hA == 9 || hB == 9) {
2888 term = pow3(1. - yaj) * eikJ + colA;
2889 if (RH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
2890 if (LH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
2893 term = pow3(1. - yjk) * eikJ + colK + (3.*yaj - yjk - yaj*yjk)/sAK;
2894 if (RH[hA] && LH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += term;
2895 if (LH[hA] && RH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += term;
2898 term = pow3(yjk) * colA;
2899 if (RH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
2900 if (LH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
2911 double GGEmitIF::AltarelliParisi(vector<double> invariants, vector<double>,
2912 vector<int>, vector<int>) {
2915 double sAK = invariants[0];
2916 double saj = invariants[1];
2917 double sjk = invariants[2];
2918 if ((saj <= 0.0) || (sjk <= 0.0) || (sAK <= 0.0))
return 0.0;
2921 double z = ( saj < sjk ? zA(invariants) : zB(invariants) );
2922 double Q2 = min(saj,sjk);
2927 AP = 1.0/z*(pow(z, 4.0) + 1.0 + pow(1 - z,4.0))/z/(1.0 - z);
2935 AP = (2.0*z/(1.0 - z) + z*(1.0 - z));
2953 double QXSplitIF::antFun(vector<double> invariants, vector<double> masses,
2954 vector<int> helBef, vector<int> helNew) {
2957 double sAK = invariants[0];
2958 double saj = invariants[1];
2959 double sjk = invariants[2];
2962 if ((saj <= 0.0) || (sjk <= 0.0) || (sAK <= 0.0))
return 0.0;
2965 initMasses(&masses);
2966 int nAvg = initHel(&helBef, &helNew);
2967 if (nAvg <= 0)
return 0.;
2970 double s = sAK + sjk;
2973 double colA = 1./(sAK * yaj);
2974 double facMj = (mj != 0.) ? pow2(mj)/s/sAK/pow2(yaj) : 0.;
2980 if (hA * hB > 0 || hA == 9 || hB == 9) {
2982 term = pow2(yAK) * colA - facMj*pow2(yAK)/(1. - yAK);
2983 if (RH[hA] && RH[hB] && RH[hi] && LH[hj] && RH[hk]) hSum += term;
2984 if (LH[hA] && LH[hB] && LH[hi] && RH[hj] && LH[hk]) hSum += term;
2987 term = pow2(1. - yAK) * colA - facMj*(1. - yAK);
2988 if (RH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
2989 if (LH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
2993 term = facMj / (1.-yAK);
2994 if (RH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
2995 if (LH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
3000 if (hA * hB < 0 || hA == 9 || hB == 9) {
3002 term = pow2(yAK) * colA - facMj*pow2(yAK)/(1. - yAK);
3003 if (RH[hA] && LH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += term;
3004 if (LH[hA] && RH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += term;
3007 term = pow2(1. - yAK) * colA - facMj*(1. - yAK);
3008 if (RH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
3009 if (LH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
3013 term = facMj/(1. - yAK);
3014 if (RH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
3015 if (LH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
3028 double QXSplitIF::AltarelliParisi(vector<double> invariants, vector<double>,
3029 vector<int>, vector<int>) {
3032 double sAK = invariants[0];
3033 double saj = invariants[1];
3034 double sjk = invariants[2];
3035 if ((saj <= 0.0) || (sjk <= 0.0) || (sAK <= 0.0))
return 0.0;
3038 double z = zA(invariants);
3040 double AP = 1.0/z * (pow2(z) + pow2(1 - z));
3057 double GXConvIF::antFun(vector<double> invariants, vector<double> masses,
3058 vector<int> helBef, vector<int> helNew) {
3061 double sAK = invariants[0];
3062 double saj = invariants[1];
3063 double sjk = invariants[2];
3066 if ((saj <= 0.0) || (sjk <= 0.0) || (sAK <= 0.0))
return 0.0;
3069 initMasses(&masses);
3070 int nAvg = initHel(&helBef, &helNew);
3071 if (nAvg <= 0)
return 0.;
3074 double s = sAK + sjk + 2.*pow2(mj);
3075 double yaj = saj / s;
3076 double yAK = sAK / s;
3077 double mu2j = (mj != 0.) ? pow2(mj)/s : 0.;
3078 double colA = 1./(2.*sAK*yAK*(yaj - 2.*mu2j));
3079 double facMj = (mj != 0.) ? mu2j/(2.*sAK)/pow2(yaj - 2*mu2j) : 0.;
3085 if (hA * hB > 0 || hA == 9 || hB == 9) {
3087 term = colA - facMj*yAK/(1. - yAK);
3088 if (RH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
3089 if (LH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
3092 term = pow2(1. - yAK) * colA - facMj*yAK*(1. - yAK);
3093 if (RH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
3094 if (LH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
3098 term = facMj * pow3(yAK)/(1. - yAK);
3099 if (RH[hA] && RH[hB] && RH[hi] && LH[hj] && RH[hk]) hSum += term;
3100 if (LH[hA] && LH[hB] && LH[hi] && RH[hj] && LH[hk]) hSum += term;
3105 if (hA * hB < 0 || hA == 9 || hB == 9) {
3107 term = colA - facMj*yAK/(1. - yAK);
3108 if (RH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
3109 if (LH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
3112 term = pow2(1. - yAK) * colA - facMj*yAK*(1. - yAK) ;
3113 if (RH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
3114 if (LH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
3118 term = facMj * pow3(yAK)/(1. - yAK);
3119 if (RH[hA] && LH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += term;
3120 if (LH[hA] && RH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += term;
3133 double GXConvIF::AltarelliParisi(vector<double> invariants, vector<double>,
3134 vector<int>, vector<int>) {
3137 double sAK = invariants[0];
3138 double saj = invariants[1];
3139 double sjk = invariants[2];
3140 if ((saj <= 0.0) || (sjk <= 0.0) || (sAK <= 0.0))
return 0.0;
3143 double z = zA(invariants);
3145 double AP = 1.0/z * (1.0 + pow2(1.0 - z))/z;
3163 double XGSplitIF::antFun(vector<double> invariants, vector<double> masses,
3164 vector<int> helBef, vector<int> helNew) {
3167 double sAK = invariants[0];
3168 double saj = invariants[1];
3169 double sjk = invariants[2];
3172 if ((saj <= 0.0) || (sjk <= 0.0) || (sAK <= 0.0))
return 0.0;
3175 initMasses(&masses);
3176 int nAvg = initHel(&helBef, &helNew);
3177 if (nAvg <= 0)
return 0.;
3180 double s = sAK + sjk + 2*pow2(mj);
3181 double yaj = saj / s;
3182 double yak = 1. - yaj;
3183 double m2jk = sjk + 2*pow2(mj);
3184 double colK = 1./(2.*m2jk);
3185 double facMj = pow2(mj)/(2.*pow2(m2jk));
3191 if (hA * hB > 0 || hA == 9 || hB == 9) {
3193 term = pow2(yak) * colK - facMj*yak/(1. - yak);
3194 if (RH[hA] && RH[hB] && RH[hi] && LH[hj] && RH[hk]) hSum += term;
3195 if (LH[hA] && LH[hB] && LH[hi] && RH[hj] && LH[hk]) hSum += term;
3198 term = pow2(yaj) * colK - facMj*yaj/(1. - yaj);
3199 if (RH[hA] && RH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
3200 if (LH[hA] && LH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
3204 term = facMj*(yaj/(1. - yaj) + yak/(1. - yak) + 2);
3205 if (RH[hA] && RH[hB] && RH[hi] && RH[hj] && RH[hk]) hSum += term;
3206 if (LH[hA] && LH[hB] && LH[hi] && LH[hj] && LH[hk]) hSum += term;
3211 if (hA * hB < 0 || hA == 9 || hB == 9) {
3213 term = pow2(yak) * colK - facMj*yak/(1. - yak);
3214 if (RH[hA] && LH[hB] && RH[hi] && RH[hj] && LH[hk]) hSum += term;
3215 if (LH[hA] && RH[hB] && LH[hi] && LH[hj] && RH[hk]) hSum += term;
3218 term = pow2(yaj) * colK - facMj*yaj/(1. - yaj);
3219 if (RH[hA] && LH[hB] && RH[hi] && LH[hj] && RH[hk]) hSum += term;
3220 if (LH[hA] && RH[hB] && LH[hi] && RH[hj] && LH[hk]) hSum += term;
3224 term = facMj*(yaj/(1. - yaj) + yak/(1. - yak) + 2);
3225 if (RH[hA] && LH[hB] && RH[hi] && LH[hj] && LH[hk]) hSum += term;
3226 if (LH[hA] && RH[hB] && LH[hi] && RH[hj] && RH[hk]) hSum += term;
3239 double XGSplitIF::AltarelliParisi(vector<double> invariants, vector<double>,
3240 vector<int>, vector<int>) {
3243 double sAK = invariants[0];
3244 double saj = invariants[1];
3245 double sjk = invariants[2];
3246 if ((saj <= 0.0) || (sjk <= 0.0) || (sAK <= 0.0))
return 0.0;
3249 double z = zB(invariants);
3251 double AP = (pow2(z)+pow2(1 - z));
3269 double QGEmitIFsec::antFun(vector<double> invariants,
3270 vector<double> mNew, vector<int> helBef, vector<int> helNew) {
3273 double ant = QGEmitIF::antFun(invariants, mNew, helBef, helNew);
3274 if (helBef.size() < 2) {helBef.push_back(9); helBef.push_back(9);}
3275 if (helNew.size() < 3) {
3276 helNew.push_back(9); helNew.push_back(9); helNew.push_back(9);}
3280 int hjNow = helNew[1];
3284 vector<double> invariantsSym = invariants;
3285 double s02 = invariants[0] - invariants[1] + invariants[2];
3286 vector<int> helSym = helNew;
3287 invariantsSym[1] = s02 + sectorDampSav * invariants[2];
3288 helSym[1] = helNew[2];
3289 helSym[2] = helNew[1];
3290 ant += QGEmitIF::antFun(invariantsSym, mNew, helBef, helSym);
3304 double GGEmitIFsec::antFun(vector<double> invariants,
3305 vector<double> mNew, vector<int> helBef, vector<int> helNew) {
3308 double ant = GGEmitIF::antFun(invariants, mNew, helBef, helNew);
3309 if (helBef.size() < 2) {helBef.push_back(9); helBef.push_back(9);}
3310 if (helNew.size() < 3) {
3311 helNew.push_back(9); helNew.push_back(9); helNew.push_back(9);}
3315 int hjNow = helNew[1];
3316 if ( hG == hjNow ) {
3319 vector<double> invariantsSym = invariants;
3320 double s02 = invariants[0] - invariants[1] + invariants[2];
3321 vector<int> helSym = helNew;
3322 invariantsSym[1] = s02 + sectorDampSav * invariants[2];
3323 helSym[1] = helNew[2];
3324 helSym[2] = helNew[1];
3325 ant += GGEmitIF::antFun(invariantsSym, mNew, helBef, helSym);
3340 double XGSplitIFsec::antFun(vector<double> invariants, vector<double> mNew,
3341 vector<int> helBef, vector<int> helNew) {
3342 return 2*XGSplitIF::antFun(invariants,mNew,helBef,helNew);}
3352 void AntennaSetFSR::initPtr(Info* infoPtrIn, DGLAP* dglapPtrIn) {
3354 infoPtr = infoPtrIn;
3355 particleDataPtr = infoPtr->particleDataPtr;
3356 settingsPtr = infoPtr->settingsPtr;
3357 rndmPtr = infoPtr->rndmPtr;
3358 dglapPtr = dglapPtrIn;
3367 void AntennaSetFSR::init() {
3371 printOut(__METHOD_NAME__,
"Cannot initialize, pointers not set.");
3374 verbose = settingsPtr->mode(
"Vincia:verbose");
3376 if (verbose >= debug)
3377 printOut(__METHOD_NAME__,
"Already initialized antenna set.");
3383 bool sectorShower = settingsPtr->flag(
"Vincia:sectorShower");
3384 antFunPtrs[iQQemitFF] = sectorShower ?
new QQEmitFFsec() : new QQEmitFF();
3385 antFunPtrs[iQGemitFF] = sectorShower ?
new QGEmitFFsec() : new QGEmitFF();
3386 antFunPtrs[iGQemitFF] = sectorShower ? (AntennaFunction*)
new GQEmitFFsec() :
3388 antFunPtrs[iGGemitFF] = sectorShower ?
new GGEmitFFsec() : new GGEmitFF();
3389 antFunPtrs[iGXsplitFF]= sectorShower ?
new GXSplitFFsec() : new GXSplitFF();
3391 antFunPtrs[iQQemitRF] =
new QQEmitRF();
3392 antFunPtrs[iQGemitRF] =
new QGEmitRF();
3393 antFunPtrs[iXGsplitRF]=
new XGSplitRF();
3394 if (verbose >= quiteloud)
3395 printOut(__METHOD_NAME__,
"Defined new antFunPtrs");
3398 for (map<int,AntennaFunction*>::iterator antFunPtrIt = antFunPtrs.begin();
3399 antFunPtrIt != antFunPtrs.end(); ++antFunPtrIt) {
3402 AntennaFunction* antFunPtr = antFunPtrIt->second;
3403 antFunPtr->initPtr(infoPtr, dglapPtr);
3404 bool pass = antFunPtr->init();
3407 if (settingsPtr->flag(
"Vincia:checkAntennae"))
3408 pass = pass && antFunPtr->check();
3412 if (verbose > normal) printOut(__METHOD_NAME__,
"Added to antenna list: "
3413 + antFunPtr->humanName());
3414 }
else if (verbose >= quiet) infoPtr->errorMsg(
"Warning in "+
3415 __METHOD_NAME__+
": one or more consistency checks failed.");
3425 vector<int> AntennaSetFSR::getIant() {
3428 map<int,AntennaFunction*>::iterator it;
3429 for (it = antFunPtrs.begin(); it != antFunPtrs.end(); ++it)
3430 iAnt.push_back(it->first);
3443 void AntennaSetISR::initPtr(Info* infoPtrIn, DGLAP* dglapPtrIn) {
3445 infoPtr = infoPtrIn;
3446 particleDataPtr = infoPtr->particleDataPtr;
3447 settingsPtr = infoPtr->settingsPtr;
3448 rndmPtr = infoPtr->rndmPtr;
3449 dglapPtr = dglapPtrIn;
3458 void AntennaSetISR::init() {
3462 printOut(__METHOD_NAME__,
"Cannot initialize, pointers not set.");
3465 verbose = settingsPtr->mode(
"Vincia:verbose");
3467 if (verbose >= debug)
3468 printOut(__METHOD_NAME__,
"Already initialized antenna set.");
3473 bool sectorShower = settingsPtr->flag(
"Vincia:sectorShower");
3474 antFunPtrs[iQQemitII] =
new QQEmitII();
3475 antFunPtrs[iGQemitII] =
new GQEmitII();
3476 antFunPtrs[iGGemitII] =
new GGEmitII();
3477 antFunPtrs[iQXsplitII] =
new QXSplitII();
3478 antFunPtrs[iGXconvII] =
new GXConvII();
3479 antFunPtrs[iQQemitIF] =
new QQEmitIF();
3480 antFunPtrs[iQGemitIF] = sectorShower ?
new QGEmitIFsec() : new QGEmitIF();
3481 antFunPtrs[iGQemitIF] =
new GQEmitIF();
3482 antFunPtrs[iGGemitIF] = sectorShower ?
new GGEmitIFsec() : new GGEmitIF();
3483 antFunPtrs[iQXsplitIF] =
new QXSplitIF();
3484 antFunPtrs[iGXconvIF] =
new GXConvIF();
3485 antFunPtrs[iXGsplitIF] = sectorShower ?
new XGSplitIFsec() : new XGSplitIF();
3488 for (map<int,AntennaFunctionIX*>::iterator antFunPtrIt = antFunPtrs.begin();
3489 antFunPtrIt != antFunPtrs.end(); ++antFunPtrIt) {
3492 AntennaFunction* antFunPtr = antFunPtrIt->second;
3493 antFunPtr->initPtr(infoPtr, dglapPtr);
3494 bool pass = antFunPtr->init();
3497 if (settingsPtr->flag(
"Vincia:checkAntennae"))
3498 pass = pass && antFunPtr->check();
3502 if (verbose > normal) printOut(__METHOD_NAME__,
"Added to antenna list: "
3503 + antFunPtr->vinciaName());
3504 }
else if (verbose >= quiet)
3505 infoPtr->errorMsg(
"Warning in "+__METHOD_NAME__
3506 +
": one or more consistency checks failed.");
3516 vector<int> AntennaSetISR::getIant() {
3519 map<int,AntennaFunctionIX*>::iterator it;
3520 for (it = antFunPtrs.begin(); it != antFunPtrs.end(); ++it)
3521 iAnt.push_back(it->first);
3535 void MECs::initPtr(Info* infoPtrIn, ShowerMEs* mg5mesPtrIn,
3536 VinciaCommon* vinComPtrIn) {
3538 infoPtr = infoPtrIn;
3539 settingsPtr = infoPtr->settingsPtr;
3540 rndmPtr = infoPtr->rndmPtr;
3541 partonSystemsPtr = infoPtr->partonSystemsPtr;
3542 mg5mesPtr = mg5mesPtrIn;
3543 vinComPtr = vinComPtrIn;
3555 verbose = settingsPtr->mode(
"Vincia:verbose");
3556 maxMECs2to1 = settingsPtr->mode(
"Vincia:maxMECs2to1");
3557 maxMECs2to2 = settingsPtr->mode(
"Vincia:maxMECs2to2");
3558 maxMECs2toN = settingsPtr->mode(
"Vincia:maxMECs2toN");
3559 maxMECsResDec = settingsPtr->mode(
"Vincia:maxMECsResDec");
3560 maxMECsMPI = settingsPtr->mode(
"Vincia:maxMECsMPI");
3561 matchingFullColour = settingsPtr->flag(
"Vincia:matchingFullColour");
3562 nFlavZeroMass = settingsPtr->mode(
"Vincia:nFlavZeroMass");
3563 if (maxMECs2to2 == 0) maxMECsMPI = 0;
3564 sizeOutBornSav.clear();
3567 if (mg5mesPtr->initVincia()) {
3568 mg5mesPtr->setColourDepthVincia(matchingFullColour);
3570 if (verbose >= 3) printOut(
"Vincia::MECs",
3571 "Could not initialise ShowerMEs interface.");
3586 bool MECs::prepare(
const int iSys,
Event& event) {
3589 int nAll = partonSystemsPtr->sizeAll(iSys);
3590 int nOut = partonSystemsPtr->sizeOut(iSys);
3591 bool isHard = (iSys == 0 && nAll - nOut == 2);
3592 bool isMPI = (iSys >= 1 && nAll - nOut == 2);
3593 sizeOutBornSav[iSys] = nOut;
3597 if (nOut == 1 && maxMECs2to1 < 0)
return false;
3598 else if (nOut == 2 && maxMECs2to2 < 0)
return false;
3599 else if (nOut >= 3 && maxMECs2toN < 0)
return false;
3601 if (infoPtr->nMPI() > maxMECsMPI)
return false;
3603 if (maxMECsResDec < 0)
return false;
3607 vector<int> idIn, idOut;
3608 if (partonSystemsPtr->hasInAB(iSys)) {
3609 idIn.push_back(event[partonSystemsPtr->getInA(iSys)].id());
3610 idIn.push_back(event[partonSystemsPtr->getInB(iSys)].id());
3611 }
else if (partonSystemsPtr->hasInRes(iSys))
3612 idIn.push_back(event[partonSystemsPtr->getInRes(iSys)].id());
3613 for (
int i = 0; i < partonSystemsPtr->sizeOut(iSys); ++i)
3614 idOut.push_back(event[partonSystemsPtr->getOut(iSys, i)].id());
3618 return mg5mesPtr->hasProcessVincia(idIn, idOut, sChan);
3626 bool MECs::polarise(
const int iSys,
Event& event) {
3629 if (partonSystemsPtr->hasInAB(iSys)) {
3632 int nOut = partonSystemsPtr->sizeOut(iSys);
3633 if (nOut==1 && maxMECs2to1 <= -1)
return false;
3634 if (nOut==2 && maxMECs2to2 <= -1)
return false;
3635 if (nOut>=3 && maxMECs2toN <= -1)
return false;
3637 }
else if (iSys == 1 && maxMECsMPI <= -1)
return false;
3641 }
else {
if (maxMECsResDec <= -1)
return false;}
3645 bool checkIncoming =
true;
3646 if (!isPolarised(iSys, event, checkIncoming)) {
3649 vector<Particle> parts = makeParticleList(iSys, event);
3650 if (parts.size() <= 2)
return false;
3651 int nIn = partonSystemsPtr->hasInRes(iSys) ? 1 : 2;
3654 if (verbose >= 4) cout <<
" MECs::polarise(): system " << iSys <<
" nIn = "
3657 if (!mg5mesPtr->selectHelicitiesVincia(parts, nIn))
return false;
3660 if (nIn == 1)
event[partonSystemsPtr->getInRes(iSys)].pol(parts[0].pol());
3662 event[partonSystemsPtr->getInA(iSys)].pol(parts[0].pol());
3663 event[partonSystemsPtr->getInB(iSys)].pol(parts[1].pol());
3667 for (
int iOut = 0; iOut < partonSystemsPtr->sizeOut(iSys); ++iOut) {
3668 int iEvent = partonSystemsPtr->getOut(iSys,iOut);
3669 int iParts = iOut + nIn;
3670 event[iEvent].pol(parts[iParts].pol());
3675 if (verbose >= 9)
event.list(
true);
3678 return isPolarised(iSys,event,
true);
3686 vector<Particle> MECs::makeParticleList(
const int iSys,
const Event& event,
3687 const vector<Particle> pNew,
const vector<int> iOld) {
3690 vector<Particle> state;
3691 if (partonSystemsPtr->hasInAB(iSys)) {
3692 int iA = partonSystemsPtr->getInA(iSys);
3693 int iB = partonSystemsPtr->getInB(iSys);
3694 for (
int j = 0; j < (int)iOld.size(); ++j) {
3696 if (iOld[j] == iA) iA = -1;
3697 if (iOld[j] == iB) iB = -1;
3699 if (iA >= 0) state.push_back(event[iA]);
3700 if (iB >= 0) state.push_back(event[iB]);
3701 }
else if (partonSystemsPtr->hasInRes(iSys)) {
3702 int iRes = partonSystemsPtr->getInRes(iSys);
3703 for (
int j = 0; j < (int)iOld.size(); ++j) {
3705 if (iOld[j] == iRes) iRes = -1;
3707 if (iRes >= 0) state.push_back(event[iRes]);
3710 for (
int j = 0; j < (int)pNew.size(); ++j) {
3711 if (!pNew[j].isFinal()) state.push_back(pNew[j]);
3715 if (state.size() == 0) {
3716 if (verbose >= 5) cout <<
"Vincia::MECs::makeParticleList(): problem: "
3717 "could not identify incoming or decaying particle." << endl;
3718 if (verbose >= 9)
event.list();
3723 for (
int i = 0; i < partonSystemsPtr->sizeOut(iSys); ++i) {
3724 int i1 = partonSystemsPtr->getOut(iSys, i);
3726 for (
int j = 0; j < (int)iOld.size(); ++j) {
if (iOld[j] == i1) i1 = -1;}
3727 if (i1 >= 0) state.push_back(event[i1]);
3730 for (
int j=0; j<(int)pNew.size(); ++j)
3731 if (pNew[j].isFinal()) state.push_back(pNew[j]);
3742 bool MECs::isPolarised(
int iSys,
Event& event,
bool checkIncoming) {
3744 for (
int i = 0; i < partonSystemsPtr->sizeAll(iSys); ++i) {
3745 int ip = partonSystemsPtr->getAll(iSys,i);
3746 if (ip == 0)
continue;
3747 if (event[ip].isFinal() || checkIncoming)
3748 if (event[ip].pol() != 9)
return true;
3758 bool MECs::doMEC(
int iSys,
int nBranch) {
3761 bool isResDec = partonSystemsPtr->hasInRes(iSys);
3762 if (isResDec) {
if (nBranch <= maxMECsResDec)
return true;
3768 if (sizeOutBorn(iSys) == 1 && nBranch <= maxMECs2to1)
return true;
3769 if (sizeOutBorn(iSys) == 2 && nBranch <= maxMECs2to2)
return true;
3770 if (sizeOutBorn(iSys) >= 3 && nBranch <= maxMECs2toN)
return true;
3773 }
else if (iSys == 1) {
if (nBranch <= maxMECsMPI)
return true;}
3785 double MECs::getME2(
const vector<Particle> state,
int nIn) {
3786 return mg5mesPtr->me2Vincia(state, nIn);}
3788 double MECs::getME2(
const int iSys,
const Event& event) {
3789 vector<Particle> state = makeParticleList(iSys, event);
3790 bool isResDec = partonSystemsPtr->hasInRes(iSys);
3792 mg5mesPtr->me2Vincia(state, 1 ) : mg5mesPtr->me2Vincia(state, 2);
3799 void MECs::header() {
3802 bool doPolarise = (maxMECs2to1 >= 0) || (maxMECs2to2 >= 0)
3803 || (maxMECs2toN >= 0) || (maxMECsResDec >= 0);
3804 bool doMecs = (maxMECs2to1 >= 1) || (maxMECs2to2 >= 1)
3805 || (maxMECs2toN >= 1) || (maxMECsResDec >= 1);
3806 cout <<
" |\n | MECs (-1:off, 0:selectHelicities, >=1:nMECs): ";
3808 cout <<
"\n | maxMECs2to1 = "
3809 << num2str(maxMECs2to1, 9) <<
"\n"
3810 <<
" | maxMECs2to2 = "
3811 << num2str(maxMECs2to2, 9) <<
"\n"
3812 <<
" | maxMECs2toN = "
3813 << num2str(maxMECs2toN, 9) <<
"\n"
3814 <<
" | maxMECsResDec = "
3815 << num2str(maxMECsResDec, 9) <<
"\n";
3819 cout <<
" | matchingFullColour = "
3820 << bool2str(matchingFullColour, 9) <<
"\n";
3821 int matchingRegOrder = settingsPtr->mode(
"Vincia:matchingRegOrder");
3822 int matchingRegShape = settingsPtr->mode(
"Vincia:matchingRegShape");
3823 double matchingScale = settingsPtr->parm(
"Vincia:matchingRegScale");
3824 bool matchingScaleIsAbs =
3825 settingsPtr->flag(
"Vincia:matchingRegScaleIsAbsolute");
3826 double matchingScaleRatio =
3827 settingsPtr->parm(
"Vincia:matchingRegScaleRatio");
3828 double matchingIRcutoff = settingsPtr->parm(
"Vincia:matchingIRcutoff");
3829 cout <<
" | regOrder = "
3830 << num2str(matchingRegOrder, 9) << endl;
3831 if (matchingScaleIsAbs)
3832 cout <<
" | regScale = "
3833 << num2str(matchingScale, 9) << endl;
3835 cout <<
" | regScaleRatio = "
3836 << num2str(matchingScaleRatio, 9) << endl;
3838 cout <<
" | regShape = "
3839 << num2str(matchingRegShape, 9) << endl;
3840 cout <<
" | IR cutoff = "
3841 << num2str(matchingIRcutoff, 9) << endl;
3845 cout <<
" | The MADGRAPH Matrix Element interface relies on:" << endl
3846 <<
" | MADGRAPH 5 : Alwall et al., JHEP06(2011)128, "
3847 <<
"arXiv:1106.0522 " << endl;
3849 else cout << bool2str(
false, 9) <<
"\n";