11 #ifndef Pythia8_VinciaAntennaFunctions_H
12 #define Pythia8_VinciaAntennaFunctions_H
15 #include "Pythia8/Basics.h"
16 #include "Pythia8/Event.h"
17 #include "Pythia8/PythiaStdlib.h"
18 #include "Pythia8/ShowerMEs.h"
21 #include "Pythia8/VinciaCommon.h"
38 double Pg2gg(
double z,
int hA=9,
int hB=9,
int hC=9);
39 double Pg2qq(
double z,
int hA=9,
int hB=9,
int hC=9,
double mu=0.);
40 double Pq2qg(
double z,
int hA=9,
int hB=9,
int hC=9,
double mu=0.);
41 double Pq2gq(
double z,
int hA=9,
int hB=9,
int hC=9,
double mu=0.);
44 double Pg2qq(
double z,
double mu) {
return Pg2qq(z, 9, 9, 9, mu);}
45 double Pq2qg(
double z,
double mu) {
return Pq2qg(z, 9, 9, 9, mu);}
46 double Pq2gq(
double z,
double mu) {
return Pq2gq(z, 9, 9, 9, mu);}
50 double Pg2ggLin(
double z,
int polA = 9,
int polB = 9,
int polC = 9);
51 double Pg2qqLin(
double z,
int polA = 9,
int hB = 9,
int hC = 9,
53 double Pq2qgLin(
double z,
int hA = 9,
int hB=9,
int polC = 9,
55 double Pq2gqLin(
double z,
int hA = 9,
int polB=9,
int hC = 9,
76 virtual string vinciaName()
const = 0;
79 virtual int idA()
const = 0;
80 virtual int idB()
const = 0;
81 virtual int id1()
const = 0;
84 virtual double antFun(vector<double> invariants, vector<double> mNew,
85 vector<int> helBef, vector<int> helNew) = 0;
89 virtual double AltarelliParisi(vector<double> invariants,
90 vector<double> mNew, vector<int> helBef, vector<int> helNew) = 0;
96 virtual string baseName()
const {
97 return id2str(id1()) +
"/" + id2str(idA()) + id2str(idB());}
100 virtual string humanName()
const {
return baseName();}
103 virtual bool check();
106 virtual void initMasses(vector<double>* masses) {
107 if (masses->size() >= 3) {
108 mi = masses->at(0); mj = masses->at(1); mk = masses->at(2);
109 }
else {mi = 0.0; mj = 0.0; mk = 0.0;}}
112 virtual int initHel(vector<int>* helBef, vector<int>* helNew);
115 double antFun(vector<double> invariants, vector<double> masses) {
116 return antFun(invariants, masses, hDum, hDum);}
119 double antFun(vector<double> invariants) {
120 return antFun(invariants, mDum, hDum, hDum);}
123 double AltarelliParisi(vector<double> invariants, vector<double> masses) {
124 return AltarelliParisi(invariants, masses, hDum, hDum);}
127 double AltarelliParisi(vector<double> invariants) {
128 return AltarelliParisi(invariants, mDum, hDum, hDum);}
131 void initPtr(
Info* infoPtrIn,
DGLAP* dglapPtrIn);
134 double chargeFac() {
return chargeFacSav;}
135 int kineMap() {
return kineMapSav;}
136 double alpha() {
return alphaSav;}
137 double sectorDamp() {
return sectorDampSav;}
140 double zA(vector<double> invariants) {
141 double yij = invariants[1]/invariants[0];
142 double yjk = invariants[2]/invariants[0];
143 return (1.-yjk)/(1.+yij);}
144 double zB(vector<double> invariants) {
145 double yij = invariants[1]/invariants[0];
146 double yjk = invariants[2]/invariants[0];
147 return (1.-yij)/(1.+yjk);}
150 string id2str(
int id)
const;
155 bool isInitPtr{
false}, isInit{
false};
158 double chargeFacSav{0.0};
159 int kineMapSav{0}, modeSLC{-1};
160 bool sectorShower{
false};
163 double alphaSav{0.0};
166 double sectorDampSav{0.0};
169 double term{}, preFacFiniteTermSav{0.0}, antMinSav{0.0};
173 double mi{0.0}, mj{0.0}, mk{0.0};
174 int hA{9}, hB{9}, hi{9}, hj{9}, hk{9};
179 map<int, bool> LH{{9,
true}, {1,
false}, {-1,
true}};
180 map<int, bool> RH{{9,
true}, {1,
true}, {-1,
false}};
195 vector<double> mDum{0, 0, 0, 0};
196 vector<int> hDum{9, 9, 9, 9};
209 virtual string vinciaName()
const {
return "Vincia:QQEmitFF";};
212 virtual int idA()
const {
return 1;}
213 virtual int idB()
const {
return -1;}
214 virtual int id1()
const {
return 21;}
217 virtual double antFun(vector<double> invariants, vector<double> mNew,
218 vector<int> helBef, vector<int> helNew);
222 virtual double AltarelliParisi(vector<double> invariants,
223 vector<double>, vector<int> helBef, vector<int> helNew);
236 virtual string vinciaName()
const {
return "Vincia:QGEmitFF";};
239 virtual int idA()
const {
return 1;}
240 virtual int idB()
const {
return 21;}
241 virtual int id1()
const {
return 21;}
244 virtual double antFun(vector<double> invariants,
245 vector<double> mNew, vector<int> helBef, vector<int> helNew);
248 virtual double AltarelliParisi(vector<double> invariants,
249 vector<double> , vector<int> helBef, vector<int> helNew);
262 virtual string vinciaName()
const {
return "Vincia:GQEmitFF";};
265 virtual int idA()
const {
return 21;}
266 virtual int idB()
const {
return -1;}
267 virtual int id1()
const {
return 21;}
270 virtual double antFun(vector<double> invariants,
271 vector<double> mNew, vector<int> helBef, vector<int> helNew);
274 virtual double AltarelliParisi(vector<double> invariants,
275 vector<double>, vector<int> helBef, vector<int> helNew);
288 virtual string vinciaName()
const {
return "Vincia:GGEmitFF";};
291 virtual int idA()
const {
return 21;}
292 virtual int idB()
const {
return 21;}
293 virtual int id1()
const {
return 21;}
296 virtual double antFun(vector<double> invariants,
297 vector<double> mNew, vector<int> helBef, vector<int> helNew);
300 virtual double AltarelliParisi(vector<double> invariants,
301 vector<double>, vector<int> helBef, vector<int> helNew);
314 virtual string vinciaName()
const {
return "Vincia:GXSplitFF";};
317 virtual int idA()
const {
return 21;}
318 virtual int idB()
const {
return 0;}
319 virtual int id1()
const {
return -1;}
322 virtual double antFun(vector<double> invariants,
323 vector<double> mNew, vector<int> helBef, vector<int> helNew);
326 virtual double AltarelliParisi(vector<double> invariants,
327 vector<double>, vector<int> helBef, vector<int> helNew);
348 virtual double antFun(vector<double> invariants,
349 vector<double> mNew, vector<int> helBef, vector<int> helNew);
363 virtual int idA()
const {
return 21;}
364 virtual int idB()
const {
return -1;}
365 virtual int id1()
const {
return 21;}
368 virtual double antFun(vector<double> invariants,
369 vector<double> mNew, vector<int> helBef, vector<int> helNew);
372 virtual double AltarelliParisi(vector<double> invariants,
373 vector<double>, vector<int> helBef, vector<int> helNew);
387 virtual double antFun(vector<double> invariants, vector<double> mNew,
388 vector<int> helBef, vector<int> helNew);
402 virtual double antFun(vector<double> invariants, vector<double> mNew,
403 vector<int> helBef, vector<int> helNew);
423 virtual string vinciaName()
const {
return "Vincia:AntennaFunctionIX";}
426 virtual int idA()
const {
return 0;}
427 virtual int idB()
const {
return 0;}
428 virtual int id0()
const {
return 0;}
429 virtual int id1()
const {
return 0;}
430 virtual int id2()
const {
return 0;}
433 virtual double zA(vector<double> invariants) {
double sAB = invariants[0];
434 double sjb = invariants[2];
return sAB/(sAB+sjb);}
435 virtual double zB(vector<double> invariants) {
double sAB = invariants[0];
436 double saj = invariants[1];
return sAB/(sAB+saj);}
439 virtual bool isIIant() {
return true;}
442 virtual bool check();
455 virtual string vinciaName()
const {
return "Vincia:QQEmitII";}
458 virtual int idA()
const {
return 1;}
459 virtual int idB()
const {
return -1;}
460 virtual int id0()
const {
return 1;}
461 virtual int id1()
const {
return 21;}
462 virtual int id2()
const {
return -1;}
465 virtual double antFun(vector<double> invariants, vector<double> masses,
466 vector<int> helBef, vector<int> helNew);
469 virtual double AltarelliParisi(vector<double> invariants,
470 vector<double>, vector<int> helBef, vector<int> helNew);
483 virtual string vinciaName()
const {
return "Vincia:GQEmitII";}
486 virtual int idA()
const {
return 21;}
487 virtual int idB()
const {
return 1;}
488 virtual int id0()
const {
return 21;}
489 virtual int id1()
const {
return 21;}
490 virtual int id2()
const {
return 1;}
493 virtual double antFun(vector<double> invariants, vector<double> masses,
494 vector<int> helBef, vector<int> helNew);
497 virtual double AltarelliParisi(vector<double> invariants,
498 vector<double>, vector<int> helBef, vector<int> helNew);
511 virtual string vinciaName()
const {
return "Vincia:GGEmitII";}
514 virtual int idA()
const {
return 21;}
515 virtual int idB()
const {
return 21;}
516 virtual int id0()
const {
return 21;}
517 virtual int id1()
const {
return 21;}
518 virtual int id2()
const {
return 21;}
521 virtual double antFun(vector<double> invariants, vector<double> masses,
522 vector<int> helBef, vector<int> helNew);
525 virtual double AltarelliParisi(vector<double> invariants,
526 vector<double>, vector<int> helBef, vector<int> helNew);
541 virtual string vinciaName()
const {
return "Vincia:QXSplitII";}
544 virtual int idA()
const {
return 1;}
545 virtual int idB()
const {
return 0;}
546 virtual int id0()
const {
return 21;}
547 virtual int id1()
const {
return -1;}
548 virtual int id2()
const {
return 0;}
551 virtual double antFun(vector<double> invariants, vector<double> masses,
552 vector<int> helBef, vector<int> helNew);
555 virtual double AltarelliParisi(vector<double> invariants,
556 vector<double>, vector<int> helBef, vector<int> helNew);
559 virtual double zB(vector<double>) {
return -1.0;}
573 virtual string vinciaName()
const {
return "Vincia:GXConvII";}
576 virtual int idA()
const {
return 21;}
577 virtual int idB()
const {
return 0;}
578 virtual int id0()
const {
return 2;}
579 virtual int id1()
const {
return 2;}
580 virtual int id2()
const {
return 0;}
583 virtual double antFun(vector<double> invariants, vector<double> masses,
584 vector<int> helBef, vector<int> helNew);
587 virtual double AltarelliParisi(vector<double> invariants,
588 vector<double>, vector<int> helBef, vector<int> helNew);
591 virtual double zB(vector<double>) {
return -1.0;}
610 virtual bool check();
613 virtual string vinciaName()
const {
return "Vincia:AntennaFunctionIF";}
616 virtual int idA()
const {
return 1;}
617 virtual int idB()
const {
return -1;}
618 virtual int id0()
const {
return 1;}
619 virtual int id1()
const {
return 21;}
620 virtual int id2()
const {
return -1;}
623 virtual double zA(vector<double> invariants) {
double sAK = invariants[0];
624 double sjk = invariants[2];
return sAK/(sAK+sjk);}
625 virtual double zB(vector<double> invariants) {
double sAK = invariants[0];
626 double saj = invariants[1];
return (sAK-saj)/sAK;}
629 virtual bool isIIant() {
return false;}
630 virtual bool isRFant() {
return false;}
633 virtual bool checkRes();
636 virtual void getTestMasses(vector<double> &masses) {masses.resize(4, 0.0);}
639 virtual bool getTestInvariants(vector<double> &invariants,
640 vector<double> masses,
double yaj,
double yjk);
646 double massiveEikonal(
double saj,
double sjk,
double sak,
647 double m_a,
double m_k) {
return 2.0*sak/(saj*sjk) - 2.0*m_a*m_a/(saj*saj)
648 - 2.0*m_k*m_k/(sjk*sjk);}
651 double massiveEikonal(vector<double> invariants, vector<double> masses) {
652 return massiveEikonal(invariants[1], invariants[2], invariants[3],
653 masses[0], masses[2]);}
656 double gramDet(vector<double> invariants, vector<double> masses) {
657 double saj(invariants[1]), sjk(invariants[2]), sak(invariants[3]),
658 mares(masses[0]), mjres(masses[1]), mkres(masses[2]);
659 return 0.25*(saj*sjk*sak - saj*saj*mkres*mkres -sak*sak*mjres*mjres
660 - sjk*sjk*mares*mares + 4.0*mares*mares*mjres*mjres*mkres*mkres);}
664 double antFunCollLimit(vector<double> invariants,vector<double> masses);
677 virtual string vinciaName()
const {
return "Vincia:QQEmitIF";}
680 virtual int idA()
const {
return 1;}
681 virtual int idB()
const {
return -1;}
682 virtual int id0()
const {
return 1;}
683 virtual int id1()
const {
return 21;}
684 virtual int id2()
const {
return -1;}
687 virtual double antFun(vector<double> invariants, vector<double> masses,
688 vector<int> helBef, vector<int> helNew);
691 virtual double AltarelliParisi(vector<double> invariants,
692 vector<double>, vector<int> helBef, vector<int> helNew);
695 virtual double zA(vector<double> invariants) {
double sAK = invariants[0];
696 double sjk = invariants[2];
return sAK/(sAK+sjk);}
697 virtual double zB(vector<double> invariants) {
double sAK = invariants[0];
698 double saj = invariants[1];
return (sAK-saj)/sAK;}
711 virtual string vinciaName()
const {
return "Vincia:QGEmitIF";}
714 virtual int idA()
const {
return 1;}
715 virtual int idB()
const {
return 21;}
716 virtual int id0()
const {
return 1;}
717 virtual int id1()
const {
return 21;}
718 virtual int id2()
const {
return 21;}
721 virtual double antFun(vector<double> invariants, vector<double> masses,
722 vector<int> helBef, vector<int> helNew);
725 virtual double AltarelliParisi(vector<double> invariants,
726 vector<double>, vector<int> helBef, vector<int> helNew);
739 virtual string vinciaName()
const {
return "Vincia:GQEmitIF";}
742 virtual int idA()
const {
return 21;}
743 virtual int idB()
const {
return 1;}
744 virtual int id0()
const {
return 21;}
745 virtual int id1()
const {
return 21;}
746 virtual int id2()
const {
return 1;}
749 virtual double antFun(vector<double> invariants, vector<double> masses,
750 vector<int> helBef, vector<int> helNew);
753 virtual double AltarelliParisi(vector<double> invariants,
754 vector<double>, vector<int> helBef, vector<int> helNew);
767 virtual string vinciaName()
const {
return "Vincia:GGEmitIF";}
770 virtual int idA()
const {
return 21;}
771 virtual int idB()
const {
return 21;}
772 virtual int id0()
const {
return 21;}
773 virtual int id1()
const {
return 21;}
774 virtual int id2()
const {
return 21;}
777 virtual double antFun(vector<double> invariants, vector<double> masses,
778 vector<int> helBef, vector<int> helNew);
781 virtual double AltarelliParisi(vector<double> invariants,
782 vector<double>, vector<int> helBef, vector<int> helNew);
797 virtual string vinciaName()
const {
return "Vincia:QXSplitIF";}
800 virtual int idA()
const {
return 1;}
801 virtual int idB()
const {
return 0;}
802 virtual int id0()
const {
return 21;}
803 virtual int id1()
const {
return -1;}
804 virtual int id2()
const {
return 0;}
807 virtual double antFun(vector<double> invariants, vector<double> masses,
808 vector<int> helBef, vector<int> helNew);
810 virtual double AltarelliParisi(vector<double> invariants,
811 vector<double> , vector<int> helBef, vector<int> helNew);
814 virtual double zB(vector<double>) {
return -1.0;}
828 virtual string vinciaName()
const {
return "Vincia:GXConvIF";}
831 virtual int idA()
const {
return 21;}
832 virtual int idB()
const {
return 0;}
833 virtual int id0()
const {
return 2;}
834 virtual int id1()
const {
return 2;}
835 virtual int id2()
const {
return 0;}
838 virtual double antFun(vector<double> invariants, vector<double> masses,
839 vector<int> helBef, vector<int> helNew);
842 virtual double AltarelliParisi(vector<double> invariants,
843 vector<double>, vector<int> helBef, vector<int> helNew);
846 virtual double zB(vector<double>) {
return -1.0;}
860 virtual string vinciaName()
const {
return "Vincia:XGsplitIF";}
863 virtual int idA()
const {
return 0;}
864 virtual int idB()
const {
return 21;}
865 virtual int id0()
const {
return 0;}
866 virtual int id1()
const {
return -1;}
867 virtual int id2()
const {
return 1;}
870 virtual double antFun(vector<double> invariants, vector<double> masses,
871 vector<int> helBef, vector<int> helNew);
874 virtual double AltarelliParisi(vector<double> invariants,
875 vector<double>, vector<int> helBef, vector<int> helNew);
878 virtual double zA(vector<double>) {
return -1.0;}
895 virtual double antFun(vector<double> invariants,
896 vector<double> mNew, vector<int> helBef, vector<int> helNew);
909 virtual double antFun(vector<double> invariants,
910 vector<double> mNew, vector<int> helBef, vector<int> helNew);
924 virtual double antFun(vector<double> invariants, vector<double> mNew,
925 vector<int> helBef, vector<int> helNew);
938 string vinciaName()
const {
return "Vincia:QQEmitRF";}
941 int idA()
const {
return 6;}
942 int idB()
const {
return 5;}
943 int id0()
const {
return 6;}
944 int id1()
const {
return 21;}
945 int id2()
const {
return 5;}
948 double zA(vector<double>) {
return -1;}
951 bool isRFant() {
return true;}
954 void getTestMasses(vector<double> &masses) {masses = {particleDataPtr->m0(6),
955 0.0, particleDataPtr->m0(5), particleDataPtr->m0(24)};}
958 virtual double AltarelliParisi(vector<double> invariants,
959 vector<double> masses, vector<int>, vector<int>) {
960 double sjk(invariants[2]), mkres(masses[2]), z(zB(invariants)),
961 mu2(mkres*mkres/sjk), Pz(dglapPtr->Pq2gq(z,9,9,9,mu2));
975 string vinciaName()
const {
return "Vincia:QGEmitRF";}
978 int idA()
const {
return 6;}
979 int idB()
const {
return 21;}
980 int ida()
const {
return 6;}
981 int idb()
const {
return 21;}
982 int id1()
const {
return 21;}
985 double zA(vector<double>) {
return -1;}
988 bool isRFant() {
return true;}
991 void getTestMasses(vector<double> &masses) {masses = {particleDataPtr->m0(6),
992 0.0, 0.0, 0.6*particleDataPtr->m0(6)};}
995 virtual double AltarelliParisi(vector<double> invariants, vector<double>,
996 vector<int>, vector<int>) {
997 double sjk(invariants[2]), z(zB(invariants)),
998 Pz(dglapPtr->Pg2gg(z, 9, 9, 9));
1012 string vinciaName()
const {
return "Vincia:XGSplitRF";}
1015 double zA(vector<double>){
return -1;}
1018 bool isRFant() {
return true;}
1021 int idA()
const {
return 6;}
1022 int idB()
const {
return 21;}
1023 int ida()
const {
return 6;}
1024 int idb()
const {
return 2;}
1025 int id1()
const {
return -2;}
1028 void getTestMasses(vector<double> &masses) {masses = {particleDataPtr->m0(6),
1029 0.0, 0.0, 0.6*particleDataPtr->m0(6)};}
1032 double AltarelliParisi(vector<double> invariants, vector<double> masses,
1033 vector<int>, vector<int>) {
1034 double sAK(invariants[0]), saj(invariants[1]), sjk(invariants[2]),
1035 mkres(masses[2]), m2q(mkres*mkres), Q2(sjk + 2*m2q), mu2(m2q/Q2),
1036 z((sAK+saj-Q2)/sAK), Pz(dglapPtr->Pg2qq(z, 9, 9, 9, mu2));
1054 for (map<int, AntennaFunction*>::iterator it = antFunPtrs.begin();
1055 it != antFunPtrs.end(); ++it)
delete it->second;
1056 antFunPtrs.clear();}
1059 void initPtr(
Info* infoPtrIn,
DGLAP* dglapPtrIn);
1065 bool exists(
int iAntIn) {
return antFunPtrs.count(iAntIn);}
1069 return (exists(iAntIn)) ? antFunPtrs[iAntIn] :
nullptr;}
1072 vector<int> getIant();
1075 string vinciaName(
int iAntIn) {
1076 return exists(iAntIn) ? antFunPtrs[iAntIn]->vinciaName() :
"noVinciaName";}
1079 string humanName(
int iAntIn) {
1080 return exists(iAntIn) ? antFunPtrs[iAntIn]->humanName() :
"noHumanName";}
1086 map<int,AntennaFunction*> antFunPtrs{};
1089 bool isInitPtr{
false}, isInit{
false};
1116 for (map<int, AntennaFunctionIX*>::iterator it = antFunPtrs.begin();
1117 it != antFunPtrs.end(); ++it)
delete it->second;
1118 antFunPtrs.clear();}
1121 void initPtr(
Info* infoPtrIn,
DGLAP* dglapPtrIn);
1127 bool exists(
int iAntIn) {
return antFunPtrs.count(iAntIn);}
1131 return (exists(iAntIn)) ? antFunPtrs[iAntIn] :
nullptr;}
1134 vector<int> getIant();
1137 string vinciaName(vector<AntennaFunctionIX*>::size_type iAntIn) {
1138 return exists(iAntIn) ? antFunPtrs[iAntIn]->vinciaName() :
"noVinciaName";}
1141 string humanName(
int iAntIn) {
1142 return exists(iAntIn) ? antFunPtrs[iAntIn]->humanName() :
"noHumanName";}
1148 map<int,AntennaFunctionIX*> antFunPtrs{};
1151 bool isInitPtr{
false}, isInit{
false};
1175 MECs() {isInitPtr =
false; isInit =
false;}
1186 antSetFSR = antFSRusr; antSetISR = antISRusr;}
1198 bool prepare(
const int iSys,
Event& event);
1201 bool polarise(
const int iSys,
Event& event);
1213 vector<Particle> makeParticleList(
const int iSys,
const Event& event,
1214 const vector<Particle> pNew = vector<Particle>(),
1215 const vector<int> iOld = vector<int>());
1219 bool isPolarised(
int iSys,
Event& event,
bool checkIncoming);
1223 return antSetFSR->getAnt(iAnt); }
1225 return antSetISR->getAnt(iAnt); }
1228 bool doMEC(
const int iSys,
const int nBranch);
1231 double getME2(
const vector<Particle> parts,
const int nIn);
1232 double getME2(
const int iSys,
const Event& event);
1235 double getMEC(
const int,
const Event&) {
return 1.;}
1238 int sizeOutBorn(
const int iSys) {
return sizeOutBornSav[iSys];}
1241 void setVerbose(
const int verboseIn) {verbose = verboseIn;}
1252 bool isInitPtr, isInit;
1269 bool matchingFullColour;
1270 int maxMECs2to1, maxMECs2to2, maxMECs2toN, maxMECsResDec, maxMECsMPI;
1274 map<int,int> sizeOutBornSav;
1282 #endif // end Pythia8_VinciaAntennaFunctions_H