8 #include "Pythia8/PartonVertex.h"
20 void PartonVertex::init() {
22 doVertex = settingsPtr->flag(
"PartonVertex:setVertex");
23 modeVertex = settingsPtr->mode(
"PartonVertex:modeVertex");
24 rProton = settingsPtr->parm(
"PartonVertex:ProtonRadius");
25 pTmin = settingsPtr->parm(
"PartonVertex:pTmin");
26 widthEmission = settingsPtr->parm(
"PartonVertex:EmissionWidth");
27 bScale = 2.187 / (2. * rProton);
35 void PartonVertex::vertexBeam(
int iNow,
int iBeam,
Event& event) {
37 event[iNow].vProd(-bNow/2., 0., 0., 0.);
39 event[iNow].vProd(bNow/2., 0. ,0. ,0.);
41 infoPtr->errorMsg(
"Error in PartonVertex:vertexBeam: Wrong beam index.");
48 void PartonVertex::vertexMPI(
int iBeg,
int nAdd,
double bNowIn,
52 if (!doVertex || modeVertex < 1 || modeVertex > 2)
return;
55 bNow = bNowIn / bScale;
56 if (modeVertex == 1) {
57 xMax = rProton - bNow / 2.;
58 yMax = sqrt( 4. * rProton * rProton - bNow * bNow);
59 }
else if (modeVertex == 2) {
64 for (
int iNow = iBeg; iNow < iBeg + nAdd; ++iNow) {
65 double x = 0.0, y = 0.0;
68 if (modeVertex == 1) {
71 x = (2. * rndmPtr->flat() - 1.) * xMax;
72 y = (2. * rndmPtr->flat() - 1.) * yMax;
73 if ( (pow2(x + bNow / 2) + y * y < pow2(rProton))
74 && (pow2(x - bNow / 2) + y * y < pow2(rProton)) ) reject =
false;
79 pair<double,double> xy = rndmPtr->gauss2();
80 x = (rProton / 2.0) * (xy.first + mux);
81 y = (rProton / 2.0) * xy.second;
85 event[iNow].vProd( x, y, 0., 0.);
94 void PartonVertex::vertexFSR(
int iNow,
Event& event) {
97 if (!doVertex || modeVertex < 1 || modeVertex > 2)
return;
100 int iMo =
event[iNow].mother1();
102 Vec4 vStart =
event[iNow].hasVertex() ?
event[iNow].vProd()
103 :
event[iMo].vProd();
106 double pT = max( event[iNow].pT(), pTmin);
107 pair<double, double> xy = rndmPtr->gauss2();
108 Vec4 vSmear = (widthEmission / pT) * Vec4( xy.first, xy.second, 0., 0.);
109 event[iNow].vProd( vStart + vSmear);
118 void PartonVertex::vertexISR(
int iNow,
Event& event) {
121 if (!doVertex || modeVertex < 1 || modeVertex > 2)
return;
124 int iMoDa =
event[iNow].mother1();
125 if (iMoDa == 0) iMoDa =
event[iNow].daughter1();
126 Vec4 vStart =
event[iNow].vProd();
127 if (!event[iNow].hasVertex() && iMoDa != 0) vStart =
event[iMoDa].vProd();
130 double pT = max( event[iNow].pT(), pTmin);
131 pair<double, double> xy = rndmPtr->gauss2();
132 Vec4 vSmear = (widthEmission / pT) * Vec4( xy.first, xy.second, 0., 0.);
133 event[iNow].vProd( vStart + vSmear);