6 <<
"EmissionVeto: " << message << endl;
18 int EmtAfterBranch,
int RecAfterBranch,
bool FSR) {
24 int radID = e[RadAfterBranch].id();
27 double sign = (FSR) ? 1. : -1.;
29 double Qsq = sign * Q.m2Calc();
32 double m2Rad = (
abs(radID) >= 4 &&
abs(radID) < 7) ?
33 Pythia8::pow2(particleDataPtr->m0(radID)) : 0.;
40 double m2Dip = sum.m2Calc();
41 double x1 = 2. * (sum * radVec) / m2Dip;
42 double x3 = 2. * (sum * emtVec) / m2Dip;
50 z = qBR.m2Calc() / qAR.m2Calc();
55 pTnow *= (Qsq - sign * m2Rad);
59 cout <<
"Warning: pTpythia was negative" << endl;
64 cout <<
"pTpythia: rad = " << RadAfterBranch <<
", emt = "
65 << EmtAfterBranch <<
", rec = " << RecAfterBranch
66 <<
", pTnow = " <<
sqrt(pTnow) << endl;
82 int iInA = partonSystemsPtr->getInA(0);
83 int iInB = partonSystemsPtr->getInB(0);
84 double betaZ = - ( e[iInA].pz() + e[iInB].pz() ) /
85 ( e[iInA].
e() + e[iInB].e() );
87 iVecBst.bst(0., 0., betaZ);
88 jVecBst.bst(0., 0., betaZ);
89 pTnow =
sqrt( (iVecBst + jVecBst).m2Calc() *
90 iVecBst.e() * jVecBst.e() /
91 Pythia8::pow2(iVecBst.e() + jVecBst.e()) );
100 cout <<
"Warning: pTpowheg was negative" << endl;
105 cout <<
"pTpowheg: i = " << i <<
", j = " << j
106 <<
", pTnow = " << pTnow << endl;
120 double pTemt = -1., pTnow;
121 int xSR1 = (xSRin == -1) ? 0 : xSRin;
122 int xSR2 = (xSRin == -1) ? 2 : xSRin + 1;
123 for (
int xSR = xSR1; xSR < xSR2; xSR++) {
125 bool FSR = (xSR == 0) ?
false :
true;
133 }
else if (!FSR &&
pTdefMode == 2 && i > 0 && j > 0 && r > 0) {
137 }
else if (FSR &&
pTdefMode == 2 && j > 0 && k > 0 && r > 0) {
146 int iInA = partonSystemsPtr->getInA(0);
147 int iInB = partonSystemsPtr->getInB(0);
148 while (e[iInA].mother1() != 1) { iInA = e[iInA].mother1(); }
149 while (e[iInB].mother1() != 2) { iInB = e[iInB].mother1(); }
152 int jNow = (j > 0) ? j : 0;
153 int jMax = (j > 0) ? j + 1 : e.size();
154 for (; jNow < jMax; jNow++) {
157 if (!e[jNow].isFinal())
continue;
158 if (e[jNow].colType() == 0 && e[jNow].
id() != 22)
continue;
166 if (pTnow > 0.) pTemt = (pTemt < 0) ? pTnow :
min(pTemt, pTnow);
173 int outSize = partonSystemsPtr->sizeOut(0);
174 for (
int iMem = 0; iMem < outSize; iMem++) {
175 int iNow = partonSystemsPtr->getOut(0, iMem);
178 if (iNow == jNow || e[iNow].colType() == 0)
continue;
179 if (jNow == e[iNow].daughter1()
180 && jNow == e[iNow].daughter2())
continue;
184 if (pTnow > 0.) pTemt = (pTemt < 0)
185 ? pTnow :
min(pTemt, pTnow);
195 pTnow =
pTpythia(e, iInA, jNow, iInB, FSR);
196 if (pTnow > 0.) pTemt = (pTemt < 0) ? pTnow :
min(pTemt, pTnow);
197 pTnow =
pTpythia(e, iInB, jNow, iInA, FSR);
198 if (pTnow > 0.) pTemt = (pTemt < 0) ? pTnow :
min(pTemt, pTnow);
203 for (
int kNow = 0; kNow < e.size(); kNow++) {
204 if (kNow == jNow || !e[kNow].isFinal() ||
205 e[kNow].colType() == 0)
continue;
209 pTnow =
pTpythia(e, kNow, jNow, iInA, FSR);
210 if (pTnow > 0.) pTemt = (pTemt < 0)
211 ? pTnow :
min(pTemt, pTnow);
212 pTnow =
pTpythia(e, kNow, jNow, iInB, FSR);
213 if (pTnow > 0.) pTemt = (pTemt < 0)
214 ? pTnow :
min(pTemt, pTnow);
217 for (
int rNow = 0; rNow < e.size(); rNow++) {
218 if (rNow == kNow || rNow == jNow ||
219 !e[rNow].isFinal() || e[rNow].colType() == 0)
continue;
220 pTnow =
pTpythia(e, kNow, jNow, rNow, FSR);
221 if (pTnow > 0.) pTemt = (pTemt < 0)
222 ? pTnow :
min(pTemt, pTnow);
233 cout <<
"pTcalc: i = " << i <<
", j = " << j <<
", k = " << k
234 <<
", r = " << r <<
", xSR = " << xSRin
235 <<
", pTemt = " << pTemt << endl;
250 if (nMPI > 1)
return false;
255 int count = 0, inonfinal = 0;
256 double pT1 = 0., pTsum = 0.;
257 for (
int i = e.size() - 1;
i > 0;
i--) {
259 if (e[
i].isFinal()) {
269 int first = -1, myid;
271 for(
int ip = 2; ip < e.size(); ip++) {
273 if(
abs(myid) < 6 ||
abs(myid) == 21)
continue;
278 for(
int ip = first; ip < e.size(); ip++) {
280 if(
abs(myid) < 6 ||
abs(myid) == 21)
continue;
283 nFinal = last - inonfinal;
291 bool isEmt = (count ==
nFinal) ?
false :
true;
292 int iEmt = (isEmt) ? e.size() - 1 : -1;
313 pTMPI = (isEmt) ? pTsum / 2. : pT1;
317 cout <<
"doVetoMPIStep: QFac = " << infoPtr->QFac()
318 <<
", QRen = " << infoPtr->QRen()
319 <<
", pThard = " <<
pThard << endl << endl;
335 if (iSys != 0)
return false;
341 int iRadAft = -1, iEmt = -1, iRecAft = -1;
342 for (
int i = e.size() - 1;
i > 0;
i--) {
343 if (iRadAft == -1 && e[
i].
status() == -41) iRadAft =
i;
344 else if (iEmt == -1 && e[
i].
status() == 43) iEmt =
i;
345 else if (iRecAft == -1 && e[
i].
status() == -42) iRecAft =
i;
346 if (iRadAft != -1 && iEmt != -1 && iRecAft != -1)
break;
348 if (iRadAft == -1 || iEmt == -1 || iRecAft == -1) {
361 double pTemt =
pTcalc(e, i, j, k, r, xSR);
364 cout <<
"doVetoISREmission: pTemt = " << pTemt << endl << endl;
386 if (iSys != 0)
return false;
392 int iRecAft = e.size() - 1;
393 int iEmt = e.size() - 2;
394 int iRadAft = e.size() - 3;
395 int iRadBef = e[iEmt].mother1();
396 if ( (e[iRecAft].
status() != 52 && e[iRecAft].
status() != -53) ||
422 for (
int jLoop = 0; jLoop < 2; jLoop++) {
423 if (jLoop == 0) pTemt =
pTcalc(e, i, j, k, r, xSR);
424 else if (jLoop == 1) pTemt =
min(pTemt,
pTcalc(e, i, j, k, r, xSR));
428 if (k != -1)
swap(j, k);
else j = iEmt;
433 pTemt =
pTcalc(e, i, -1, k, r, xSR);
438 cout <<
"doVetoFSREmission: pTemt = " << pTemt << endl << endl;
460 if (e[e.size() - 1].pT() >
pTMPI) {
462 cout <<
"doVetoMPIEmission: pTnow = " << e[e.size() - 1].pT()
463 <<
", pTMPI = " <<
pTMPI << endl << endl;
void swap(ora::Record &rh, ora::Record &lh)
bool doVetoMPIEmission(int, const Pythia8::Event &e)
bool doVetoISREmission(int, const Pythia8::Event &e, int iSys)
void fatalEmissionVeto(string message)
unsigned long int nISRveto
Abs< T >::type abs(const T &t)
double pTpowheg(const Pythia8::Event &e, int i, int j, bool FSR)
unsigned long int nFSRveto
double pTcalc(const Pythia8::Event &e, int i, int j, int k, int r, int xSRin)
bool doVetoMPIStep(int nMPI, const Pythia8::Event &e)
double pTpythia(const Pythia8::Event &e, int RadAfterBranch, int EmtAfterBranch, int RecAfterBranch, bool FSR)
bool doVetoFSREmission(int, const Pythia8::Event &e, int iSys, bool)