9 #ifndef Pythia8_VinciaEW_H 10 #define Pythia8_VinciaEW_H 13 #include "Pythia8/Event.h" 14 #include "Pythia8/StandardModel.h" 15 #include "Pythia8/PartonSystems.h" 16 #include "Pythia8/PythiaComplex.h" 17 #include "Pythia8/BeamParticle.h" 18 #include "Pythia8/UserHooks.h" 21 #include "Pythia8/VinciaCommon.h" 22 #include "Pythia8/VinciaQED.h" 36 EWParticle(
double massIn,
double widthIn,
bool isResIn) :
37 mass(massIn), width(widthIn), isRes(isResIn) {};
40 double mass{0.}, width{0.};
54 bool find(
int id,
int pol){
55 return data.find(make_pair(
id, pol)) != data.end();}
58 void add(
int id,
int pol,
double massIn,
double widthIn,
bool isResIn) {
59 data[make_pair(
id, pol)] =
EWParticle(massIn, widthIn, isResIn);}
62 double mass(
int id,
int pol) {
63 return find(
id, pol) ? data[make_pair(
id, pol)].mass : 0.;}
68 if (find(
id, 1))
return data[make_pair(
id, 1)].mass;
69 return find(
id, 0) ? data[make_pair(
id, 0)].mass : 0.;
74 return find(
id, pol) ? data[make_pair(
id, pol)].width : 0.;}
78 return find(
id, pol) && data[make_pair(
id, pol)].isRes;}
83 if (find(
id, 1))
return data[make_pair(
id, 1)].isRes;
84 else if (find(
id, 0))
return data[make_pair(
id, 0)].isRes;
89 EWParticle*
get(
int id,
int pol) {
return &data.at(make_pair(
id, pol)); }
90 unordered_map<pair<int, int>,
EWParticle>::iterator begin() {
92 unordered_map<pair<int, int>,
EWParticle>::iterator end() {
110 val(valIn), poli(poliIn), polj(poljIn) {}
113 void print() {cout <<
"(" << poli <<
", " << polj <<
") " << val;}
131 val(valIn), poli(poliIn), polj(poljIn) {}
139 void print() {cout <<
"(" << poli <<
", " << polj <<
") " << val;}
160 rndmPtr = infoPtr->rndmPtr;
161 settingsPtr = infoPtr->settingsPtr;
162 loggerPtr = infoPtr->loggerPtr;
163 alphaPtr = alphaPtrIn;
164 alphaSPtr = alphaSPtrIn;
170 vector<pair<int, int> > >* cluMapFinalIn,
171 unordered_map< pair<int, int>, vector<pair<int, int> > >*
186 Vec4 spinProdFlat(
string method,
const Vec4& ka,
const Vec4& pa);
189 void initCoup(
bool va,
int id1,
int id2,
int pol,
bool m);
192 void initFSRAmp(
bool va,
int id1,
int id2,
int pol,
193 const Vec4& pi,
const Vec4 &pj,
const double& mMot,
const double& widthQ2);
196 bool zdenFSRAmp(
const string& method,
const Vec4& pi,
const Vec4& pj,
200 void initISRAmp(
bool va,
int id1,
int id2,
int pol,
201 const Vec4& pa,
const Vec4 &pj,
double& mA);
204 bool zdenISRAmp(
const string& method,
const Vec4& pa,
const Vec4& pj,
211 complex ftofvFSRAmp(
const Vec4& pi,
const Vec4& pj,
int idMot,
int idi,
212 int idj,
double mMot,
double widthQ2,
int polMot,
int poli,
int polj);
213 complex ftofhFSRAmp(
const Vec4& pi,
const Vec4& pj,
int idMot,
int idi,
214 int idj,
double mMot,
double widthQ2,
int polMot,
int poli,
int polj);
215 complex fbartofbarvFSRAmp(
const Vec4& pi,
const Vec4& pj,
int idMot,
int idi,
216 int idj,
double mMot,
double widthQ2,
int polMot,
int poli,
int polj);
217 complex fbartofbarhFSRAmp(
const Vec4& pi,
const Vec4& pj,
int idMot,
int idi,
218 int idj,
double mMot,
double widthQ2,
int polMot,
int poli,
int polj);
219 complex vTtoffbarFSRAmp(
const Vec4& pi,
const Vec4& pj,
int idMot,
int idi,
220 int idj,
double mMot,
double widthQ2,
int polMot,
int poli,
int polj);
221 complex vTtovhFSRAmp(
const Vec4& pi,
const Vec4& pj,
int idMot,
int idi,
222 int idj,
double mMot,
double widthQ2,
int polMot,
int poli,
int polj);
223 complex vTtovvFSRAmp(
const Vec4& pi,
const Vec4& pj,
int idMot,
int idi,
224 int idj,
double mMot,
double widthQ2,
int polMot,
int poli,
int polj);
225 complex vLtoffbarFSRAmp(
const Vec4& pi,
const Vec4& pj,
int idMot,
int idi,
226 int idj,
double mMot,
double widthQ2,
int polMot,
int poli,
int polj);
227 complex vLtovhFSRAmp(
const Vec4& pi,
const Vec4& pj,
int idMot,
int idi,
228 int idj,
double mMot,
double widthQ2,
int polMot,
int poli,
int polj);
229 complex vLtovvFSRAmp(
const Vec4& pi,
const Vec4& pj,
int idMot,
int idi,
230 int idj,
double mMot,
double widthQ2,
int polMot,
int poli,
int polj);
231 complex htoffbarFSRAmp(
const Vec4& pi,
const Vec4& pj,
int idMot,
int idi,
232 int idj,
double mMot,
double widthQ2,
int polMot,
int poli,
int polj);
233 complex htovvFSRAmp(
const Vec4& pi,
const Vec4& pj,
int idMot,
int idi,
234 int idj,
double mMot,
double widthQ2,
int polMot,
int poli,
int polj);
235 complex htohhFSRAmp(
const Vec4& pi,
const Vec4& pj,
int idMot,
int idi,
236 int idj,
double mMot,
double widthQ2,
int polMot,
int poli,
int polj);
240 int idj,
double mA,
int polA,
int pola,
int polj);
242 int idj,
double mA,
int polA,
int pola,
int polj);
243 complex fbartofbarvISRAmp(
const Vec4& pa,
const Vec4& pj,
int idA,
int ida,
244 int idj,
double mA,
int polA,
int pola,
int polj);
245 complex fbartofbarhISRAmp(
const Vec4& pa,
const Vec4& pj,
int idA,
int ida,
246 int idj,
double mA,
int polA,
int pola,
int polj);
249 complex branchAmpFSR(
const Vec4& pi,
const Vec4& pj,
int idMot,
int idi,
250 int idj,
double mMot,
double widthQ2,
int polMot,
int poli=9,
int polj=9);
252 int idj,
double mA,
int polA,
int pola=9,
int polj=9);
256 int idj,
double mMot,
double widthQ2,
int polMot,
int poli,
int polj) {
257 return norm(branchAmpFSR(pi, pj, idMot, idi, idj, mMot, widthQ2,
258 polMot, poli, polj));}
261 vector<AntWrapper> branchKernelFF(
Vec4 pi,
Vec4 pj,
int idMot,
int idi,
262 int idj,
double mMot,
double widthQ2,
int polMot);
266 int idj,
double mA,
int polA,
int pola,
int polj) {
267 return norm(branchAmpISR(pa, pj, idA, ida, idj, mA, polA, pola, polj));}
270 vector<AntWrapper> branchKernelII(
Vec4 pa,
Vec4 pj,
int idA,
int ida,
271 int idj,
double mA,
int polA);
274 void initFFAnt(
bool va,
int id1,
int id2,
int pol,
const double& Q2,
275 const double& widthQ2,
const double& xi,
const double& xj,
276 const double& mMot,
const double& miIn,
const double& mjIn);
281 ss <<
"helicity combination was not found:\n " 282 <<
"polMot = " << polMot <<
" poli = " << poli <<
" polj = " << polj;
283 loggerPtr->ERROR_MSG(ss.str());}
286 void initIIAnt(
int id1,
int id2,
int pol,
const double& Q2,
287 const double& xA,
const double& xj,
288 const double& mA,
const double& maIn,
const double& mjIn);
293 ss <<
"helicity combination was not found:\n " 294 <<
"polA = " << polA <<
" pola = " << pola <<
" polj = " << polj;
295 loggerPtr->ERROR_MSG(ss.str());}
300 double ftofvFFAnt(
double Q2,
double widthQ2,
double xi,
double xj,
301 int idMot,
int idi,
int idj,
double mMot,
double miIn,
double mjIn,
302 int polMot,
int poli,
int polj);
303 double ftofhFFAnt(
double Q2,
double widthQ2,
double xi,
double xj,
304 int idMot,
int idi,
int idj,
double mMot,
double miIn,
double mjIn,
305 int polMot,
int poli,
int polj);
306 double fbartofbarvFFAnt(
double Q2,
double widthQ2,
double xi,
double xj,
307 int idMot,
int idi,
int idj,
double mMot,
double miIn,
double mjIn,
308 int polMot,
int poli,
int polj);
309 double fbartofbarhFFAnt(
double Q2,
double widthQ2,
double xi,
double xj,
310 int idMot,
int idi,
int idj,
double mMot,
double miIn,
double mjIn,
311 int polMot,
int poli,
int polj);
312 double vtoffbarFFAnt(
double Q2,
double widthQ2,
double xi,
double xj,
313 int idMot,
int idi,
int idj,
double mMot,
double miIn,
double mjIn,
314 int polMot,
int poli,
int polj);
315 double vtovhFFAnt(
double Q2,
double widthQ2,
double xi,
double xj,
316 int idMot,
int idi,
int idj,
double mMot,
double miIn,
double mjIn,
317 int polMot,
int poli,
int polj);
318 double vtovvFFAnt(
double Q2,
double widthQ2,
double xi,
double xj,
319 int idMot,
int idi,
int idj,
double mMot,
double miIn,
double mjIn,
320 int polMot,
int poli,
int polj);
321 double htoffbarFFAnt(
double Q2,
double widthQ2,
double xi,
double xj,
322 int idMot,
int idi,
int idj,
double mMot,
double miIn,
double mjIn,
323 int polMot,
int poli,
int polj);
324 double htovvFFAnt(
double Q2,
double widthQ2,
double xi,
double xj,
325 int idMot,
int idi,
int idj,
double mMot,
double miIn,
double mjIn,
326 int polMot,
int poli,
int polj);
327 double htohhFFAnt(
double Q2,
double widthQ2,
double xi,
double xj,
328 int idMot,
int idi,
int idj,
double mMot,
double miIn,
double mjIn,
329 int polMot,
int poli,
int polj);
334 double ftofvIIAnt(
double Q2,
double xA,
double xj,
335 int idA,
int ida,
int idj,
double mA,
double maIn,
double mjIn,
336 int polA,
int pola,
int polj);
337 double fbartofbarvIIAnt(
double Q2,
double xA,
double xj,
338 int idA,
int ida,
int idj,
double mA,
double maIn,
double mjIn,
339 int polA,
int pola,
int polj);
342 double antFuncFF(
double Q2,
double widthQ2,
double xi,
double xj,
343 int idMot,
int idi,
int idj,
double mMot,
double miIn,
double mjIn,
344 int polMot,
int poli,
int polj);
347 vector<AntWrapper> antFuncFF(
double Q2,
double widthQ2,
double xi,
348 double xj,
int idMot,
int idi,
int idj,
double mMot,
double miIn,
349 double mjIn,
int polMot);
352 double antFuncII(
double Q2,
double xA,
double xj,
353 int idA,
int ida,
int idj,
double mA,
double maIn,
double mjIn,
354 int polA,
int pola,
int polj);
357 vector<AntWrapper> antFuncII(
double Q2,
double xA,
double xj,
358 int idA,
int ida,
int idj,
double mA,
double maIn,
double mjIn,
int polA);
362 const double& mMot,
const double& miIn,
const double& mjIn) {
363 mi = miIn; mj = mjIn; mMot2 =
pow2(mMot); mi2 =
pow2(mi); mj2 =
pow2(mj);
364 initCoup(va, id1, id2, pol,
true);}
367 bool zdenFSRSplit(
const string& method,
const double& Q2,
const double& z,
373 ss <<
"helicity combination was not found:\n " 374 <<
"polMot = " << polMot <<
" poli = " << poli <<
" polj = " << polj;
375 loggerPtr->ERROR_MSG(ss.str());}
379 const double& mA,
const double& maIn,
const double& mjIn) {
380 ma = maIn; mj = mjIn; mA2 =
pow2(mA); ma2 =
pow2(ma); mj2 =
pow2(mj);
381 initCoup(va, id1, id2, pol, mA > VinciaConstants::NANO);}
384 bool zdenISRSplit(
const string& method,
const double& Q2,
const double& z,
385 bool flip,
bool check);
390 ss <<
"helicity combination was not found:\n " 391 <<
"polA = " << polA <<
" pola = " << pola <<
" polj = " << polj;
392 loggerPtr->ERROR_MSG(ss.str());}
395 double ftofvFSRSplit(
double Q2,
double z,
int idMot,
int idi,
int idj,
396 double mMot,
double miIn,
double mjIn,
int polMot,
int poli,
int polj);
397 double ftofhFSRSplit(
double Q2,
double z,
int idMot,
int idi,
int idj,
398 double mMot,
double miIn,
double mjIn,
int polMot,
int poli,
int polj);
399 double fbartofbarvFSRSplit(
double Q2,
double z,
int idMot,
int idi,
int idj,
400 double mMot,
double miIn,
double mjIn,
int polMot,
int poli,
int polj);
401 double fbartofbarhFSRSplit(
double Q2,
double z,
int idMot,
int idi,
int idj,
402 double mMot,
double miIn,
double mjIn,
int polMot,
int poli,
int polj);
403 double vTtoffbarFSRSplit(
double Q2,
double z,
int idMot,
int idi,
int idj,
404 double mMot,
double miIn,
double mjIn,
int polMot,
int poli,
int polj);
405 double vTtovhFSRSplit(
double Q2,
double z,
int idMot,
int idi,
int idj,
406 double mMot,
double miIn,
double mjIn,
int polMot,
int poli,
int polj);
407 double vTtovvFSRSplit(
double Q2,
double z,
int idMot,
int idi,
int idj,
408 double mMot,
double miIn,
double mjIn,
int polMot,
int poli,
int polj);
409 double vLtoffbarFSRSplit(
double Q2,
double z,
int idMot,
int idi,
int idj,
410 double mMot,
double miIn,
double mjIn,
int polMot,
int poli,
int polj);
411 double vLtovhFSRSplit(
double Q2,
double z,
int idMot,
int idi,
int idj,
412 double mMot,
double miIn,
double mjIn,
int polMot,
int poli,
int polj);
413 double vLtovvFSRSplit(
double Q2,
double z,
int idMot,
int idi,
int idj,
414 double mMot,
double miIn,
double mjIn,
int polMot,
int poli,
int polj);
415 double htoffbarFSRSplit(
double Q2,
double z,
int idMot,
int idi,
int idj,
416 double mMot,
double miIn,
double mjIn,
int polMot,
int poli,
int polj);
417 double htovvFSRSplit(
double Q2,
double z,
int idMot,
int idi,
int idj,
418 double mMot,
double miIn,
double mjIn,
int polMot,
int poli,
int polj);
419 double htohhFSRSplit(
double Q2,
double z,
int idMot,
int idi,
int idj,
420 double mMot,
double miIn,
double mjIn,
int polMot,
int poli,
int polj);
423 double ftofvISRSplit(
double Q2,
double z,
int idA,
int ida,
int idj,
424 double mA,
double maIn,
double mjIn,
int polA,
int pola,
int polj);
425 double ftofhISRSplit(
double Q2,
double z,
int idA,
int ida,
int idj,
426 double mA,
double maIn,
double mjIn,
int polA,
int pola,
int polj);
427 double fbartofbarvISRSplit(
double Q2,
double z,
int idA,
int ida,
int idj,
428 double mA,
double maIn,
double mjIn,
int polA,
int pola,
int polj);
429 double fbartofbarhISRSplit(
double Q2,
double z,
int idA,
int ida,
int idj,
430 double mA,
double maIn,
double mjIn,
int polA,
int pola,
int polj);
433 double splitFuncFSR(
double Q2,
double z,
int idMot,
int idi,
int idj,
434 double mMot,
double miIn,
double mjIn,
int polMot,
int poli,
int polj);
435 double splitFuncISR(
double Q2,
double z,
int idA,
int ida,
int idj,
436 double mA,
double maIn,
double mjIn,
int polA,
int pola,
int polj);
439 double getPartialWidth(
int idMot,
int idi,
int idj,
double mMot,
int polMot);
442 double getTotalWidth(
int idMot,
double mMot,
int polMot);
445 double getBreitWigner(
int id,
double m,
int pol);
446 double getBreitWignerOverestimate(
int id,
double m,
int pol);
449 double sampleMass(
int id,
int pol);
452 void applyBosonInterferenceFactor(
Event &event,
int XYEv,
Vec4 pi,
Vec4 pj,
453 int idi,
int idj,
int poli,
int polj);
456 bool polarise(vector<Particle> &state);
460 void eventWeight(
double eventWeightIn) {eventWeightSave = eventWeightIn;}
469 unordered_map<pair<int, int>,
double>
vMap, aMap, gMap, vCKM;
476 unordered_map<int, vector<double> > cBW;
478 unordered_map<pair<int,int>,
double> nBW, np;
481 double eventWeightSave{1};
484 double mw, mw2, sw, sw2;
490 unordered_map<pair<int, int>, vector<pair<int, int> > >* cluMapFinal{};
491 unordered_map<pair<int, int>, vector<pair<int, int> > >* cluMapInitial{};
494 vector<int> fermionPols, vectorPols, scalarPols;
497 double v, a, vPls, vMin, g;
500 double mMot2, mi, mi2, mj, mj2, mA2, ma, ma2, isrQ2;
504 Vec4 kij, ki, kj, pij, kaj, ka, paj;
505 double wij, wi, wj, wij2, wi2, wj2, waj, wa, waj2, wa2;
508 double Q4, Q4gam, Q2til, ant;
521 bool isInitPtr{
false};
535 double c0In = 0,
double c1In = 0,
double c2In = 0,
double c3In = 0):
536 idMot(idMotIn), idi(idiIn), idj(idjIn), polMot(polMotIn), c0(c0In),
537 c1(c1In), c2(c2In), c3(c3In),
538 isSplitToFermions(abs(idMot) > 20 && abs(idi) < 20 && abs(idj) < 20) {;}
541 void print() {cout <<
" (" << idMot <<
", " << polMot <<
") -> " << idi <<
542 "," << idj <<
": (" << c0 <<
", " << c1 <<
", " << c2 <<
", " << c3 <<
548 double c0, c1, c2, c3;
563 EWAntenna(): iSys(-1), shat(0), doBosonInterference(false) {};
569 ss <<
"Brancher = (" << iMot <<
", " << polMot
570 <<
"), Recoiler = " << iRec;
571 printOut(__METHOD_NAME__, ss.str());
572 for (
int i = 0; i < (int)brVec.size(); i++) brVec[i].print();}
579 loggerPtr = infoPtr->loggerPtr;
580 partonSystemsPtr = infoPtr->partonSystemsPtr;
581 vinComPtr = vinComPtrIn;
582 alphaPtr = alphaPtrIn;
583 ampCalcPtr = ampCalcPtrIn;
587 virtual bool init(
Event &event,
int iMotIn,
int iRecIn,
int iSysIn,
588 vector<EWBranching> &branchings,
Settings* settingsPtr) = 0;
594 virtual double generateTrial(
double q2Start,
double q2End,
598 virtual bool acceptTrial(
Event& event) = 0;
601 virtual void updateEvent(
Event& event) = 0;
602 virtual void updatePartonSystems(
Event& event);
606 int getIndexRec() {
return iRec;};
610 return brTrial !=
nullptr && brTrial->isSplitToFermions;}
611 virtual bool isInitial() {
return false;}
612 virtual bool isResonanceDecay() {
return false;}
615 bool selectChannel(
int idx,
const double& cSum,
const map<double, int>&
616 cSumSoFar,
int& idi,
int& idj,
double& mi2,
double& mj2);
621 int iMot, iRec, idMot, idRec, polMot;
625 double sAnt, mMot, mMot2, mRec, mRec2;
636 double q2Trial, sijTrial, sjkTrial;
637 int poliTrial, poljTrial;
644 map<double, int> c0SumSoFar, c1SumSoFar, c2SumSoFar, c3SumSoFar;
651 unordered_map<int,int> iReplace;
680 virtual bool init(
Event &event,
int iMotIn,
int iRecIn,
int iSysIn,
681 vector<EWBranching> &branchings,
Settings* settingsPtr)
override;
682 virtual double generateTrial(
double q2Start,
double q2End,
double alphaIn)
684 virtual bool acceptTrial(
Event &event)
override;
685 virtual void updateEvent(
Event &event)
override;
690 double mAnt2, sqrtKallen;
694 bool vetoResonanceProduction;
707 bool init(
Event &event,
int iMotIn,
int iRecIn,
int iSysIn,
708 vector<EWBranching> &branchings,
Settings* settingsPtr)
override;
709 bool isResonanceDecay()
override {
return true;}
710 double generateTrial(
double q2Start,
double q2End,
double alphaIn)
override;
711 bool acceptTrial(
Event &event)
override;
712 void updateEvent(
Event &event)
override;
715 bool genForceDecay(
Event &event);
720 bool trialIsResDecay;
726 bool doDecayOnly{
false};
740 beamAPtr(beamAPtrIn), beamBPtr(beamBPtrIn), shh(0), xMot(0), xRec(0),
741 vetoResonanceProduction(false), TINYPDFtrial(1e-10) {;}
744 bool init(
Event &event,
int iMotIn,
int iRecIn,
int iSysIn,
745 vector<EWBranching> &branchings,
Settings* settingsPtr)
override;
746 bool isInitial()
override {
return true;}
747 double generateTrial(
double q2Start,
double q2End,
double alphaIn)
override;
748 bool acceptTrial(
Event &event)
override;
749 void updateEvent(
Event &event)
override;
750 void updatePartonSystems(
Event &event)
override;
763 bool vetoResonanceProduction;
765 vector<Vec4> pRecVec;
783 EWSystem(unordered_map<pair<int, int>, vector<EWBranching> >* brMapFinalIn,
784 unordered_map<pair<int, int>, vector<EWBranching> >* brMapInitialIn,
785 unordered_map<pair<int, int>, vector<EWBranching> >* brMapResonanceIn,
786 unordered_map<pair<int, int>, vector<pair<int, int> > >* cluMapFinalIn,
787 unordered_map<pair<int, int>, vector<pair<int, int> > >* cluMapInitialIn,
789 shh(0), iSysSav(0), resDecOnlySav(
false), q2Cut(0), q2Trial(0),
790 lastWasSplitSav(
false), lastWasDecSav(
false), lastWasInitialSav(
false),
791 lastWasBelowCut(
false), ISav(0), KSav(0), brMapFinal(brMapFinalIn),
792 brMapInitial(brMapInitialIn), brMapResonance(brMapResonanceIn),
793 cluMapFinal(cluMapFinalIn), cluMapInitial(cluMapInitialIn),
794 ampCalcPtr(ampCalcIn), isInit(
false), doVetoHardEmissions(
false),
795 verbose(
false), vetoHardEmissionsDeltaR2(0) {clearLastTrial();}
801 rndmPtr = infoPtr->rndmPtr;
802 settingsPtr = infoPtr->settingsPtr;
803 loggerPtr = infoPtr->loggerPtr;
804 vinComPtr = vinComPtrIn;
809 beamAPtr = beamAPtrIn; beamBPtr = beamBPtrIn;
810 doVetoHardEmissions = settingsPtr->
flag(
"Vincia:EWoverlapVeto");
811 vetoHardEmissionsDeltaR2 =
812 pow2(settingsPtr->parm(
"Vincia:EWoverlapVetoDeltaR"));
819 bool prepare(
Event &event,
int iSysIn,
double q2CutIn,
bool resDecOnlyIn) {
820 iSysSav = iSysIn; resDecOnlySav = resDecOnlyIn; q2Cut = q2CutIn;
821 shh = infoPtr->s();
return buildSystem(event);}
824 bool buildSystem(
Event &event);
830 double q2Next(
double q2Start,
double q2End);
834 Event &event,
int iMot,
int iRec,
835 unordered_map<pair<int, int>, vector<EWBranching> >* brMapPtr) {
836 if (iMot == 0)
return;
837 int idA(event[iMot].
id()), polA(event[iMot].pol());
838 if (idA == 21)
return;
839 auto it = brMapPtr->find(make_pair(idA, polA));
840 if (it != brMapPtr->end()) {
842 ant.setVerbose(verbose);
844 ant.initPtr(infoPtr, vinComPtr, al, ampCalcPtr);
846 if (ant.init(event, iMot, iRec, iSysSav, it->second, settingsPtr)) {
847 antVec.push_back(std::move(ant));
850 ss <<
"Added EW antenna with iEv = " 851 << iMot <<
" and iRec = "<< iRec<<
" in system "<< iSysSav;
852 printOut(__METHOD_NAME__, ss.str());}}}}
856 double q2End,
double alphaIn) {
857 if (q2End > q2Start)
return;
858 for (
int i = 0; i < (int)antVec.size(); i++) {
860 double q2New = antVec[i].generateTrial(q2Start,q2End,alphaIn);
862 if (q2New > q2Trial && q2New > q2End) {
865 antTrial = &(antVec[i]);
866 lastWasDecSav = antTrial->isResonanceDecay();
867 lastWasInitialSav = antTrial->isInitial();
870 lastWasSplitSav = lastWasDecSav ?
true : antTrial->isSplitToFermions();
871 lastWasBelowCut = (q2Trial < q2Cut)?
true :
false;
872 ISav = antTrial->getIndexMot(); KSav = antTrial->getIndexRec();}}}
875 void generateTrial(
Event &event, vector<EWAntenna> & antVec,
double q2Start,
876 double q2End,
double alphaIn);
880 bool passed = antTrial->acceptTrial(event);
882 printOut(__METHOD_NAME__, passed ?
"Passed veto" :
"Vetoed branching");
889 if (antTrial !=
nullptr) antTrial->updateEvent(event);
890 else loggerPtr->ERROR_MSG(
"trial doesn't exist!");
898 if (antTrial!=
nullptr) antTrial->updatePartonSystems(event);
899 else loggerPtr->ERROR_MSG(
"trial doesn't exist!");
905 for (
int i = 0; i < (int)antVecFinal.size(); i++) antVecFinal[i].print();
906 for (
int i = 0; i < (int)antVecRes.size(); i++) antVecRes[i].print();
907 for (
int i = 0; i < (int)antVecInitial.size(); i++)
908 antVecInitial[i].print();}
912 antVecInitial.size() + antVecRes.size();}
913 unsigned int nResDec() {
return antVecRes.size();}
920 bool lastWasInitial() {
return lastWasInitialSav;}
921 bool lastWasResonanceDecay() {
return lastWasDecSav;}
925 antVecRes.clear(); clearLastTrial();}
929 q2Trial = 0; antTrial =
nullptr; lastWasSplitSav =
false;
930 lastWasDecSav =
false; lastWasInitialSav =
false; lastWasBelowCut =
false;
957 vector<EWAntennaFF> antVecFinal;
958 vector<EWAntennaII> antVecInitial;
959 vector<EWAntennaFFres> antVecRes;
964 bool lastWasSplitSav, lastWasDecSav, lastWasInitialSav, lastWasBelowCut;
968 unordered_map<pair<int, int>, vector<EWBranching> >
969 *brMapFinal{}, *brMapInitial{}, *brMapResonance{};
972 unordered_map<pair<int, int>, vector<pair<int, int> > >
973 *cluMapFinal{}, *cluMapInitial{};
979 bool isInit, doVetoHardEmissions;
981 double vetoHardEmissionsDeltaR2;
1000 loggerPtr = infoPtr->loggerPtr;
1001 partonSystemsPtr = infoPtr->partonSystemsPtr;
1002 rndmPtr = infoPtr->rndmPtr;
1003 settingsPtr = infoPtr->settingsPtr;
1004 vinComPtr = vinComPtrIn;
1005 ampCalc.
initPtr(infoPtr, &al, &vinComPtr->alphaStrong);
1014 if (isLoaded)
return ampCalc.polarise(state);
1019 bool prepare(
int iSysIn,
Event &event,
bool isBelowHadIn=
false)
override;
1025 if (iSysIn != ewSystem.system())
return;
1026 else ewSystem.buildSystem(event);
1032 verbose = verboseIn; ampCalc.setVerbose(verboseIn);}
1035 void load()
override;
1038 double q2Next(
Event&,
double q2Start,
double q2End)
override;
1042 bool lastIsInitial()
override {
return ewSystem.lastWasInitial(); }
1043 bool lastIsResonanceDecay()
override {
1044 return ewSystem.lastWasResonanceDecay(); }
1050 bool success =
false;
1051 if (ewSystem.hasTrial()) success = ewSystem.acceptTrial(event);
1052 else loggerPtr->ERROR_MSG(
"trial doesn't exist!");
1061 if (ewSystem.hasTrial()) ewSystem.updateEvent(event);
1062 else loggerPtr->ERROR_MSG(
"trial doesn't exist!");
1064 printOut(__METHOD_NAME__,
"Event after update:");
event.list();
1071 if (ewSystem.hasTrial()) ewSystem.updatePartonSystems(event);
1072 else loggerPtr->ERROR_MSG(
"trial doesn't exist!");
1078 ewSystem.clearAntennae();
1079 ampCalc.eventWeight(1);
1083 unsigned int nBranchers()
override {
return ewSystem.nBranchers();}
1084 unsigned int nResDec()
override {
return ewSystem.nResDec();}
1090 void printBranchings();
1093 double q2min()
override {
return q2minSav;}
1095 double eventWeight() {
return ampCalc.eventWeight();}
1098 void q2min(
double q2minSavIn) {q2minSav = q2minSavIn;}
1101 int sysWin()
override {
return ewSystem.system();}
1109 unordered_map<pair<int, int>, vector<pair<int, int> > >
1114 unordered_map<pair<int, int>, vector<EWBranching> >
1127 bool readFile(
string file);
1128 bool readLine(
string line);
1129 bool attributeValue(
string line,
string attribute,
string& val);
1130 template <
class T>
bool attributeValue(
1131 string line,
string attribute, T& val) {
1133 if (!attributeValue(line, attribute, valString))
return false;
1134 istringstream valStream(valString);
1135 if ( !(valStream >> val) ) {
1136 loggerPtr->ERROR_MSG(
"failed to store attribute " 1137 + attribute +
" " + valString);
1141 bool addBranching(
string line, unordered_map< pair<int, int>,
1142 vector<EWBranching> > & branchings, unordered_map< pair<int, int>,
1143 vector<pair<int, int> > > & clusterings,
double headroom,
bool decay);
1144 bool addParticle(
int idIn,
int polIn,
bool isRes);
1161 bool isLoaded, doEW, doFFbranchings, doIIbranchings, doRFbranchings,
1162 doBosonInterference;
1168 double headroomFinal, headroomInitial;
1188 bool doVetoISREmission(
int sizeOld,
const Event &event,
int iSys)
override;
1189 bool doVetoFSREmission(
int sizeOld,
const Event &event,
int iSys,
1190 bool inResonance =
false)
override;
1193 void init(shared_ptr<VinciaEW> ewShowerPtrIn);
1198 bool doVetoEmission(
int sizeOld,
const Event &event,
int iSys);
1200 double findQCDScale(
int sizeOld,
const Event& event,
int iSys);
1202 double findEWScale(
int sizeOld,
const Event& event,
int iSys);
1204 double ktMeasure(
const Event& event,
int indexi,
int indexj,
double mI2);
1206 double findktQCD(
const Event& event,
int indexi,
int indexj);
1208 double findktEW(
const Event& event,
int indexi,
int indexj);
1210 bool setLastFSREmission(
int sizeOld,
const Event& event);
1212 bool setLastISREmission(
int sizeOld,
const Event& event);
1233 shared_ptr<VinciaEW> ewShowerPtr{};
void init(BeamParticle *beamAPtrIn, BeamParticle *beamBPtrIn)
Initialize.
Definition: VinciaEW.h:808
AntWrapper norm()
Normalization.
Definition: VinciaEW.h:134
bool canVetoISREmission() override
Define to activate veto.
Definition: VinciaEW.h:1184
constexpr double pow2(const double &x)
Powers of small integers - for balance speed/code clarity.
Definition: PythiaStdlib.h:182
double width(int id, int pol)
Return particle width.
Definition: VinciaEW.h:73
bool canVetoFSREmission() override
Possibility to veto an emission in the FSR machinery.
Definition: VinciaEW.h:1185
int iMot
Indices, PID, and polarization of I, K in Pythia event record.
Definition: VinciaEW.h:621
Class to contain an amplitude and two outgoing polarizations.
Definition: VinciaEW.h:125
unordered_map< pair< int, int >, vector< pair< int, int > > > cluMapFinal
Public members.
Definition: VinciaEW.h:1110
double c0Sum
Info on coefficents.
Definition: VinciaEW.h:643
double val
Members.
Definition: VinciaEW.h:116
std::complex< double > complex
Convenient typedef for double precision complex numbers.
Definition: PythiaComplex.h:17
Rndm * rndmPtr
Pointer to the random number generator.
Definition: Info.h:89
EWBranching(int idMotIn, int idiIn, int idjIn, int polMotIn, double c0In=0, double c1In=0, double c2In=0, double c3In=0)
Constructor.
Definition: VinciaEW.h:534
Simple class to save information about particles.
Definition: VinciaEW.h:30
int system()
Return which system we are handling.
Definition: VinciaEW.h:827
void hmsgIIAnt(int polA, int pola, int polj)
Report helicity combination error for an II antenna function.
Definition: VinciaEW.h:291
Definition: StandardModel.h:23
Class that contains an electroweak branching.
Definition: VinciaEW.h:529
AmpWrapper & operator+=(complex c)
Operators.
Definition: VinciaEW.h:137
The Event class holds all info on the generated event.
Definition: Event.h:453
unordered_map< pair< int, int >, EWParticle > data
Member.
Definition: VinciaEW.h:96
Definition: BeamParticle.h:133
EWParticleData ewData
Locally store data about EW particles.
Definition: VinciaEW.h:1118
Initial-initial electroweak antenna.
Definition: VinciaEW.h:734
void print()
Print.
Definition: VinciaEW.h:541
void clearAntennae()
Clear the antennae.
Definition: VinciaEW.h:924
bool polarise(vector< Particle > &state) override
Select helicities for a resonance-decay system.
Definition: VinciaEW.h:1013
int idMot
For a branching I->ij, particle IDs and polarisation of I.
Definition: VinciaEW.h:546
EWParticle()=default
Constructor.
Calculator class for amplitudes, antennae, and Breit-Wigners.
Definition: VinciaEW.h:151
double q2Match
Matching scale.
Definition: VinciaEW.h:647
void initPtr(Info *infoPtrIn, AlphaEM *alphaPtrIn, AlphaStrong *alphaSPtrIn)
Initialize the pointers.
Definition: VinciaEW.h:156
Class to do the veto for overlapping QCD/EW shower phase space.
Definition: VinciaEW.h:1176
Base class for Vincia's QED and EW shower modules.
Definition: VinciaQED.h:444
Final-final electroweak antenna.
Definition: VinciaEW.h:676
void print()
Print.
Definition: VinciaEW.h:113
double alpha
Overestimate of QED coupling.
Definition: VinciaEW.h:627
vector< Vec4 > pNew
Outgoing momenta after branching.
Definition: VinciaEW.h:640
void printOut(string, string, int nPad=0, char padChar='-')
end METHOD_NAME
Definition: VinciaCommon.cc:4964
Top-level class for the electroweak shower module.
Definition: VinciaEW.h:989
void setVerbose(int verboseIn) override
Set verbose level.
Definition: VinciaEW.h:1031
bool find(int id, int pol)
Find particle data.
Definition: VinciaEW.h:54
AmpWrapper(complex valIn, int poliIn, int poljIn)
Constructor.
Definition: VinciaEW.h:130
void hmsgFSRSplit(int polMot, int poli, int polj)
Report helicty combination error for an FSR splitting kernel.
Definition: VinciaEW.h:371
void hmsgISRSplit(int polA, int pola, int polj)
Report helicty combination error for an ISR splitting kernel.
Definition: VinciaEW.h:388
void hmsgFFAnt(int polMot, int poli, int polj)
Report helicity combination error for an FF antenna function.
Definition: VinciaEW.h:279
void print()
Print, must be implemented by base classes.
Definition: VinciaEW.h:567
Class that performs electroweak showers in a single parton system.
Definition: VinciaEW.h:777
Definition: StandardModel.h:106
bool lastIsSplitting() override
Query last branching.
Definition: VinciaEW.h:1041
int sysWin() override
We only have one system.
Definition: VinciaEW.h:1101
void setVerbose(int verboseIn)
Set verbosity.
Definition: VinciaEW.h:816
double mass(int id)
Return particle mass.
Definition: VinciaEW.h:66
double mass
Members.
Definition: VinciaEW.h:40
unsigned int nBranchers() override
Get number of EW branchers.
Definition: VinciaEW.h:1083
EWAntenna()
Constructor and destructor.
Definition: VinciaEW.h:563
double eventWeight()
EW event weight.
Definition: VinciaEW.h:459
Definition: VinciaCommon.h:494
double q2min() override
Override additional base class methods.
Definition: VinciaEW.h:1093
double branchKernelFF(const Vec4 &pi, const Vec4 &pj, int idMot, int idi, int idj, double mMot, double widthQ2, int polMot, int poli, int polj)
Compute FF antenna function from amplitudes.
Definition: VinciaEW.h:255
void updateEvent(Event &event)
Update an event.
Definition: VinciaEW.h:886
bool hasTrial
Trial variables.
Definition: VinciaEW.h:635
int jNew
Information for partonSystems.
Definition: VinciaEW.h:650
complex val
Members.
Definition: VinciaEW.h:142
int getIndexMot()
Return index.
Definition: VinciaEW.h:605
bool isResonance(int pid)
Check if a particle is a resonance according to EW shower database.
Definition: VinciaEW.h:1104
void initFSRSplit(bool va, int id1, int id2, int pol, const double &mMot, const double &miIn, const double &mjIn)
Initialize an FSR splitting kernel.
Definition: VinciaEW.h:361
unordered_map< pair< int, int >, vector< EWBranching > > brMapFinal
Definition: VinciaEW.h:1115
bool acceptTrial(Event &event) override
Check veto.
Definition: VinciaEW.h:1047
bool isRes(int id)
Return if particle is resonance.
Definition: VinciaEW.h:81
Final-final electroweak resonance antenna.
Definition: VinciaEW.h:702
double q2minColoured() override
End scales.
Definition: VinciaEW.h:1094
AmpCalculator ampCalc
Amplitude calculator.
Definition: VinciaEW.h:1121
void initISRSplit(bool va, int id1, int id2, int pol, const double &mA, const double &maIn, const double &mjIn)
Initialize an ISR splitting kernel.
Definition: VinciaEW.h:378
Locally saved particle data in glorified map.
Definition: VinciaEW.h:49
Class to contain an antenna function and two outgoing polarizations.
Definition: VinciaEW.h:104
void updatePartonSystems(Event &event) override
Update partonSystems after branching accepted.
Definition: VinciaEW.h:1068
void initPtr(Info *infoPtrIn, VinciaCommon *vinComPtrIn, AlphaEM *alIn)
Initialize pointers.
Definition: VinciaEW.h:798
void clear(int) override
Clear EW system.
Definition: VinciaEW.h:1077
int iSys
Parton system this antenna is part of.
Definition: VinciaEW.h:629
Base class for an electroweak antenna.
Definition: VinciaEW.h:558
ParticleData * particleDataPtr
Pointer to the particle data table.
Definition: Info.h:83
PartonSystems * partonSystemsPtr
Pointer to information on subcollision parton locations.
Definition: Info.h:99
Vec4 pMot
Momenta of antenna constituents.
Definition: VinciaEW.h:623
bool lastWasSplitToFermions()
Check if split to fermions, initial, or resonance.
Definition: VinciaEW.h:919
vector< EWBranching > brVec
EW branchings.
Definition: VinciaEW.h:632
int verbose
Verbosity.
Definition: VinciaEW.h:668
void initPtr(Info *infoPtrIn, VinciaCommon *vinComPtrIn) override
Initialize pointers (called at construction time).
Definition: VinciaEW.h:997
EWAntennaII(BeamParticle *beamAPtrIn, BeamParticle *beamBPtrIn)
Constructor.
Definition: VinciaEW.h:739
bool initPtr(Info *infoPtrIn)
Initialize pointers.
Definition: VinciaCommon.h:499
bool prepare(Event &event, int iSysIn, double q2CutIn, bool resDecOnlyIn)
Prepare an event.
Definition: VinciaEW.h:819
const int DEBUG
Verbosity levels. Vincia has one more level (debug) beyond report.
Definition: VinciaCommon.h:49
void addAntenna(T ant, vector< T > &antVec, Event &event, int iMot, int iRec, unordered_map< pair< int, int >, vector< EWBranching > > *brMapPtr)
Add an antenna.
Definition: VinciaEW.h:833
void initPtr(Info *infoPtrIn, VinciaCommon *vinComPtrIn, AlphaEM *alphaPtrIn, AmpCalculator *ampCalcPtrIn)
Initialize pointers.
Definition: VinciaEW.h:575
The PartonSystems class describes the whole set of subcollisions.
Definition: PartonSystems.h:42
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
double m(const Vec4 &v1)
Invariant mass and its square.
Definition: Basics.cc:595
double branchKernelII(Vec4 pa, Vec4 pj, int idA, int ida, int idj, double mA, int polA, int pola, int polj)
Compute II antenna function from amplitudes.
Definition: VinciaEW.h:265
void q2min(double q2minSavIn)
Setter for q2minSav.
Definition: VinciaEW.h:1098
AntWrapper(double valIn, int poliIn, int poljIn)
Constructor.
Definition: VinciaEW.h:109
UserHooks is base class for user access to program execution.
Definition: UserHooks.h:32
bool acceptTrial(Event &event)
Accept a trial.
Definition: VinciaEW.h:879
const int DASHLEN
Padding length for dashes in standardised Vincia verbose output.
Definition: VinciaCommon.h:52
bool isSplitToFermions
Store if branching is a splitting.
Definition: VinciaEW.h:550
void setVerbose(int verboseIn)
Set verbosity level.
Definition: VinciaEW.h:175
void update(Event &event, int iSysIn) override
Update EW shower system each time something has changed.
Definition: VinciaEW.h:1022
bool isSplitToFermions()
Check if splitting to fermions, inital, or resoance.
Definition: VinciaEW.h:609
void updateEvent(Event &event) override
Update event after branching accepted.
Definition: VinciaEW.h:1058
void updatePartonSystems(Event &event)
Update parton systems.
Definition: VinciaEW.h:895
EWSystem()
Constructors.
Definition: VinciaEW.h:782
void add(int id, int pol, double massIn, double widthIn, bool isResIn)
Add particle data.
Definition: VinciaEW.h:58
double c0
Overestimate constants used to sample antennae.
Definition: VinciaEW.h:548
void clearLastTrial()
Clear the last saved trial (but keep the antennae).
Definition: VinciaEW.h:928
void printAntennae()
Print the antennas.
Definition: VinciaEW.h:904
void setVerbose(int verboseIn)
Set verbosity level.
Definition: VinciaEW.h:591
bool flag(string key) const
Shorthand to read settings values.
Definition: PhysicsBase.h:45
bool doBosonInterference
Settings.
Definition: VinciaEW.h:665
void generateTrial(vector< T > &antVec, double q2Start, double q2End, double alphaIn)
Generate a trial.
Definition: VinciaEW.h:855
VinciaEW()
Constructor.
Definition: VinciaEW.h:994
double sAnt
Masses and invariants of antenna constituents.
Definition: VinciaEW.h:625
double mass(int id, int pol)
Return particle mass.
Definition: VinciaEW.h:62
Definition: Settings.h:195
unordered_map< pair< int, int >, double > vMap
Definition: VinciaEW.h:469
bool isRes(int id, int pol)
Return if particle is resonance.
Definition: VinciaEW.h:77
bool hasTrial()
Check if system has a trial pointer.
Definition: VinciaEW.h:916
unsigned int nBranchers()
Get number of branchers (total and res-dec only)
Definition: VinciaEW.h:911