9 #include "Pythia8/DireSplittingsQCD.h"
10 #include "Pythia8/DireSpace.h"
11 #include "Pythia8/DireTimes.h"
19 const double DireSplittingQCD::SMALL_TEVOL = 2.0;
23 void DireSplittingQCD::init() {
26 CA = settingsPtr->parm(
"DireColorQCD:CA") > 0.0
27 ? settingsPtr->parm(
"DireColorQCD:CA") : 3.0;
28 CF = settingsPtr->parm(
"DireColorQCD:CF") > 0.0
29 ? settingsPtr->parm(
"DireColorQCD:CF") : 4./3.;
30 TR = settingsPtr->parm(
"DireColorQCD:TR") > 0.
31 ? settingsPtr->parm(
"DireColorQCD:TR") : 0.5;
33 NF_qcd_fsr = settingsPtr->mode(
"TimeShower:nGluonToQuark");
36 double alphaSvalue = settingsPtr->parm(
"SpaceShower:alphaSvalue");
37 alphaSorder = settingsPtr->mode(
"SpaceShower:alphaSorder");
38 int alphaSnfmax = settingsPtr->mode(
"StandardModel:alphaSnfmax");
39 bool alphaSuseCMW = settingsPtr->flag(
"SpaceShower:alphaSuseCMW");
41 alphaS.init( alphaSvalue, alphaSorder, alphaSnfmax, alphaSuseCMW);
44 pTmin = settingsPtr->parm(
"SpaceShower:pTmin");
45 pTmin = min(pTmin,settingsPtr->parm(
"TimeShower:pTmin"));
46 usePDFalphas = settingsPtr->flag(
"ShowerPDF:usePDFalphas");
47 pT2minVariations = pow2(max(0.,settingsPtr->parm(
"Variations:pTmin")));
49 BeamParticle*
beam = NULL;
50 if (beamAPtr != NULL || beamBPtr != NULL) {
51 beam = (beamAPtr != NULL && particleDataPtr->isHadron(beamAPtr->id())) ?
53 : (beamBPtr != NULL && particleDataPtr->isHadron(beamBPtr->id())) ?
55 if (beam == NULL && beamAPtr != 0) beam = beamAPtr;
56 if (beam == NULL && beamBPtr != 0) beam = beamBPtr;
58 alphaS2pi = (usePDFalphas && beam != NULL)
59 ? beam->alphaS(pTmin*pTmin) * 0.5/M_PI
61 ? alphaS.alphaS(pTmin*pTmin) *0.5/M_PI
64 if (!usePDFalphas && alphaSorder == 0) alphaS2pi = alphaSvalue*0.5/M_PI;
66 doVariations = settingsPtr->flag(
"Variations:doVariations");
67 doCorrelations = settingsPtr->mode(
"DireTimes:kernelOrder") == 4
68 || settingsPtr->mode(
"DireSpace:kernelOrder") == 4;
70 orderSave = (is_fsr) ? settingsPtr->mode(
"DireTimes:kernelOrder")
71 : settingsPtr->mode(
"DireSpace:kernelOrder");
73 doGeneralizedKernel = (is_fsr)
74 ? settingsPtr->flag(
"DireTimes:doGeneralizedKernel") :
false;
76 useBackboneGluons = (is_fsr)
77 ? settingsPtr->flag(
"DireTimes:useBackboneGluons") :
false;
79 doMECs = settingsPtr->flag(
"Dire:doMECs")
80 || settingsPtr->flag(
"Dire:doMOPS")
81 || settingsPtr->flag(
"Dire:doMEM");
85 bool DireSplittingQCD::hasMECBef(
const Event& state,
double pT2) {
86 if (!doMECs)
return false;
88 for (
int i=0; i < state.size(); ++i) {
89 if (i == splitInfo.iRadBef)
continue;
90 if (state[i].isFinal()) out.push_back(state[i].id());
91 if (state[i].mother1() == 1 && state[i].mother2() == 0)
92 in.push_back(state[i].id());
93 if (state[i].mother1() == 2 && state[i].mother2() == 0)
94 in.push_back(state[i].id());
96 int idRad = splitInfo.radBef()->id;
97 int colType = (idRad!=21) ? idRad/abs(idRad) : 2;
98 vector<int> re = radAndEmt( idRad, colType);
99 if (is_isr) in.push_back(re[0]);
100 else out.push_back(re[0]);
101 for (
size_t i=1; i < re.size(); ++i) out.push_back(re[i]);
102 bool aboveCut = doMECs &&
103 pT2 > pow2(max(0.,settingsPtr->parm(
"Dire:pTminMECs")));
104 bool hasMEcode = (is_isr)
105 ? isr->weights->hasME(in,out) : fsr->weights->hasME(in,out);
106 return aboveCut && hasMEcode;
109 bool DireSplittingQCD::hasMECAft(
const Event& state,
double pT2) {
110 if (!doMECs)
return false;
111 vector <int> in, out;
112 for (
int i=0; i < state.size(); ++i) {
113 if (state[i].isFinal()) out.push_back(state[i].id());
114 if (state[i].mother1() == 1 && state[i].mother2() == 0)
115 in.push_back(state[i].id());
116 if (state[i].mother1() == 2 && state[i].mother2() == 0)
117 in.push_back(state[i].id());
119 bool aboveCut = doMECs &&
120 pT2 > pow2(max(0.,settingsPtr->parm(
"Dire:pTminMECs")));
121 bool hasMEcode = (is_isr)
122 ? isr->weights->hasME(in,out) : fsr->weights->hasME(in,out);
123 return aboveCut && hasMEcode;
131 double DireSplittingQCD::getNF(
double pT2) {
134 pT2 = max( pT2, pow2(pTmin) );
136 BeamParticle* beam = NULL;
137 if (beamAPtr != NULL || beamBPtr != NULL) {
138 beam = (beamAPtr != NULL && particleDataPtr->isHadron(beamAPtr->id())) ?
140 : (beamBPtr != NULL && particleDataPtr->isHadron(beamBPtr->id())) ?
142 if (beam == NULL && beamAPtr != 0) beam = beamAPtr;
143 if (beam == NULL && beamBPtr != 0) beam = beamBPtr;
147 if ( !usePDFalphas || beam == NULL) {
148 if ( pT2 > pow2( max(0., particleDataPtr->m0(5) ) )
149 && pT2 < pow2( particleDataPtr->m0(6)) ) NF = 5.;
150 else if ( pT2 > pow2( max( 0., particleDataPtr->m0(4)) ) ) NF = 4.;
151 else if ( pT2 > pow2( max( 0., particleDataPtr->m0(3)) ) ) NF = 3.;
153 if ( pT2 > pow2( max(0., beam->mQuarkPDF(5) ) )
154 && pT2 < pow2( particleDataPtr->m0(6)) ) NF = 5.;
155 else if ( pT2 > pow2( max( 0., beam->mQuarkPDF(4)) ) ) NF = 4.;
156 else if ( pT2 > pow2( max( 0., beam->mQuarkPDF(3)) ) ) NF = 3.;
163 double DireSplittingQCD::GammaQCD2 (
double NF) {
164 return (67./18.-pow2(M_PI)/6.)*CA - 10./9.*NF*TR;
169 double DireSplittingQCD::GammaQCD3 (
double NF) {
170 return 1./4.* (CA*CA*(245./6.-134./27.*pow2(M_PI)+11./45.*pow(M_PI,4)
172 +CA*NF*TR*(-418./27.+40./27.*pow2(M_PI)-56./3.*ZETA3)
173 +CF*NF*TR*(-55./3.+16.*ZETA3)-16./27.*pow2(NF*TR));
178 double DireSplittingQCD::betaQCD0 (
double NF)
179 {
return 11./6.*CA - 2./3.*NF*TR;}
183 double DireSplittingQCD::betaQCD1 (
double NF)
184 {
return 17./6.*pow2(CA) - (5./3.*CA+CF)*NF*TR;}
188 double DireSplittingQCD::betaQCD2 (
double NF)
189 {
return 2857./432.*pow(CA,3)
190 + (-1415./216.*pow2(CA) - 205./72.*CA*CF + pow2(CF)/4.) *TR*NF
191 + ( 79.*CA + 66.*CF)/108.*pow2(TR*NF); }
198 double DireSplittingQCD::as2Pi(
double pT2,
int orderNow,
199 double renormMultFacNow) {
202 BeamParticle* beam = NULL;
203 if (beamAPtr != NULL || beamBPtr != NULL) {
204 beam = (beamAPtr != NULL && particleDataPtr->isHadron(beamAPtr->id())) ?
206 : (beamBPtr != NULL && particleDataPtr->isHadron(beamBPtr->id())) ?
208 if (beam == NULL && beamAPtr != 0) beam = beamAPtr;
209 if (beam == NULL && beamBPtr != 0) beam = beamBPtr;
211 double scale = pT2 * ( (renormMultFacNow > 0.)
212 ? renormMultFacNow : renormMultFac);
213 scale = max(scale, pow2(pTmin) );
216 double asPT2pi = (usePDFalphas && beam != NULL)
217 ? beam->alphaS(scale) / (2.*M_PI)
218 : alphaS.alphaS(scale) / (2.*M_PI);
219 int order = (orderNow > -1) ? orderNow : correctionOrder;
224 double m2cPhys = (usePDFalphas && beam != NULL)
225 ? pow2(max(0.,beam->mQuarkPDF(4)))
226 : alphaS.muThres2(4);
227 if ( !( (scale > m2cPhys && pT2 < m2cPhys)
228 || (scale < m2cPhys && pT2 > m2cPhys) ) ) m2cPhys = -1.;
229 double m2bPhys = (usePDFalphas && beam != NULL)
230 ? pow2(max(0.,beam->mQuarkPDF(5)))
231 : alphaS.muThres2(5);
232 if ( !( (scale > m2bPhys && pT2 < m2bPhys)
233 || (scale < m2bPhys && pT2 > m2bPhys) ) ) m2bPhys = -1.;
234 vector<double> scales;
235 scales.push_back(scale);
236 scales.push_back(pT2);
237 if (m2cPhys > 0.) scales.push_back(m2cPhys);
238 if (m2bPhys > 0.) scales.push_back(m2bPhys);
239 sort( scales.begin(), scales.end());
240 if (scale > pT2) reverse(scales.begin(), scales.end());
242 double asPT2piCorr = asPT2pi;
243 for (
int i = 1; i< int(scales.size()); ++i) {
244 double NF = getNF( 0.5*(scales[i]+scales[i-1]) );
245 double L = log( scales[i]/scales[i-1] );
247 if (order > 0) subt += asPT2piCorr * betaQCD0(NF) * L;
248 if (order > 2) subt += pow2( asPT2piCorr ) * ( betaQCD1(NF)*L
249 - pow2(betaQCD0(NF)*L) );
250 if (order > 4) subt += pow( asPT2piCorr, 3) * ( betaQCD2(NF)*L
251 - 2.5 * betaQCD0(NF)*betaQCD1(NF)*L*L
252 + pow( betaQCD0(NF)*L, 3) );
253 asPT2piCorr *= 1.0 - subt;
265 double DireSplittingQCD::polevl(
double x,
double* coef,
int N ) {
275 ans = ans * x + *p++;
285 double DireSplittingQCD::DiLog(
double x) {
287 static double cof_A[8] = {
288 4.65128586073990045278E-5,
289 7.31589045238094711071E-3,
290 1.33847639578309018650E-1,
291 8.79691311754530315341E-1,
292 2.71149851196553469920E0,
293 4.25697156008121755724E0,
294 3.29771340985225106936E0,
295 1.00000000000000000126E0,
297 static double cof_B[8] = {
298 6.90990488912553276999E-4,
299 2.54043763932544379113E-2,
300 2.82974860602568089943E-1,
301 1.41172597751831069617E0,
302 3.63800533345137075418E0,
303 5.03278880143316990390E0,
304 3.54771340985225096217E0,
305 9.99999999999999998740E-1,
309 return -DiLog(1./x)+M_PI*M_PI/3.-0.5*pow2(log(x));
318 return( M_PI*M_PI/6.0 );
340 y = -w * polevl( w, cof_A, 7) / polevl( w, cof_B, 7 );
343 y = (M_PI * M_PI)/6.0 - log(x) * log(1.0-x) - y;
347 y = -0.5 * z * z - y;
356 double DireSplittingQCD::softRescaleInt(
int order) {
360 if (order > 3)
return 1.;
362 if (order > 0) rescale += alphaS2pi*GammaQCD2(3.);
363 if (order > 1) rescale += pow2(alphaS2pi)*GammaQCD3(3.);
369 double DireSplittingQCD::softRescaleDiff(
int order,
double pT2,
370 double renormMultFacNow) {
373 double NF = getNF(pT2 * ( (renormMultFacNow > 0.)
374 ? renormMultFacNow : renormMultFac) );
375 double asPT2pi = as2Pi(pT2, order, renormMultFacNow);
378 if (order > 3)
return 1.;
380 if (order > 0) rescale += asPT2pi * GammaQCD2(NF);
381 if (order > 1) rescale += pow2(asPT2pi) * GammaQCD3(NF);
387 double DireSplittingQCD::beta0Endpoint(
int order,
double m2dip,
388 double pT2,
double z,
double renormMultFacNow) {
391 if (order < 4)
return 0.;
393 double ycs = pT2/m2dip/(1.-z);
394 double siq = ycs*m2dip;
395 double sjq = (1.-z)*m2dip;
396 double sij = m2dip - siq - sjq;
397 double as = as2Pi(pT2, order, renormMultFacNow);
398 double mu2 = pT2*((renormMultFacNow >0.) ? renormMultFacNow : renormMultFac);
399 double add = as * 2.*sij/(siq*sjq)
400 * log( (mu2*sij)/(siq*sjq) ) * betaQCD0(pT2);
406 bool DireSplittingQCD::hasSharedColor(
const Event& event,
int iRad,
408 int radCol(event[iRad].col()), radAcl(event[iRad].acol()),
409 recCol(event[iRec].col()), recAcl(event[iRec].acol());
410 if ( event[iRad].isFinal() && event[iRec].isFinal() ) {
411 if (radCol != 0 && radCol == recAcl)
return true;
412 if (radAcl != 0 && radAcl == recCol)
return true;
413 }
else if ( event[iRad].isFinal() && !event[iRec].isFinal() ) {
414 if (radCol != 0 && radCol == recCol)
return true;
415 if (radAcl != 0 && radAcl == recAcl)
return true;
416 }
else if (!event[iRad].isFinal() && event[iRec].isFinal() ) {
417 if (radCol != 0 && radCol == recCol)
return true;
418 if (radAcl != 0 && radAcl == recAcl)
return true;
419 }
else if (!event[iRad].isFinal() && !event[iRec].isFinal() ) {
420 if (radCol != 0 && radCol == recAcl)
return true;
421 if (radAcl != 0 && radAcl == recCol)
return true;
428 vector<int> DireSplittingQCD::sharedColor(
const Event& event,
int iRad,
431 int radCol(event[iRad].col()), radAcl(event[iRad].acol()),
432 recCol(event[iRec].col()), recAcl(event[iRec].acol());
433 if ( event[iRad].isFinal() && event[iRec].isFinal() ) {
434 if (radCol != 0 && radCol == recAcl) ret.push_back(radCol);
435 if (radAcl != 0 && radAcl == recCol) ret.push_back(radAcl);
436 }
else if ( event[iRad].isFinal() && !event[iRec].isFinal() ) {
437 if (radCol != 0 && radCol == recCol) ret.push_back(radCol);
438 if (radAcl != 0 && radAcl == recAcl) ret.push_back(radAcl);
439 }
else if (!event[iRad].isFinal() && event[iRec].isFinal() ) {
440 if (radCol != 0 && radCol == recCol) ret.push_back(radCol);
441 if (radAcl != 0 && radAcl == recAcl) ret.push_back(radAcl);
442 }
else if (!event[iRad].isFinal() && !event[iRec].isFinal() ) {
443 if (radCol != 0 && radCol == recAcl) ret.push_back(radCol);
444 if (radAcl != 0 && radAcl == recCol) ret.push_back(radAcl);
451 int DireSplittingQCD::findCol(
int col, vector<int> iExc,
const Event& event,
456 int inA = 0, inB = 0;
457 for (
int i=event.size()-1; i > 0; --i) {
458 if ( event[i].mother1() == 1 &&
event[i].status() != -31
459 &&
event[i].status() != -34) {
if (inA == 0) inA = i; }
460 if ( event[i].mother1() == 2 &&
event[i].status() != -31
461 &&
event[i].status() != -34) {
if (inB == 0) inB = i; }
465 for(
int n = 0; n <
event.size(); ++n) {
467 if ( find(iExc.begin(), iExc.end(), n) != iExc.end() )
continue;
468 if ( event[n].colType() != 0 &&
event[n].status() > 0 ) {
469 if ( event[n].acol() == col ) {
473 if ( event[n].col() == col ) {
480 for(
int n = event.size()-1; n > 0; --n) {
482 if ( find(iExc.begin(), iExc.end(), n) != iExc.end() )
continue;
483 if ( index == 0 && event[n].colType() != 0
484 && ( n == inA || n == inB) ) {
485 if ( event[n].acol() == col ) {
489 if ( event[n].col() == col ) {
496 if ( type == 1 && index < 0)
return abs(index);
497 if ( type == 2 && index > 0)
return abs(index);
507 unordered_map<string,double> DireSplittingQCD::getPhasespaceVars(
508 const Event& state, PartonSystems*) {
511 unordered_map<string,double> ret(splitInfo.getKinInfo());
515 double z(splitInfo.kinematics()->z), pT2(splitInfo.kinematics()->pT2),
516 m2dip(splitInfo.kinematics()->m2Dip),
517 m2RadBef(splitInfo.kinematics()->m2RadBef),
518 m2Rad(splitInfo.kinematics()->m2RadAft),
519 m2Rec(splitInfo.kinematics()->m2Rec),
520 m2Emt(splitInfo.kinematics()->m2EmtAft),
521 m2Emt2(splitInfo.kinematics()->m2EmtAft2),
522 sai(splitInfo.kinematics()->sai), xa(splitInfo.kinematics()->xa);
526 if (splitInfo.radBef()->isFinal && !splitInfo.recBef()->isFinal ) {
528 double xRecBef = 2.* state[splitInfo.iRecBef].e()
529 / (beamAPtr->e() + beamBPtr->e());
531 double q2 = (state[splitInfo.iRecBef].p()
532 -state[splitInfo.iRadBef].p()).m2Calc();
538 double kappa2 = pT2/Q2;
539 double xCS = 1 - kappa2/(1.-z);
540 double xCDST = xCS*( 1. + (m2RadBef-m2Rad-m2Emt)/Q2 );
541 xNew = xRecBef / xCDST;
543 double m2a(m2Emt), m2i(m2Emt), m2j(m2Emt2), m2aij(m2RadBef), m2k(0.0);
544 if ( nEmissions() == 2 ) {
545 double m2ai = sai + m2a + m2i;
546 xCS = (q2 - m2ai - m2a - m2i)
547 / (q2 - m2ai - m2a - m2i - pT2 * xa/z);
548 xCDST = xCS * ( 1. - (m2aij-m2ai-m2j)/ (q2-m2ai-m2j-m2k) );
549 xNew = xRecBef / xCDST;
553 }
else if (!splitInfo.radBef()->isFinal && splitInfo.recBef()->isFinal ) {
555 double xRadBef = 2.* state[splitInfo.iRadBef].e()
556 / (beamAPtr->e() + beamBPtr->e());
562 }
else if (!splitInfo.radBef()->isFinal && !splitInfo.recBef()->isFinal ) {
564 double xRadBef = 2.* state[splitInfo.iRadBef].e()
565 / (beamAPtr->e() + beamBPtr->e());
567 double m2DipCorr = m2dip;
569 double kappa2 = pT2 / m2DipCorr;
570 double xCS = (z*(1-z)- kappa2)/(1-z);
573 double q2 = (state[splitInfo.iRadBef].p()
574 +state[splitInfo.iRecBef].p()).m2Calc();
577 double m2a(m2Rad), m2i(m2Emt), m2j(m2Emt2), m2k(m2Rec);
578 if ( nEmissions() == 2 ) {
579 xCS = z * (q2 - m2a - m2i - m2j - m2k) / q2;
585 ret.insert(make_pair(
"xInAft", xNew));
591 double DireSplittingQCD::getJacobian(
const Event& state, PartonSystems*
595 double z(splitInfo.kinematics()->z), pT2(splitInfo.kinematics()->pT2),
596 m2dip(splitInfo.kinematics()->m2Dip),
597 m2RadBef(splitInfo.kinematics()->m2RadBef),
598 m2Rad(splitInfo.kinematics()->m2RadAft),
599 m2Rec(splitInfo.kinematics()->m2Rec),
600 m2Emt(splitInfo.kinematics()->m2EmtAft),
601 m2Emt2(splitInfo.kinematics()->m2EmtAft2),
602 sai(splitInfo.kinematics()->sai), xa(splitInfo.kinematics()->xa),
603 phi(splitInfo.kinematics()->phi);
605 double jacobian = 0.0;
607 if ( splitInfo.radBef()->isFinal && splitInfo.recBef()->isFinal ) {
611 double q2 = (state[splitInfo.iRadBef].p()
612 + state[splitInfo.iRecBef].p()).m2Calc();
615 double m2aij(m2RadBef), m2a(m2Emt), m2i(m2Emt), m2j(m2Emt2), m2k(m2Rec);
618 double yCS = pT2/Q2 / (1. - z);
620 double mu2RadBef = m2RadBef/ q2;
621 double mu2Rad = m2Rad/ q2;
622 double mu2Rec = m2Rec/ q2;
623 double mu2Emt = m2Emt/ q2;
625 double jac1 = ( 1. - mu2Rad - mu2Rec - mu2Emt)
626 / sqrt(lABC(1.,mu2RadBef,mu2Rec));
627 double jac2 = 1. + ( mu2Rad + mu2Emt - mu2RadBef)
628 /( yCS*(1. - mu2Rad - mu2Rec - mu2Emt));
631 if (nEmissions() == 2) {
634 jac1 = (q2 - m2aij - m2k) / sqrt( lABC(q2, m2aij, m2k) );
637 double m2ai = sai + m2a + m2i;
638 double m2aik = (sai + m2a + m2i) + m2k + z/xa * (q2 - m2RadBef - m2k);
639 jac1 *= (m2aik - m2ai - m2k) / sqrt( lABC(m2aik, m2ai, m2k) );
642 jac2 = 1 + (m2ai + m2j - m2aij) / (pT2*xa/z);
647 jacobian = jac1/jac2;
650 }
else if (splitInfo.radBef()->isFinal && !splitInfo.recBef()->isFinal ) {
651 double q2 = (state[splitInfo.iRecBef].p()
652 -state[splitInfo.iRadBef].p()).m2Calc();
656 double m2a(m2Emt), m2i(m2Emt), m2j(m2Emt2), m2aij(m2RadBef), m2k(0.0);
660 int iOther = (state[splitInfo.iRecBef].mother1() == 1)
661 ? partonSystems->getInB(splitInfo.systemRec)
662 : partonSystems->getInA(splitInfo.systemRec);
663 Vec4 pOther(state[iOther].p());
667 double kappa2 = pT2/Q2;
668 double xCS = 1 - kappa2/(1.-z);
669 double xCDST = xCS*( 1. + (m2RadBef-m2Rad-m2Emt)/Q2 );
672 if ( nEmissions() != 2 )
673 jacobian = ( 1.- xCS) / ( 1. - xCDST);
676 if ( nEmissions() == 2 ) {
678 double m2ai = sai + m2a + m2i;
679 xCS = (q2 - m2ai - m2a - m2i)
680 / (q2 - m2ai - m2a - m2i - pT2 * xa/z);
683 double saij = (xCS - 1.)/xCS * (q2 - m2a) + (m2ai + m2j)/xCS;
684 double xbar = (q2 - m2aij - m2k) / (q2 - saij - m2k);
687 double sHatBefore = (state[splitInfo.iRecBef].p() + pOther).m2Calc();
688 double m2OtherBeam = 0.;
691 Vec4 q(state[splitInfo.iRecBef].p()-state[splitInfo.iRadBef].p());
692 Vec4 pRadBef(state[splitInfo.iRadBef].p());
693 Vec4 pRecBef(state[splitInfo.iRecBef].p());
694 Vec4 qpar(q.px()+pRadBef.px(), q.py()+pRadBef.py(), q.pz(), q.e());
695 double qpar2 = qpar.m2Calc();
696 double pT2ijt = pow2(pRadBef.px()) + pow2(pRadBef.py());
697 Vec4 pRec( (pRecBef - (qpar*pRecBef)/qpar2 * qpar)
698 * sqrt( (lABC(q2,saij,m2k) - 4.*m2k*pT2ijt)
699 /(lABC(q2,m2aij,m2k) - 4.*m2k*pT2ijt))
700 + qpar * (q2+m2k-saij)/(2.*qpar2) );
702 double sHatAfter = (pOther + pRec).m2Calc();
705 double rho_bai = sqrt( lABC(sHatBefore, m2k, m2OtherBeam)
706 / lABC(sHatAfter, m2k, m2OtherBeam) );
707 jacobian = rho_bai/xbar
708 * (saij + m2k - q2) / sqrt( lABC(saij, m2k, q2) );
711 double saib = m2ai + m2k
712 + z/xa * (q2 - m2k - m2ai - m2j - pT2*xa/z);
713 jacobian *= (m2ai + m2k - saib) / sqrt( lABC(m2ai, m2k, saib) );
715 xCDST = xCS * ( 1. - (m2aij-m2ai-m2j)/ (q2-m2ai-m2j-m2k) );
717 jacobian *= ( 1.- xCS) / ( 1. - xCDST);
720 }
else if (!splitInfo.radBef()->isFinal && splitInfo.recBef()->isFinal ) {
722 double jac(1.), m2aij(m2RadBef), m2ai(0.), m2a(m2Rad), m2i(m2Emt),
723 m2j(m2Emt2), m2k(m2Rec);
724 m2ai = -sai + m2a + m2i;
725 double q2 = (state[splitInfo.iRadBef].p()
726 -state[splitInfo.iRecBef].p()).m2Calc();
729 int iOther = state[splitInfo.iRadBef].mother1() == 1
730 ? partonSystems->getInB(splitInfo.system)
731 : partonSystems->getInA(splitInfo.system);
732 Vec4 pOther(state[iOther].p());
735 if ( nEmissions() == 2 ) {
739 double m2jk = pT2/xa + q2*( 1. - xa/z) - m2ai;
740 double uCS = z*(m2ai-m2a-m2i)/q2;
741 double xCS = uCS + xa - (pT2*z)/(q2*xa);
742 Vec4 q( state[splitInfo.iRadBef].p() - state[splitInfo.iRecBef].p() );
743 double sHatBef = (state[splitInfo.iRadBef].p() + pOther).m2Calc();
744 double sijk = q2*(1.-1./z) - m2a;
750 if (!settingsPtr->flag(
"DireSpace:useGlobalMapIF")) {
753 Vec4 pTk_tilde( state[splitInfo.iRecBef].p().px(),
754 state[splitInfo.iRecBef].p().py(), 0., 0.);
755 Vec4 qpar( q + pTk_tilde );
757 double q2par = qpar.m2Calc();
758 double pT2k = -pTk_tilde.m2Calc();
759 double s_i_jk = (1. - 1./xCS)*(q2 - m2a) + (m2i + m2jk) / xCS;
761 Vec4 pa( ( state[splitInfo.iRadBef].p() - 0.5*(q2-m2aij-m2k)/q2par
763 * sqrt( (lABC(q2,s_i_jk,m2a) - 4.*m2a*pT2k)
764 / (lABC(q2,m2k,m2aij) - 4.*m2aij*pT2k))
765 + qpar * 0.5 * (q2 + m2a - s_i_jk) / q2par);
767 sHatAft = (pa + pOther).m2Calc();
777 Vec4 pb_tilde( state[splitInfo.iRecBef].p() );
778 Vec4 pa12_tilde( state[splitInfo.iRadBef].p() );
779 q.p(pb_tilde-pa12_tilde);
782 double zbar = (q2-m2ai-m2jk) / bABC(q2,m2ai,m2jk)
783 *( (xCS - 1)/(xCS-uCS) - m2jk / gABC(q2,m2ai,m2jk)
784 * (m2ai + m2i - m2a) / (q2 - m2ai - m2jk));
785 double kT2 = zbar*(1.-zbar)*m2ai - (1-zbar)*m2i - zbar*m2a;
788 Vec4 pjk( (pb_tilde - q*pb_tilde/q2*q)
789 *sqrt(lABC(q2,m2ai,m2jk)/lABC(q2,m2aij,m2k))
790 + 0.5*(q2+m2jk-m2ai)/q2*q );
796 pair<Vec4, Vec4> pTvecs = getTwoPerpendicular(pai, pjk);
797 Vec4 kTmom( sqrt(kT2)*sin(phi)*pTvecs.first
798 + sqrt(kT2)*cos(phi)*pTvecs.second);
801 Vec4 pi( - zbar *(gABC(q2,m2ai,m2jk)*pai + m2ai*pjk)
803 + ( (1.-zbar)*m2ai + m2i - m2a) / bABC(q2,m2ai,m2jk)
804 * (pjk + m2jk/gABC(q2,m2ai,m2jk)*pai)
811 sHatAft = (pa + pOther).m2Calc();
816 double m2Other = pOther.m2Calc();
817 double rho_aij = sqrt( lABC(sHatBef, m2a, m2Other)
818 /lABC(sHatAft, m2a, m2Other));
819 jac = rho_aij / z * (sijk + m2a - q2) / sqrt(lABC(sijk, m2a, q2));
822 jac *= -q2 * xa / z / sqrt(lABC(m2jk, m2ai, q2));
825 jac *= 1. / (1. - (m2ai + m2j - m2aij) / (pT2/xa)) ;
833 }
else if (!splitInfo.radBef()->isFinal && !splitInfo.recBef()->isFinal ) {
835 double q2 = (state[splitInfo.iRadBef].p()
836 +state[splitInfo.iRecBef].p()).m2Calc();
839 double m2a(m2Rad), m2i(m2Emt), m2j(m2Emt2), m2aij(m2RadBef), m2k(m2Rec);
843 if ( nEmissions() == 2 ) {
845 double sab = q2/z + m2a + m2k;
846 jacobian = (sab-m2a-m2k) / sqrt(lABC(sab, m2a, m2k) );
847 double m2ai = -sai + m2a + m2i;
848 double sjq = q2*xa/z + m2ai + m2k;
849 jacobian *= (sjq-m2ai-m2k) / sqrt(lABC(sjq, m2ai, m2k) );
852 jacobian *= 1. / (1. - (m2ai + m2j - m2aij) / (pT2/xa)) ;
863 bool Dire_fsr_qcd_Q2QGG::canRadiate (
const Event& state, pair<int,int> ints,
864 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*) {
865 if (orderSave != 4)
return false;
866 return ( state[ints.first].isFinal()
867 && state[ints.second].colType() != 0
868 && hasSharedColor(state, ints.first, ints.second)
869 && state[ints.first].isQuark() );
872 bool Dire_fsr_qcd_Q2QGG::canRadiate (
const Event& state,
int iRadBef,
873 int iRecBef, Settings*, PartonSystems*, BeamParticle*) {
874 if (orderSave != 4)
return false;
875 return ( state[iRadBef].isFinal()
876 && state[iRecBef].colType() != 0
877 && hasSharedColor(state, iRadBef, iRecBef)
878 && state[iRadBef].isQuark() );
881 double Dire_fsr_qcd_Q2QGG::gaugeFactor (
int,
int ) {
return 1.;}
882 double Dire_fsr_qcd_Q2QGG::symmetryFactor (
int,
int ) {
return 1.;}
884 vector<pair<int,int> > Dire_fsr_qcd_Q2QGG::radAndEmtCols(
int iRad,
int colType,
886 int newCol1 = state.nextColTag();
887 int newCol2 = state.nextColTag();
888 int colEmtAft1, acolEmtAft1, colRadAft, acolRadAft, colEmtAft2, acolEmtAft2;
890 colEmtAft1 = state[iRad].col();
891 acolEmtAft1 = newCol2;
894 colEmtAft2 = newCol2;
895 acolEmtAft2 = newCol1;
897 colEmtAft1 = newCol1;
898 acolEmtAft1 = newCol2;
900 acolRadAft = newCol1;
901 colEmtAft2 = newCol2;
902 acolEmtAft2 = state[iRad].acol();
907 splitInfo.addExtra(
"colEmtInt", newCol1);
908 splitInfo.addExtra(
"acolEmtInt", state[iRad].acol());
909 splitInfo.addExtra(
"colRadInt", state[iRad].col());
910 splitInfo.addExtra(
"acolRadInt", newCol1);
912 splitInfo.addExtra(
"colEmtInt", state[iRad].col());
913 splitInfo.addExtra(
"acolEmtInt", newCol1);
914 splitInfo.addExtra(
"colRadInt", newCol1);
915 splitInfo.addExtra(
"acolRadInt", state[iRad].acol());
918 return createvector<pair<int,int> >
919 (make_pair(colRadAft, acolRadAft))
920 (make_pair(colEmtAft1, acolEmtAft1))
921 (make_pair(colEmtAft2, acolEmtAft2));
924 int Dire_fsr_qcd_Q2QGG::radBefID(
int idRA,
int) {
925 if (particleDataPtr->isQuark(idRA))
return idRA;
929 pair<int,int> Dire_fsr_qcd_Q2QGG::radBefCols(
932 return make_pair(0,0);
936 double Dire_fsr_qcd_Q2QGG::zSplit(
double,
double,
double m2dip) {
937 double R = rndmPtr->flat();
939 double a = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
940 double z1 = pow((1+a)/a,-R)*(1+a) - a;
946 double Dire_fsr_qcd_Q2QGG::overestimateInt(
double,
double,
947 double,
double m2dip,
int) {
949 double kappa2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
951 wt = 16*CF*log( (kappa2 + 1)/kappa2);
956 double Dire_fsr_qcd_Q2QGG::overestimateDiff(
double z,
double m2dip,
int) {
958 double kappaOld2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
960 wt = 16*CF / (z + kappaOld2);
964 double Dire_fsr_qcd_Q2QGG::counterTerm(
double si1,
double si2,
double sj1,
965 double sj2,
double sij,
double s12) {
968 double kT12 = ((si1+si2)*(sj1+sj2)-sij*s12)
969 / (si1+si2+sj1+sj2+sij+s12);
970 double kTi12 = (si1*s12)/(si1+si2+s12);
971 double kTi1j = (si1*sj1)/(si1+sj1+sij);
973 && kTi1j > pow2(settingsPtr->parm(
"TimeShower:pTmin")))
return 0.;
977 double wij12 = 1. - (sij*s12) / ((si1 + si2)*(sj1 + sj2));
978 double wij12bar = ((si1 + si2)*(sj1 + sj2) - sij*s12)
979 / (si1*sj1 + si2*sj2);
980 double ct2 = pow2(si1*sj2-si2*sj1)/(s12*sij*(si1+si2)*(sj1+sj2));
983 double qqSoft = 2.*CF/CA * (2.*si2/(si1+s12) * (wij12+wij12bar)/2.);
985 double qqColorCorr = (CA - 2.*CF)/CA * (2.*si2/(si1+s12) - 2.*sij/(si1+sj1))
986 * (wij12 + wij12bar) / 2.;
988 double ggSoft = 2. * si2/(si1+s12) * (wij12+wij12bar)/2.;
989 double ggColl = (-1. + ct2/2.0) * wij12;
993 qqSoft = qqColl = ggSoft = ggColl = 0.;
994 qqColorCorr = (CA - 2.*CF)/CA * (- 2.*sij/(si1+sj1))
995 * (wij12 + wij12bar) / 2.;
999 double ct = 2. * ((qqSoft+qqColl+qqColorCorr) / si1 +(ggSoft+ggColl) / s12)
1000 * sij / ((si1+si2)*(sj1+sj2)-sij*s12);
1008 bool Dire_fsr_qcd_Q2QGG::calc(
const Event& state,
int orderNow) {
1011 if (
false) cout << state[0].e() << orderNow << endl;
1014 double z(splitInfo.kinematics()->z),
1015 pT2(splitInfo.kinematics()->pT2),
1016 m2dip(splitInfo.kinematics()->m2Dip),
1017 xa(splitInfo.kinematics()->xa),
1018 sai(splitInfo.kinematics()->sai),
1019 m2i12(splitInfo.kinematics()->m2RadBef),
1020 m2i(splitInfo.kinematics()->m2RadAft),
1021 m21(splitInfo.kinematics()->m2EmtAft),
1022 m22(splitInfo.kinematics()->m2EmtAft2),
1023 m2j(splitInfo.kinematics()->m2Rec);
1025 splitInfo.addExtra(
"idRadInt",21);
1026 splitInfo.addExtra(
"idEmtInt",state[splitInfo.iRadBef].id());
1027 splitInfo.addExtra(
"swapped",1);
1030 double scale2 = couplingScale2 ( z, pT2, m2dip,
1031 make_pair (splitInfo.radBef()->id, splitInfo.radBef()->isFinal),
1032 make_pair (splitInfo.recBef()->id, splitInfo.recBef()->isFinal));
1033 if (scale2 < 0.) scale2 = pT2;
1036 unordered_map<string,double> wts;
1037 int order = (orderNow > -1) ? orderNow : correctionOrder;
1038 if ( order != 4 || m2i12 > 0. || m2i > 0. || m21 > 0. || m22 > 0.
1040 wts.insert( make_pair(
"base", 0.) );
1041 if (doVariations && settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
1042 wts.insert( make_pair(
"Variations:muRfsrDown", 0.));
1043 if (doVariations && settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
1044 wts.insert( make_pair(
"Variations:muRfsrUp", 0.));
1046 for ( unordered_map<string,double>::iterator it = wts.begin();
1047 it != wts.end(); ++it )
1048 kernelVals.insert(make_pair( it->first, it->second ));
1053 Event trialEvent(state);
1054 bool physical =
false;
1055 if (splitInfo.recBef()->isFinal)
1056 physical = fsr->branch_FF(trialEvent,
true, &splitInfo);
1058 physical = fsr->branch_FI(trialEvent,
true, &splitInfo);
1060 Vec4 pi(trialEvent[splitInfo.iEmtAft].p());
1061 Vec4 pj(trialEvent[splitInfo.iRecAft].p());
1062 Vec4 p1(trialEvent[splitInfo.iRadAft].p());
1063 Vec4 p2(trialEvent[splitInfo.iEmtAft2].p());
1067 && ( abs(pi.m2Calc()-m2i) > sai || abs(p1.m2Calc()-m21) > sai
1068 || abs(p2.m2Calc()-m22) > sai || abs(pj.m2Calc()-m2j) > sai))
1072 wts.insert( make_pair(
"base", 0.) );
1073 if (doVariations && settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
1074 wts.insert( make_pair(
"Variations:muRfsrDown", 0.));
1075 if (doVariations && settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
1076 wts.insert( make_pair(
"Variations:muRfsrUp", 0.));
1078 for ( unordered_map<string,double>::iterator it = wts.begin();
1079 it != wts.end(); ++it )
1080 kernelVals.insert(make_pair( it->first, it->second ));
1085 double sij(2.*pi*pj), si1(2.*pi*p1), si2(2.*pi*p2),
1086 sj1(2.*pj*p1), sj2(2.*pj*p2), s12(2.*p1*p2);
1087 double sign = (splitInfo.recBef()->isFinal) ? 1. : -1.;
1088 double p2i1(sai + m2i + m21);
1089 double q2 = sign*(pi+p1+p2+sign*pj).m2Calc();
1090 double si12 = (pi+p1+p2).m2Calc();
1091 double yi12 = (splitInfo.recBef()->isFinal) ? si12 / q2 : 0.;
1092 double z1(z/(1.-yi12)), z2( z/xa/(1-yi12) - z1 ), z3(1-z1-z2);
1096 if (is_sai_endpoint()) {
1098 double x = z1/(z1+z2);
1100 prob = 2.0*CA*(log(x)/(1.0-x)+log(1.0-x)/x+(-2.0+x*(1.-x))*log(x*(1.-x)));
1103 prob += -2.0*CA/2.0*(log(x)/(1.0-x)+log(1.0-x)/x);
1106 prob *= CF * (2.0/(1.0-z3*(1.0-yi12))-2.0);
1113 double kT12 = ((si1+si2)*(sj1+sj2)-sij*s12)/(si1+si2+sj1+sj2+sij+s12);
1115 if ( abs(sai) < 1e-10 || splitInfo.terminateEvolution ==
true
1116 || kT12 < pow2(settingsPtr->parm(
"TimeShower:pTmin"))) {
1117 wts.insert( make_pair(
"base", 0.) );
1118 if (doVariations && settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
1119 wts.insert( make_pair(
"Variations:muRfsrDown", 0.));
1120 if (doVariations && settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
1121 wts.insert( make_pair(
"Variations:muRfsrUp", 0.));
1123 for ( unordered_map<string,double>::iterator it = wts.begin();
1125 ++it ) kernelVals.insert(make_pair( it->first, it->second ));
1131 double wij12 = 1. - (sij*s12) / ((si1 + si2)*(sj1 + sj2));
1132 double wij12bar = ((si1 + si2)*(sj1 + sj2) - sij*s12)
1133 / (si1*sj1 + si2*sj2);
1134 double w = (1+wij12/wij12bar)/2.;
1137 double strongOrder = (1. * ( sij/(si1*s12*sj2)
1139 - sij*sij/(si1*sj1*si2*sj2)));
1140 double collB = sij/((si1+si2)*(sj1+sj2)) * 1./s12;
1141 double ct2 = pow2(si1*sj2-si2*sj1) / (s12*sij*(si1+si2)*(sj1+sj2));
1142 double collA = ct2*collB;
1143 double loSquare = 2.0*CF/CA * w * pow2(sij)/(si1*sj1*si2*sj2);
1146 prob = w * strongOrder - 2.0*collB + collA + loSquare;
1149 double subtTot(0.), subt(0.);
1151 subt = 0.25*counterTerm(si1,si2,sj1,sj2,sij,s12);
1152 if (subt != 0.) { ncounter++; subtTot += subt; }
1153 subt = 0.25*counterTerm(si2,si1,sj2,sj1,sij,s12);
1154 if (subt != 0.) { ncounter++; subtTot += subt; }
1155 subt = 0.25*counterTerm(sj1,sj2,si1,si2,sij,s12);
1156 if (subt != 0.) { ncounter++; subtTot += subt; }
1157 subt = 0.25*counterTerm(sj2,sj1,si2,si1,sij,s12);
1158 if (subt != 0.) { ncounter++; subtTot += subt; }
1163 if (ncounter==4) prob = 0.;
1166 prob *= CF*CA*pow2(si1+si2+s12);
1175 prob *= 1. / (1.-p2i1/si12);
1178 if (is_sai_endpoint()) { splitInfo.set_sai(0.0); }
1181 wts.insert( make_pair(
"base", prob * as2Pi(scale2, order, renormMultFac) ));
1184 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
1185 wts.insert( make_pair(
"Variations:muRfsrDown", prob
1186 * as2Pi(scale2, order, (scale2 > pT2minVariations)
1187 ? settingsPtr->parm(
"Variations:muRfsrDown")*renormMultFac :
1189 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
1190 wts.insert( make_pair(
"Variations:muRfsrUp", prob
1191 * as2Pi(scale2, order, (scale2 > pT2minVariations)
1192 ? settingsPtr->parm(
"Variations:muRfsrUp")*renormMultFac :
1198 for ( unordered_map<string,double>::iterator it = wts.begin();
1199 it != wts.end(); ++it )
1200 it->second *= z2/(1.-z3);
1203 wts.insert( make_pair(
"base_order_as2", wts[
"base"] ));
1207 for ( unordered_map<string,double>::iterator it = wts.begin();
1208 it != wts.end(); ++it )
1209 kernelVals.insert(make_pair( it->first, it->second ));
1218 bool Dire_fsr_qcd_G2GGG::canRadiate (
const Event& state, pair<int,int> ints,
1219 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*) {
1220 if (orderSave != 4)
return false;
1221 return ( state[ints.first].isFinal()
1222 && state[ints.second].colType() != 0
1223 && hasSharedColor(state, ints.first, ints.second)
1224 && state[ints.first].id() == 21);
1227 bool Dire_fsr_qcd_G2GGG::canRadiate (
const Event& state,
int iRadBef,
1228 int iRecBef, Settings*, PartonSystems*, BeamParticle*) {
1229 if (orderSave != 4)
return false;
1230 return ( state[iRadBef].isFinal()
1231 && state[iRecBef].colType() != 0
1232 && hasSharedColor(state, iRadBef, iRecBef)
1233 && state[iRadBef].
id() == 21);
1237 double Dire_fsr_qcd_G2GGG::gaugeFactor (
int,
int ) {
return 1.;}
1238 double Dire_fsr_qcd_G2GGG::symmetryFactor (
int,
int ) {
return 1.;}
1240 vector<pair<int,int> > Dire_fsr_qcd_G2GGG::radAndEmtCols(
int iRad,
int colType,
1243 int newCol1 = state.nextColTag();
1244 int newCol2 = state.nextColTag();
1245 int colRadAft(0), acolRadAft(0), colEmtAft1(0), acolEmtAft1(0),
1246 colEmtAft2(0), acolEmtAft2(0);
1248 colRadAft = newCol1;
1250 colEmtAft1 = state[iRad].col();
1251 acolEmtAft1 = newCol2;
1252 colEmtAft2 = newCol2;
1253 acolEmtAft2 = newCol1;
1256 acolRadAft = newCol1;
1257 colEmtAft1 = newCol2;
1258 acolEmtAft1 = state[iRad].acol();
1259 colEmtAft2 = newCol1;
1260 acolEmtAft2 = newCol2;
1265 splitInfo.addExtra(
"colEmtInt", newCol1);
1266 splitInfo.addExtra(
"acolEmtInt", state[iRad].acol());
1267 splitInfo.addExtra(
"colRadInt", state[iRad].col());
1268 splitInfo.addExtra(
"acolRadInt", newCol1);
1270 splitInfo.addExtra(
"colEmtInt", state[iRad].col());
1271 splitInfo.addExtra(
"acolEmtInt", newCol1);
1272 splitInfo.addExtra(
"colRadInt", newCol1);
1273 splitInfo.addExtra(
"acolRadInt", state[iRad].acol());
1276 return createvector<pair<int,int> >
1277 (make_pair(colRadAft, acolRadAft))
1278 (make_pair(colEmtAft1, acolEmtAft1))
1279 (make_pair(colEmtAft2, acolEmtAft2));
1283 int Dire_fsr_qcd_G2GGG::radBefID(
int,
int) {
1287 pair<int,int> Dire_fsr_qcd_G2GGG::radBefCols(
1290 return make_pair(0,0);
1294 double Dire_fsr_qcd_G2GGG::zSplit(
double zMinAbs,
double,
double m2dip) {
1295 double R = rndmPtr->flat();
1297 double a = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
1299 double zmin = zMinAbs;
1301 double z1 = (2*pow(a,R) + 4*pow(a,1 + R) + 2*pow(a,2 + R) +
1302 2*pow(a,2)*pow(1 + a - 2*zmin + pow(zmin,2),R)
1303 *pow(1/(a + zmin) + a/(a + zmin),2*R) -
1304 sqrt(pow(-2*pow(a,R) - 4*pow(a,1 + R) - 2*pow(a,2 + R) -
1305 2*pow(a,2)*pow(1 + a - 2*zmin + pow(zmin,2),R)
1306 *pow(1/(a + zmin) + a/(a + zmin),2*R),2) -
1307 4*(pow(a,R) + 2*pow(a,1 + R) + pow(a,2 + R) -
1308 a*pow(1 + a - 2*zmin + pow(zmin,2),R)
1309 *pow(1/(a + zmin) + a/(a + zmin),2*R))*
1310 (pow(a,R) + 3*pow(a,1 + R) + 3*pow(a,2 + R) + pow(a,3 + R) -
1311 pow(a,3)*pow(1 + a - 2*zmin + pow(zmin,2),R)
1312 *pow(1/(a + zmin) + a/(a + zmin),2*R))))/
1313 (2.*(pow(a,R) + 2*pow(a,1 + R) + pow(a,2 + R) -
1314 a*pow(1 + a - 2*zmin + pow(zmin,2),R)
1315 *pow(1/(a + zmin) + a/(a + zmin),2*R)));
1322 double Dire_fsr_qcd_G2GGG::overestimateInt(
double zMinAbs,
double zMaxAbs,
1323 double,
double m2dip,
int orderNow) {
1325 int order = (orderNow > -1) ? orderNow : correctionOrder;
1326 double kappa2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
1328 wt = CA/2.*CA * softRescaleInt(order) * 2.
1329 * 0.5 * ( log( (kappa2 + pow2(1-zMinAbs)) / (kappa2 + pow2(1-zMaxAbs)))
1330 + 2.*log( (kappa2+zMaxAbs)/(kappa2+zMinAbs)) );
1336 double Dire_fsr_qcd_G2GGG::overestimateDiff(
double z,
double m2dip,
1339 int order = (orderNow > -1) ? orderNow : correctionOrder;
1340 double kappaOld2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
1342 wt = CA/2.*CA * softRescaleInt(order)
1343 * 2.* ((1.-z) / ( pow2(1.-z) + kappaOld2) + 1./(z+kappaOld2));
1347 double Dire_fsr_qcd_G2GGG::counterTerm(
double si1,
double si2,
double sj1,
1348 double sj2,
double sij,
double s12) {
1351 double kT12 = ((si1+si2)*(sj1+sj2)-sij*s12)
1352 / (si1+si2+sj1+sj2+sij+s12);
1353 double kTi12 = (si1*s12)/(si1+si2+s12);
1354 if (kTi12>kT12)
return 0.0;
1358 double wij12 = 1. - (sij*s12) / ((si1 + si2)*(sj1 + sj2));
1359 double wij12bar = ((si1 + si2)*(sj1 + sj2) - sij*s12)
1360 / (si1*sj1 + si2*sj2);
1361 double ct2 = pow2(si1*sj2-si2*sj1)/(s12*sij*(si1+si2)*(sj1+sj2));
1364 double gg1Soft = 2.*CA/2./CA * (2.*si2/(si1+s12) * (wij12+wij12bar)/2.);
1365 double gg1Coll = 0.;
1366 double gg1ColorCorr = 0.;
1368 double gg2Soft = 2. * si2/(si1+s12) * (wij12+wij12bar)/2.;
1369 double gg2Coll = (-1. + ct2/2.0) * wij12;
1371 double ct = 2.0 * ((gg1Soft+gg1Coll+gg1ColorCorr) / si1 +(gg2Soft+gg2Coll)
1373 * sij / ((si1+si2)*(sj1+sj2)-sij*s12);
1381 bool Dire_fsr_qcd_G2GGG::calc(
const Event& state,
int orderNow) {
1384 if (
false) cout << state[0].e() << orderNow << endl;
1387 double z(splitInfo.kinematics()->z),
1388 pT2(splitInfo.kinematics()->pT2),
1389 m2dip(splitInfo.kinematics()->m2Dip),
1390 xa(splitInfo.kinematics()->xa),
1391 sai(splitInfo.kinematics()->sai),
1392 m2i12(splitInfo.kinematics()->m2RadBef),
1393 m2i(splitInfo.kinematics()->m2RadAft),
1394 m21(splitInfo.kinematics()->m2EmtAft),
1395 m22(splitInfo.kinematics()->m2EmtAft2),
1396 m2j(splitInfo.kinematics()->m2Rec);
1398 splitInfo.addExtra(
"idRadInt",21);
1399 splitInfo.addExtra(
"idEmtInt",state[splitInfo.iRadBef].id());
1400 splitInfo.addExtra(
"swapped",1);
1403 double scale2 = couplingScale2 ( z, pT2, m2dip,
1404 make_pair (splitInfo.radBef()->id, splitInfo.radBef()->isFinal),
1405 make_pair (splitInfo.recBef()->id, splitInfo.recBef()->isFinal));
1406 if (scale2 < 0.) scale2 = pT2;
1409 unordered_map<string,double> wts;
1410 int order = (orderNow > -1) ? orderNow : correctionOrder;
1411 if ( order != 4 || m2i12 > 0. || m2i > 0. || m21 > 0. || m22 > 0.
1413 wts.insert( make_pair(
"base", 0.) );
1414 if (doVariations && settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
1415 wts.insert( make_pair(
"Variations:muRfsrDown", 0.));
1416 if (doVariations && settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
1417 wts.insert( make_pair(
"Variations:muRfsrUp", 0.));
1419 for ( unordered_map<string,double>::iterator it = wts.begin();
1420 it != wts.end(); ++it )
1421 kernelVals.insert(make_pair( it->first, it->second ));
1426 Event trialEvent(state);
1427 bool physical =
false;
1428 if (splitInfo.recBef()->isFinal)
1429 physical = fsr->branch_FF(trialEvent,
true, &splitInfo);
1431 physical = fsr->branch_FI(trialEvent,
true, &splitInfo);
1433 Vec4 pi(trialEvent[splitInfo.iEmtAft].p());
1434 Vec4 pj(trialEvent[splitInfo.iRecAft].p());
1435 Vec4 p1(trialEvent[splitInfo.iRadAft].p());
1436 Vec4 p2(trialEvent[splitInfo.iEmtAft2].p());
1440 && ( abs(pi.m2Calc()-m2i) > sai || abs(p1.m2Calc()-m21) > sai
1441 || abs(p2.m2Calc()-m22) > sai || abs(pj.m2Calc()-m2j) > sai))
1445 wts.insert( make_pair(
"base", 0.) );
1446 if (doVariations && settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
1447 wts.insert( make_pair(
"Variations:muRfsrDown", 0.));
1448 if (doVariations && settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
1449 wts.insert( make_pair(
"Variations:muRfsrUp", 0.));
1451 for ( unordered_map<string,double>::iterator it = wts.begin();
1452 it != wts.end(); ++it )
1453 kernelVals.insert(make_pair( it->first, it->second ));
1458 double sij(2.*pi*pj), si1(2.*pi*p1), si2(2.*pi*p2),
1459 sj1(2.*pj*p1), sj2(2.*pj*p2), s12(2.*p1*p2);
1461 double sign = (splitInfo.recBef()->isFinal) ? 1. : -1.;
1462 double p2i1(sai + m2i + m21);
1463 double q2 = sign*(pi+p1+p2+sign*pj).m2Calc();
1464 double si12 = (pi+p1+p2).m2Calc();
1465 double yi12 = (splitInfo.recBef()->isFinal) ? si12 / q2 : 0.;
1466 double z1(z/(1.-yi12)), z2( z/xa/(1-yi12) - z1 ), z3(1-z1-z2);
1470 if (is_sai_endpoint()) {
1472 double x(z1/(z1+z2));
1474 prob = 2.0*CA*(log(x)/(1.0-x)+log(1.0-x)/x+(-2.0+x*(1.-x))*log(x*(1.-x)));
1477 prob += -2.0*CA/2.0*(log(x)/(1.0-x)+log(1.0-x)/x);
1480 prob *= CA/2. * (2.0/(1.0-z3*(1.0-yi12))-2.0);
1487 double kT12 = ((si1+si2)*(sj1+sj2)-sij*s12)/(si1+si2+sj1+sj2+sij+s12);
1488 if ( abs(sai) < 1e-10 || splitInfo.terminateEvolution ==
true
1489 || kT12 < pow2(settingsPtr->parm(
"TimeShower:pTmin"))) {
1490 wts.insert( make_pair(
"base", 0.) );
1491 if (doVariations && settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
1492 wts.insert( make_pair(
"Variations:muRfsrDown", 0.));
1493 if (doVariations && settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
1494 wts.insert( make_pair(
"Variations:muRfsrUp", 0.));
1496 for ( unordered_map<string,double>::iterator it = wts.begin();
1498 ++it ) kernelVals.insert(make_pair( it->first, it->second ));
1504 double wij12 = 1. - (sij*s12) / ((si1 + si2)*(sj1 + sj2));
1505 double wij12bar = ((si1 + si2)*(sj1 + sj2) - sij*s12)
1506 / (si1*sj1 + si2*sj2);
1507 double w = (1+wij12/wij12bar)/2.;
1510 double strongOrder = (1. * ( sij/(si1*s12*sj2)
1512 - sij*sij/(si1*sj1*si2*sj2)));
1513 double collB = sij/((si1+si2)*(sj1+sj2)) * 1./s12;
1514 double ct2 = pow2(si1*sj2-si2*sj1) / (s12*sij*(si1+si2)*(sj1+sj2));
1515 double collA = ct2*collB;
1516 double loSquare = 2.0*CA/2./CA * w * pow2(sij)/(si1*sj1*si2*sj2);
1519 prob = w * strongOrder - 2.0*collB + collA + loSquare;
1522 double subtTot(0.), subt(0.);
1524 subt = 0.25*counterTerm(si1,si2,sj1,sj2,sij,s12);
1525 if (subt != 0.) { ncounter++; subtTot += subt; }
1526 subt = 0.25*counterTerm(si2,si1,sj2,sj1,sij,s12);
1527 if (subt != 0.) { ncounter++; subtTot += subt; }
1528 subt = 0.25*counterTerm(sj1,sj2,si1,si2,sij,s12);
1529 if (subt != 0.) { ncounter++; subtTot += subt; }
1530 subt = 0.25*counterTerm(sj2,sj1,si2,si1,sij,s12);
1531 if (subt != 0.) { ncounter++; subtTot += subt; }
1536 if (ncounter==4) prob = 0.;
1539 prob *= CA/2.*CA*pow2(si1+si2+s12);
1549 prob *= 1. / (1.-p2i1/si12);
1552 if (is_sai_endpoint()) { splitInfo.set_sai(0.0); }
1555 wts.insert( make_pair(
"base", prob * as2Pi(scale2, order, renormMultFac) ));
1558 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
1559 wts.insert( make_pair(
"Variations:muRfsrDown", prob
1560 * as2Pi(scale2, order, (scale2 > pT2minVariations)
1561 ? settingsPtr->parm(
"Variations:muRfsrDown")*renormMultFac :
1563 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
1564 wts.insert( make_pair(
"Variations:muRfsrUp", prob
1565 * as2Pi(scale2, order, (scale2 > pT2minVariations)
1566 ? settingsPtr->parm(
"Variations:muRfsrUp")*renormMultFac :
1572 for ( unordered_map<string,double>::iterator it = wts.begin();
1573 it != wts.end(); ++it )
1574 it->second *= z2/(1.-z3);
1577 wts.insert( make_pair(
"base_order_as2", wts[
"base"] ));
1581 for (unordered_map<string,double>::iterator it = wts.begin();
1582 it != wts.end(); ++it)
1583 kernelVals.insert(make_pair( it->first, it->second));
1591 bool Dire_fsr_qcd_Q2Qqqbar::canRadiate (
const Event& state, pair<int,int> ints,
1592 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*) {
1593 if (orderSave != 4)
return false;
1594 return ( state[ints.first].isFinal()
1595 && state[ints.second].colType() != 0
1596 && hasSharedColor(state, ints.first, ints.second)
1597 && state[ints.first].isQuark() );
1600 bool Dire_fsr_qcd_Q2Qqqbar::canRadiate (
const Event& state,
int iRadBef,
1601 int iRecBef, Settings*, PartonSystems*, BeamParticle*) {
1602 if (orderSave != 4)
return false;
1603 return ( state[iRadBef].isFinal()
1604 && state[iRecBef].colType() != 0
1605 && hasSharedColor(state, iRadBef, iRecBef)
1606 && state[iRadBef].isQuark());
1610 double Dire_fsr_qcd_Q2Qqqbar::gaugeFactor (
int,
int ) {
return 1.;}
1611 double Dire_fsr_qcd_Q2Qqqbar::symmetryFactor (
int,
int ) {
return 1.;}
1613 vector<pair<int,int> > Dire_fsr_qcd_Q2Qqqbar::radAndEmtCols(
int iRad,
1614 int colType,
Event state) {
1616 int typeEmt = (idEmtAfterSave > 0) ? 1 : -1;
1617 int newCol1 = state.nextColTag();
1618 int colRadAft(0), acolRadAft(0), colEmtAft1(0), acolEmtAft1(0),
1619 colEmtAft2(0), acolEmtAft2(0);
1621 colRadAft = newCol1;
1623 colEmtAft1 = (typeEmt > 0) ? state[iRad].col() : 0;
1624 acolEmtAft1 = (typeEmt > 0) ? 0 : newCol1;
1625 colEmtAft2 = (typeEmt > 0) ? 0 : state[iRad].col();
1626 acolEmtAft2 = (typeEmt > 0) ? newCol1 : 0;
1629 acolRadAft = newCol1;
1630 colEmtAft1 = (typeEmt < 0) ? 0 : newCol1;
1631 acolEmtAft1 = (typeEmt < 0) ? state[iRad].acol() : 0;
1632 colEmtAft2 = (typeEmt < 0) ? newCol1 : 0;
1633 acolEmtAft2 = (typeEmt < 0) ? 0 : state[iRad].acol();
1638 splitInfo.addExtra(
"colEmtInt", newCol1);
1639 splitInfo.addExtra(
"acolEmtInt", state[iRad].acol());
1640 splitInfo.addExtra(
"colRadInt", state[iRad].col());
1641 splitInfo.addExtra(
"acolRadInt", newCol1);
1643 splitInfo.addExtra(
"colEmtInt", state[iRad].col());
1644 splitInfo.addExtra(
"acolEmtInt", newCol1);
1645 splitInfo.addExtra(
"colRadInt", newCol1);
1646 splitInfo.addExtra(
"acolRadInt", state[iRad].acol());
1649 return createvector<pair<int,int> >
1650 (make_pair(colRadAft, acolRadAft))
1651 (make_pair(colEmtAft1, acolEmtAft1))
1652 (make_pair(colEmtAft2, acolEmtAft2));
1656 int Dire_fsr_qcd_Q2Qqqbar::radBefID(
int idRA,
int) {
1657 if (particleDataPtr->isQuark(idRA))
return idRA;
1661 pair<int,int> Dire_fsr_qcd_Q2Qqqbar::radBefCols(
1664 return make_pair(0,0);
1668 double Dire_fsr_qcd_Q2Qqqbar::zSplit(
double zMinAbs,
double,
double m2dip) {
1669 double R = rndmPtr->flat();
1671 double a = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
1673 double zmin = zMinAbs;
1675 double z1 = (2*pow(a,R) + 4*pow(a,1 + R) + 2*pow(a,2 + R) +
1676 2*pow(a,2)*pow(1 + a - 2*zmin + pow(zmin,2),R)
1677 *pow(1/(a + zmin) + a/(a + zmin),2*R) -
1678 sqrt(pow(-2*pow(a,R) - 4*pow(a,1 + R) - 2*pow(a,2 + R) -
1679 2*pow(a,2)*pow(1 + a - 2*zmin + pow(zmin,2),R)
1680 *pow(1/(a + zmin) + a/(a + zmin),2*R),2) -
1681 4*(pow(a,R) + 2*pow(a,1 + R) + pow(a,2 + R) -
1682 a*pow(1 + a - 2*zmin + pow(zmin,2),R)
1683 *pow(1/(a + zmin) + a/(a + zmin),2*R))*
1684 (pow(a,R) + 3*pow(a,1 + R) + 3*pow(a,2 + R) + pow(a,3 + R) -
1685 pow(a,3)*pow(1 + a - 2*zmin + pow(zmin,2),R)
1686 *pow(1/(a + zmin) + a/(a + zmin),2*R))))/
1687 (2.*(pow(a,R) + 2*pow(a,1 + R) + pow(a,2 + R) -
1688 a*pow(1 + a - 2*zmin + pow(zmin,2),R)
1689 *pow(1/(a + zmin) + a/(a + zmin),2*R)));
1696 double Dire_fsr_qcd_Q2Qqqbar::overestimateInt(
double zMinAbs,
double zMaxAbs,
1697 double,
double m2dip,
int orderNow) {
1699 int order = (orderNow > -1) ? orderNow : correctionOrder;
1700 double kappa2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
1702 wt = CF*TR * softRescaleInt(order) * 2.
1703 * 0.5 * ( log( (kappa2 + pow2(1-zMinAbs)) / (kappa2 + pow2(1-zMaxAbs)))
1704 + 2.*log( (kappa2+zMaxAbs)/(kappa2+zMinAbs)) );
1710 double Dire_fsr_qcd_Q2Qqqbar::overestimateDiff(
double z,
double m2dip,
1713 int order = (orderNow > -1) ? orderNow : correctionOrder;
1714 double kappa2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
1716 wt = CF*TR * softRescaleInt(order)
1717 * 2.* ((1.-z) / ( pow2(1.-z) + kappa2) + 1./(z+kappa2));
1721 double Dire_fsr_qcd_Q2Qqqbar::counterTerm(
double si1,
double si2,
double sj1,
1722 double sj2,
double sij,
double s12) {
1725 double kT12 = ((si1+si2)*(sj1+sj2)-sij*s12)
1726 / (si1+si2+sj1+sj2+sij+s12);
1727 double kTi12 = (si1*s12)/(si1+si2+s12);
1728 if (kTi12>kT12)
return 0.0;
1732 double wij12 = 1. - (sij*s12) / ((si1 + si2)*(sj1 + sj2));
1733 double ct2 = pow2(si1*sj2-si2*sj1)/(s12*sij*(si1+si2)*(sj1+sj2));
1736 double gqColl = (1. - ct2) * wij12;
1738 double ct = 2. * gqColl / s12 * sij / ((si1+si2)*(sj1+sj2)-sij*s12);
1745 bool Dire_fsr_qcd_Q2Qqqbar::calc(
const Event& state,
int orderNow) {
1748 if (
false) cout << state[0].e() << orderNow << endl;
1751 double z(splitInfo.kinematics()->z),
1752 pT2(splitInfo.kinematics()->pT2),
1753 m2dip(splitInfo.kinematics()->m2Dip),
1754 xa(splitInfo.kinematics()->xa),
1755 sai(splitInfo.kinematics()->sai),
1756 m2i12(splitInfo.kinematics()->m2RadBef),
1757 m2i(splitInfo.kinematics()->m2RadAft),
1758 m21(splitInfo.kinematics()->m2EmtAft),
1759 m22(splitInfo.kinematics()->m2EmtAft2),
1760 m2j(splitInfo.kinematics()->m2Rec);
1762 splitInfo.addExtra(
"idRadInt",21);
1763 splitInfo.addExtra(
"idEmtInt",state[splitInfo.iRadBef].id());
1764 splitInfo.addExtra(
"swapped",1);
1767 double scale2 = couplingScale2 ( z, pT2, m2dip,
1768 make_pair (splitInfo.radBef()->id, splitInfo.radBef()->isFinal),
1769 make_pair (splitInfo.recBef()->id, splitInfo.recBef()->isFinal));
1770 if (scale2 < 0.) scale2 = pT2;
1773 unordered_map<string,double> wts;
1774 int order = (orderNow > -1) ? orderNow : correctionOrder;
1775 if ( order!= 4 || m2i12 > 0. || m2i > 0. || m21 > 0. || m22 > 0.
1777 wts.insert( make_pair(
"base", 0.) );
1778 if (doVariations && settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
1779 wts.insert( make_pair(
"Variations:muRfsrDown", 0.));
1780 if (doVariations && settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
1781 wts.insert( make_pair(
"Variations:muRfsrUp", 0.));
1783 for ( unordered_map<string,double>::iterator it = wts.begin();
1784 it != wts.end(); ++it )
1785 kernelVals.insert(make_pair( it->first, it->second ));
1790 Event trialEvent(state);
1791 bool physical =
false;
1792 if (splitInfo.recBef()->isFinal)
1793 physical = fsr->branch_FF(trialEvent,
true, &splitInfo);
1795 physical = fsr->branch_FI(trialEvent,
true, &splitInfo);
1797 Vec4 pi(trialEvent[splitInfo.iEmtAft].p());
1798 Vec4 pj(trialEvent[splitInfo.iRecAft].p());
1799 Vec4 p1(trialEvent[splitInfo.iRadAft].p());
1800 Vec4 p2(trialEvent[splitInfo.iEmtAft2].p());
1804 && ( abs(pi.m2Calc()-m2i) > sai || abs(p1.m2Calc()-m21) > sai
1805 || abs(p2.m2Calc()-m22) > sai || abs(pj.m2Calc()-m2j) > sai))
1809 wts.insert( make_pair(
"base", 0.) );
1810 if (doVariations && settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
1811 wts.insert( make_pair(
"Variations:muRfsrDown", 0.));
1812 if (doVariations && settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
1813 wts.insert( make_pair(
"Variations:muRfsrUp", 0.));
1815 for ( unordered_map<string,double>::iterator it = wts.begin();
1816 it != wts.end(); ++it )
1817 kernelVals.insert(make_pair( it->first, it->second ));
1822 double sij(2.*pi*pj), si1(2.*pi*p1), si2(2.*pi*p2),
1823 sj1(2.*pj*p1), sj2(2.*pj*p2), s12(2.*p1*p2);
1825 double sign = (splitInfo.recBef()->isFinal) ? 1. : -1.;
1826 double p2i1(sai + m2i + m21);
1827 double q2 = sign*(pi+p1+p2+sign*pj).m2Calc();
1828 double si12 = (pi+p1+p2).m2Calc();
1829 double yi12 = (splitInfo.recBef()->isFinal) ? si12 / q2 : 0.;
1830 double z1(z/(1.-yi12)), z2( z/xa/(1-yi12) - z1 ), z3(1-z1-z2);
1834 if (is_sai_endpoint()) {
1836 double x = z1/(z1+z2);
1838 prob = TR*(2.0*x*(1.-x)+(1.0-2.0*x*(1.-x))*log(x*(1.-x)));
1841 prob *= CF * (2.0/(1.0-z3*(1.0-yi12))-2.0);
1844 if (getNF(pT2) < abs(idEmtAfterSave)) prob = 0.;
1851 double kT12 = ((si1+si2)*(sj1+sj2)-sij*s12)/(si1+si2+sj1+sj2+sij+s12);
1852 if ( abs(sai) < 1e-10
1853 || kT12 < pow2(settingsPtr->parm(
"TimeShower:pTmin")) ) {
1854 wts.insert( make_pair(
"base", 0.) );
1855 if (doVariations && settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
1856 wts.insert( make_pair(
"Variations:muRfsrDown", 0.));
1857 if (doVariations && settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
1858 wts.insert( make_pair(
"Variations:muRfsrUp", 0.));
1860 for ( unordered_map<string,double>::iterator it = wts.begin();
1862 ++it ) kernelVals.insert(make_pair( it->first, it->second ));
1867 prob = 2.0*sij/(s12*(si1+si2)*(sj1+sj2))
1868 - 2.0*pow2(sj1*si2-sj2*si1)/pow2(s12*(si1+si2)*(sj1+sj2));
1872 subt += 0.25*counterTerm(si1,si2,sj1,sj2,sij,s12);
1873 subt += 0.25*counterTerm(si2,si1,sj2,sj1,sij,s12);
1874 subt += 0.25*counterTerm(sj1,sj2,si1,si2,sij,s12);
1875 subt += 0.25*counterTerm(sj2,sj1,si2,si1,sij,s12);
1879 prob *= CF*TR*pow2(si1+si2+s12);
1888 prob *= 1. / (1.-p2i1/si12);
1891 if (is_sai_endpoint()) { splitInfo.set_sai(0.0); }
1894 wts.insert( make_pair(
"base", prob * as2Pi(scale2, order, renormMultFac) ));
1897 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
1898 wts.insert( make_pair(
"Variations:muRfsrDown", prob
1899 * as2Pi(scale2, order, (scale2 > pT2minVariations)
1900 ? settingsPtr->parm(
"Variations:muRfsrDown")*renormMultFac :
1902 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
1903 wts.insert( make_pair(
"Variations:muRfsrUp", prob
1904 * as2Pi(scale2, order, (scale2 > pT2minVariations)
1905 ? settingsPtr->parm(
"Variations:muRfsrUp")*renormMultFac :
1911 for ( unordered_map<string,double>::iterator it = wts.begin();
1912 it != wts.end(); ++it )
1913 it->second *= z2/(1.-z3);
1916 wts.insert( make_pair(
"base_order_as2", wts[
"base"] ));
1920 for (unordered_map<string,double>::iterator it = wts.begin();
1921 it != wts.end(); ++it)
1922 kernelVals.insert(make_pair( it->first, it->second));
1931 bool Dire_fsr_qcd_G2Gqqbar::canRadiate (
const Event& state, pair<int,int> ints,
1932 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*) {
1933 if (orderSave != 4)
return false;
1934 return ( state[ints.first].isFinal()
1935 && state[ints.second].colType() != 0
1936 && hasSharedColor(state, ints.first, ints.second)
1937 && state[ints.first].id() == 21);
1940 bool Dire_fsr_qcd_G2Gqqbar::canRadiate (
const Event& state,
int iRadBef,
1941 int iRecBef, Settings*, PartonSystems*, BeamParticle*) {
1942 if (orderSave != 4)
return false;
1943 return ( state[iRadBef].isFinal()
1944 && state[iRecBef].colType() != 0
1945 && hasSharedColor(state, iRadBef, iRecBef)
1946 && state[iRadBef].
id() == 21);
1950 double Dire_fsr_qcd_G2Gqqbar::gaugeFactor (
int,
int ) {
return 1.;}
1951 double Dire_fsr_qcd_G2Gqqbar::symmetryFactor (
int,
int ) {
return 1.;}
1953 vector<pair<int,int> > Dire_fsr_qcd_G2Gqqbar::radAndEmtCols(
int iRad,
1954 int colType,
Event state) {
1956 int typeEmt = (idEmtAfterSave > 0) ? 1 : -1;
1957 int newCol1 = state.nextColTag();
1958 int colRadAft(0), acolRadAft(0), colEmtAft1(0), acolEmtAft1(0),
1959 colEmtAft2(0), acolEmtAft2(0);
1961 colRadAft = newCol1;
1963 colEmtAft1 = (typeEmt > 0) ? state[iRad].col() : 0;
1964 acolEmtAft1 = (typeEmt > 0) ? 0 : newCol1;
1965 colEmtAft2 = (typeEmt > 0) ? 0 : state[iRad].col();
1966 acolEmtAft2 = (typeEmt > 0) ? newCol1 : 0;
1969 acolRadAft = newCol1;
1970 colEmtAft1 = (typeEmt < 0) ? newCol1 : 0;
1971 acolEmtAft1 = (typeEmt < 0) ? 0 : state[iRad].acol();
1972 colEmtAft2 = (typeEmt < 0) ? 0 : newCol1;
1973 acolEmtAft2 = (typeEmt < 0) ? state[iRad].acol() : 0;
1978 splitInfo.addExtra(
"colEmtInt", newCol1);
1979 splitInfo.addExtra(
"acolEmtInt", state[iRad].acol());
1980 splitInfo.addExtra(
"colRadInt", state[iRad].col());
1981 splitInfo.addExtra(
"acolRadInt", newCol1);
1983 splitInfo.addExtra(
"colEmtInt", state[iRad].col());
1984 splitInfo.addExtra(
"acolEmtInt", newCol1);
1985 splitInfo.addExtra(
"colRadInt", newCol1);
1986 splitInfo.addExtra(
"acolRadInt", state[iRad].acol());
1989 return createvector<pair<int,int> >
1990 (make_pair(colRadAft, acolRadAft))
1991 (make_pair(colEmtAft1, acolEmtAft1))
1992 (make_pair(colEmtAft2, acolEmtAft2));
1996 int Dire_fsr_qcd_G2Gqqbar::radBefID(
int,
int) {
2000 pair<int,int> Dire_fsr_qcd_G2Gqqbar::radBefCols(
2003 return make_pair(0,0);
2008 double Dire_fsr_qcd_G2Gqqbar::zSplit(
double zMinAbs,
double,
double m2dip) {
2009 double R = rndmPtr->flat();
2011 double a = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
2012 double zmin = zMinAbs;
2013 double z1 = (2*pow(a,R) + 4*pow(a,1 + R) + 2*pow(a,2 + R) +
2014 2*pow(a,2)*pow(1 + a - 2*zmin + pow(zmin,2),R)
2015 *pow(1/(a + zmin) + a/(a + zmin),2*R) -
2016 sqrt(pow(-2*pow(a,R) - 4*pow(a,1 + R) - 2*pow(a,2 + R) -
2017 2*pow(a,2)*pow(1 + a - 2*zmin + pow(zmin,2),R)
2018 *pow(1/(a + zmin) + a/(a + zmin),2*R),2) -
2019 4*(pow(a,R) + 2*pow(a,1 + R) + pow(a,2 + R) -
2020 a*pow(1 + a - 2*zmin + pow(zmin,2),R)
2021 *pow(1/(a + zmin) + a/(a + zmin),2*R))*
2022 (pow(a,R) + 3*pow(a,1 + R) + 3*pow(a,2 + R) + pow(a,3 + R) -
2023 pow(a,3)*pow(1 + a - 2*zmin + pow(zmin,2),R)
2024 *pow(1/(a + zmin) + a/(a + zmin),2*R))))/
2025 (2.*(pow(a,R) + 2*pow(a,1 + R) + pow(a,2 + R) -
2026 a*pow(1 + a - 2*zmin + pow(zmin,2),R)
2027 *pow(1/(a + zmin) + a/(a + zmin),2*R)));
2033 double Dire_fsr_qcd_G2Gqqbar::overestimateInt(
double zMinAbs,
double zMaxAbs,
2034 double,
double m2dip,
int orderNow) {
2036 int order = (orderNow > -1) ? orderNow : correctionOrder;
2037 double kappa2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
2039 wt = CA/2.*TR * softRescaleInt(order) * 2.
2040 * 0.5 * ( log( (kappa2 + pow2(1-zMinAbs)) / (kappa2 + pow2(1-zMaxAbs)))
2041 + 2.*log( (kappa2+zMaxAbs)/(kappa2+zMinAbs)) );
2048 double Dire_fsr_qcd_G2Gqqbar::overestimateDiff(
double z,
double m2dip,
2051 int order = (orderNow > -1) ? orderNow : correctionOrder;
2052 double kappa2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
2054 wt = CA/2.*TR * softRescaleInt(order)
2055 * 2.* ((1.-z) / ( pow2(1.-z) + kappa2) + 1./(z+kappa2));
2059 double Dire_fsr_qcd_G2Gqqbar::counterTerm(
double si1,
double si2,
double sj1,
2060 double sj2,
double sij,
double s12) {
2063 double kT12 = ((si1+si2)*(sj1+sj2)-sij*s12)
2064 / (si1+si2+sj1+sj2+sij+s12);
2065 double kTi12 = (si1*s12)/(si1+si2+s12);
2066 if (kTi12>kT12)
return 0.0;
2070 double wij12 = 1. - (sij*s12) / ((si1 + si2)*(sj1 + sj2));
2071 double ct2 = pow2(si1*sj2-si2*sj1)/(s12*sij*(si1+si2)*(sj1+sj2));
2074 double gqColl = (1. - ct2) * wij12;
2076 double ct = 2. * gqColl / s12 * sij / ((si1+si2)*(sj1+sj2)-sij*s12);
2083 bool Dire_fsr_qcd_G2Gqqbar::calc(
const Event& state,
int orderNow) {
2086 if (
false) cout << state[0].e() << orderNow << endl;
2089 double z(splitInfo.kinematics()->z),
2090 pT2(splitInfo.kinematics()->pT2),
2091 m2dip(splitInfo.kinematics()->m2Dip),
2092 xa(splitInfo.kinematics()->xa),
2093 sai(splitInfo.kinematics()->sai),
2094 m2i12(splitInfo.kinematics()->m2RadBef),
2095 m2i(splitInfo.kinematics()->m2RadAft),
2096 m21(splitInfo.kinematics()->m2EmtAft),
2097 m22(splitInfo.kinematics()->m2EmtAft2),
2098 m2j(splitInfo.kinematics()->m2Rec);
2100 splitInfo.addExtra(
"idRadInt",21);
2101 splitInfo.addExtra(
"idEmtInt",state[splitInfo.iRadBef].id());
2102 splitInfo.addExtra(
"swapped",1);
2105 double scale2 = couplingScale2 ( z, pT2, m2dip,
2106 make_pair (splitInfo.radBef()->id, splitInfo.radBef()->isFinal),
2107 make_pair (splitInfo.recBef()->id, splitInfo.recBef()->isFinal));
2108 if (scale2 < 0.) scale2 = pT2;
2111 unordered_map<string,double> wts;
2112 int order = (orderNow > -1) ? orderNow : correctionOrder;
2113 if ( order != 4 || m2i12 > 0. || m2i > 0. || m21 > 0. || m22 > 0.
2115 wts.insert( make_pair(
"base", 0.) );
2116 if (doVariations && settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
2117 wts.insert( make_pair(
"Variations:muRfsrDown", 0.));
2118 if (doVariations && settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
2119 wts.insert( make_pair(
"Variations:muRfsrUp", 0.));
2121 for ( unordered_map<string,double>::iterator it = wts.begin();
2122 it != wts.end(); ++it )
2123 kernelVals.insert(make_pair( it->first, it->second ));
2128 Event trialEvent(state);
2129 bool physical =
false;
2130 if (splitInfo.recBef()->isFinal)
2131 physical = fsr->branch_FF(trialEvent,
true, &splitInfo);
2133 physical = fsr->branch_FI(trialEvent,
true, &splitInfo);
2135 Vec4 pi(trialEvent[splitInfo.iEmtAft].p());
2136 Vec4 pj(trialEvent[splitInfo.iRecAft].p());
2137 Vec4 p1(trialEvent[splitInfo.iRadAft].p());
2138 Vec4 p2(trialEvent[splitInfo.iEmtAft2].p());
2142 && ( abs(pi.m2Calc()-m2i) > sai || abs(p1.m2Calc()-m21) > sai
2143 || abs(p2.m2Calc()-m22) > sai || abs(pj.m2Calc()-m2j) > sai))
2147 wts.insert( make_pair(
"base", 0.) );
2148 if (doVariations && settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
2149 wts.insert( make_pair(
"Variations:muRfsrDown", 0.));
2150 if (doVariations && settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
2151 wts.insert( make_pair(
"Variations:muRfsrUp", 0.));
2153 for ( unordered_map<string,double>::iterator it = wts.begin();
2154 it != wts.end(); ++it )
2155 kernelVals.insert(make_pair( it->first, it->second ));
2160 double sij(2.*pi*pj), si1(2.*pi*p1), si2(2.*pi*p2),
2161 sj1(2.*pj*p1), sj2(2.*pj*p2), s12(2.*p1*p2);
2163 double sign = (splitInfo.recBef()->isFinal) ? 1. : -1.;
2164 double p2i1(sai + m2i + m21);
2165 double q2 = sign*(pi+p1+p2+sign*pj).m2Calc();
2166 double si12 = (pi+p1+p2).m2Calc();
2167 double yi12 = (splitInfo.recBef()->isFinal) ? si12 / q2 : 0.;
2168 double z1(z/(1.-yi12)), z2( z/xa/(1-yi12) - z1 ), z3(1-z1-z2);
2172 if (is_sai_endpoint()) {
2174 double x = z1/(z1+z2);
2176 prob = TR*(2.0*x*(1.-x)+(1.0-2.0*x*(1.-x))*log(x*(1.-x)));
2179 prob *= CA/2. * (2.0/(1.0-z3*(1.0-yi12))-2.0);
2182 if (getNF(pT2) < abs(idEmtAfterSave)) prob = 0.;
2189 double kT12 = ((si1+si2)*(sj1+sj2)-sij*s12)/(si1+si2+sj1+sj2+sij+s12);
2190 if ( abs(sai) < 1e-10
2191 || kT12 < pow2(settingsPtr->parm(
"TimeShower:pTmin")) ) {
2192 wts.insert( make_pair(
"base", 0.) );
2193 if (doVariations && settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
2194 wts.insert( make_pair(
"Variations:muRfsrDown", 0.));
2195 if (doVariations && settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
2196 wts.insert( make_pair(
"Variations:muRfsrUp", 0.));
2198 for ( unordered_map<string,double>::iterator it = wts.begin();
2200 ++it ) kernelVals.insert(make_pair( it->first, it->second ));
2205 prob = 2.0*sij/(s12*(si1+si2)*(sj1+sj2))
2206 - 2.0*pow2(sj1*si2-sj2*si1)/pow2(s12*(si1+si2)*(sj1+sj2));
2210 subt += 0.25*counterTerm(si1,si2,sj1,sj2,sij,s12);
2211 subt += 0.25*counterTerm(si2,si1,sj2,sj1,sij,s12);
2212 subt += 0.25*counterTerm(sj1,sj2,si1,si2,sij,s12);
2213 subt += 0.25*counterTerm(sj2,sj1,si2,si1,sij,s12);
2217 prob *= CA/2.*TR*pow2(si1+si2+s12);
2227 prob *= 1. / (1.-p2i1/si12);
2230 if (is_sai_endpoint()) { splitInfo.set_sai(0.0); }
2233 wts.insert( make_pair(
"base", prob * as2Pi(scale2, order, renormMultFac) ));
2236 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
2237 wts.insert( make_pair(
"Variations:muRfsrDown", prob
2238 * as2Pi(scale2, order, (scale2 > pT2minVariations)
2239 ? settingsPtr->parm(
"Variations:muRfsrDown")*renormMultFac :
2241 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
2242 wts.insert( make_pair(
"Variations:muRfsrUp", prob
2243 * as2Pi(scale2, order, (scale2 > pT2minVariations)
2244 ? settingsPtr->parm(
"Variations:muRfsrUp")*renormMultFac :
2250 for ( unordered_map<string,double>::iterator it = wts.begin();
2251 it != wts.end(); ++it )
2252 it->second *= z2/(1.-z3);
2255 wts.insert( make_pair(
"base_order_as2", wts[
"base"] ));
2259 for (unordered_map<string,double>::iterator it = wts.begin();
2260 it != wts.end(); ++it)
2261 kernelVals.insert(make_pair( it->first, it->second));
2274 bool Dire_fsr_qcd_Q2QG::canRadiate (
const Event& state, pair<int,int> ints,
2275 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*) {
2276 return ( state[ints.first].isFinal()
2277 && state[ints.second].colType() != 0
2278 && hasSharedColor(state, ints.first, ints.second)
2279 && state[ints.first].isQuark() );
2282 bool Dire_fsr_qcd_Q2QG::canRadiate (
const Event& state,
int iRadBef,
2283 int iRecBef, Settings*, PartonSystems*, BeamParticle*) {
2284 return ( state[iRadBef].isFinal()
2285 && state[iRecBef].colType() != 0
2286 && hasSharedColor(state, iRadBef, iRecBef)
2287 && state[iRadBef].isQuark());
2290 int Dire_fsr_qcd_Q2QG::kinMap() {
return 1;}
2291 int Dire_fsr_qcd_Q2QG::motherID(
int idDaughter) {
return idDaughter;}
2292 int Dire_fsr_qcd_Q2QG::sisterID(
int) {
return 21;}
2293 double Dire_fsr_qcd_Q2QG::gaugeFactor (
int,
int ) {
return CF;}
2294 double Dire_fsr_qcd_Q2QG::symmetryFactor (
int,
int ) {
return 1.;}
2296 int Dire_fsr_qcd_Q2QG::radBefID(
int idRA,
int) {
2297 if (particleDataPtr->isQuark(idRA))
return idRA;
2301 pair<int,int> Dire_fsr_qcd_Q2QG::radBefCols(
2302 int colRadAfter,
int,
2303 int colEmtAfter,
int acolEmtAfter) {
2304 bool isQuark = (colRadAfter > 0);
2305 if (isQuark)
return make_pair(colEmtAfter,0);
2306 return make_pair(0,acolEmtAfter);
2309 vector <int> Dire_fsr_qcd_Q2QG::recPositions(
const Event& state,
int iRad,
2312 int colRad = state[iRad].col();
2313 int acolRad = state[iRad].acol();
2314 int colEmt = state[iEmt].col();
2315 int acolEmt = state[iEmt].acol();
2316 int colShared = (colRad > 0 && colRad == acolEmt) ? colRad
2317 : (acolRad > 0 && colEmt == acolRad) ? colEmt : 0;
2319 vector<int> iExc(1,iRad); iExc.push_back(iEmt);
2323 if ( colEmt != 0 && colEmt != colShared) {
2324 int acolF = findCol(colEmt, iExc, state, 1);
2325 int colI = findCol(colEmt, iExc, state, 2);
2326 if (acolF > 0 && colI == 0) recs.push_back (acolF);
2327 if (acolF == 0 && colI > 0) recs.push_back (colI);
2330 if ( acolEmt != 0 && acolEmt != colShared) {
2331 int colF = findCol(acolEmt, iExc, state, 2);
2332 int acolI = findCol(acolEmt, iExc, state, 1);
2333 if ( colF > 0 && acolI == 0) recs.push_back (colF);
2334 if ( colF == 0 && acolI > 0) recs.push_back (acolI);
2341 double Dire_fsr_qcd_Q2QG::zSplit(
double zMinAbs,
double,
double m2dip) {
2342 double Rz = rndmPtr->flat();
2343 double kappaMin2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
2344 double p = pow( 1. + pow2(1-zMinAbs)/kappaMin2, Rz );
2345 double res = 1. - sqrt( p - 1. )*sqrt(kappaMin2);
2350 double Dire_fsr_qcd_Q2QG::overestimateInt(
double zMinAbs,
double,
2351 double,
double m2dip,
int orderNow) {
2353 double preFac = symmetryFactor() * gaugeFactor();
2354 int order = (orderNow > -1) ? orderNow : correctionOrder;
2355 double kappaMin2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
2356 double wt = preFac * softRescaleInt(order)
2357 *2. * 0.5 * log( 1. + pow2(1.-zMinAbs)/kappaMin2);
2362 double Dire_fsr_qcd_Q2QG::overestimateDiff(
double z,
double m2dip,
2364 double preFac = symmetryFactor() * gaugeFactor();
2365 int order = (orderNow > -1) ? orderNow : correctionOrder;
2366 double kappaMin2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
2367 double wt = preFac * softRescaleInt(order)
2368 *2. * (1.-z) / ( pow2(1.-z) + kappaMin2);
2373 bool Dire_fsr_qcd_Q2QG::calc(
const Event& state,
int orderNow) {
2376 if (
false) cout << state[0].e() << orderNow << endl;
2379 double z(splitInfo.kinematics()->z), pT2(splitInfo.kinematics()->pT2),
2380 m2dip(splitInfo.kinematics()->m2Dip),
2381 m2RadBef(splitInfo.kinematics()->m2RadBef),
2382 m2Rad(splitInfo.kinematics()->m2RadAft),
2383 m2Rec(splitInfo.kinematics()->m2Rec),
2384 m2Emt(splitInfo.kinematics()->m2EmtAft);
2385 int splitType(splitInfo.type);
2388 bool doMultiPole = (doCorrelations
2389 && !direInfoPtr->isSoft(splitInfo.iRadBef)
2390 && direInfoPtr->isSoft(splitInfo.iRecBef));
2393 bool doMassive = (abs(splitType) == 2);
2399 double preFac = symmetryFactor() * gaugeFactor();
2400 int order = (orderNow > -1) ? orderNow : correctionOrder;
2401 double kappa2 = max(pow2(settingsPtr->parm(
"TimeShower:pTmin"))
2405 double scale2 = couplingScale2 ( z, pT2, m2dip,
2406 make_pair (splitInfo.radBef()->id, splitInfo.radBef()->isFinal),
2407 make_pair (splitInfo.recBef()->id, splitInfo.recBef()->isFinal));
2408 if (scale2 < 0.) scale2 = pT2;
2410 unordered_map<string,double> wts;
2411 double wt_base_as1 = 0.;
2416 if (doGeneralizedKernel) {
2417 wt_base_as1 = preFac * 2.* (1.-z) / ( pow2(1.-z) + kappa2)
2418 * ( 1./z*sCoef(-1) + sCoef(0) + z*sCoef(1) + z*z*sCoef(2))
2419 * exp(1./z*sExp(-1) + sExp(0) + z*sExp(1) + z*z*sExp(2));
2420 wt_base_as1 += preFac * 2.* kappa2 / ( pow2(1.-z) + kappa2)
2421 * ( 1./z*kCoef(-1) + kCoef(0) + z*kCoef(1) + z*z*kCoef(2))
2422 * exp(1./z*kExp(-1) + kExp(0) + z*kExp(1) + z*z*kExp(2));
2424 wt_base_as1 = preFac * ( 2.* (1.-z) / ( pow2(1.-z) + kappa2) );
2426 wts.insert( make_pair(
"base", softRescaleDiff(order, scale2, renormMultFac)
2430 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
2431 wts.insert( make_pair(
"Variations:muRfsrDown", wt_base_as1
2432 * softRescaleDiff( order, scale2, (scale2 > pT2minVariations)
2433 ? settingsPtr->parm(
"Variations:muRfsrDown")*renormMultFac :
2435 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
2436 wts.insert( make_pair(
"Variations:muRfsrUp", wt_base_as1
2437 * softRescaleDiff( order, scale2, (scale2 > pT2minVariations)
2438 ? settingsPtr->parm(
"Variations:muRfsrUp")*renormMultFac :
2443 if (!doMassive && order >= 0) {
2444 if (doGeneralizedKernel) {
2445 double tmp = preFac * (1.-z)
2446 * ( 1./z*cCoef(-1) + cCoef(0) + z*cCoef(1) + z*z*cCoef(2))
2447 * exp(1./z*cExp(-1) + cExp(0) + z*cExp(1) + z*z*cExp(2))
2450 for ( unordered_map<string,double>::iterator it = wts.begin();
2451 it != wts.end(); ++it)
2454 wt_base_as1 += -preFac * ( 1.+z );
2455 for ( unordered_map<string,double>::iterator it = wts.begin();
2456 it != wts.end(); ++it)
2457 it->second += -preFac * ( 1.+z );
2466 double loEikonal = preFac * ( 2.* (1.-z) / ( pow2(1.-z) + kappa2) - 2.);
2468 double loColl = (!doMassive && order >= 0) ? preFac * ( 1. - z) : 0.;
2470 Event trialEvent(state);
2471 bool physical =
false;
2472 if (splitInfo.recBef()->isFinal)
2473 physical = fsr->branch_FF(trialEvent,
true, &splitInfo);
2475 physical = fsr->branch_FI(trialEvent,
true, &splitInfo);
2478 wts.insert( make_pair(
"base", 0.) );
2479 if (doVariations && settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
2480 wts.insert( make_pair(
"Variations:muRfsrDown", 0.));
2481 if (doVariations && settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
2482 wts.insert( make_pair(
"Variations:muRfsrUp", 0.));
2484 for ( unordered_map<string,double>::iterator it = wts.begin();
2486 ++it ) kernelVals.insert(make_pair( it->first, it->second ));
2491 Vec4 pi(trialEvent[splitInfo.iRadAft].p());
2492 Vec4 p2(trialEvent[splitInfo.iRecAft].p());
2493 Vec4 p1(trialEvent[splitInfo.iEmtAft].p());
2495 int size = splitInfo.iSiblings.size();
2497 for (
int i = 0; i < size; ++i) {
2498 if (splitInfo.iSiblings[i].first == splitInfo.iRadBef)
continue;
2499 if (splitInfo.iSiblings[i].first == splitInfo.iRecBef)
continue;
2500 iOther = splitInfo.iSiblings[i].first;
2502 Vec4 pj(state[iOther].p());
2504 double si1= 2.*pi*p1, sj1=2.*pj*p1, s12=2.*p1*p2;
2505 double si2= 2.*pi*p2, sj2=2.*pj*p2, sij=2.*pi*pj;
2509 double wij12 = 1. - (sij*s12) / ((si1 + si2)*(sj1 + sj2));
2510 double wij12bar = ((si1 + si2)*(sj1 + sj2) - sij*s12)
2511 / (si1*sj1 + si2*sj2);
2512 double fullSoft = loEikonal * 0.5 * (wij12 + wij12bar);
2513 double fullColl = loColl;
2514 double colorCorrection = (CA - 2.*CF) * (si2/(si1+s12) - sij/(si1+sj1))
2515 * 0.5 * (wij12 + wij12bar);
2518 wt_base_as1 = fullSoft + fullColl + colorCorrection;
2519 wts.insert( make_pair(
"base",
2520 softRescaleDiff( order, scale2, renormMultFac) * fullSoft
2521 + fullColl + colorCorrection ) );
2524 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
2525 wts.insert( make_pair(
"Variations:muRfsrDown",
2526 softRescaleDiff( order, scale2, (scale2 > pT2minVariations)
2527 ? settingsPtr->parm(
"Variations:muRfsrDown")*renormMultFac :
2528 renormMultFac)*fullSoft
2529 + fullColl + colorCorrection));
2530 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
2531 wts.insert( make_pair(
"Variations:muRfsrUp",
2532 softRescaleDiff( order, scale2, (scale2 > pT2minVariations)
2533 ? settingsPtr->parm(
"Variations:muRfsrUp")*renormMultFac :
2534 renormMultFac)*fullSoft
2535 + fullColl + colorCorrection));
2542 double ep = beta0Endpoint(order, m2dip, pT2, z, renormMultFac);
2543 for ( unordered_map<string,double>::iterator it = wts.begin();
2544 it != wts.end(); ++it)
2545 it->second += CF*ep;
2549 if (doMassive && order >= 0) {
2551 double pipj = 0., vijkt = 1., vijk = 1.;
2554 if (splitType == 2) {
2557 double yCS = kappa2 / (1.-z);
2558 double nu2RadBef = m2RadBef/m2dip;
2559 double nu2Rad = m2Rad/m2dip;
2560 double nu2Emt = m2Emt/m2dip;
2561 double nu2Rec = m2Rec/m2dip;
2562 vijk = pow2(1.-yCS) - 4.*(yCS+nu2Rad+nu2Emt)*nu2Rec;
2563 double Q2mass = m2dip + m2Rad + m2Rec + m2Emt;
2564 vijkt = pow2(Q2mass/m2dip - nu2RadBef - nu2Rec)
2565 - 4.*nu2RadBef*nu2Rec;
2566 vijk = sqrt(vijk) / (1-yCS);
2567 vijkt = sqrt(vijkt)/ (Q2mass/m2dip - nu2RadBef - nu2Rec);
2568 pipj = m2dip * yCS/2.;
2571 }
else if (splitType ==-2) {
2574 double xCS = 1 - kappa2/(1.-z);
2577 pipj = m2dip/2. * (1-xCS)/xCS;
2581 double massCorr = -1.*preFac*vijkt/vijk*m2RadBef/pipj;
2582 if (doGeneralizedKernel) {
2583 massCorr += preFac * vijkt/vijk * (1.-z)
2584 * ( 1./z*cCoef(-1) + cCoef(0) + z*cCoef(1) + z*z*cCoef(2))
2585 * exp(1./z*cExp(-1) + cExp(0) + z*cExp(1) + z*z*cExp(2))
2586 + preFac * vijkt/vijk * fCoef();
2588 massCorr += -1.*preFac*vijkt/vijk*( 1. + z);
2591 wt_base_as1 += massCorr;
2592 for ( unordered_map<string,double>::iterator it = wts.begin();
2593 it != wts.end(); ++it)
2594 it->second += massCorr;
2599 if (!doMassive && order == 3) {
2600 for ( unordered_map<string,double>::iterator it = wts.begin();
2601 it !=wts.end(); ++it){
2604 if (it->first ==
"base")
2605 mukf = renormMultFac;
2606 else if (it->first ==
"Variations:muRfsrDown")
2607 mukf = settingsPtr->parm(
"Variations:muRfsrDown");
2608 else if (it->first ==
"Variations:muRfsrUp")
2609 mukf = settingsPtr->parm(
"Variations:muRfsrUp");
2613 if (scale2 < pT2minVariations) mukf = renormMultFac;
2615 double NF = getNF(scale2 * mukf);
2616 double alphasPT2pi = as2Pi(scale2, order, mukf);
2618 double pqq1 = preFac / (18*(z-1)) * (
2619 ((-1 + z)*(4*TF*(-10 + z*(-37 + z*(29 + 28*z))) + z
2620 *(90*CF*(-1 + z) + CA*(53 - 187*z + 3*(1 + z)*pow2(M_PI)))) +
2621 3*z*log(z)*(34*TF + 12*(CF - CF*z + 2*TF*z) - 2
2622 *(9*CF + TF*(17 + 8*z))*pow2(z) - 12*CF*log(1 - z)*(1 + pow2(z)) -
2623 CA*(17 + 5*pow2(z)) - 3*log(z)*(CA - 3*CF + 2*TF + (CA - 5*CF - 2*TF)
2627 pqq1 += - preFac * 0.5 * 40./9. * TF * ( z /(z*z + kappa2) - 1./z);
2629 it->second += alphasPT2pi*pqq1;
2636 for ( unordered_map<string,double>::iterator it = wts.begin();
2637 it != wts.end(); ++it )
2642 if (order > 0) wts.insert( make_pair(
"base_order_as2",
2643 wts[
"base"] - wt_base_as1 ));
2647 for ( unordered_map<string,double>::iterator it = wts.begin();
2648 it != wts.end(); ++it )
2649 kernelVals.insert(make_pair( it->first, it->second ));
2664 bool Dire_fsr_qcd_Q2GQ::canRadiate (
const Event& state, pair<int,int> ints,
2665 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*) {
2666 return ( state[ints.first].isFinal()
2667 && state[ints.second].colType() != 0
2668 && hasSharedColor(state, ints.first, ints.second)
2669 && state[ints.first].isQuark() );
2672 bool Dire_fsr_qcd_Q2GQ::canRadiate (
const Event& state,
int iRadBef,
2673 int iRecBef, Settings*, PartonSystems*, BeamParticle*) {
2674 return ( state[iRadBef].isFinal()
2675 && state[iRecBef].colType() != 0
2676 && hasSharedColor(state, iRadBef, iRecBef)
2677 && state[iRadBef].isQuark());
2680 int Dire_fsr_qcd_Q2GQ::kinMap() {
return 1;}
2681 int Dire_fsr_qcd_Q2GQ::motherID(
int idDaughter) {
return idDaughter;}
2682 int Dire_fsr_qcd_Q2GQ::sisterID(
int) {
return 21;}
2683 double Dire_fsr_qcd_Q2GQ::gaugeFactor (
int,
int ) {
return CF;}
2684 double Dire_fsr_qcd_Q2GQ::symmetryFactor (
int,
int ) {
return 1.;}
2686 int Dire_fsr_qcd_Q2GQ::radBefID(
int idRad,
int idEmt) {
2687 if (idRad == 21 && particleDataPtr->isQuark(idEmt))
return idEmt;
2688 if (idEmt == 21 && particleDataPtr->isQuark(idRad))
return idRad;
2692 pair<int,int> Dire_fsr_qcd_Q2GQ::radBefCols(
2693 int colRadAfter,
int acolRadAfter,
2694 int colEmtAfter,
int acolEmtAfter) {
2695 int colE = (colEmtAfter*acolEmtAfter == 0 && colRadAfter*acolRadAfter != 0)
2696 ? colEmtAfter : colRadAfter;
2697 int colR = (colEmtAfter*acolEmtAfter == 0 && colRadAfter*acolRadAfter != 0)
2698 ? colRadAfter : colEmtAfter;
2699 int acolR = (colEmtAfter*acolEmtAfter == 0 && colRadAfter*acolRadAfter != 0)
2700 ? acolRadAfter : acolEmtAfter;
2702 bool isQuark = (colE > 0);
2703 if (isQuark)
return make_pair(colR,0);
2704 return make_pair(0,acolR);
2707 vector <int> Dire_fsr_qcd_Q2GQ::recPositions(
const Event& state,
int iRad,
2712 if ( state[iEmt].idAbs() < 20 && state[iRad].
id() == 21) swap( iRad, iEmt);
2714 int colRad = state[iRad].col();
2715 int acolRad = state[iRad].acol();
2716 int colEmt = state[iEmt].col();
2717 int acolEmt = state[iEmt].acol();
2718 int colShared = (colRad > 0 && colRad == acolEmt) ? colRad
2719 : (acolRad > 0 && colEmt == acolRad) ? colEmt : 0;
2721 vector<int> iExc(1,iRad); iExc.push_back(iEmt);
2725 if ( colEmt != 0 && colEmt != colShared) {
2726 int acolF = findCol(colEmt, iExc, state, 1);
2727 int colI = findCol(colEmt, iExc, state, 2);
2728 if (acolF > 0 && colI == 0) recs.push_back (acolF);
2729 if (acolF == 0 && colI > 0) recs.push_back (colI);
2732 if ( acolEmt != 0 && acolEmt != colShared) {
2733 int colF = findCol(acolEmt, iExc, state, 2);
2734 int acolI = findCol(acolEmt, iExc, state, 1);
2735 if ( colF > 0 && acolI == 0) recs.push_back (colF);
2736 if ( colF == 0 && acolI > 0) recs.push_back (acolI);
2743 double Dire_fsr_qcd_Q2GQ::zSplit(
double zMinAbs,
double,
double m2dip) {
2744 double Rz = rndmPtr->flat();
2745 double kappaMin2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
2746 double p = pow( 1. + pow2(1-zMinAbs)/kappaMin2, Rz );
2747 double res = 1. - sqrt( p - 1. )*sqrt(kappaMin2);
2752 double Dire_fsr_qcd_Q2GQ::overestimateInt(
double zMinAbs,
double,
2753 double,
double m2dip,
int orderNow) {
2755 double preFac = symmetryFactor() * gaugeFactor();
2756 int order = (orderNow > -1) ? orderNow : correctionOrder;
2757 double kappaMin2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
2758 double wt = preFac * 2. * 0.5 * log( 1. + pow2(1.-zMinAbs)/kappaMin2);
2762 if ( ( correctionOrder > 0 && correctionOrder <= 2 )
2763 || ( orderNow > -1 && orderNow <= 2 ) )
2764 wt *= softRescaleInt(order);
2770 double Dire_fsr_qcd_Q2GQ::overestimateDiff(
double z,
double m2dip,
2772 double preFac = symmetryFactor() * gaugeFactor();
2773 int order = (orderNow > -1) ? orderNow : correctionOrder;
2774 double kappaMin2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
2775 double wt = preFac * 2.* (1.-z) / ( pow2(1.-z) + kappaMin2);
2778 if ( ( correctionOrder > 0 && correctionOrder <= 2 )
2779 || ( orderNow > -1 && orderNow <= 2 ) )
2780 wt *= softRescaleInt(order);
2785 bool Dire_fsr_qcd_Q2GQ::calc(
const Event& state,
int orderNow) {
2788 if (
false) cout << state[0].e() << orderNow << endl;
2791 double z(splitInfo.kinematics()->z), pT2(splitInfo.kinematics()->pT2),
2792 m2dip(splitInfo.kinematics()->m2Dip),
2793 m2RadBef(splitInfo.kinematics()->m2RadBef),
2794 m2Rad(splitInfo.kinematics()->m2RadAft),
2795 m2Rec(splitInfo.kinematics()->m2Rec),
2796 m2Emt(splitInfo.kinematics()->m2EmtAft);
2797 int splitType(splitInfo.type);
2803 double preFac = symmetryFactor() * gaugeFactor();
2804 int order = (orderNow > -1) ? orderNow : correctionOrder;
2805 double kappa2 = max(pow2(settingsPtr->parm(
"TimeShower:pTmin"))
2808 unordered_map<string,double> wts;
2809 double wt_base_as1 = 0.;
2810 if (doGeneralizedKernel) {
2811 wt_base_as1 = preFac * 2.* (1.-z) / ( pow2(1.-z) + kappa2)
2812 * ( 1./z*sCoef(-1) + sCoef(0) + z*sCoef(1) + z*z*sCoef(2))
2813 * exp(1./z*sExp(-1) + sExp(0) + z*sExp(1) + z*z*sExp(2));
2814 wt_base_as1 += preFac * 2.* kappa2 / ( pow2(1.-z) + kappa2)
2815 * ( 1./z*kCoef(-1) + kCoef(0) + z*kCoef(1) + z*z*kCoef(2))
2816 * exp(1./z*kExp(-1) + kExp(0) + z*kExp(1) + z*z*kExp(2));
2818 wt_base_as1 = preFac * ( 2.* (1.-z) / ( pow2(1.-z) + kappa2) );
2820 wts.insert( make_pair(
"base", wt_base_as1 ));
2823 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
2824 wts.insert( make_pair(
"Variations:muRfsrDown", wt_base_as1 ));
2825 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
2826 wts.insert( make_pair(
"Variations:muRfsrUp", wt_base_as1 ));
2830 double scale2 = couplingScale2 ( z, pT2, m2dip,
2831 make_pair (splitInfo.radBef()->id, splitInfo.radBef()->isFinal),
2832 make_pair (splitInfo.recBef()->id, splitInfo.recBef()->isFinal));
2833 if (scale2 < 0.) scale2 = pT2;
2837 bool doRescale = ( ( correctionOrder > 0 && correctionOrder <= 2 )
2838 || ( orderNow > -1 && orderNow <= 2 ) );
2840 wts[
"base"] *= softRescaleDiff( order, scale2, renormMultFac);
2841 if (doVariations && settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
2842 wts[
"Variations:muRfsrDown"] *= softRescaleDiff( order, scale2,
2843 (scale2 > pT2minVariations) ? settingsPtr->parm(
"Variations:muRfsrDown")
2846 if (doVariations && settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
2847 wts[
"Variations:muRfsrUp"] *= softRescaleDiff( order, scale2,
2848 (scale2 > pT2minVariations) ? settingsPtr->parm(
"Variations:muRfsrUp")
2854 bool doMassive = (abs(splitType) == 2);
2857 if (!doMassive && order >= 0) {
2858 if (doGeneralizedKernel) {
2859 double tmp = preFac * (1.-z)
2860 * ( 1./z*cCoef(-1) + cCoef(0) + z*cCoef(1) + z*z*cCoef(2))
2861 * exp(1./z*cExp(-1) + cExp(0) + z*cExp(1) + z*z*cExp(2))
2864 for ( unordered_map<string,double>::iterator it = wts.begin();
2865 it != wts.end(); ++it)
2868 wt_base_as1 += -preFac * ( 1.+z );
2869 for ( unordered_map<string,double>::iterator it = wts.begin();
2870 it != wts.end(); ++it)
2871 it->second += -preFac * ( 1.+z );
2876 if (doMassive && order >= 0) {
2878 double pipj = 0., vijkt = 1., vijk = 1.;
2881 if (splitType == 2) {
2884 double yCS = kappa2 / (1.-z);
2885 double nu2RadBef = m2RadBef/m2dip;
2886 double nu2Rad = m2Rad/m2dip;
2887 double nu2Emt = m2Emt/m2dip;
2888 double nu2Rec = m2Rec/m2dip;
2889 vijk = pow2(1.-yCS) - 4.*(yCS+nu2Rad+nu2Emt)*nu2Rec;
2890 double Q2mass = m2dip + m2Rad + m2Rec + m2Emt;
2891 vijkt = pow2(Q2mass/m2dip - nu2RadBef - nu2Rec)
2892 - 4.*nu2RadBef*nu2Rec;
2893 vijk = sqrt(vijk) / (1-yCS);
2894 vijkt = sqrt(vijkt)/ (Q2mass/m2dip - nu2RadBef - nu2Rec);
2895 pipj = m2dip * yCS/2.;
2897 }
else if (splitType ==-2) {
2900 double xCS = 1 - kappa2/(1.-z);
2903 pipj = m2dip/2. * (1-xCS)/xCS;
2907 double massCorr = -1.*preFac*vijkt/vijk*m2RadBef/pipj;
2908 if (doGeneralizedKernel) {
2909 massCorr += preFac * vijkt/vijk * (1.-z)
2910 * ( 1./z*cCoef(-1) + cCoef(0) + z*cCoef(1) + z*z*cCoef(2))
2911 * exp(1./z*cExp(-1) + cExp(0) + z*cExp(1) + z*z*cExp(2))
2912 + preFac * vijkt/vijk * fCoef();
2914 massCorr += -1.*preFac*vijkt/vijk*( 1. + z);
2917 wt_base_as1 += massCorr;
2918 for ( unordered_map<string,double>::iterator it = wts.begin();
2919 it != wts.end(); ++it)
2920 it->second += massCorr;
2925 if (!doMassive && order == 3){
2926 for ( unordered_map<string,double>::iterator it = wts.begin();
2927 it !=wts.end(); ++it) {
2929 if (it->first ==
"base")
2930 mukf = renormMultFac;
2931 else if (it->first ==
"Variations:muRfsrDown")
2932 mukf = settingsPtr->parm(
"Variations:muRfsrDown");
2933 else if (it->first ==
"Variations:muRfsrUp")
2934 mukf = settingsPtr->parm(
"Variations:muRfsrUp");
2938 if (scale2 < pT2minVariations) mukf = renormMultFac;
2942 double NF = getNF(scale2 * mukf);
2943 double alphasPT2pi = as2Pi(scale2, order, mukf);
2945 double pqg1 = preFac * (
2946 (9*CF*x*(-1 + 9*x) + 144*(CA - CF)*(2 + (-2 + x)*x)
2947 *DiLog(x) + 36*CA*(2 + x*(2 + x))*DiLog(1/(1 + x)) -
2948 2*CA*(-17 + 9*(-5 + x)*x + 44*pow(x,3) + 3*pow2(M_PI)*(2 + pow2(x))) +
2949 3*(12*log(1 - x)*((3*CA - 2*CF)*(2 + (-2 + x)*x)*log(x) + (-CA + CF)
2951 log(x)*(3*CF*(-16 + x)*x + 2*CA*(-18 + x*(24 + x*(27 + 8*x))) - 3
2952 *log(x)*(CF*(-2 + x)*x + CA*(8 + 4*x + 6*pow2(x)))) -
2953 6*(CA - CF)*(2 + (-2 + x)*x)*pow2(log(1 - x)) + 6*CA*(2 + x*(2 + x))
2954 *pow2(log(1 + x))))/(18.*x)
2957 pqg1 += preFac * 0.5 * 40./9. * TF * ( x /(x*x + kappa2) - 1./x);
2959 it->second += alphasPT2pi*pqg1;
2965 for ( unordered_map<string,double>::iterator it = wts.begin();
2966 it != wts.end(); ++it )
2967 it->second *= (1-z);
2969 wt_base_as1 *= (1-z);
2971 if (order > 0) wts.insert( make_pair(
"base_order_as2",
2972 wts[
"base"] - wt_base_as1 ));
2976 for ( unordered_map<string,double>::iterator it = wts.begin();
2977 it != wts.end(); ++it )
2978 kernelVals.insert(make_pair( it->first, it->second ));
2994 bool Dire_fsr_qcd_G2GG1::canRadiate (
const Event& state, pair<int,int> ints,
2995 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*) {
2996 return ( state[ints.first].isFinal()
2997 && state[ints.second].colType() != 0
2998 && hasSharedColor(state, ints.first, ints.second)
2999 && state[ints.first].id() == 21 );
3002 bool Dire_fsr_qcd_G2GG1::canRadiate (
const Event& state,
int iRadBef,
3003 int iRecBef, Settings*, PartonSystems*, BeamParticle*) {
3004 return ( state[iRadBef].isFinal()
3005 && state[iRecBef].colType() != 0
3006 && hasSharedColor(state, iRadBef, iRecBef)
3007 && state[iRadBef].
id() == 21);
3010 int Dire_fsr_qcd_G2GG1::kinMap() {
return 1;}
3011 int Dire_fsr_qcd_G2GG1::motherID(
int) {
return 21;}
3012 int Dire_fsr_qcd_G2GG1::sisterID(
int) {
return 21;}
3013 double Dire_fsr_qcd_G2GG1::gaugeFactor (
int,
int ) {
return 2.*CA;}
3014 double Dire_fsr_qcd_G2GG1::symmetryFactor (
int,
int ) {
return 0.5;}
3016 int Dire_fsr_qcd_G2GG1::radBefID(
int,
int){
return 21;}
3017 pair<int,int> Dire_fsr_qcd_G2GG1::radBefCols(
3018 int colRadAfter,
int acolRadAfter,
3019 int colEmtAfter,
int acolEmtAfter) {
3020 int colRemove = (colRadAfter == acolEmtAfter)
3021 ? colRadAfter : acolRadAfter;
3022 int col = (colRadAfter == colRemove)
3023 ? colEmtAfter : colRadAfter;
3024 int acol = (acolRadAfter == colRemove)
3025 ? acolEmtAfter : acolRadAfter;
3026 return make_pair(col,acol);
3029 vector <int> Dire_fsr_qcd_G2GG1::recPositions(
const Event& state,
int iRad,
3032 int colRad = state[iRad].col();
3033 int acolRad = state[iRad].acol();
3034 int colEmt = state[iEmt].col();
3035 int acolEmt = state[iEmt].acol();
3036 int colShared = (colRad > 0 && colRad == acolEmt) ? colRad
3037 : (acolRad > 0 && colEmt == acolRad) ? colEmt : 0;
3039 vector<int> iExc(1,iRad); iExc.push_back(iEmt);
3043 if ( colEmt != 0 && colEmt != colShared) {
3044 int acolF = findCol(colEmt, iExc, state, 1);
3045 int colI = findCol(colEmt, iExc, state, 2);
3046 if (acolF > 0 && colI == 0) recs.push_back (acolF);
3047 if (acolF == 0 && colI > 0) recs.push_back (colI);
3050 if ( acolEmt != 0 && acolEmt != colShared) {
3051 int colF = findCol(acolEmt, iExc, state, 2);
3052 int acolI = findCol(acolEmt, iExc, state, 1);
3053 if ( colF > 0 && acolI == 0) recs.push_back (colF);
3054 if ( colF == 0 && acolI > 0) recs.push_back (acolI);
3061 double Dire_fsr_qcd_G2GG1::zSplit(
double zMinAbs,
double,
double m2dip) {
3063 double R = rndmPtr->flat();
3064 double kappaMin2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
3065 double p = pow( 1. + pow2(1-zMinAbs)/kappaMin2, R );
3066 double res = 1. - sqrt( p - 1. )*sqrt(kappaMin2);
3071 double Dire_fsr_qcd_G2GG1::overestimateInt(
double zMinAbs,
double,
3072 double,
double m2dip,
int orderNow) {
3075 double preFac = symmetryFactor() * gaugeFactor();
3076 int order = (orderNow > -1) ? orderNow : correctionOrder;
3077 double kappaMin2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
3078 double wt = preFac * softRescaleInt(order)
3079 *0.5 * log( 1. + pow2(1.-zMinAbs)/kappaMin2);
3080 if (useBackboneGluons) wt *= 2.;
3085 double Dire_fsr_qcd_G2GG1::overestimateDiff(
double z,
double m2dip,
3088 double preFac = symmetryFactor() * gaugeFactor();
3089 int order = (orderNow > -1) ? orderNow : correctionOrder;
3090 double kappaMin2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
3091 double wt = preFac * softRescaleInt(order)
3092 *(1.-z) / ( pow2(1.-z) + kappaMin2);
3093 if (useBackboneGluons) wt *= 2.;
3098 bool Dire_fsr_qcd_G2GG1::calc(
const Event& state,
int orderNow) {
3101 if (
false) cout << state[0].e() << orderNow << endl;
3104 double z(splitInfo.kinematics()->z), pT2(splitInfo.kinematics()->pT2),
3105 m2dip(splitInfo.kinematics()->m2Dip),
3106 m2Rad(splitInfo.kinematics()->m2RadAft),
3107 m2Rec(splitInfo.kinematics()->m2Rec),
3108 m2Emt(splitInfo.kinematics()->m2EmtAft);
3109 int splitType(splitInfo.type);
3112 bool doMultiPole = (doCorrelations
3113 && direInfoPtr->isSoft(splitInfo.iRadBef));
3116 bool doMassive = (abs(splitType) == 2);
3118 double preFac = symmetryFactor() * gaugeFactor();
3121 for (
int i=0; i < state.size(); ++i)
if (state[i].isFinal()) nFinal++;
3122 if (useBackboneGluons && nFinal > 2) {
3123 vector<int> cols = sharedColor(state,splitInfo.iRadBef,splitInfo.iRecBef);
3124 vector<int> bcols = fsrDec->bornColors;
3126 && find(bcols.begin(), bcols.end(), cols.front()) != bcols.end())
3128 else if (cols.size()==1) {
3129 int colNow = cols.front();
3130 int colRad = state[splitInfo.iRadBef].col();
3131 int acolRad = state[splitInfo.iRadBef].acol();
3132 if ( colNow == colRad
3133 && find(bcols.begin(), bcols.end(), acolRad) != bcols.end())
3135 else if (colNow == acolRad
3136 && find(bcols.begin(), bcols.end(), colRad) != bcols.end())
3141 int order = (orderNow > -1) ? orderNow : correctionOrder;
3142 double kappa2 = max(pow2(settingsPtr->parm(
"TimeShower:pTmin"))
3148 unordered_map<string,double> wts;
3149 double wt_base_as1 = 0.;
3152 double scale2 = couplingScale2 ( z, pT2, m2dip,
3153 make_pair (splitInfo.radBef()->id, splitInfo.radBef()->isFinal),
3154 make_pair (splitInfo.recBef()->id, splitInfo.recBef()->isFinal));
3155 if (scale2 < 0.) scale2 = pT2;
3161 if (doGeneralizedKernel) {
3162 wt_base_as1 = preFac * (1.-z) / ( pow2(1.-z) + kappa2)
3163 * ( 1./z*sCoef(-1) + sCoef(0) + z*sCoef(1) + z*z*sCoef(2))
3164 * exp(1./z*sExp(-1) + sExp(0) + z*sExp(1) + z*z*sExp(2));
3165 wt_base_as1 += preFac * kappa2 / ( pow2(1.-z) + kappa2)
3166 * ( 1./z*kCoef(-1) + kCoef(0) + z*kCoef(1) + z*z*kCoef(2))
3167 * exp(1./z*kExp(-1) + kExp(0) + z*kExp(1) + z*z*kExp(2));
3169 wt_base_as1 = preFac * (1.-z) / ( pow2(1.-z) + kappa2);
3171 wts.insert( make_pair(
"base", wt_base_as1
3172 * softRescaleDiff( order, scale2, renormMultFac) ));
3175 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
3176 wts.insert( make_pair(
"Variations:muRfsrDown", wt_base_as1
3177 * softRescaleDiff( order, scale2, (scale2 > pT2minVariations)
3178 ? settingsPtr->parm(
"Variations:muRfsrDown")*renormMultFac :
3180 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
3181 wts.insert( make_pair(
"Variations:muRfsrUp", wt_base_as1
3182 * softRescaleDiff( order, scale2, (scale2 > pT2minVariations)
3183 ? settingsPtr->parm(
"Variations:muRfsrUp")*renormMultFac :
3189 if (!doMassive && order >= 0) {
3190 if (doGeneralizedKernel) {
3191 coll = preFac * 0.5 * z*(1.-z)
3192 * ( 1./z*cCoef(-1) + cCoef(0) + z*cCoef(1) + z*z*cCoef(2))
3193 * exp(1./z*cExp(-1) + cExp(0) + z*cExp(1) + z*z*cExp(2))
3194 + preFac * 0.5 * fCoef();
3196 coll = preFac * ( -1. + 0.5*z*(1.-z) );
3199 for ( unordered_map<string,double>::iterator it = wts.begin();
3200 it != wts.end(); ++it)
3202 wt_base_as1 += coll;
3206 double ep = beta0Endpoint(order, m2dip, pT2, z, renormMultFac);
3207 for ( unordered_map<string,double>::iterator it = wts.begin();
3208 it != wts.end(); ++it)
3209 it->second += CA/2.*ep;
3215 double loEikonal = preFac * ((1.-z) / (pow2(1.-z) + kappa2)-1.);
3218 Event trialEvent(state);
3219 bool physical =
false;
3220 if (splitInfo.recBef()->isFinal)
3221 physical = fsr->branch_FF(trialEvent,
true, &splitInfo);
3223 physical = fsr->branch_FI(trialEvent,
true, &splitInfo);
3226 wts.insert( make_pair(
"base", 0.) );
3227 if (doVariations && settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
3228 wts.insert( make_pair(
"Variations:muRfsrDown", 0.));
3229 if (doVariations && settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
3230 wts.insert( make_pair(
"Variations:muRfsrUp", 0.));
3232 for ( unordered_map<string,double>::iterator it = wts.begin();
3234 ++it ) kernelVals.insert(make_pair( it->first, it->second ));
3239 Vec4 p1(trialEvent[splitInfo.iRadAft].p());
3240 Vec4 pi(trialEvent[splitInfo.iRecAft].p());
3241 Vec4 p2(trialEvent[splitInfo.iEmtAft].p());
3243 int size = splitInfo.iSiblings.size();
3245 for (
int i = 0; i < size; ++i) {
3246 if (splitInfo.iSiblings[i].first == splitInfo.iRadBef)
continue;
3247 if (splitInfo.iSiblings[i].first == splitInfo.iRecBef)
continue;
3248 iOther = splitInfo.iSiblings[i].first;
3250 Vec4 pj(state[iOther].p());
3252 double si1= 2.*pi*p1, sj1=2.*pj*p1, s12=2.*p1*p2;
3253 double si2= 2.*pi*p2, sj2=2.*pj*p2, sij=2.*pi*pj;
3257 double wij12 = 1. - (sij*s12) / ((si1 + si2)*(sj1 + sj2));
3258 double wij12bar = ((si1 + si2)*(sj1 + sj2) - sij*s12)
3259 / (si1*sj1 + si2*sj2);
3263 double ct2= pow2(si1*sj2-si2*sj1) / (s12*sij*(si1+si2)*(sj1+sj2));
3264 double fullColl = (!doMassive && order >= 0)
3265 ? preFac * 0.5*( -1. + ct2/2.0) * wij12 : 0.;
3266 double fullSoft = loEikonal * 0.5 * (wij12 + wij12bar);
3271 wt_base_as1 = fullSoft + fullColl;
3272 wts.insert( make_pair(
"base", fullSoft
3273 * softRescaleDiff( order, scale2, renormMultFac) ));
3276 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
3277 wts.insert( make_pair(
"Variations:muRfsrDown", fullSoft
3278 * softRescaleDiff( order, scale2, (scale2 > pT2minVariations)
3279 ? settingsPtr->parm(
"Variations:muRfsrDown")*renormMultFac :
3281 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
3282 wts.insert( make_pair(
"Variations:muRfsrUp", fullSoft
3283 * softRescaleDiff( order, scale2, (scale2 > pT2minVariations)
3284 ? settingsPtr->parm(
"Variations:muRfsrUp")*renormMultFac :
3289 for ( unordered_map<string,double>::iterator it = wts.begin();
3290 it != wts.end(); ++it)
3291 it->second += fullColl;
3295 if (doMassive && order >= 0) {
3300 if (splitType == 2) {
3302 double yCS = kappa2 / (1.-z);
3303 double nu2Rad = m2Rad/m2dip;
3304 double nu2Emt = m2Emt/m2dip;
3305 double nu2Rec = m2Rec/m2dip;
3306 vijk = pow2(1.-yCS) - 4.*(yCS+nu2Rad+nu2Emt)*nu2Rec;
3307 vijk = sqrt(vijk) / (1-yCS);
3310 }
else if (splitType ==-2) {
3317 if (doGeneralizedKernel) {
3318 coll = preFac * 0.5 * 1./vijk * z*(1.-z)
3319 * ( 1./z*cCoef(-1) + cCoef(0) + z*cCoef(1) + z*z*cCoef(2))
3320 * exp(1./z*cExp(-1) + cExp(0) + z*cExp(1) + z*z*cExp(2))
3321 + preFac * 0.5 * 1./vijk * fCoef();
3324 coll = preFac * 1./ vijk * ( -1. + 0.5 * z*(1.-z) );
3326 wt_base_as1 += coll;
3327 for ( unordered_map<string,double>::iterator it = wts.begin();
3328 it != wts.end(); ++it)
3334 if (!doMassive && order == 3 ) {
3335 for ( unordered_map<string,double>::iterator it = wts.begin();
3336 it !=wts.end(); ++it){
3338 if (it->first ==
"base")
3339 mukf = renormMultFac;
3340 else if (it->first ==
"Variations:muRfsrDown")
3341 mukf = settingsPtr->parm(
"Variations:muRfsrDown");
3342 else if (it->first ==
"Variations:muRfsrUp")
3343 mukf = settingsPtr->parm(
"Variations:muRfsrUp");
3347 if (scale2 < pT2minVariations) mukf = renormMultFac;
3349 double NF = getNF(scale2 * mukf);
3350 double alphasPT2pi = as2Pi(scale2, order, mukf);
3359 double pgg1 = preFac * 0.5 * 0.5 / ( 18*x*(pow2(x)-1) ) * (
3360 TF*(4*(-1 + x)*(-23 + x*(6 + x*(10 + x*(4 + 23*x)))) + 24*(1 + x)
3361 *(2 + (-1 + x)*x*(3 + x*(-3 + 2*x)))*log(x)) +
3362 (CF*TF*(-12*(1 + x)*(8 + x*(7 - x*(2 + x)*(-3 + 8*x)))*log(x) - 8
3363 *(1 + x)*(23 + x*(14 + 41*x))*pow2(-1 + x) +
3364 36*(-1 + x)*x*pow2(1 + x)*pow2(log(x))))/CA + 72*CA*(-1 + x)
3365 *DiLog(1/(1 + x))*pow2(1 + x + pow2(x)) +
3366 CA*(-6*(1 + x)*(-22 + x*(11 + x*(30 + x*(-19 + 22*x))))*log(x) +
3367 (1 - x)*(x*(1 + x)*(25 + 109*x) + 6*(2 + x*(1 + 2*x*(1 + x)))
3368 *pow2(M_PI)) - 72*(1 + x)*log(1 - x)*log(x)*pow2(1 + (-1 + x)*x) +
3369 36*(2 + x*(1 + (-4 + x)*(-1 + x)*x*(1 + x)))*pow2(log(x)) + 36*(-1 + x)
3370 *pow2(log(1 + x))*pow2(1 + x + pow2(x)))
3374 pgg1 += preFac * 0.5 * 0.5 * 40./9. * TF * ( x /(x*x + kappa2) - 1./x);
3376 it->second += alphasPT2pi*pgg1;
3382 for ( unordered_map<string,double>::iterator it = wts.begin();
3383 it != wts.end(); ++it)
3388 if (order > 0) wts.insert( make_pair(
"base_order_as2",
3389 wts[
"base"] - wt_base_as1 ));
3393 for ( unordered_map<string,double>::iterator it = wts.begin();
3394 it != wts.end(); ++it)
3395 kernelVals.insert(make_pair( it->first, it->second ));
3411 bool Dire_fsr_qcd_G2GG2::canRadiate (
const Event& state, pair<int,int> ints,
3412 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*) {
3413 return ( state[ints.first].isFinal()
3414 && state[ints.second].colType() != 0
3415 && hasSharedColor(state, ints.first, ints.second)
3416 && state[ints.first].id() == 21 );
3419 bool Dire_fsr_qcd_G2GG2::canRadiate (
const Event& state,
int iRadBef,
3420 int iRecBef, Settings*, PartonSystems*, BeamParticle*) {
3421 return ( state[iRadBef].isFinal()
3422 && state[iRecBef].colType() != 0
3423 && hasSharedColor(state, iRadBef, iRecBef)
3424 && state[iRadBef].
id() == 21);
3427 int Dire_fsr_qcd_G2GG2::kinMap() {
return 1;}
3428 int Dire_fsr_qcd_G2GG2::motherID(
int) {
return 21;}
3429 int Dire_fsr_qcd_G2GG2::sisterID(
int) {
return 21;}
3430 double Dire_fsr_qcd_G2GG2::gaugeFactor (
int,
int ) {
return 2.*CA;}
3431 double Dire_fsr_qcd_G2GG2::symmetryFactor (
int,
int ) {
return 0.5;}
3433 int Dire_fsr_qcd_G2GG2::radBefID(
int,
int){
return 21;}
3434 pair<int,int> Dire_fsr_qcd_G2GG2::radBefCols(
3435 int colRadAfter,
int acolRadAfter,
3436 int colEmtAfter,
int acolEmtAfter) {
3437 int colRemove = (colRadAfter == acolEmtAfter)
3438 ? colRadAfter : acolRadAfter;
3439 int col = (colRadAfter == colRemove)
3440 ? colEmtAfter : colRadAfter;
3441 int acol = (acolRadAfter == colRemove)
3442 ? acolEmtAfter : acolRadAfter;
3443 return make_pair(col,acol);
3446 vector <int> Dire_fsr_qcd_G2GG2::recPositions(
const Event& state,
int iRad,
3449 int colRad = state[iRad].col();
3450 int acolRad = state[iRad].acol();
3451 int colEmt = state[iEmt].col();
3452 int acolEmt = state[iEmt].acol();
3453 int colShared = (colRad > 0 && colRad == acolEmt) ? colRad
3454 : (acolRad > 0 && colEmt == acolRad) ? colEmt : 0;
3456 vector<int> iExc(1,iRad); iExc.push_back(iEmt);
3461 if ( colRad != 0 && colRad != colShared) {
3462 int acolF = findCol(colRad, iExc, state, 1);
3463 int colI = findCol(colRad, iExc, state, 2);
3464 if (acolF > 0 && colI == 0) recs.push_back (acolF);
3465 if (acolF == 0 && colI > 0) recs.push_back (colI);
3469 if ( acolRad != 0 && acolRad != colShared) {
3470 int colF = findCol(acolRad, iExc, state, 2);
3471 int acolI = findCol(acolRad, iExc, state, 1);
3472 if ( colF > 0 && acolI == 0) recs.push_back (colF);
3473 if ( colF == 0 && acolI > 0) recs.push_back (acolI);
3481 double Dire_fsr_qcd_G2GG2::zSplit(
double zMinAbs,
double,
double m2dip) {
3483 double R = rndmPtr->flat();
3484 double kappaMin2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
3485 double p = pow( 1. + pow2(1-zMinAbs)/kappaMin2, R );
3486 double res = 1. - sqrt( p - 1. )*sqrt(kappaMin2);
3491 double Dire_fsr_qcd_G2GG2::overestimateInt(
double zMinAbs,
double,
3492 double,
double m2dip,
int orderNow) {
3494 double preFac = symmetryFactor() * gaugeFactor();
3496 int order = (orderNow > -1) ? orderNow : correctionOrder;
3497 double kappaMin2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
3498 double wt = preFac * softRescaleInt(order)
3499 *0.5 * log( 1. + pow2(1.-zMinAbs)/kappaMin2);
3500 if (useBackboneGluons) wt *= 2.;
3505 double Dire_fsr_qcd_G2GG2::overestimateDiff(
double z,
double m2dip,
3508 double preFac = symmetryFactor() * gaugeFactor();
3509 int order = (orderNow > -1) ? orderNow : correctionOrder;
3510 double kappaMin2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
3511 double wt = preFac * softRescaleInt(order)
3512 *(1.-z) / ( pow2(1.-z) + kappaMin2);
3513 if (useBackboneGluons) wt *= 2.;
3518 bool Dire_fsr_qcd_G2GG2::calc(
const Event& state,
int orderNow) {
3521 if (
false) cout << state[0].e() << orderNow << endl;
3524 double z(splitInfo.kinematics()->z), pT2(splitInfo.kinematics()->pT2),
3525 m2dip(splitInfo.kinematics()->m2Dip),
3526 m2Rad(splitInfo.kinematics()->m2RadAft),
3527 m2Rec(splitInfo.kinematics()->m2Rec),
3528 m2Emt(splitInfo.kinematics()->m2EmtAft);
3529 int splitType(splitInfo.type);
3533 (doCorrelations && direInfoPtr->isSoft(splitInfo.iRadBef));
3536 bool doMassive = (abs(splitType) == 2);
3538 double preFac = symmetryFactor() * gaugeFactor();
3541 for (
int i=0; i < state.size(); ++i)
if (state[i].isFinal()) nFinal++;
3542 if (useBackboneGluons && nFinal > 2) {
3543 vector<int> cols = sharedColor(state,splitInfo.iRadBef,splitInfo.iRecBef);
3544 vector<int> bcols = fsrDec->bornColors;
3546 && find(bcols.begin(), bcols.end(), cols.front()) != bcols.end())
3548 else if (cols.size()==1) {
3549 int colNow = cols.front();
3550 int colRad = state[splitInfo.iRadBef].col();
3551 int acolRad = state[splitInfo.iRadBef].acol();
3552 if ( colNow == colRad
3553 && find(bcols.begin(), bcols.end(), acolRad) != bcols.end())
3555 else if (colNow == acolRad
3556 && find(bcols.begin(), bcols.end(), colRad) != bcols.end())
3561 int order = (orderNow > -1) ? orderNow : correctionOrder;
3562 double kappa2 = max(pow2(settingsPtr->parm(
"TimeShower:pTmin"))
3568 unordered_map<string,double> wts;
3569 double wt_base_as1 = 0.;
3572 double scale2 = couplingScale2 ( z, pT2, m2dip,
3573 make_pair (splitInfo.radBef()->id, splitInfo.radBef()->isFinal),
3574 make_pair (splitInfo.recBef()->id, splitInfo.recBef()->isFinal));
3575 if (scale2 < 0.) scale2 = pT2;
3581 if (doGeneralizedKernel) {
3582 wt_base_as1 = preFac * (1.-z) / ( pow2(1.-z) + kappa2)
3583 * ( 1./z*sCoef(-1) + sCoef(0) + z*sCoef(1) + z*z*sCoef(2))
3584 * exp(1./z*sExp(-1) + sExp(0) + z*sExp(1) + z*z*sExp(2));
3585 wt_base_as1 += preFac * kappa2 / ( pow2(1.-z) + kappa2)
3586 * ( 1./z*kCoef(-1) + kCoef(0) + z*kCoef(1) + z*z*kCoef(2))
3587 * exp(1./z*kExp(-1) + kExp(0) + z*kExp(1) + z*z*kExp(2));
3589 wt_base_as1 = preFac * (1.-z) / ( pow2(1.-z) + kappa2);
3591 wts.insert( make_pair(
"base", wt_base_as1
3592 * softRescaleDiff( order, scale2, renormMultFac) ));
3595 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
3596 wts.insert( make_pair(
"Variations:muRfsrDown", wt_base_as1
3597 * softRescaleDiff( order, scale2, (scale2 > pT2minVariations)
3598 ? settingsPtr->parm(
"Variations:muRfsrDown")*renormMultFac :
3600 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
3601 wts.insert( make_pair(
"Variations:muRfsrUp", wt_base_as1
3602 * softRescaleDiff( order, scale2, (scale2 > pT2minVariations)
3603 ? settingsPtr->parm(
"Variations:muRfsrUp")*renormMultFac :
3609 if (!doMassive && order >= 0) {
3610 if (doGeneralizedKernel) {
3611 coll = preFac * 0.5 * z*(1.-z)
3612 * ( 1./z*cCoef(-1) + cCoef(0) + z*cCoef(1) + z*z*cCoef(2))
3613 * exp(1./z*cExp(-1) + cExp(0) + z*cExp(1) + z*z*cExp(2))
3614 + preFac * 0.5 * fCoef();
3616 coll = preFac * ( -1. + 0.5*z*(1.-z) );
3619 for ( unordered_map<string,double>::iterator it = wts.begin();
3620 it != wts.end(); ++it)
3622 wt_base_as1 += coll;
3626 double ep = beta0Endpoint(order, m2dip, pT2, z, renormMultFac);
3627 for ( unordered_map<string,double>::iterator it = wts.begin();
3628 it != wts.end(); ++it)
3629 it->second += CA/2.*ep;
3635 double loEikonal = preFac * ((1.-z) / (pow2(1.-z) + kappa2) -1.);
3638 Event trialEvent(state);
3639 bool physical =
false;
3640 if (splitInfo.recBef()->isFinal)
3641 physical = fsr->branch_FF(trialEvent,
true, &splitInfo);
3643 physical = fsr->branch_FI(trialEvent,
true, &splitInfo);
3646 wts.insert( make_pair(
"base", 0.) );
3647 if (doVariations && settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
3648 wts.insert( make_pair(
"Variations:muRfsrDown", 0.));
3649 if (doVariations && settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
3650 wts.insert( make_pair(
"Variations:muRfsrUp", 0.));
3652 for ( unordered_map<string,double>::iterator it = wts.begin();
3654 ++it ) kernelVals.insert(make_pair( it->first, it->second ));
3659 Vec4 p1(trialEvent[splitInfo.iRadAft].p());
3660 Vec4 pi(trialEvent[splitInfo.iRecAft].p());
3661 Vec4 p2(trialEvent[splitInfo.iEmtAft].p());
3663 int size = splitInfo.iSiblings.size();
3665 for (
int i = 0; i < size; ++i) {
3666 if (splitInfo.iSiblings[i].first == splitInfo.iRadBef)
continue;
3667 if (splitInfo.iSiblings[i].first == splitInfo.iRecBef)
continue;
3668 iOther = splitInfo.iSiblings[i].first;
3670 Vec4 pj(state[iOther].p());
3672 double si1= 2.*pi*p1, sj1=2.*pj*p1, s12=2.*p1*p2;
3673 double si2= 2.*pi*p2, sj2=2.*pj*p2, sij=2.*pi*pj;
3677 double wij12 = 1. - (sij*s12) / ((si1 + si2)*(sj1 + sj2));
3678 double wij12bar = ((si1 + si2)*(sj1 + sj2) - sij*s12)
3679 / (si1*sj1 + si2*sj2);
3683 double ct2 = pow2(si1*sj2-si2*sj1) / (s12*sij*(si1+si2)*(sj1+sj2));
3684 double fullColl = (!doMassive && order >= 0)
3685 ? preFac * 0.5*( -1. + ct2/2.0) * wij12 : 0.;
3686 double fullSoft = loEikonal * 0.5 * (wij12 + wij12bar);
3691 wt_base_as1 = fullSoft + fullColl;
3692 wts.insert( make_pair(
"base", fullSoft
3693 * softRescaleDiff( order, scale2, renormMultFac) ));
3696 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
3697 wts.insert( make_pair(
"Variations:muRfsrDown", fullSoft
3698 * softRescaleDiff( order, scale2, (scale2 > pT2minVariations)
3699 ? settingsPtr->parm(
"Variations:muRfsrDown")*renormMultFac :
3701 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
3702 wts.insert( make_pair(
"Variations:muRfsrUp", fullSoft
3703 * softRescaleDiff( order, scale2, (scale2 > pT2minVariations)
3704 ? settingsPtr->parm(
"Variations:muRfsrUp")*renormMultFac :
3709 for ( unordered_map<string,double>::iterator it = wts.begin();
3710 it != wts.end(); ++it)
3711 it->second += fullColl;
3715 if (doMassive && order >= 0) {
3720 if (splitType == 2) {
3722 double yCS = kappa2 / (1.-z);
3723 double nu2Rad = m2Rad/m2dip;
3724 double nu2Emt = m2Emt/m2dip;
3725 double nu2Rec = m2Rec/m2dip;
3726 vijk = pow2(1.-yCS) - 4.*(yCS+nu2Rad+nu2Emt)*nu2Rec;
3727 vijk = sqrt(vijk) / (1-yCS);
3730 }
else if (splitType ==-2) {
3737 if (doGeneralizedKernel) {
3738 coll = preFac * 0.5 * 1./vijk * z*(1.-z)
3739 * ( 1./z*cCoef(-1) + cCoef(0) + z*cCoef(1) + z*z*cCoef(2))
3740 * exp(1./z*cExp(-1) + cExp(0) + z*cExp(1) + z*z*cExp(2))
3741 + preFac * 0.5 * 1./vijk * fCoef();
3743 coll = preFac * 1./ vijk * ( -1. + 0.5 * z*(1.-z) );
3745 wt_base_as1 += coll;
3746 for ( unordered_map<string,double>::iterator it = wts.begin();
3747 it != wts.end(); ++it)
3753 if (!doMassive && order == 3) {
3754 for ( unordered_map<string,double>::iterator it = wts.begin();
3755 it !=wts.end(); ++it) {
3757 if (it->first ==
"base")
3758 mukf = renormMultFac;
3759 else if (it->first ==
"Variations:muRfsrDown")
3760 mukf = settingsPtr->parm(
"Variations:muRfsrDown");
3761 else if (it->first ==
"Variations:muRfsrUp")
3762 mukf = settingsPtr->parm(
"Variations:muRfsrUp");
3766 if (scale2 < pT2minVariations) mukf = renormMultFac;
3768 double NF = getNF(scale2 * mukf);
3769 double alphasPT2pi = as2Pi(scale2, order, mukf);
3780 double pgg1 = preFac * 0.5 * 0.5 / ( 18*x*(pow2(x)-1) ) * (
3781 TF*(4*(-1 + x)*(-23 + x*(6 + x*(10 + x*(4 + 23*x)))) + 24*(1 + x)
3782 *(2 + (-1 + x)*x*(3 + x*(-3 + 2*x)))*log(x)) +
3783 (CF*TF*(-12*(1 + x)*(8 + x*(7 - x*(2 + x)*(-3 + 8*x)))*log(x) - 8
3784 *(1 + x)*(23 + x*(14 + 41*x))*pow2(-1 + x) +
3785 36*(-1 + x)*x*pow2(1 + x)*pow2(log(x))))/CA + 72*CA*(-1 + x)
3786 *DiLog(1/(1 + x))*pow2(1 + x + pow2(x)) +
3787 CA*(-6*(1 + x)*(-22 + x*(11 + x*(30 + x*(-19 + 22*x))))*log(x) +
3788 (1 - x)*(x*(1 + x)*(25 + 109*x) + 6*(2 + x*(1 + 2*x*(1 + x)))
3789 *pow2(M_PI)) - 72*(1 + x)*log(1 - x)*log(x)*pow2(1 + (-1 + x)*x) +
3790 36*(2 + x*(1 + (-4 + x)*(-1 + x)*x*(1 + x)))*pow2(log(x)) + 36
3791 *(-1 + x)*pow2(log(1 + x))*pow2(1 + x + pow2(x)))
3795 pgg1 += preFac * 0.5 * 0.5 * 40./9. * TF * ( x /(x*x + kappa2) - 1./x);
3797 it->second += alphasPT2pi*pgg1;
3803 for ( unordered_map<string,double>::iterator it = wts.begin();
3804 it != wts.end(); ++it )
3805 it->second *= (1-z);
3807 wt_base_as1 *= (1-z);
3809 if (order > 0) wts.insert( make_pair(
"base_order_as2",
3810 wts[
"base"] - wt_base_as1 ));
3814 for ( unordered_map<string,double>::iterator it = wts.begin();
3815 it != wts.end(); ++it )
3816 kernelVals.insert(make_pair( it->first, it->second ));
3829 bool Dire_fsr_qcd_G2QQ1::canRadiate (
const Event& state, pair<int,int> ints,
3830 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*) {
3831 return ( state[ints.first].isFinal()
3832 && state[ints.second].colType() != 0
3833 && hasSharedColor(state, ints.first, ints.second)
3834 && state[ints.first].id() == 21 );
3837 bool Dire_fsr_qcd_G2QQ1::canRadiate (
const Event& state,
int iRadBef,
3838 int iRecBef, Settings*, PartonSystems*, BeamParticle*) {
3839 return ( state[iRadBef].isFinal()
3840 && state[iRecBef].colType() != 0
3841 && hasSharedColor(state, iRadBef, iRecBef)
3842 && state[iRadBef].
id() == 21);
3845 int Dire_fsr_qcd_G2QQ1::kinMap() {
return 1;}
3846 int Dire_fsr_qcd_G2QQ1::motherID(
int) {
return 1;}
3847 int Dire_fsr_qcd_G2QQ1::sisterID(
int) {
return 1;}
3848 double Dire_fsr_qcd_G2QQ1::gaugeFactor (
int,
int ) {
return NF_qcd_fsr*TR;}
3849 double Dire_fsr_qcd_G2QQ1::symmetryFactor (
int,
int ) {
return 0.5;}
3851 int Dire_fsr_qcd_G2QQ1::radBefID(
int,
int){
return 21;}
3852 pair<int,int> Dire_fsr_qcd_G2QQ1::radBefCols(
3853 int colRadAfter,
int acolRadAfter,
3854 int colEmtAfter,
int acolEmtAfter) {
3855 int col = (colRadAfter > 0) ? colRadAfter : colEmtAfter;
3856 int acol = (acolRadAfter > 0) ? acolRadAfter : acolEmtAfter;
3857 return make_pair(col,acol);
3860 vector <int> Dire_fsr_qcd_G2QQ1::recPositions(
const Event& state,
int iRad,
3863 int colRad = state[iRad].col();
3864 int acolRad = state[iRad].acol();
3865 int colEmt = state[iEmt].col();
3866 int acolEmt = state[iEmt].acol();
3867 int colShared = (colRad > 0 && colRad == acolEmt) ? colRad
3868 : (acolRad > 0 && colEmt == acolRad) ? colEmt : 0;
3870 vector<int> iExc(1,iRad); iExc.push_back(iEmt);
3876 if ( colEmt != 0 && colEmt != colShared) {
3877 int acolF = findCol(colEmt, iExc, state, 1);
3878 int colI = findCol(colEmt, iExc, state, 2);
3879 if (acolF > 0 && colI == 0) recs.push_back (acolF);
3880 if (acolF == 0 && colI > 0) recs.push_back (colI);
3883 if ( acolEmt != 0 && acolEmt != colShared) {
3884 int colF = findCol(acolEmt, iExc, state, 2);
3885 int acolI = findCol(acolEmt, iExc, state, 1);
3886 if ( colF > 0 && acolI == 0) recs.push_back (colF);
3887 if ( colF == 0 && acolI > 0) recs.push_back (acolI);
3895 double Dire_fsr_qcd_G2QQ1::zSplit(
double zMinAbs,
double zMaxAbs,
double) {
3896 return (zMinAbs + rndmPtr->flat() * (zMaxAbs - zMinAbs));
3900 double Dire_fsr_qcd_G2QQ1::overestimateInt(
double zMinAbs,
double zMaxAbs,
3901 double,
double,
int) {
3903 double preFac = symmetryFactor() * gaugeFactor();
3904 wt = 2.*preFac * 0.5 * ( zMaxAbs - zMinAbs);
3909 double Dire_fsr_qcd_G2QQ1::overestimateDiff(
double,
double,
int) {
3911 double preFac = symmetryFactor() * gaugeFactor();
3912 wt = 2.*preFac * 0.5;
3917 bool Dire_fsr_qcd_G2QQ1::calc(
const Event& state,
int orderNow) {
3920 if (
false) cout << state[0].e() << orderNow << endl;
3923 double z(splitInfo.kinematics()->z), pT2(splitInfo.kinematics()->pT2),
3924 m2dip(splitInfo.kinematics()->m2Dip),
3925 m2Rad(splitInfo.kinematics()->m2RadAft),
3926 m2Rec(splitInfo.kinematics()->m2Rec),
3927 m2Emt(splitInfo.kinematics()->m2EmtAft);
3928 int splitType(splitInfo.type);
3930 double preFac = symmetryFactor() * gaugeFactor();
3931 int order = (orderNow > -1) ? orderNow : correctionOrder;
3932 double kappa2 = max(pow2(settingsPtr->parm(
"TimeShower:pTmin"))
3935 unordered_map<string,double> wts;
3936 double wt_base_as1 = 0.;
3940 if ( doCorrelations && direInfoPtr->isSoft(splitInfo.iRadBef)) {
3941 Event trialEvent(state);
3942 bool physical =
false;
3943 if (splitInfo.recBef()->isFinal)
3944 physical = fsr->branch_FF(trialEvent,
true, &splitInfo);
3946 physical = fsr->branch_FI(trialEvent,
true, &splitInfo);
3949 wts.insert( make_pair(
"base", 0.) );
3950 if (doVariations && settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
3951 wts.insert( make_pair(
"Variations:muRfsrDown", 0.));
3952 if (doVariations && settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
3953 wts.insert( make_pair(
"Variations:muRfsrUp", 0.));
3955 for ( unordered_map<string,double>::iterator it = wts.begin();
3957 ++it ) kernelVals.insert(make_pair( it->first, it->second ));
3962 Vec4 p1(trialEvent[splitInfo.iRadAft].p());
3963 Vec4 pi(trialEvent[splitInfo.iRecAft].p());
3964 Vec4 p2(trialEvent[splitInfo.iEmtAft].p());
3966 int size = splitInfo.iSiblings.size();
3968 for (
int i = 0; i < size; ++i) {
3969 if (splitInfo.iSiblings[i].first == splitInfo.iRadBef)
continue;
3970 if (splitInfo.iSiblings[i].first == splitInfo.iRecBef)
continue;
3971 iOther = splitInfo.iSiblings[i].first;
3973 Vec4 pj(state[iOther].p());
3975 double si1= 2.*pi*p1, sj1=2.*pj*p1, s12=2.*p1*p2;
3976 double si2= 2.*pi*p2, sj2=2.*pj*p2, sij=2.*pi*pj;
3977 double ct2= pow2(si1*sj2-si2*sj1) / (s12*sij*(si1+si2)*(sj1+sj2));
3981 double wij12 = 1. - (sij*s12) / ((si1 + si2)*(sj1 + sj2));
3982 wt_base_as1 = preFac*(1.- ct2)*wij12;
3986 if (doGeneralizedKernel) {
3987 wt_base_as1 = preFac * ( pow(1.-z,2.) + pow(z,2.) )
3988 * ( 1./z*cCoef(-1) + cCoef(0) + z*cCoef(1) + z*z*cCoef(2))
3989 * exp(1./z*cExp(-1) + cExp(0) + z*cExp(1) + z*z*cExp(2))
3992 wt_base_as1 = preFac * ( pow(1.-z,2.) + pow(z,2.) );
3997 if (order == -1) wt_base_as1 = 0.0;
4000 double scale2 = couplingScale2 ( z, pT2, m2dip,
4001 make_pair (splitInfo.radBef()->id, splitInfo.radBef()->isFinal),
4002 make_pair (splitInfo.recBef()->id, splitInfo.recBef()->isFinal));
4003 if (scale2 < 0.) scale2 = pT2;
4005 wts.insert( make_pair(
"base", wt_base_as1 ));
4008 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
4009 wts.insert( make_pair(
"Variations:muRfsrDown", wt_base_as1 ));
4010 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
4011 wts.insert( make_pair(
"Variations:muRfsrUp", wt_base_as1 ));
4015 bool doMassive = (abs(splitType) == 2);
4019 double vijk = 1., pipj = 0.;
4022 if (splitType == 2) {
4024 double yCS = kappa2 / (1.-z);
4025 double nu2Rad = m2Rad/m2dip;
4026 double nu2Emt = m2Emt/m2dip;
4027 double nu2Rec = m2Rec/m2dip;
4028 vijk = pow2(1.-yCS) - 4.*(yCS+nu2Rad+nu2Emt)*nu2Rec;
4029 vijk = sqrt(vijk) / (1-yCS);
4030 pipj = m2dip * yCS /2.;
4033 }
else if (splitType ==-2) {
4035 double xCS = 1 - kappa2/(1.-z);
4037 pipj = m2dip/2. * (1-xCS)/xCS;
4040 wt_base_as1 = preFac * 1. / vijk * m2Emt / (pipj + m2Emt);
4041 if (doGeneralizedKernel) {
4042 wt_base_as1 += preFac * 1. / vijk * ( pow(1.-z,2.) + pow(z,2.) )
4043 * ( 1./z*cCoef(-1) + cCoef(0) + z*cCoef(1) + z*z*cCoef(2))
4044 * exp(1./z*cExp(-1) + cExp(0) + z*cExp(1) + z*z*cExp(2))
4047 wt_base_as1 += preFac * 1. / vijk * (pow(1.-z,2.) + pow(z,2.));
4051 if (order == -1) wt_base_as1 = 0.0;
4054 for ( unordered_map<string,double>::iterator it = wts.begin();
4055 it != wts.end(); ++it)
4056 it->second = wt_base_as1;
4061 if (!doMassive && order == 3) {
4062 for ( unordered_map<string,double>::iterator it = wts.begin();
4063 it !=wts.end(); ++it) {
4065 if (it->first ==
"base")
4066 mukf = renormMultFac;
4067 else if (it->first ==
"Variations:muRfsrDown")
4068 mukf = settingsPtr->parm(
"Variations:muRfsrDown");
4069 else if (it->first ==
"Variations:muRfsrUp")
4070 mukf = settingsPtr->parm(
"Variations:muRfsrUp");
4074 if (scale2 < pT2minVariations) mukf = renormMultFac;
4076 double NF = getNF(scale2 * mukf);
4077 double alphasPT2pi = as2Pi(scale2, order, mukf);
4079 double pgq1 = preFac * (
4080 (TF*(-8./3. - (8*(1 + 2*(-1 + z)*z)*(2 + 3*log(1 - z) + 3*log(z)))/9.)
4081 + CF*(-2 + 3*z - 4*log(1 - z) + (-7 + 8*z)*log(z) + (1 - 2*z)
4083 (2*(1 + 2*(-1 + z)*z)*(15 - 24*DiLog(z) + 3*log(-1 + 1/z) -
4084 24*log(1 - z)*log(z) + pow2(M_PI) + 3*pow2(log(-((-1 + z)*z)))))/3.) +
4085 (CA*(-152 - 40/z + 166*z + 36*log(1 - z) - 12*(1 + 19*z)*log(z) +
4086 (1 + 2*(-1 + z)*z)*(178 - 144*DiLog(z) + log(1 - z)*(30 - 72*log(z)) -
4087 3*log(z)*(4 + 3*log(z)) + 3*pow2(M_PI) +
4088 18*pow2(log(1 - z))) + 9*(2 + 8*z)*pow2(log(z)) +
4089 3*(1 + 2*z*(1 + z))*(-12*DiLog(1/(1 + z)) + pow2(M_PI) +
4090 3*pow2(log(z)) - 6*pow2(log(1 + z)))))/9.)/2.
4094 pgq1 += - preFac * 0.5 * 40./9. * CA * ( z /(z*z + kappa2) - 1./z);
4096 it->second += alphasPT2pi*pgq1;
4102 for ( unordered_map<string,double>::iterator it = wts.begin();
4103 it != wts.end(); ++it )
4108 if (order > 0) wts.insert( make_pair(
"base_order_as2",
4109 wts[
"base"] - wt_base_as1 ));
4113 for ( unordered_map<string,double>::iterator it = wts.begin();
4114 it != wts.end(); ++it )
4115 kernelVals.insert(make_pair( it->first, it->second ));
4128 bool Dire_fsr_qcd_G2QQ2::canRadiate (
const Event& state, pair<int,int> ints,
4129 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*) {
4130 return ( state[ints.first].isFinal()
4131 && state[ints.second].colType() != 0
4132 && hasSharedColor(state, ints.first, ints.second)
4133 && state[ints.first].id() == 21 );
4136 bool Dire_fsr_qcd_G2QQ2::canRadiate (
const Event& state,
int iRadBef,
4137 int iRecBef, Settings*, PartonSystems*, BeamParticle*) {
4138 return ( state[iRadBef].isFinal()
4139 && state[iRecBef].colType() != 0
4140 && hasSharedColor(state, iRadBef, iRecBef)
4141 && state[iRadBef].
id() == 21);
4144 int Dire_fsr_qcd_G2QQ2::kinMap() {
return 1;}
4145 int Dire_fsr_qcd_G2QQ2::motherID(
int) {
return -1;}
4146 int Dire_fsr_qcd_G2QQ2::sisterID(
int) {
return -1;}
4147 double Dire_fsr_qcd_G2QQ2::gaugeFactor (
int,
int ) {
return NF_qcd_fsr*TR;}
4148 double Dire_fsr_qcd_G2QQ2::symmetryFactor (
int,
int ) {
return 0.5;}
4150 int Dire_fsr_qcd_G2QQ2::radBefID(
int,
int){
return 21;}
4151 pair<int,int> Dire_fsr_qcd_G2QQ2::radBefCols(
4152 int colRadAfter,
int acolRadAfter,
4153 int colEmtAfter,
int acolEmtAfter) {
4154 int col = (colRadAfter > 0) ? colRadAfter : colEmtAfter;
4155 int acol = (acolRadAfter > 0) ? acolRadAfter : acolEmtAfter;
4156 return make_pair(col,acol);
4159 vector <int> Dire_fsr_qcd_G2QQ2::recPositions(
const Event& state,
int iRad,
4162 int colRad = state[iRad].col();
4163 int acolRad = state[iRad].acol();
4164 int colEmt = state[iEmt].col();
4165 int acolEmt = state[iEmt].acol();
4166 int colShared = (colRad > 0 && colRad == acolEmt) ? colRad
4167 : (acolRad > 0 && colEmt == acolRad) ? colEmt : 0;
4169 vector<int> iExc(1,iRad); iExc.push_back(iEmt);
4175 if ( colRad != 0 && colRad != colShared) {
4176 int acolF = findCol(colRad, iExc, state, 1);
4177 int colI = findCol(colRad, iExc, state, 2);
4178 if (acolF > 0 && colI == 0) recs.push_back (acolF);
4179 if (acolF == 0 && colI > 0) recs.push_back (colI);
4182 if ( acolRad != 0 && acolRad != colShared) {
4183 int colF = findCol(acolRad, iExc, state, 2);
4184 int acolI = findCol(acolRad, iExc, state, 1);
4185 if ( colF > 0 && acolI == 0) recs.push_back (colF);
4186 if ( colF == 0 && acolI > 0) recs.push_back (acolI);
4194 double Dire_fsr_qcd_G2QQ2::zSplit(
double zMinAbs,
double zMaxAbs,
double) {
4195 return (zMinAbs + rndmPtr->flat() * (zMaxAbs - zMinAbs));
4199 double Dire_fsr_qcd_G2QQ2::overestimateInt(
double zMinAbs,
double zMaxAbs,
4200 double,
double,
int) {
4202 double preFac = symmetryFactor() * gaugeFactor();
4203 wt = 2.*preFac * 0.5 * ( zMaxAbs - zMinAbs);
4208 double Dire_fsr_qcd_G2QQ2::overestimateDiff(
double,
double,
int) {
4210 double preFac = symmetryFactor() * gaugeFactor();
4211 wt = 2.*preFac * 0.5;
4216 bool Dire_fsr_qcd_G2QQ2::calc(
const Event& state,
int orderNow) {
4219 if (
false) cout << state[0].e() << orderNow << endl;
4222 double z(splitInfo.kinematics()->z), pT2(splitInfo.kinematics()->pT2),
4223 m2dip(splitInfo.kinematics()->m2Dip),
4224 m2Rad(splitInfo.kinematics()->m2RadAft),
4225 m2Rec(splitInfo.kinematics()->m2Rec),
4226 m2Emt(splitInfo.kinematics()->m2EmtAft);
4227 int splitType(splitInfo.type);
4229 double preFac = symmetryFactor() * gaugeFactor();
4230 int order = (orderNow > -1) ? orderNow : correctionOrder;
4231 double kappa2 = max(pow2(settingsPtr->parm(
"TimeShower:pTmin"))
4234 unordered_map<string,double> wts;
4235 double wt_base_as1 = 0.;
4239 if ( doCorrelations && direInfoPtr->isSoft(splitInfo.iRadBef)) {
4240 Event trialEvent(state);
4241 bool physical =
false;
4242 if (splitInfo.recBef()->isFinal)
4243 physical = fsr->branch_FF(trialEvent,
true, &splitInfo);
4245 physical = fsr->branch_FI(trialEvent,
true, &splitInfo);
4248 wts.insert( make_pair(
"base", 0.) );
4249 if (doVariations && settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
4250 wts.insert( make_pair(
"Variations:muRfsrDown", 0.));
4251 if (doVariations && settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
4252 wts.insert( make_pair(
"Variations:muRfsrUp", 0.));
4254 for ( unordered_map<string,double>::iterator it = wts.begin();
4256 ++it ) kernelVals.insert(make_pair( it->first, it->second ));
4261 Vec4 p1(trialEvent[splitInfo.iRadAft].p());
4262 Vec4 pi(trialEvent[splitInfo.iRecAft].p());
4263 Vec4 p2(trialEvent[splitInfo.iEmtAft].p());
4265 int size = splitInfo.iSiblings.size();
4267 for (
int i = 0; i < size; ++i) {
4268 if (splitInfo.iSiblings[i].first == splitInfo.iRadBef)
continue;
4269 if (splitInfo.iSiblings[i].first == splitInfo.iRecBef)
continue;
4270 iOther = splitInfo.iSiblings[i].first;
4272 Vec4 pj(state[iOther].p());
4274 double si1= 2.*pi*p1, sj1=2.*pj*p1, s12=2.*p1*p2;
4275 double si2= 2.*pi*p2, sj2=2.*pj*p2, sij=2.*pi*pj;
4276 double ct2= pow2(si1*sj2-si2*sj1) / (s12*sij*(si1+si2)*(sj1+sj2));
4280 double wij12 = 1. - (sij*s12) / ((si1 + si2)*(sj1 + sj2));
4281 wt_base_as1 = preFac*(1.- ct2)*wij12;
4285 if (doGeneralizedKernel) {
4286 wt_base_as1 = preFac * ( pow(1.-z,2.) + pow(z,2.) )
4287 * ( 1./z*cCoef(-1) + cCoef(0) + z*cCoef(1) + z*z*cCoef(2))
4288 * exp(1./z*cExp(-1) + cExp(0) + z*cExp(1) + z*z*cExp(2))
4291 wt_base_as1 = preFac * ( pow(1.-z,2.) + pow(z,2.) );
4296 if (order == -1) wt_base_as1 = 0.0;
4299 double scale2 = couplingScale2 ( z, pT2, m2dip,
4300 make_pair (splitInfo.radBef()->id, splitInfo.radBef()->isFinal),
4301 make_pair (splitInfo.recBef()->id, splitInfo.recBef()->isFinal));
4302 if (scale2 < 0.) scale2 = pT2;
4304 wts.insert( make_pair(
"base", wt_base_as1 ));
4307 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
4308 wts.insert( make_pair(
"Variations:muRfsrDown", wt_base_as1 ));
4309 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
4310 wts.insert( make_pair(
"Variations:muRfsrUp", wt_base_as1 ));
4313 bool doMassive = (abs(splitType) == 2);
4317 double vijk = 1., pipj = 0.;
4320 if (splitType == 2) {
4322 double yCS = kappa2 / (1.-z);
4323 double nu2Rad = m2Rad/m2dip;
4324 double nu2Emt = m2Emt/m2dip;
4325 double nu2Rec = m2Rec/m2dip;
4326 vijk = pow2(1.-yCS) - 4.*(yCS+nu2Rad+nu2Emt)*nu2Rec;
4327 vijk = sqrt(vijk) / (1-yCS);
4328 pipj = m2dip * yCS /2.;
4331 }
else if (splitType ==-2) {
4333 double xCS = 1 - kappa2/(1.-z);
4335 pipj = m2dip/2. * (1-xCS)/xCS;
4338 wt_base_as1 = preFac * 1. / vijk * m2Emt / (pipj + m2Emt);
4339 if (doGeneralizedKernel) {
4340 wt_base_as1 += preFac * 1. / vijk * ( pow(1.-z,2.) + pow(z,2.) )
4341 * ( 1./z*cCoef(-1) + cCoef(0) + z*cCoef(1) + z*z*cCoef(2))
4342 * exp(1./z*cExp(-1) + cExp(0) + z*cExp(1) + z*z*cExp(2))
4345 wt_base_as1 += preFac * 1. / vijk * (pow(1.-z,2.) + pow(z,2.));
4349 if (order == -1) wt_base_as1 = 0.0;
4352 for ( unordered_map<string,double>::iterator it = wts.begin();
4353 it != wts.end(); ++it)
4354 it->second = wt_base_as1;
4359 if (!doMassive && order == 3) {
4360 for ( unordered_map<string,double>::iterator it = wts.begin();
4361 it !=wts.end(); ++it){
4363 if (it->first ==
"base")
4364 mukf = renormMultFac;
4365 else if (it->first ==
"Variations:muRfsrDown")
4366 mukf = settingsPtr->parm(
"Variations:muRfsrDown");
4367 else if (it->first ==
"Variations:muRfsrUp")
4368 mukf = settingsPtr->parm(
"Variations:muRfsrUp");
4372 if (scale2 < pT2minVariations) mukf = renormMultFac;
4374 double NF = getNF(scale2 * mukf);
4375 double alphasPT2pi = as2Pi(scale2, order, mukf);
4378 double pgq1 = preFac * (
4379 (TF*(-8./3. - (8*(1 + 2*(-1 + x)*x)*(2 + 3*log(1 - x) + 3*log(x)))/9.)
4380 + CF*(-2 + 3*x - 4*log(1 - x) + (-7 + 8*x)*log(x) + (1 - 2*x)
4382 (2*(1 + 2*(-1 + x)*x)*(15 - 24*DiLog(x) + 3*log(-1 + 1/x) - 24
4383 *log(1 - x)*log(x) + pow2(M_PI) + 3*pow2(log(-((-1 + x)*x)))))/3.) +
4384 (CA*(-152 - 40/x + 166*x + 36*log(1 - x) - 12*(1 + 19*x)*log(x) +
4385 (1 + 2*(-1 + x)*x)*(178 - 144*DiLog(x) + log(1 - x)*(30 - 72*log(x)) -
4386 3*log(x)*(4 + 3*log(x)) + 3*pow2(M_PI) +
4387 18*pow2(log(1 - x))) + 9*(2 + 8*x)*pow2(log(x)) +
4388 3*(1 + 2*x*(1 + x))*(-12*DiLog(1/(1 + x)) + pow2(M_PI) +
4389 3*pow2(log(x)) - 6*pow2(log(1 + x)))))/9.)/2.
4393 pgq1 += - preFac * 0.5 * 40./9. * CA * ( x /(x*x + kappa2) - 1./x);
4395 it->second += alphasPT2pi*pgq1;
4401 for ( unordered_map<string,double>::iterator it = wts.begin();
4402 it != wts.end(); ++it )
4403 it->second *= (1-z);
4405 wt_base_as1 *= (1-z);
4407 if (order > 0) wts.insert( make_pair(
"base_order_as2",
4408 wts[
"base"] - wt_base_as1 ));
4412 for ( unordered_map<string,double>::iterator it = wts.begin();
4413 it != wts.end(); ++it )
4414 kernelVals.insert(make_pair( it->first, it->second ));
4427 bool Dire_fsr_qcd_Q2qQqbarDist::canRadiate (
const Event& state,
4428 pair<int,int> ints, unordered_map<string,bool>, Settings*, PartonSystems*,
4430 return ( state[ints.first].isFinal()
4431 && state[ints.second].colType() != 0
4432 && hasSharedColor(state, ints.first, ints.second)
4433 && state[ints.first].isQuark() );
4436 bool Dire_fsr_qcd_Q2qQqbarDist::canRadiate (
const Event& state,
int iRadBef,
4437 int iRecBef, Settings*, PartonSystems*, BeamParticle*) {
4438 if (orderSave < 3)
return false;
4439 return ( state[iRadBef].isFinal()
4440 && state[iRecBef].colType() != 0
4441 && hasSharedColor(state, iRadBef, iRecBef)
4442 && state[iRadBef].isQuark());
4445 int Dire_fsr_qcd_Q2qQqbarDist::kinMap() {
return 2;}
4446 int Dire_fsr_qcd_Q2qQqbarDist::motherID(
int idDaughter) {
return idDaughter;}
4447 int Dire_fsr_qcd_Q2qQqbarDist::sisterID(
int) {
return 1;}
4448 double Dire_fsr_qcd_Q2qQqbarDist::gaugeFactor (
int,
int ) {
return CF;}
4449 double Dire_fsr_qcd_Q2qQqbarDist::symmetryFactor (
int,
int ) {
return 1.;}
4451 int Dire_fsr_qcd_Q2qQqbarDist::radBefID(
int idRA,
int) {
4452 if (particleDataPtr->isQuark(idRA))
return idRA;
4455 pair<int,int> Dire_fsr_qcd_Q2qQqbarDist::radBefCols(
4456 int colRadAfter,
int,
4457 int colEmtAfter,
int acolEmtAfter) {
4458 bool isQuark = (colRadAfter > 0);
4459 if (isQuark)
return make_pair(colEmtAfter,0);
4460 return make_pair(0,acolEmtAfter);
4464 double Dire_fsr_qcd_Q2qQqbarDist::zSplit(
double zMinAbs,
double zMaxAbs,
4467 double Rz = rndmPtr->flat();
4468 double kappa4 = pow(settingsPtr->parm(
"TimeShower:pTmin"), 4) / pow2(m2dip);
4471 res = pow( (kappa4 + zMaxAbs)/(kappa4 + zMinAbs), -Rz )
4472 * (kappa4 + zMaxAbs - kappa4
4473 *pow((kappa4 + zMaxAbs)/(kappa4 + zMinAbs), Rz));
4480 double Dire_fsr_qcd_Q2qQqbarDist::overestimateInt(
double zMinAbs,
4481 double zMaxAbs,
double,
double m2dip,
int orderNow) {
4484 int order = (orderNow > -1) ? orderNow : correctionOrder;
4485 if (order != 3)
return 0.0;
4487 double preFac = symmetryFactor() * gaugeFactor();
4488 double pT2min = pow2(settingsPtr->parm(
"TimeShower:pTmin"));
4489 double kappa4 = pow2(pT2min/m2dip);
4492 double wt = preFac * TR * 2. * ( NF_qcd_fsr - 1. ) * 20./9.
4493 * log( ( kappa4 + zMaxAbs) / ( kappa4 + zMinAbs) );
4496 wt *= as2Pi(pT2min);
4503 double Dire_fsr_qcd_Q2qQqbarDist::overestimateDiff(
double z,
double m2dip,
4507 int order = (orderNow > -1) ? orderNow : correctionOrder;
4508 if (order < 3)
return 0.0;
4510 double preFac = symmetryFactor() * gaugeFactor();
4511 double pT2min = pow2(settingsPtr->parm(
"TimeShower:pTmin"));
4512 double kappa4 = pow2(pT2min/m2dip);
4514 double wt = preFac * TR * 2. * ( NF_qcd_fsr - 1. ) * 20./ 9. * 1
4518 wt *= as2Pi(pT2min);
4525 bool Dire_fsr_qcd_Q2qQqbarDist::calc(
const Event& state,
int orderNow) {
4528 if (
false) cout << state[0].e() << orderNow << endl;
4531 double z(splitInfo.kinematics()->z),
4532 pT2(splitInfo.kinematics()->pT2),
4533 m2dip(splitInfo.kinematics()->m2Dip),
4534 xa(splitInfo.kinematics()->xa),
4535 sai(splitInfo.kinematics()->sai),
4536 m2aij(splitInfo.kinematics()->m2RadBef),
4537 m2a(splitInfo.kinematics()->m2RadAft),
4538 m2i(splitInfo.kinematics()->m2EmtAft),
4539 m2j(splitInfo.kinematics()->m2EmtAft2),
4540 m2k(splitInfo.kinematics()->m2Rec);
4543 double scale2 = couplingScale2 ( z, pT2, m2dip,
4544 make_pair (splitInfo.radBef()->id, splitInfo.radBef()->isFinal),
4545 make_pair (splitInfo.recBef()->id, splitInfo.recBef()->isFinal));
4546 if (scale2 < 0.) scale2 = pT2;
4549 unordered_map<string,double> wts;
4550 int order = (orderNow > -1) ? orderNow : correctionOrder;
4551 if (order < 3 || m2aij > 0. || m2a > 0. || m2i > 0. || m2j > 0. || m2k > 0.){
4552 wts.insert( make_pair(
"base", 0.) );
4553 if (doVariations && settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
4554 wts.insert( make_pair(
"Variations:muRfsrDown", 0.));
4555 if (doVariations && settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
4556 wts.insert( make_pair(
"Variations:muRfsrUp", 0.));
4558 for ( unordered_map<string,double>::iterator it = wts.begin();
4559 it != wts.end(); ++it )
4560 kernelVals.insert(make_pair( it->first, it->second ));
4566 bool isEndpoint = (rndmPtr->flat() < 0.5);
4568 Event trialEvent(state);
4569 bool physical =
false;
4570 if (splitInfo.recBef()->isFinal)
4571 physical = fsr->branch_FF(trialEvent,
true, &splitInfo);
4573 physical = fsr->branch_FI(trialEvent,
true, &splitInfo);
4576 Vec4 pa(trialEvent[splitInfo.iRadAft].p());
4577 Vec4 pk(trialEvent[splitInfo.iRecAft].p());
4578 Vec4 pi(trialEvent[splitInfo.iEmtAft].p());
4579 Vec4 pj(trialEvent[splitInfo.iEmtAft2].p());
4582 if ( abs(pa.m2Calc()-m2a) > sai || abs(pi.m2Calc()-m2i) > sai
4583 || abs(pj.m2Calc()-m2j) > sai || abs(pk.m2Calc()-m2k) > sai)
4587 wts.insert( make_pair(
"base", 0.) );
4588 if (doVariations && settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
4589 wts.insert( make_pair(
"Variations:muRfsrDown", 0.));
4590 if (doVariations && settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
4591 wts.insert( make_pair(
"Variations:muRfsrUp", 0.));
4593 for ( unordered_map<string,double>::iterator it = wts.begin();
4594 it != wts.end(); ++it )
4595 kernelVals.insert(make_pair( it->first, it->second ));
4599 double sign = (splitInfo.recBef()->isFinal) ? 1. : -1.;
4600 double p2ai(sai + m2a + m2i),
4601 p2aj((pa+pj).m2Calc()),
4602 p2ak(sign*(pa+sign*pk).m2Calc()),
4603 p2ij((pi+pj).m2Calc()),
4604 p2ik(sign*(pi+sign*pk).m2Calc()),
4605 p2jk(sign*(pj+sign*pk).m2Calc());
4606 double q2 = sign*(pa+pi+pj+sign*pk).m2Calc();
4607 double saij = (pa+pi+pj).m2Calc();
4608 double yaij = (splitInfo.recBef()->isFinal) ? saij / q2 : 0.;
4611 double z1(z/(1.-yaij)), z2( z/xa/(1-yaij) - z1 ), z3(1-z1-z2);
4615 prob = CF*TR*((1.0+z3*z3)/(1.0-z3)
4616 +(1.0-2.0*z1*z2/pow2(z1+z2))*(1.0-z3+(1.0+z3*z3)/(1.0-z3)
4617 *(log(z1*z2*z3)-1.0)));
4618 prob-= CF*TR*2.0*((1.0+z3*z3)/(1.0-z3)*log(z3*(1.0-z3)) +1.0-z3)
4619 *(1.0-2.0*z1*z2/pow2(z1+z2));
4622 prob *= 2. * ( NF_qcd_fsr - 1. );
4628 prob *= 1. / (1.-p2ai/saij);
4632 double s12(p2ai), s13(p2aj), s23(p2ij), s123(saij);
4633 double t123 = 2.*(z1*s23 - z2*s13)/(z1+z2) + (z1-z2)/(z1+z2)*s12;
4634 double CG = 0.5*CF*TR*s123/s12
4635 *( - pow2(t123)/ (s12*s123)
4636 + (4.*z3 + pow2(z1-z2))/(z1+z2) + z1 + z2 - s12/s123 );
4637 double cosPhiKT1KT3 = pow2(p2ij*p2ak - p2aj*p2ik + p2ai*p2jk)
4638 / (4.*p2ai*p2ij*p2ak*p2jk);
4639 double subt = CF*TR*s123/s12
4640 * ( (1.+z3*z3) / (1.-z3) * (1.-2.*z1*z2/pow2(1-z3))
4641 + 4.*z1*z2*z3 / pow(1.-z3,3) * (1-2.*cosPhiKT1KT3) );
4644 if ( abs(s12) < 1e-10) prob = 0.0;
4647 prob *= 2. * ( NF_qcd_fsr - 1. );
4653 prob *= 1. / (1.-p2ai/saij);
4658 if (isEndpoint) { splitInfo.set_sai(0.0); }
4661 wts.insert( make_pair(
"base", prob * as2Pi(scale2, order, renormMultFac) ));
4664 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
4665 wts.insert( make_pair(
"Variations:muRfsrDown", prob
4666 * as2Pi(scale2, order, (scale2 > pT2minVariations)
4667 ? settingsPtr->parm(
"Variations:muRfsrDown")*renormMultFac :
4669 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
4670 wts.insert( make_pair(
"Variations:muRfsrUp", prob
4671 * as2Pi(scale2, order, (scale2 > pT2minVariations)
4672 ? settingsPtr->parm(
"Variations:muRfsrUp")*renormMultFac :
4678 for ( unordered_map<string,double>::iterator it = wts.begin();
4679 it != wts.end(); ++it )
4683 wts.insert( make_pair(
"base_order_as2", wts[
"base"] ));
4687 for ( unordered_map<string,double>::iterator it = wts.begin();
4688 it != wts.end(); ++it )
4689 kernelVals.insert(make_pair( it->first, it->second ));
4701 bool Dire_fsr_qcd_Q2QbarQQId::canRadiate (
const Event& state,
4703 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*) {
4704 return ( state[ints.first].isFinal()
4705 && state[ints.second].colType() != 0
4706 && hasSharedColor(state, ints.first, ints.second)
4707 && state[ints.first].isQuark() );
4710 bool Dire_fsr_qcd_Q2QbarQQId::canRadiate (
const Event& state,
int iRadBef,
4711 int iRecBef, Settings*, PartonSystems*, BeamParticle*) {
4712 if (orderSave < 3)
return false;
4713 return ( state[iRadBef].isFinal()
4714 && state[iRecBef].colType() != 0
4715 && hasSharedColor(state, iRadBef, iRecBef)
4716 && state[iRadBef].isQuark());
4719 int Dire_fsr_qcd_Q2QbarQQId::kinMap() {
return 2;}
4720 int Dire_fsr_qcd_Q2QbarQQId::motherID(
int idDaughter) {
return idDaughter;}
4721 int Dire_fsr_qcd_Q2QbarQQId::sisterID(
int) {
return 1;}
4722 double Dire_fsr_qcd_Q2QbarQQId::gaugeFactor (
int,
int ) {
return CF;}
4723 double Dire_fsr_qcd_Q2QbarQQId::symmetryFactor (
int,
int ) {
return 1.;}
4725 int Dire_fsr_qcd_Q2QbarQQId::radBefID(
int idRA,
int) {
4726 if (particleDataPtr->isQuark(idRA))
return idRA;
4729 pair<int,int> Dire_fsr_qcd_Q2QbarQQId::radBefCols(
4730 int colRadAfter,
int,
4731 int colEmtAfter,
int acolEmtAfter) {
4732 bool isQuark = (colRadAfter > 0);
4733 if (isQuark)
return make_pair(colEmtAfter,0);
4734 return make_pair(0,acolEmtAfter);
4738 double Dire_fsr_qcd_Q2QbarQQId::zSplit(
double zMinAbs,
double zMaxAbs,
4742 double Rz = rndmPtr->flat();
4743 double kappaMin2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
4744 double p = (kappaMin2 + zMaxAbs*zMaxAbs)
4745 / (kappaMin2 + zMinAbs*zMinAbs);
4746 double res = sqrt( (kappaMin2 + zMaxAbs*zMaxAbs - kappaMin2*pow(p,Rz))
4753 double Dire_fsr_qcd_Q2QbarQQId::overestimateInt(
double zMinAbs,
double zMaxAbs,
4754 double,
double m2dip,
int orderNow) {
4757 int order = (orderNow > -1) ? orderNow : correctionOrder;
4758 if (order != 3)
return 0.0;
4761 double preFac = symmetryFactor() * gaugeFactor();
4762 double pT2min = pow2(settingsPtr->parm(
"TimeShower:pTmin"));
4763 double kappaMin2 = pT2min/m2dip;
4764 double wt = preFac * TR * 20./9.
4765 * 0.5 * log( ( kappaMin2 + zMaxAbs*zMaxAbs)
4766 / ( kappaMin2 + zMinAbs*zMinAbs) );
4768 wt *= as2Pi(pT2min);
4774 double Dire_fsr_qcd_Q2QbarQQId::overestimateDiff(
double z,
double m2dip,
4778 int order = (orderNow > -1) ? orderNow : correctionOrder;
4779 if (order < 3)
return 0.0;
4781 double preFac = symmetryFactor() * gaugeFactor();
4782 double pT2min = pow2(settingsPtr->parm(
"TimeShower:pTmin"));
4783 double kappaMin2 = pT2min/m2dip;
4784 double wt = preFac * TR * 20./ 9. * z / (z*z + kappaMin2);
4786 wt *= as2Pi(pT2min);
4792 bool Dire_fsr_qcd_Q2QbarQQId::calc(
const Event& state,
int orderNow) {
4795 if (
false) cout << state[0].e() << orderNow << endl;
4798 double z(splitInfo.kinematics()->z),
4799 pT2(splitInfo.kinematics()->pT2),
4800 m2dip(splitInfo.kinematics()->m2Dip),
4801 xa(splitInfo.kinematics()->xa),
4802 sai(splitInfo.kinematics()->sai),
4803 m2aij(splitInfo.kinematics()->m2RadBef),
4804 m2a(splitInfo.kinematics()->m2RadAft),
4805 m2i(splitInfo.kinematics()->m2EmtAft),
4806 m2j(splitInfo.kinematics()->m2EmtAft2),
4807 m2k(splitInfo.kinematics()->m2Rec);
4810 double scale2 = couplingScale2 ( z, pT2, m2dip,
4811 make_pair (splitInfo.radBef()->id, splitInfo.radBef()->isFinal),
4812 make_pair (splitInfo.recBef()->id, splitInfo.recBef()->isFinal));
4813 if (scale2 < 0.) scale2 = pT2;
4815 unordered_map<string,double> wts;
4816 int order = (orderNow > -1) ? orderNow : correctionOrder;
4818 if (order < 3 || m2aij > 0. || m2a > 0. || m2i > 0. || m2j > 0. || m2k > 0.){
4819 wts.insert( make_pair(
"base", 0.) );
4820 if (doVariations && settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
4821 wts.insert( make_pair(
"Variations:muRfsrDown", 0.));
4822 if (doVariations && settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
4823 wts.insert( make_pair(
"Variations:muRfsrUp", 0.));
4825 for ( unordered_map<string,double>::iterator it = wts.begin();
4826 it != wts.end(); ++it )
4827 kernelVals.insert(make_pair( it->first, it->second ));
4833 bool isEndpoint = (rndmPtr->flat() < 0.5);
4835 Event trialEvent(state);
4836 bool physical =
false;
4837 if (splitInfo.recBef()->isFinal)
4838 physical = fsr->branch_FF(trialEvent,
true, &splitInfo);
4840 physical = fsr->branch_FI(trialEvent,
true, &splitInfo);
4843 Vec4 pa(trialEvent[splitInfo.iRadAft].p());
4844 Vec4 pk(trialEvent[splitInfo.iRecAft].p());
4845 Vec4 pi(trialEvent[splitInfo.iEmtAft].p());
4846 Vec4 pj(trialEvent[splitInfo.iEmtAft2].p());
4849 if ( abs(pa.m2Calc()-m2a) > sai || abs(pi.m2Calc()-m2i) > sai
4850 || abs(pj.m2Calc()-m2j) > sai || abs(pk.m2Calc()-m2k) > sai)
4854 wts.insert( make_pair(
"base", 0.) );
4855 if (doVariations && settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
4856 wts.insert( make_pair(
"Variations:muRfsrDown", 0.));
4857 if (doVariations && settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
4858 wts.insert( make_pair(
"Variations:muRfsrUp", 0.));
4860 for ( unordered_map<string,double>::iterator it = wts.begin();
4861 it != wts.end(); ++it )
4862 kernelVals.insert(make_pair( it->first, it->second ));
4866 double sign = (splitInfo.recBef()->isFinal) ? 1. : -1.;
4867 double p2ai(sai + m2a + m2i),
4868 p2aj((pa+pj).m2Calc()),
4869 p2ak(sign*(pa+sign*pk).m2Calc()),
4870 p2ij((pi+pj).m2Calc()),
4871 p2ik(sign*(pi+sign*pk).m2Calc()),
4872 p2jk(sign*(pj+sign*pk).m2Calc());
4873 double q2 = sign*(pa+pi+pj+sign*pk).m2Calc();
4874 double saij = (pa+pi+pj).m2Calc();
4875 double yaij = (splitInfo.recBef()->isFinal) ? saij / q2 : 0.;
4878 double z1(z/(1.-yaij)), z2( z/xa/(1-yaij) - z1 ), z3(1-z1-z2);
4882 prob = CF*TR*((1.0+z3*z3)/(1.0-z3)
4883 +(1.0-2.0*z1*z2/pow2(z1+z2))*(1.0-z3+(1.0+z3*z3)/(1.0-z3)
4884 *(log(z1*z2*z3)-1.0)));
4886 prob+= CF*TR*((1.0+z2*z2)/(1.0-z2)
4887 +(1.0-2.0*z1*z3/pow2(z1+z3))*(1.0-z2+(1.0+z2*z2)/(1.0-z2)
4888 *(log(z1*z3*z2)-1.0)));
4890 prob-= CF*TR*2.0*((1.0+z3*z3)/(1.0-z3)*log(z3*(1.0-z3)) +1.0-z3)
4891 *(1.0-2.0*z1*z2/pow2(z1+z2));
4893 prob-= CF*TR*2.0*((1.0+z2*z2)/(1.0-z2)*log(z2*(1.0-z2)) +1.0-z2)
4894 *(1.0-2.0*z1*z3/pow2(z1+z3));
4901 prob *= 1. / (1.-p2ai/saij);
4905 double s12(p2ai), s13(p2aj), s23(p2ij), s123(saij);
4906 double t123 = 2.*(z1*s23 - z2*s13)/(z1+z2) + (z1-z2)/(z1+z2)*s12;
4907 double CG = 0.5*CF*TR*s123/s12
4908 *( - pow2(t123)/ (s12*s123)
4909 + (4.*z3 + pow2(z1-z2))/(z1+z2) + z1 + z2 - s12/s123 );
4911 double t132 = 2.*(z1*s23 - z3*s12)/(z1+z3) + (z1-z3)/(z1+z3)*s13;
4912 CG += 0.5*CF*TR*s123/s13
4913 *( - pow2(t132)/ (s13*s123)
4914 + (4.*z2 + pow2(z1-z3))/(z1+z3) + z1 + z3 - s13/s123 );
4916 CG += CF*(CF-0.5*CA)
4918 + s123/s12 * ( (1.+z1*z1)/(1-z2) - 2.*z2/(1.-z3) )
4919 - s123*s123/(s12*s13) * 0.5*z1*(1.+z1*z1) / ((1.-z2)*(1.-z3)));
4921 CG += CF*(CF-0.5*CA)
4923 + s123/s13 * ( (1.+z1*z1)/(1-z3) - 2.*z3/(1.-z2) )
4924 - s123*s123/(s13*s12) * 0.5*z1*(1.+z1*z1) / ((1.-z3)*(1.-z2)));
4926 double cosPhiKT1KT3 = pow2(p2ij*p2ak - p2aj*p2ik + p2ai*p2jk)
4927 / (4.*p2ai*p2ij*p2ak*p2jk);
4928 double subt = CF*TR*s123/s12
4929 * ( (1.+z3*z3) / (1.-z3) * (1.-2.*z1*z2/pow2(1-z3))
4930 + 4.*z1*z2*z3 / pow(1.-z3,3) * (1-2.*cosPhiKT1KT3) );
4932 double cosPhiKT1KT2 = pow2(p2ij*p2ak + p2aj*p2ik - p2ai*p2jk)
4933 / (4.*p2aj*p2ij*p2ak*p2ik);
4934 subt += CF*TR*s123/s13
4935 * ( (1.+z2*z2) / (1.-z2) * (1.-2.*z1*z3/pow2(1-z2))
4936 + 4.*z1*z3*z2 / pow(1.-z2,3) * (1-2.*cosPhiKT1KT2) );
4939 if ( abs(s12) < 1e-10) prob = 0.0;
4946 prob *= 1. / (1.-p2ai/saij);
4951 prob *= (z/xa - z) / ( 1- z);
4954 if (isEndpoint) { splitInfo.set_sai(0.0); }
4956 wts.insert( make_pair(
"base", prob*as2Pi(scale2, order, renormMultFac) ));
4960 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
4961 wts.insert( make_pair(
"Variations:muRfsrDown", prob
4962 * as2Pi(scale2, order, (scale2 > pT2minVariations)
4963 ? settingsPtr->parm(
"Variations:muRfsrDown")*renormMultFac :
4965 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
4966 wts.insert( make_pair(
"Variations:muRfsrUp", prob
4967 * as2Pi(scale2, order, (scale2 > pT2minVariations)
4968 ? settingsPtr->parm(
"Variations:muRfsrUp")*renormMultFac :
4974 for ( unordered_map<string,double>::iterator it = wts.begin();
4975 it != wts.end(); ++it )
4979 wts.insert( make_pair(
"base_order_as2", wts[
"base"] ));
4983 for ( unordered_map<string,double>::iterator it = wts.begin();
4984 it != wts.end(); ++it )
4985 kernelVals.insert(make_pair( it->first, it->second ));
4998 bool Dire_isr_qcd_Q2QG::canRadiate (
const Event& state, pair<int,int> ints,
4999 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*) {
5000 return (!state[ints.first].isFinal()
5001 && state[ints.second].colType() != 0
5002 && hasSharedColor(state, ints.first, ints.second)
5003 && state[ints.first].isQuark() );
5006 bool Dire_isr_qcd_Q2QG::canRadiate (
const Event& state,
int iRadBef,
5007 int iRecBef, Settings*, PartonSystems*, BeamParticle*) {
5008 return ( !state[iRadBef].isFinal()
5009 && state[iRecBef].colType() != 0
5010 && hasSharedColor(state, iRadBef, iRecBef)
5011 && state[iRadBef].isQuark());
5014 int Dire_isr_qcd_Q2QG::kinMap() {
return 1;}
5015 int Dire_isr_qcd_Q2QG::motherID(
int idDaughter) {
return idDaughter;}
5016 int Dire_isr_qcd_Q2QG::sisterID(
int) {
return 21;}
5017 double Dire_isr_qcd_Q2QG::gaugeFactor (
int,
int ) {
return CF;}
5018 double Dire_isr_qcd_Q2QG::symmetryFactor (
int,
int ) {
return 1.;}
5020 int Dire_isr_qcd_Q2QG::radBefID(
int idRA,
int) {
5021 if (particleDataPtr->isQuark(idRA))
return idRA;
5024 pair<int,int> Dire_isr_qcd_Q2QG::radBefCols(
5025 int colRadAfter,
int acolRadAfter,
5026 int colEmtAfter,
int acolEmtAfter) {
5027 bool isQuark = (colRadAfter > 0);
5028 int colRemove = (colRadAfter == colEmtAfter)
5030 int col = (colRadAfter == colRemove)
5031 ? acolEmtAfter : colRadAfter;
5032 if (isQuark)
return make_pair(col,0);
5033 colRemove = (acolRadAfter == acolEmtAfter)
5035 int acol = (acolRadAfter == colRemove)
5036 ? colEmtAfter : acolRadAfter;
5037 return make_pair(0,acol);
5040 vector <int> Dire_isr_qcd_Q2QG::recPositions(
const Event& state,
int iRad,
5043 int colRad = state[iRad].col();
5044 int acolRad = state[iRad].acol();
5045 int colEmt = state[iEmt].col();
5046 int acolEmt = state[iEmt].acol();
5047 int colShared = (colRad > 0 && colRad == colEmt) ? colEmt
5048 : (acolRad > 0 && acolEmt == acolRad) ? acolEmt : 0;
5050 vector<int> iExc(1,iRad); iExc.push_back(iEmt);
5054 if ( colEmt != 0 && colEmt != colShared) {
5055 int acolF = findCol(colEmt, iExc, state, 1);
5056 int colI = findCol(colEmt, iExc, state, 2);
5057 if (acolF > 0 && colI == 0) recs.push_back (acolF);
5058 if (acolF == 0 && colI > 0) recs.push_back (colI);
5061 if ( acolEmt != 0 && acolEmt != colShared) {
5062 int colF = findCol(acolEmt, iExc, state, 2);
5063 int acolI = findCol(acolEmt, iExc, state, 1);
5064 if ( colF > 0 && acolI == 0) recs.push_back (colF);
5065 if ( colF == 0 && acolI > 0) recs.push_back (acolI);
5072 double Dire_isr_qcd_Q2QG::zSplit(
double zMinAbs,
double,
double m2dip) {
5073 double Rz = rndmPtr->flat();
5074 double kappa2 = pow2(settingsPtr->parm(
"SpaceShower:pTmin"))/m2dip;
5075 double p = pow( 1. + pow2(1-zMinAbs)/kappa2, Rz );
5076 double res = 1. - sqrt( p - 1. )*sqrt(kappa2);
5081 double Dire_isr_qcd_Q2QG::overestimateInt(
double zMinAbs,
double,
5082 double,
double m2dip,
int orderNow) {
5084 double preFac = symmetryFactor() * gaugeFactor();
5085 int order = (orderNow > -1) ? orderNow : correctionOrder;
5086 double kappa2 = pow2(settingsPtr->parm(
"SpaceShower:pTmin"))/m2dip;
5087 wt = preFac * softRescaleInt(order)
5088 * 2. * 0.5 * log( 1. + pow2(1.-zMinAbs)/kappa2);
5093 double Dire_isr_qcd_Q2QG::overestimateDiff(
double z,
double m2dip,
5096 double preFac = symmetryFactor() * gaugeFactor();
5097 int order = (orderNow > -1) ? orderNow : correctionOrder;
5098 double kappaOld2 = pow2(settingsPtr->parm(
"SpaceShower:pTmin"))/m2dip;
5099 wt = preFac * softRescaleInt(order)
5100 * 2.* (1.-z) / ( pow2(1.-z) + kappaOld2);
5105 bool Dire_isr_qcd_Q2QG::calc(
const Event& state,
int orderNow) {
5108 if (
false) cout << state[0].e() << orderNow << endl;
5111 double z(splitInfo.kinematics()->z), pT2(splitInfo.kinematics()->pT2),
5112 m2dip(splitInfo.kinematics()->m2Dip);
5114 double preFac = symmetryFactor() * gaugeFactor();
5115 int order = (orderNow > -1) ? orderNow : correctionOrder;
5116 double kappa2 = max(pow2(settingsPtr->parm(
"SpaceShower:pTmin"))
5119 unordered_map<string,double> wts;
5120 double wt_base_as1 = preFac * 2.*(1.-z)/(pow2(1.-z) + kappa2);
5122 if (order >= 0) wt_base_as1 += -preFac*(1.+z);
5125 double scale2 = couplingScale2 ( z, pT2, m2dip,
5126 make_pair (splitInfo.radBef()->id, splitInfo.radBef()->isFinal),
5127 make_pair (splitInfo.recBef()->id, splitInfo.recBef()->isFinal));
5128 if (scale2 < 0.) scale2 = pT2;
5130 wts.insert( make_pair(
"base", wt_base_as1
5131 * softRescaleDiff( order, scale2, renormMultFac) ));
5134 if (settingsPtr->parm(
"Variations:muRisrDown") != 1.)
5135 wts.insert( make_pair(
"Variations:muRisrDown", wt_base_as1
5136 * softRescaleDiff( order, scale2, (scale2 > pT2minVariations)
5137 ? settingsPtr->parm(
"Variations:muRisrDown")*renormMultFac :
5139 if (settingsPtr->parm(
"Variations:muRisrUp") != 1.)
5140 wts.insert( make_pair(
"Variations:muRisrUp", wt_base_as1
5141 * softRescaleDiff( order, scale2, (scale2 > pT2minVariations)
5142 ? settingsPtr->parm(
"Variations:muRisrUp")*renormMultFac :
5149 for ( unordered_map<string,double>::iterator it = wts.begin();
5150 it !=wts.end(); ++it) {
5153 if (it->first ==
"base")
5154 mukf = renormMultFac;
5155 else if (it->first ==
"Variations:muRisrDown")
5156 mukf = settingsPtr->parm(
"Variations:muRisrDown");
5157 else if (it->first ==
"Variations:muRisrUp")
5158 mukf = settingsPtr->parm(
"Variations:muRisrUp");
5162 if (scale2 < pT2minVariations) mukf = renormMultFac;
5164 double NF = getNF(scale2 * mukf);
5165 double alphasPT2pi = as2Pi(scale2, order, mukf);
5167 double pqq1 = preFac * 1 / ( 18*z*(z-1) ) * (
5168 (-1 + z)*(-8*TF*(-5 + (-1 + z)*z*(-5 + 14*z))
5169 + z*(90*CF*(-1 + z) + CA*(53 - 187*z + 3*(1 + z)*pow2(M_PI))))
5170 +3*z*log(z)*(-2*(TF + CF*(-9 + 6*(-1 + z)*z) + TF*z*(12 - z*(9 + 8*z)))
5171 + 12*CF*log(1 - z)*(1 + pow2(z)) - CA*(17 + 5*pow2(z)))
5172 -9*z*(CA - CF - 2*TF + (CA + CF + 2*TF)*pow2(z))*pow2(log(z)));
5174 pqq1 += preFac * 20./9.*TF * ( z/(pow2(z)+kappa2) - 1./z);
5176 it->second += alphasPT2pi*pqq1;
5181 if (order > 0) wts.insert( make_pair(
"base_order_as2",
5182 wts[
"base"] - wt_base_as1 ));
5186 for ( unordered_map<string,double>::iterator it = wts.begin();
5187 it != wts.end(); ++it )
5188 kernelVals.insert(make_pair( it->first, it->second ));
5201 bool Dire_isr_qcd_G2GG1::canRadiate (
const Event& state, pair<int,int> ints,
5202 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*) {
5203 return (!state[ints.first].isFinal()
5204 && state[ints.second].colType() != 0
5205 && hasSharedColor(state, ints.first, ints.second)
5206 && state[ints.first].id() == 21 );
5209 bool Dire_isr_qcd_G2GG1::canRadiate (
const Event& state,
int iRadBef,
5210 int iRecBef, Settings*, PartonSystems*, BeamParticle*) {
5211 return ( !state[iRadBef].isFinal()
5212 && state[iRecBef].colType() != 0
5213 && hasSharedColor(state, iRadBef, iRecBef)
5214 && state[iRadBef].
id() == 21);
5217 int Dire_isr_qcd_G2GG1::kinMap() {
return 1;}
5218 int Dire_isr_qcd_G2GG1::motherID(
int) {
return 21;}
5219 int Dire_isr_qcd_G2GG1::sisterID(
int) {
return 21;}
5220 double Dire_isr_qcd_G2GG1::gaugeFactor (
int,
int ) {
return 2.*CA;}
5221 double Dire_isr_qcd_G2GG1::symmetryFactor (
int,
int ) {
return 0.5;}
5223 int Dire_isr_qcd_G2GG1::radBefID(
int idRA,
int){
5224 if (idRA == 21)
return 21;
5227 pair<int,int> Dire_isr_qcd_G2GG1::radBefCols(
5228 int colRadAfter,
int acolRadAfter,
5229 int colEmtAfter,
int acolEmtAfter) {
5230 int colRemove = (colRadAfter == colEmtAfter)
5231 ? colRadAfter : acolRadAfter;
5232 int col = (colRadAfter == colRemove)
5233 ? acolEmtAfter : colRadAfter;
5234 int acol = (acolRadAfter == colRemove)
5235 ? colEmtAfter : acolRadAfter;
5236 return make_pair(col,acol);
5239 vector <int> Dire_isr_qcd_G2GG1::recPositions(
const Event& state,
int iRad,
5242 int colRad = state[iRad].col();
5243 int acolRad = state[iRad].acol();
5244 int colEmt = state[iEmt].col();
5245 int acolEmt = state[iEmt].acol();
5246 int colShared = (colRad > 0 && colRad == colEmt) ? colEmt
5247 : (acolRad > 0 && acolEmt == acolRad) ? acolEmt : 0;
5249 vector<int> iExc(1,iRad); iExc.push_back(iEmt);
5253 if ( colEmt != 0 && colEmt != colShared) {
5254 int acolF = findCol(colEmt, iExc, state, 1);
5255 int colI = findCol(colEmt, iExc, state, 2);
5256 if (acolF > 0 && colI == 0) recs.push_back (acolF);
5257 if (acolF == 0 && colI > 0) recs.push_back (colI);
5260 if ( acolEmt != 0 && acolEmt != colShared) {
5261 int colF = findCol(acolEmt, iExc, state, 2);
5262 int acolI = findCol(acolEmt, iExc, state, 1);
5263 if ( colF > 0 && acolI == 0) recs.push_back (colF);
5264 if ( colF == 0 && acolI > 0) recs.push_back (acolI);
5271 double Dire_isr_qcd_G2GG1::zSplit(
double zMinAbs,
double,
double m2dip) {
5272 double R = rndmPtr->flat();
5273 double kappa2 = pow2(settingsPtr->parm(
"SpaceShower:pTmin"))/m2dip;
5275 double res = (-2.*pow(kappa2,R)*pow(zMinAbs,2.*R) +
5276 sqrt(4.*pow(kappa2,2.*R)
5278 + 4.*(pow(kappa2,R) + pow(kappa2,1. + R))
5280 *(-(pow(kappa2,R)*pow(zMinAbs,2.*R))
5282 *pow(1. + kappa2 - 2.*zMinAbs + pow(zMinAbs,2.),R))))
5283 / (2.*(-(pow(kappa2,R)*pow(zMinAbs,2.*R))
5285 *pow(1. + kappa2 - 2.*zMinAbs + pow(zMinAbs,2.),R)));
5290 double Dire_isr_qcd_G2GG1::overestimateInt(
double zMinAbs,
double,
5291 double,
double m2dip,
int orderNow) {
5293 double preFac = symmetryFactor() * gaugeFactor();
5294 int order = (orderNow > -1) ? orderNow : correctionOrder;
5295 double kappa2 = pow2(settingsPtr->parm(
"SpaceShower:pTmin"))/m2dip;
5297 wt = preFac * softRescaleInt(order)
5298 *0.5*( log(1./pow2(zMinAbs) + pow2(1.-zMinAbs)/(kappa2*pow2(zMinAbs))));
5304 double Dire_isr_qcd_G2GG1::overestimateDiff(
double z,
double m2dip,
5307 double preFac = symmetryFactor() * gaugeFactor();
5308 int order = (orderNow > -1) ? orderNow : correctionOrder;
5309 double kappaOld2 = pow2(settingsPtr->parm(
"SpaceShower:pTmin"))/m2dip;
5311 wt = preFac * softRescaleInt(order)
5312 * ((1.-z) / ( pow2(1.-z) + kappaOld2) + 1./z);
5317 bool Dire_isr_qcd_G2GG1::calc(
const Event& state,
int orderNow) {
5320 if (
false) cout << state[0].e() << orderNow << endl;
5323 double z(splitInfo.kinematics()->z), pT2(splitInfo.kinematics()->pT2),
5324 m2dip(splitInfo.kinematics()->m2Dip),
5325 m2Rec(splitInfo.kinematics()->m2Rec);
5326 int splitType(splitInfo.type);
5328 double preFac = symmetryFactor() * gaugeFactor();
5329 int order = (orderNow > -1) ? orderNow : correctionOrder;
5330 double kappa2 = max(pow2(settingsPtr->parm(
"SpaceShower:pTmin"))
5333 unordered_map<string,double> wts;
5334 double wt_base_as1 = preFac * ( (1.-z) / (pow2(1.-z)+kappa2) );
5337 double scale2 = couplingScale2 ( z, pT2, m2dip,
5338 make_pair (splitInfo.radBef()->id, splitInfo.radBef()->isFinal),
5339 make_pair (splitInfo.recBef()->id, splitInfo.recBef()->isFinal));
5340 if (scale2 < 0.) scale2 = pT2;
5342 wts.insert( make_pair(
"base", wt_base_as1
5343 * softRescaleDiff( order, scale2, renormMultFac) ));
5346 if (settingsPtr->parm(
"Variations:muRisrDown") != 1.)
5347 wts.insert( make_pair(
"Variations:muRisrDown", wt_base_as1
5348 * softRescaleDiff( order, scale2, (scale2 > pT2minVariations)
5349 ? settingsPtr->parm(
"Variations:muRisrDown")*renormMultFac :
5351 if (settingsPtr->parm(
"Variations:muRisrUp") != 1.)
5352 wts.insert( make_pair(
"Variations:muRisrUp", wt_base_as1
5353 * softRescaleDiff( order, scale2, (scale2 > pT2minVariations)
5354 ? settingsPtr->parm(
"Variations:muRisrUp")*renormMultFac :
5359 for ( unordered_map<string,double>::iterator it = wts.begin();
5360 it != wts.end(); ++it)
5361 it->second += preFac * 0.5 * ( z / ( pow2(z) + kappa2) - 1. ) - preFac;
5362 wt_base_as1 += preFac * 0.5 * ( z / ( pow2(z) + kappa2) - 1. ) - preFac;
5366 bool doMassive = ( m2Rec > 0. && splitType == 2);
5368 if (doMassive && order >= 0) {
5370 double uCS = kappa2 / (1-z);
5371 double massCorr = - m2Rec / m2dip * uCS / (1.-uCS);
5373 for ( unordered_map<string,double>::iterator it = wts.begin();
5374 it != wts.end(); ++it)
5375 it->second += preFac * 0.5 * massCorr;
5377 wt_base_as1 += preFac * 0.5 * massCorr;
5383 if (!doMassive && order == 3) {
5384 for ( unordered_map<string,double>::iterator it = wts.begin();
5385 it !=wts.end(); ++it){
5388 if (it->first ==
"base")
5389 mukf = renormMultFac;
5390 else if (it->first ==
"Variations:muRisrDown")
5391 mukf = settingsPtr->parm(
"Variations:muRisrDown");
5392 else if (it->first ==
"Variations:muRisrUp")
5393 mukf = settingsPtr->parm(
"Variations:muRisrUp");
5397 if (scale2 < pT2minVariations) mukf = renormMultFac;
5399 double NF = getNF(scale2 * mukf);
5400 double alphasPT2pi = as2Pi(scale2, order, mukf);
5411 double pgg1 = preFac * 0.5 / ( 18*z*(pow2(z)-1) ) * 0.5 * (
5412 TF*(-1 + pow2(z))*((4*(-1 + z)*(-23 + z*(6 + z*(10 + z*(4 + 23*z)))))/
5413 (-1 + pow2(z)) + (24*(1 - z)*z*log(z)*pow2(1 + z))/(-1 + pow2(z)))
5414 + (CF*TF*(-1 + pow2(z))*((36*(1 - z)*z*(1 + z)*(3 + 5*z)*log(z))
5415 /(-1 + pow2(z)) + (24*(1 + z)*(-1 + z*(11 + 5*z))*pow2(-1 + z))
5416 /(-1 + pow2(z)) - (36*(-1 + z)*z*pow2(1 + z)*pow2(log(z)))
5417 /(-1 + pow2(z))))/CA - 72*CA*(-1 + z)*DiLog(1/(1 + z))
5418 *pow2(1 + z + pow2(z))
5419 + CA*(-1 + pow2(z))*((6*(1 - z)*z*(1 + z)*(25 + 11*z*(-1 + 4*z))
5420 *log(z))/(-1 + pow2(z))
5421 + ((1 - z)*(z*(1 + z)*(25 + 109*z) + 6*(2 + z*(1 + 2*z*(1 + z)))
5422 *pow2(M_PI)))/(-1 + pow2(z))
5423 + (72*(1 + z)*log(1 - z)*log(z)*pow2(1 + (-1 + z)*z))/(-1 + pow2(z))
5424 - (36*z*pow2(log(z))*pow2(1 + z - pow2(z)))/(-1 + pow2(z))
5425 + (144*DiLog(1/(1 + z))*pow2(1 + z + pow2(z)))/(1 + z)
5426 + (36*(-1 + z)*pow2(log(1 + z))*pow2(1 + z + pow2(z)))
5430 pgg1 += -preFac * 0.5 * 40./9.*TF * 0.5 * ( z/(pow2(z)+kappa2) - 1./z);
5432 it->second += alphasPT2pi*pgg1;
5437 if (order > 0) wts.insert( make_pair(
"base_order_as2",
5438 wts[
"base"] - wt_base_as1 ));
5442 for ( unordered_map<string,double>::iterator it = wts.begin();
5443 it != wts.end(); ++it )
5444 kernelVals.insert(make_pair( it->first, it->second ));
5457 bool Dire_isr_qcd_G2GG2::canRadiate (
const Event& state, pair<int,int> ints,
5458 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*) {
5459 return (!state[ints.first].isFinal()
5460 && state[ints.second].colType() != 0
5461 && hasSharedColor(state, ints.first, ints.second)
5462 && state[ints.first].id() == 21 );
5465 bool Dire_isr_qcd_G2GG2::canRadiate (
const Event& state,
int iRadBef,
5466 int iRecBef, Settings*, PartonSystems*, BeamParticle*) {
5467 return ( !state[iRadBef].isFinal()
5468 && state[iRecBef].colType() != 0
5469 && hasSharedColor(state, iRadBef, iRecBef)
5470 && state[iRadBef].
id() == 21);
5473 int Dire_isr_qcd_G2GG2::kinMap() {
return 1;}
5474 int Dire_isr_qcd_G2GG2::motherID(
int) {
return 21;}
5475 int Dire_isr_qcd_G2GG2::sisterID(
int) {
return 21;}
5476 double Dire_isr_qcd_G2GG2::gaugeFactor (
int,
int ) {
return 2.*CA;}
5477 double Dire_isr_qcd_G2GG2::symmetryFactor (
int,
int ) {
return 0.5;}
5479 int Dire_isr_qcd_G2GG2::radBefID(
int idRA,
int){
5480 if (idRA==21)
return 21;
5483 pair<int,int> Dire_isr_qcd_G2GG2::radBefCols(
5484 int colRadAfter,
int acolRadAfter,
5485 int colEmtAfter,
int acolEmtAfter) {
5486 int colRemove = (colRadAfter == colEmtAfter)
5487 ? colRadAfter : acolRadAfter;
5488 int col = (colRadAfter == colRemove)
5489 ? acolEmtAfter : colRadAfter;
5490 int acol = (acolRadAfter == colRemove)
5491 ? colEmtAfter : acolRadAfter;
5492 return make_pair(col,acol);
5495 vector <int> Dire_isr_qcd_G2GG2::recPositions(
const Event& state,
int iRad,
5498 int colRad = state[iRad].col();
5499 int acolRad = state[iRad].acol();
5500 int colEmt = state[iEmt].col();
5501 int acolEmt = state[iEmt].acol();
5502 int colShared = (colRad > 0 && colRad == colEmt) ? colEmt
5503 : (acolRad > 0 && acolEmt == acolRad) ? acolEmt : 0;
5505 vector<int> iExc(1,iRad); iExc.push_back(iEmt);
5509 if ( colRad != 0 && colRad != colShared) {
5510 int acolF = findCol(colRad, iExc, state, 1);
5511 int colI = findCol(colRad, iExc, state, 2);
5512 if (acolF > 0 && colI == 0) recs.push_back (acolF);
5513 if (acolF == 0 && colI > 0) recs.push_back (colI);
5516 if ( acolRad != 0 && acolRad != colShared) {
5517 int colF = findCol(acolRad, iExc, state, 2);
5518 int acolI = findCol(acolRad, iExc, state, 1);
5519 if ( colF > 0 && acolI == 0) recs.push_back (colF);
5520 if ( colF == 0 && acolI > 0) recs.push_back (acolI);
5528 double Dire_isr_qcd_G2GG2::zSplit(
double zMinAbs,
double,
double m2dip) {
5529 double R = rndmPtr->flat();
5530 double kappa2 = pow2(settingsPtr->parm(
"SpaceShower:pTmin"))/m2dip;
5533 double res = (-2.*pow(kappa2,R)*pow(zMinAbs,2.*R) +
5534 sqrt(4.*pow(kappa2,2.*R)
5536 + 4.*(pow(kappa2,R) + pow(kappa2,1. + R))
5538 *(-(pow(kappa2,R)*pow(zMinAbs,2.*R))
5540 *pow(1. + kappa2 - 2.*zMinAbs + pow(zMinAbs,2.),R))))
5541 / (2.*(-(pow(kappa2,R)*pow(zMinAbs,2.*R))
5543 *pow(1. + kappa2 - 2.*zMinAbs + pow(zMinAbs,2.),R)));
5548 double Dire_isr_qcd_G2GG2::overestimateInt(
double zMinAbs,
double,
5549 double,
double m2dip,
int) {
5551 double preFac = symmetryFactor() * gaugeFactor();
5552 double kappa2 = pow2(settingsPtr->parm(
"SpaceShower:pTmin"))/m2dip;
5556 *0.5*( log(1./pow2(zMinAbs) + pow2(1.-zMinAbs)/(kappa2*pow2(zMinAbs))));
5562 double Dire_isr_qcd_G2GG2::overestimateDiff(
double z,
double m2dip,
int) {
5564 double preFac = symmetryFactor() * gaugeFactor();
5565 double kappa2 = pow2(settingsPtr->parm(
"SpaceShower:pTmin"))/m2dip;
5569 * ((1.-z) / ( pow2(1.-z) + kappa2) + 1./z);
5574 bool Dire_isr_qcd_G2GG2::calc(
const Event& state,
int orderNow) {
5577 if (
false) cout << state[0].e() << orderNow << endl;
5580 double z(splitInfo.kinematics()->z), pT2(splitInfo.kinematics()->pT2),
5581 m2dip(splitInfo.kinematics()->m2Dip),
5582 m2Rec(splitInfo.kinematics()->m2Rec);
5583 int splitType(splitInfo.type);
5585 double preFac = symmetryFactor() * gaugeFactor();
5586 int order = (orderNow > -1) ? orderNow : correctionOrder;
5587 double kappa2 = max(pow2(settingsPtr->parm(
"SpaceShower:pTmin"))/m2dip,
5590 unordered_map<string,double> wts;
5591 double wt_base_as1 = preFac * 0.5 * z / ( pow2(z) + kappa2);
5593 if (order >= 0) wt_base_as1 += -preFac*0.5 + preFac*z*(1.-z);
5596 double scale2 = couplingScale2 ( z, pT2, m2dip,
5597 make_pair (splitInfo.radBef()->id, splitInfo.radBef()->isFinal),
5598 make_pair (splitInfo.recBef()->id, splitInfo.recBef()->isFinal));
5599 if (scale2 < 0.) scale2 = pT2;
5601 wts.insert( make_pair(
"base", wt_base_as1 ));
5604 if (settingsPtr->parm(
"Variations:muRisrDown") != 1.)
5605 wts.insert( make_pair(
"Variations:muRisrDown", wt_base_as1 ));
5606 if (settingsPtr->parm(
"Variations:muRisrUp") != 1.)
5607 wts.insert( make_pair(
"Variations:muRisrUp", wt_base_as1 ));
5611 bool doMassive = ( m2Rec > 0. && splitType == 2);
5613 if (doMassive && order >= 0) {
5615 double uCS = kappa2 / (1-z);
5616 double massCorr = - m2Rec / m2dip * uCS / (1.-uCS);
5618 for ( unordered_map<string,double>::iterator it = wts.begin();
5619 it != wts.end(); ++it)
5620 it->second += preFac * 0.5 * massCorr;
5622 wt_base_as1 += preFac * 0.5 * massCorr;
5627 if (!doMassive && order == 3) {
5628 for ( unordered_map<string,double>::iterator it = wts.begin();
5629 it !=wts.end(); ++it){
5632 if (it->first ==
"base")
5633 mukf = renormMultFac;
5634 else if (it->first ==
"Variations:muRisrDown")
5635 mukf = settingsPtr->parm(
"Variations:muRisrDown");
5636 else if (it->first ==
"Variations:muRisrUp")
5637 mukf = settingsPtr->parm(
"Variations:muRisrUp");
5641 if (scale2 < pT2minVariations) mukf = renormMultFac;
5643 double NF = getNF(scale2 * mukf);
5644 double alphasPT2pi = as2Pi(scale2, order, mukf);
5655 double pgg1 = preFac * 0.5 / ( 18*z*(pow2(z)-1) ) * 0.5 * (
5656 TF*(-1 + pow2(z))*((4*(-1 + z)*(-23 + z*(6 + z*(10 + z*(4 + 23*z)))))
5658 +(24*(1 - z)*z*log(z)*pow2(1 + z))/(-1 + pow2(z)))
5659 +(CF*TF*(-1 + pow2(z))*((36*(1 - z)*z*(1 + z)*(3 + 5*z)*log(z))
5661 +(24*(1 + z)*(-1 + z*(11 + 5*z))*pow2(-1 + z))/(-1 + pow2(z))
5662 -(36*(-1 + z)*z*pow2(1 + z)*pow2(log(z)))/(-1 + pow2(z))))/CA
5663 -72*CA*(-1 + z)*DiLog(1/(1 + z))*pow2(1 + z + pow2(z))
5664 +CA*(-1 + pow2(z))*((6*(1 - z)*z*(1 + z)*(25 + 11*z*(-1 + 4*z))
5665 *log(z))/(-1 + pow2(z))
5666 +((1 - z)*(z*(1 + z)*(25 + 109*z) + 6*(2 + z*(1 + 2*z*(1 + z)))
5667 *pow2(M_PI)))/(-1 + pow2(z))
5668 +(72*(1 + z)*log(1 - z)*log(z)*pow2(1 + (-1 + z)*z))/(-1 + pow2(z))
5669 -(36*z*pow2(log(z))*pow2(1 + z - pow2(z)))/(-1 + pow2(z))
5670 +(144*DiLog(1/(1 + z))*pow2(1 + z + pow2(z)))/(1 + z)
5671 +(36*(-1 + z)*pow2(log(1 + z))*pow2(1 + z + pow2(z)))/(-1 + pow2(z))));
5673 pgg1 += -preFac * 0.5 * 40./9.*TF * 0.5 * ( z/(pow2(z)+kappa2) - 1./z);
5675 it->second += alphasPT2pi*pgg1;
5680 if (order > 0) wts.insert( make_pair(
"base_order_as2",
5681 wts[
"base"] - wt_base_as1 ));
5685 for ( unordered_map<string,double>::iterator it = wts.begin();
5686 it != wts.end(); ++it )
5687 kernelVals.insert(make_pair( it->first, it->second ));
5700 bool Dire_isr_qcd_G2QQ::canRadiate (
const Event& state, pair<int,int> ints,
5701 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*) {
5702 return (!state[ints.first].isFinal()
5703 && state[ints.second].colType() != 0
5704 && hasSharedColor(state, ints.first, ints.second)
5705 && state[ints.first].isQuark() );
5708 bool Dire_isr_qcd_G2QQ::canRadiate (
const Event& state,
int iRadBef,
5709 int iRecBef, Settings*, PartonSystems*, BeamParticle*) {
5710 return ( !state[iRadBef].isFinal()
5711 && state[iRecBef].colType() != 0
5712 && hasSharedColor(state, iRadBef, iRecBef)
5713 && state[iRadBef].isQuark());
5716 int Dire_isr_qcd_G2QQ::kinMap() {
return 1;}
5717 int Dire_isr_qcd_G2QQ::motherID(
int) {
return 21;}
5718 int Dire_isr_qcd_G2QQ::sisterID(
int idDaughter) {
return -idDaughter;}
5719 double Dire_isr_qcd_G2QQ::gaugeFactor (
int,
int ) {
return TR;}
5720 double Dire_isr_qcd_G2QQ::symmetryFactor (
int,
int ) {
return 1.0;}
5722 int Dire_isr_qcd_G2QQ::radBefID(
int,
int idEA){
5723 if (particleDataPtr->isQuark(idEA))
return -idEA;
5726 pair<int,int> Dire_isr_qcd_G2QQ::radBefCols(
5727 int colRadAfter,
int acolRadAfter,
5728 int colEmtAfter,
int acolEmtAfter) {
5729 bool isQuark = (acolEmtAfter > 0);
5730 int colRemove = (colRadAfter == colEmtAfter)
5732 int col = (colRadAfter == colRemove)
5733 ? acolEmtAfter : colRadAfter;
5734 if (isQuark)
return make_pair(col,0);
5735 colRemove = (acolRadAfter == acolEmtAfter)
5737 int acol = (acolRadAfter == colRemove)
5738 ? colEmtAfter : acolRadAfter;
5739 return make_pair(0,acol);
5742 vector <int> Dire_isr_qcd_G2QQ::recPositions(
const Event& state,
int iRad,
5745 int colRad = state[iRad].col();
5746 int acolRad = state[iRad].acol();
5747 int colEmt = state[iEmt].col();
5748 int acolEmt = state[iEmt].acol();
5749 int colShared = (colRad > 0 && colRad == acolEmt) ? colRad
5750 : (acolRad > 0 && colEmt == acolRad) ? colEmt : 0;
5752 vector<int> iExc(1,iRad); iExc.push_back(iEmt);
5756 if ( colRad != 0 && colRad != colShared) {
5757 int acolF = findCol(colRad, iExc, state, 1);
5758 int colI = findCol(colRad, iExc, state, 2);
5759 if (acolF > 0 && colI == 0) recs.push_back (acolF);
5760 if (acolF == 0 && colI > 0) recs.push_back (colI);
5763 if ( acolRad != 0 && acolRad != colShared) {
5764 int colF = findCol(acolRad, iExc, state, 2);
5765 int acolI = findCol(acolRad, iExc, state, 1);
5766 if ( colF > 0 && acolI == 0) recs.push_back (colF);
5767 if ( colF == 0 && acolI > 0) recs.push_back (acolI);
5774 double Dire_isr_qcd_G2QQ::zSplit(
double zMinAbs,
double zMaxAbs,
double) {
5777 double res = zMinAbs + rndmPtr->flat() * (zMaxAbs - zMinAbs);
5782 double Dire_isr_qcd_G2QQ::overestimateInt(
double zMinAbs,
double zMaxAbs,
5783 double,
double,
int) {
5785 double preFac = symmetryFactor() * gaugeFactor();
5789 * 2. * ( zMaxAbs - zMinAbs);
5794 double Dire_isr_qcd_G2QQ::overestimateDiff(
double,
double,
int) {
5796 double preFac = symmetryFactor() * gaugeFactor();
5805 bool Dire_isr_qcd_G2QQ::calc(
const Event& state,
int orderNow) {
5808 if (
false) cout << state[0].e() << orderNow << endl;
5811 double z(splitInfo.kinematics()->z), pT2(splitInfo.kinematics()->pT2),
5812 m2dip(splitInfo.kinematics()->m2Dip);
5814 double preFac = symmetryFactor() * gaugeFactor();
5815 int order = (orderNow > -1) ? orderNow : correctionOrder;
5816 double kappa2 = max(pow2(settingsPtr->parm(
"SpaceShower:pTmin"))
5817 /m2dip, pT2/m2dip);;
5819 unordered_map<string,double> wts;
5820 double wt_base_as1 = preFac * (pow(1.-z,2.) + pow(z,2.));
5822 if (order == -1) wt_base_as1 = 0.0;
5825 double scale2 = couplingScale2 ( z, pT2, m2dip,
5826 make_pair (splitInfo.radBef()->id, splitInfo.radBef()->isFinal),
5827 make_pair (splitInfo.recBef()->id, splitInfo.recBef()->isFinal));
5828 if (scale2 < 0.) scale2 = pT2;
5830 wts.insert( make_pair(
"base", wt_base_as1 ));
5833 if (settingsPtr->parm(
"Variations:muRisrDown") != 1.)
5834 wts.insert( make_pair(
"Variations:muRisrDown", wt_base_as1 ));
5835 if (settingsPtr->parm(
"Variations:muRisrUp") != 1.)
5836 wts.insert( make_pair(
"Variations:muRisrUp", wt_base_as1 ));
5840 for ( unordered_map<string,double>::iterator it = wts.begin();
5841 it !=wts.end(); ++it){
5844 if (it->first ==
"base")
5845 mukf = renormMultFac;
5846 else if (it->first ==
"Variations:muRisrDown")
5847 mukf = settingsPtr->parm(
"Variations:muRisrDown");
5848 else if (it->first ==
"Variations:muRisrUp")
5849 mukf = settingsPtr->parm(
"Variations:muRisrUp");
5853 if (scale2 < pT2minVariations) mukf = renormMultFac;
5855 double alphasPT2pi = as2Pi(scale2, order, mukf);
5857 double pgq1 = preFac * (
5858 (CF*(4 - 9*z + 4*log(1 - z) + (-1 + 4*z)*log(z)
5859 -(2*(1 + 2*(-1 + z)*z)*(-15 - 3*(-2 + log(-1 + 1/z))*log(-1 + 1/z) +
5861 +(-1 + 2*z)*pow2(log(z)))
5862 +(2*CA*(20 - 18*z*(1 + 2*z*(1 + z))*DiLog(1/(1 + z))
5863 +z*(-18 + (225 - 218*z)*z + pow2(M_PI)*(3 + 6*pow2(z)))
5864 +3*z*(12*(-1 + z)*z*log(1 - z)
5865 +log(z)*(3 + 4*z*(6 + 11*z) - 3*(1 + 2*z)*log(z))
5866 +(-3 - 6*(-1 + z)*z)*pow2(log(1 - z))
5867 -3*(1 + 2*z*(1 + z))*pow2(log(1 + z)))))/(9.*z))/2. );
5869 pgq1 += preFac * 20./9.*CA * ( z/(pow2(z)+kappa2) - 1./z);
5871 it->second += alphasPT2pi*pgq1;
5876 if (order > 0) wts.insert( make_pair(
"base_order_as2",
5877 wts[
"base"] - wt_base_as1 ));
5881 for ( unordered_map<string,double>::iterator it = wts.begin();
5882 it != wts.end(); ++it )
5883 kernelVals.insert(make_pair( it->first, it->second ));
5896 bool Dire_isr_qcd_Q2GQ::canRadiate (
const Event& state, pair<int,int> ints,
5897 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*) {
5898 return (!state[ints.first].isFinal()
5899 && state[ints.second].colType() != 0
5900 && hasSharedColor(state, ints.first, ints.second)
5901 && state[ints.first].id() == 21 );
5904 bool Dire_isr_qcd_Q2GQ::canRadiate (
const Event& state,
int iRadBef,
5905 int iRecBef, Settings*, PartonSystems*, BeamParticle*) {
5906 return ( !state[iRadBef].isFinal()
5907 && state[iRecBef].colType() != 0
5908 && hasSharedColor(state, iRadBef, iRecBef)
5909 && state[iRadBef].
id() == 21);
5912 int Dire_isr_qcd_Q2GQ::kinMap() {
return 1;}
5913 int Dire_isr_qcd_Q2GQ::motherID(
int) {
return 1;}
5914 int Dire_isr_qcd_Q2GQ::sisterID(
int) {
return 1;}
5915 double Dire_isr_qcd_Q2GQ::gaugeFactor (
int,
int ) {
return CF;}
5916 double Dire_isr_qcd_Q2GQ::symmetryFactor (
int,
int ) {
return 0.5;}
5918 int Dire_isr_qcd_Q2GQ::radBefID(
int idRA,
int){
5919 if (particleDataPtr->isQuark(idRA))
return 21;
5922 pair<int,int> Dire_isr_qcd_Q2GQ::radBefCols(
5923 int colRadAfter,
int acolRadAfter,
5924 int colEmtAfter,
int acolEmtAfter) {
5925 int col = (colRadAfter > 0) ? colRadAfter : acolEmtAfter;
5926 int acol = (acolRadAfter > 0) ? acolRadAfter : colEmtAfter;
5927 return make_pair(col,acol);
5930 vector <int> Dire_isr_qcd_Q2GQ::recPositions(
const Event& state,
int iRad,
5935 int colRad = state[iRad].col();
5936 int acolRad = state[iRad].acol();
5937 int colEmt = state[iEmt].col();
5938 int acolEmt = state[iEmt].acol();
5939 int colShared = (colRad > 0 && colRad == acolEmt) ? colRad
5940 : (acolRad > 0 && colEmt == acolRad) ? colEmt : 0;
5942 vector<int> iExc(1,iRad); iExc.push_back(iEmt);
5946 if ( colEmt != 0 && colEmt != colShared) {
5947 int acolF = findCol(colEmt, iExc, state, 1);
5948 int colI = findCol(colEmt, iExc, state, 2);
5949 if (acolF > 0 && colI == 0) recs.push_back (acolF);
5950 if (acolF == 0 && colI > 0) recs.push_back (colI);
5952 iExc.insert(iExc.end(), recs.begin(), recs.end());
5954 if ( acolEmt != 0 && acolEmt != colShared) {
5955 int colF = findCol(acolEmt, iExc, state, 2);
5956 int acolI = findCol(acolEmt, iExc, state, 1);
5957 if ( colF > 0 && acolI == 0) recs.push_back (colF);
5958 if ( colF == 0 && acolI > 0) recs.push_back (acolI);
5960 iExc.insert(iExc.end(), recs.begin(), recs.end());
5962 if ( colRad != 0 && colRad != colShared) {
5963 int acolF = findCol(colRad, iExc, state, 1);
5964 int colI = findCol(colRad, iExc, state, 2);
5965 if (acolF > 0 && colI == 0) recs.push_back (acolF);
5966 if (acolF == 0 && colI > 0) recs.push_back (colI);
5968 iExc.insert(iExc.end(), recs.begin(), recs.end());
5970 if ( acolRad != 0 && acolRad != colShared) {
5971 int colF = findCol(acolRad, iExc, state, 2);
5972 int acolI = findCol(acolRad, iExc, state, 1);
5973 if ( colF > 0 && acolI == 0) recs.push_back (colF);
5974 if ( colF == 0 && acolI > 0) recs.push_back (acolI);
5976 iExc.insert(iExc.end(), recs.begin(), recs.end());
5983 double Dire_isr_qcd_Q2GQ::zSplit(
double zMinAbs,
double,
double) {
5984 double R = rndmPtr->flat();
5985 double res = pow(zMinAbs,3./4.)
5986 / ( pow(1. + R*(-1. + pow(zMinAbs,-3./8.)),2./3.)
5987 *pow(R - (-1. + R)*pow(zMinAbs,3./8.),2.));
5992 double Dire_isr_qcd_Q2GQ::overestimateInt(
double zMinAbs,
double,
5993 double,
double,
int) {
5995 double preFac = symmetryFactor() * gaugeFactor();
5996 wt = preFac * 2./3. * (8.*(-1. + pow(zMinAbs,-3./8.)));
6002 double Dire_isr_qcd_Q2GQ::overestimateDiff(
double z,
double,
int) {
6004 double preFac = symmetryFactor() * gaugeFactor();
6005 wt = preFac * 2. / pow(z,11./8.);
6010 bool Dire_isr_qcd_Q2GQ::calc(
const Event& state,
int orderNow) {
6013 if (
false) cout << state[0].e() << orderNow << endl;
6016 double z(splitInfo.kinematics()->z), pT2(splitInfo.kinematics()->pT2),
6017 m2dip(splitInfo.kinematics()->m2Dip),
6018 m2Rec(splitInfo.kinematics()->m2Rec);
6019 int splitType(splitInfo.type);
6021 double preFac = symmetryFactor() * gaugeFactor();
6022 int order = (orderNow > -1) ? orderNow : correctionOrder;
6023 double kappa2 = max(pow2(settingsPtr->parm(
"SpaceShower:pTmin"))
6024 /m2dip, pT2/m2dip);;
6026 unordered_map<string,double> wts;
6027 double wt_base_as1 = preFac * 2.*z/(pow2(z)+kappa2);
6029 if (order >= 0) wt_base_as1 += preFac*(z-2.);
6032 double scale2 = couplingScale2 ( z, pT2, m2dip,
6033 make_pair (splitInfo.radBef()->id, splitInfo.radBef()->isFinal),
6034 make_pair (splitInfo.recBef()->id, splitInfo.recBef()->isFinal));
6035 if (scale2 < 0.) scale2 = pT2;
6037 wts.insert( make_pair(
"base", wt_base_as1 ));
6040 if (settingsPtr->parm(
"Variations:muRisrDown") != 1.)
6041 wts.insert( make_pair(
"Variations:muRisrDown", wt_base_as1 ));
6042 if (settingsPtr->parm(
"Variations:muRisrUp") != 1.)
6043 wts.insert( make_pair(
"Variations:muRisrUp", wt_base_as1 ));
6047 bool doMassive = ( m2Rec > 0. && splitType == 2);
6050 if (doMassive && order >= 0) {
6052 double uCS = kappa2 / (1-z);
6054 double massCorr = -2. * m2Rec / m2dip * uCS / (1.-uCS);
6056 for ( unordered_map<string,double>::iterator it = wts.begin();
6057 it != wts.end(); ++it)
6058 it->second += preFac * massCorr;
6059 wt_base_as1 += preFac * massCorr;
6062 if (!doMassive && order == 3) {
6063 for ( unordered_map<string,double>::iterator it = wts.begin();
6064 it !=wts.end(); ++it){
6067 if (it->first ==
"base")
6068 mukf = renormMultFac;
6069 else if (it->first ==
"Variations:muRisrDown")
6070 mukf = settingsPtr->parm(
"Variations:muRisrDown");
6071 else if (it->first ==
"Variations:muRisrUp")
6072 mukf = settingsPtr->parm(
"Variations:muRisrUp");
6076 if (scale2 < pT2minVariations) mukf = renormMultFac;
6078 double NF = getNF(scale2 * mukf);
6079 double alphasPT2pi = as2Pi(scale2, order, mukf);
6082 double pqg1 = preFac * (
6083 (-9*CF*z*(5 + 7*z) - 16*TF*(5 + z*(-5 + 4*z))
6084 +36*CA*(2 + z*(2 + z))*DiLog(1/(1 + z))
6085 +2*CA*(9 + z*(19 + z*(37 + 44*z)) - 3*pow2(M_PI)*(2 + pow2(z)))
6086 +3*(-2*log(1 - z)*(CA*(-22 + (22 - 17*z)*z)
6087 +4*TF*(2 + (-2 + z)*z) + 3*CF*(6 + z*(-6 + 5*z))
6088 +6*CA*(2 + (-2 + z)*z)*log(z))
6089 +z*log(z)*(3*CF*(4 + 7*z) - 2*CA*(36 + z*(15 + 8*z))
6090 +3*(CF*(-2 + z) + 2*CA*(2 + z))*log(z))
6091 +6*(CA - CF)*(2 + (-2 + z)*z)*pow2(log(1 - z))
6092 +6*CA*(2 + z*(2 + z))*pow2(log(1 + z))))/(18.*z) );
6094 pqg1 += - preFac * 40./9.*TF * ( z/(pow2(z)+kappa2) - 1./z);
6096 it->second += alphasPT2pi*pqg1;
6101 if (order > 0) wts.insert( make_pair(
"base_order_as2",
6102 wts[
"base"] - wt_base_as1 ));
6106 for ( unordered_map<string,double>::iterator it = wts.begin();
6107 it != wts.end(); ++it )
6108 kernelVals.insert(make_pair( it->first, it->second ));
6121 bool Dire_isr_qcd_Q2qQqbarDist::canRadiate (
const Event& state,
6122 pair<int,int> ints, unordered_map<string,bool>, Settings*, PartonSystems*,
6124 return (!state[ints.first].isFinal()
6125 && state[ints.second].colType() != 0
6126 && hasSharedColor(state, ints.first, ints.second)
6127 && state[ints.first].isQuark() );
6130 bool Dire_isr_qcd_Q2qQqbarDist::canRadiate (
const Event& state,
int iRadBef,
6131 int iRecBef, Settings*, PartonSystems*, BeamParticle*) {
6132 if (orderSave < 3)
return false;
6133 return ( !state[iRadBef].isFinal()
6134 && state[iRecBef].colType() != 0
6135 && hasSharedColor(state, iRadBef, iRecBef)
6136 && state[iRadBef].isQuark());
6139 int Dire_isr_qcd_Q2qQqbarDist::kinMap() {
return 2;}
6140 int Dire_isr_qcd_Q2qQqbarDist::motherID(
int idDaughter) {
return idDaughter;}
6141 int Dire_isr_qcd_Q2qQqbarDist::sisterID(
int) {
return 1;}
6142 double Dire_isr_qcd_Q2qQqbarDist::gaugeFactor (
int,
int ) {
return CF;}
6143 double Dire_isr_qcd_Q2qQqbarDist::symmetryFactor (
int,
int ) {
return 1.;}
6145 int Dire_isr_qcd_Q2qQqbarDist::radBefID(
int idRA,
int) {
6146 if (particleDataPtr->isQuark(idRA))
return idRA;
6150 pair<int,int> Dire_isr_qcd_Q2qQqbarDist::radBefCols(
6151 int colRadAfter,
int acolRadAfter,
6152 int colEmtAfter,
int acolEmtAfter) {
6153 bool isQuark = (colRadAfter > 0);
6154 int colRemove = (colRadAfter == colEmtAfter)
6156 int col = (colRadAfter == colRemove)
6157 ? acolEmtAfter : colRadAfter;
6158 if (isQuark)
return make_pair(col,0);
6159 colRemove = (acolRadAfter == acolEmtAfter)
6161 int acol = (acolRadAfter == colRemove)
6162 ? colEmtAfter : acolRadAfter;
6163 return make_pair(0,acol);
6167 double Dire_isr_qcd_Q2qQqbarDist::zSplit(
double zMinAbs,
double zMaxAbs,
6169 double Rz = rndmPtr->flat();
6172 double kappa2 = pow(settingsPtr->parm(
"SpaceShower:pTmin"), 2) / m2dip;
6174 res = pow( (pow(kappa2,1) + zMaxAbs)/(pow(kappa2,1) + zMinAbs), -Rz )
6175 * (pow(kappa2,1) + zMaxAbs - pow(kappa2,1)
6176 *pow((pow(kappa2,1) + zMaxAbs)/(pow(kappa2,1)
6181 if ( splitInfo.recBef()->isFinal
6182 && (splitInfo.radBef()->id < 0 || abs(splitInfo.radBef()->id) > 2) ) {
6183 double k = pow(kappa2,1);
6185 * tan( Rz*atan(zMaxAbs*pow(k,-0.5))
6186 - (Rz-1.)*atan(zMinAbs*pow(k,-0.5)));
6194 double Dire_isr_qcd_Q2qQqbarDist::overestimateInt(
double zMinAbs,
6195 double zMaxAbs,
double,
double m2dip,
int orderNow) {
6198 int order = (orderNow > -1) ? orderNow : correctionOrder;
6199 if (order < 3)
return 0.0;
6201 double preFac = symmetryFactor() * gaugeFactor();
6202 double pT2min = pow2(settingsPtr->parm(
"SpaceShower:pTmin"));
6205 double kappa2 = pT2min/m2dip;
6207 double wt = preFac * TR * 20./9.
6208 * log( ( pow(kappa2,1) + zMaxAbs) / ( pow(kappa2,1) + zMinAbs) );
6212 if ( splitInfo.recBef()->isFinal
6213 && (splitInfo.radBef()->id < 0 || abs(splitInfo.radBef()->id) > 2) ) {
6214 double k = pow(kappa2,1);
6215 wt = preFac * TR * 20./9.
6216 * ( atan(zMaxAbs*pow(k,-0.5))
6217 - atan(zMinAbs*pow(k,-0.5)))*pow(k,-0.5);
6221 wt *= as2Pi(pT2min);
6227 double Dire_isr_qcd_Q2qQqbarDist::overestimateDiff(
double z,
double m2dip,
6231 int order = (orderNow > -1) ? orderNow : correctionOrder;
6232 if (order < 3)
return 0.0;
6234 double preFac = symmetryFactor() * gaugeFactor();
6235 double pT2min = pow2(settingsPtr->parm(
"SpaceShower:pTmin"));
6237 double kappa2 = pT2min/m2dip;
6239 double wt = preFac * TR * 20./ 9. * 1 / (z + pow(kappa2,1));
6243 if ( splitInfo.recBef()->isFinal
6244 && (splitInfo.radBef()->id < 0 || abs(splitInfo.radBef()->id) > 2) )
6245 wt = preFac * TR * 20./ 9. * 1. / (z*z + pow(kappa2,1));
6247 wt *= as2Pi(pT2min);
6253 bool Dire_isr_qcd_Q2qQqbarDist::calc(
const Event& state,
int orderNow) {
6256 if (
false) cout << state[0].e() << orderNow << endl;
6259 double z(splitInfo.kinematics()->z),
6260 m2dip(splitInfo.kinematics()->m2Dip),
6261 pT2(splitInfo.kinematics()->pT2),
6262 xa(splitInfo.kinematics()->xa),
6263 sai(splitInfo.kinematics()->sai),
6264 m2aij(splitInfo.kinematics()->m2RadBef),
6265 m2a(splitInfo.kinematics()->m2RadAft),
6266 m2i(splitInfo.kinematics()->m2EmtAft),
6267 m2j(splitInfo.kinematics()->m2EmtAft2),
6268 m2k(splitInfo.kinematics()->m2Rec);
6271 unordered_map<string,double> wts;
6272 int order = (orderNow > -1) ? orderNow : correctionOrder;
6273 if (order < 3 || m2aij > 0. || m2a > 0. || m2i > 0. || m2j > 0. || m2k > 0.){
6274 wts.insert( make_pair(
"base", 0.) );
6275 if (doVariations && settingsPtr->parm(
"Variations:muRisrDown") != 1.)
6276 wts.insert( make_pair(
"Variations:muRisrDown", 0.));
6277 if (doVariations && settingsPtr->parm(
"Variations:muRisrUp") != 1.)
6278 wts.insert( make_pair(
"Variations:muRisrUp", 0.));
6280 for ( unordered_map<string,double>::iterator it = wts.begin();
6281 it != wts.end(); ++it )
6282 kernelVals.insert(make_pair( it->first, it->second ));
6288 bool isEndpoint = (rndmPtr->flat() < 0.5);
6290 Event trialEvent(state);
6291 bool physical =
true;
6292 if (splitInfo.recBef()->isFinal)
6293 physical = isr->branch_IF(trialEvent,
true, &splitInfo);
6295 physical = isr->branch_II(trialEvent,
true, &splitInfo);
6298 Vec4 pa(trialEvent[splitInfo.iRadAft].p());
6299 Vec4 pk(trialEvent[splitInfo.iRecAft].p());
6300 Vec4 pj(trialEvent[splitInfo.iEmtAft].p());
6301 Vec4 pi(trialEvent[splitInfo.iEmtAft2].p());
6303 double sign = (splitInfo.recBef()->isFinal) ? 1. : -1.;
6304 double p2ai(-sai + m2a + m2i),
6305 p2aj( (-pa+pj).m2Calc()),
6306 p2ak( (-pa+sign*pk).m2Calc()),
6307 p2ij( (pi+pj).m2Calc()),
6308 p2ik( (pi+sign*pk).m2Calc()),
6309 p2jk( (pj+sign*pk).m2Calc());
6310 double saij = (-pa+pi+pj).m2Calc();
6311 double q2 = (-pa + sign*pk + pi + pj).m2Calc();
6312 double z1(-sign*pa*pk/(-sign*pk*(pa-pi-pj))),
6313 z2(sign*pi*pk/(-sign*pk*(pa-pi-pj))),
6315 double pT2min = pow2(settingsPtr->parm(
"SpaceShower:pTmin"));
6316 if ( z1< 1. || z2 > 0. || z3 > 0.)
6318 if ( splitInfo.recBef()->isFinal && -(q2+pT2/xa-p2ai) < pT2min)
6322 if ( abs(pa.m2Calc()-m2a) > sai || abs(pi.m2Calc()-m2i) > sai
6323 || abs(pj.m2Calc()-m2j) > sai || abs(pk.m2Calc()-m2k) > sai)
6328 wts.insert( make_pair(
"base", 0.) );
6329 if (doVariations && settingsPtr->parm(
"Variations:muRisrDown") != 1.)
6330 wts.insert( make_pair(
"Variations:muRisrDown", 0.));
6331 if (doVariations && settingsPtr->parm(
"Variations:muRisrUp") != 1.)
6332 wts.insert( make_pair(
"Variations:muRisrUp", 0.));
6334 for ( unordered_map<string,double>::iterator it = wts.begin();
6335 it != wts.end(); ++it )
6336 kernelVals.insert(make_pair( it->first, it->second ));
6344 prob = CF*TR*((1.0+z3*z3)/(1.0-z3)
6345 +(1.0-2.0*z1*z2/pow2(z1+z2))*(1.0-z3+(1.0+z3*z3)/(1.0-z3)
6346 *(log(z2/z1*z3/(1-z3))-1.0)));
6347 prob-= CF*TR*2.0*((1.0+z3*z3)/(1.0-z3)*log(-z3/(1.0-z3)) +1.0-z3)
6348 *(1.0-2.0*z1*z2/pow2(z1+z2));
6355 prob *= z/xa * 1. / (1.-p2ai/saij);
6359 double s12(p2ai), s13(p2aj), s23(p2ij), s123(saij);
6360 double t123 = 2.*(z1*s23 - z2*s13)/(z1+z2) + (z1-z2)/(z1+z2)*s12;
6361 double CG = 0.5*CF*TR*s123/s12
6362 *( - pow2(t123)/ (s12*s123)
6363 + (4.*z3 + pow2(z1-z2))/(z1+z2) + z1 + z2 - s12/s123 );
6364 double cosPhiKT1KT3 = pow2(p2ij*p2ak - p2aj*p2ik + p2ai*p2jk)
6365 / (4.*p2ai*p2ij*p2ak*p2jk);
6366 double subt = CF*TR*s123/s12
6367 * ( (1.+z3*z3) / (1.-z3) * (1.-2.*z1*z2/pow2(1-z3))
6368 + 4.*z1*z2*z3 / pow(1.-z3,3) * (1-2.*cosPhiKT1KT3) );
6371 if ( abs(s12) < 1e-10) prob = 0.0;
6378 prob *= z/xa * 1. / (1.-p2ai/saij);
6383 if (isEndpoint) { splitInfo.set_sai(0.0); }
6386 double scale2 = couplingScale2 ( z, pT2, m2dip,
6387 make_pair (splitInfo.radBef()->id, splitInfo.radBef()->isFinal),
6388 make_pair (splitInfo.recBef()->id, splitInfo.recBef()->isFinal));
6389 if (scale2 < 0.) scale2 = pT2;
6392 wts.insert( make_pair(
"base", prob * as2Pi(scale2, order, renormMultFac) ));
6395 if (settingsPtr->parm(
"Variations:muRisrDown") != 1.)
6396 wts.insert( make_pair(
"Variations:muRisrDown", prob
6397 * as2Pi(scale2, order, (scale2 > pT2minVariations)
6398 ? settingsPtr->parm(
"Variations:muRisrDown")*renormMultFac :
6400 if (settingsPtr->parm(
"Variations:muRisrUp") != 1.)
6401 wts.insert( make_pair(
"Variations:muRisrUp", prob
6402 * as2Pi(scale2, order, (scale2 > pT2minVariations)
6403 ? settingsPtr->parm(
"Variations:muRisrUp")*renormMultFac :
6408 for ( unordered_map<string,double>::iterator it = wts.begin();
6409 it != wts.end(); ++it )
6413 wts.insert( make_pair(
"base_order_as2", wts[
"base"] ));
6417 for ( unordered_map<string,double>::iterator it = wts.begin();
6418 it != wts.end(); ++it )
6419 kernelVals.insert(make_pair( it->first, it->second ));
6432 bool Dire_isr_qcd_Q2QbarQQId::canRadiate (
const Event& state,
6434 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*) {
6435 return (!state[ints.first].isFinal()
6436 && state[ints.second].colType() != 0
6437 && hasSharedColor(state, ints.first, ints.second)
6438 && state[ints.first].isQuark() );
6441 bool Dire_isr_qcd_Q2QbarQQId::canRadiate (
const Event& state,
int iRadBef,
6442 int iRecBef, Settings*, PartonSystems*, BeamParticle*) {
6443 if (orderSave < 3)
return false;
6444 return ( !state[iRadBef].isFinal()
6445 && state[iRecBef].colType() != 0
6446 && hasSharedColor(state, iRadBef, iRecBef)
6447 && state[iRadBef].isQuark());
6450 int Dire_isr_qcd_Q2QbarQQId::kinMap() {
return 2;}
6451 int Dire_isr_qcd_Q2QbarQQId::motherID(
int idDaughter) {
return -idDaughter;}
6452 int Dire_isr_qcd_Q2QbarQQId::sisterID(
int) {
return 1;}
6453 double Dire_isr_qcd_Q2QbarQQId::gaugeFactor (
int,
int ) {
return CF;}
6454 double Dire_isr_qcd_Q2QbarQQId::symmetryFactor (
int,
int ) {
return 1.;}
6456 int Dire_isr_qcd_Q2QbarQQId::radBefID(
int idRA,
int) {
6457 if (particleDataPtr->isQuark(idRA))
return idRA;
6460 pair<int,int> Dire_isr_qcd_Q2QbarQQId::radBefCols(
6461 int colRadAfter,
int,
6462 int colEmtAfter,
int acolEmtAfter) {
6463 bool isQuark = (colRadAfter > 0);
6464 if (isQuark)
return make_pair(colEmtAfter,0);
6465 return make_pair(0,acolEmtAfter);
6469 double Dire_isr_qcd_Q2QbarQQId::zSplit(
double zMinAbs,
double zMaxAbs,
6471 double Rz = rndmPtr->flat();
6472 double kappa2 = pow2(settingsPtr->parm(
"SpaceShower:pTmin"))/m2dip;
6474 double res = pow( (pow(kappa2,1) + zMaxAbs)/(pow(kappa2,1) + zMinAbs), -Rz )
6475 * (pow(kappa2,1) + zMaxAbs - pow(kappa2,1)
6476 *pow((pow(kappa2,1) + zMaxAbs)/(pow(kappa2,1)
6481 if ( splitInfo.recBef()->isFinal && splitInfo.radBef()->id < 0 ) {
6482 double k = pow(kappa2,1);
6484 * tan( Rz*atan(zMaxAbs*pow(k,-0.5))
6485 - (Rz-1.)*atan(zMinAbs*pow(k,-0.5)));
6492 double Dire_isr_qcd_Q2QbarQQId::overestimateInt(
double zMinAbs,
double zMaxAbs,
6493 double,
double m2dip,
int orderNow) {
6496 int order = (orderNow > -1) ? orderNow : correctionOrder;
6497 if (order < 3)
return 0.0;
6499 double preFac = symmetryFactor() * gaugeFactor();
6500 double pT2min = pow2(settingsPtr->parm(
"SpaceShower:pTmin"));
6501 double kappa2 = pT2min/m2dip;
6503 double wt = preFac * TR * 20./9.
6504 * log( ( pow(kappa2,1) + zMaxAbs) / ( pow(kappa2,1) + zMinAbs) );
6508 if ( splitInfo.recBef()->isFinal && splitInfo.radBef()->id < 0 ) {
6509 double k = pow(kappa2,1);
6510 wt = preFac * TR * 20./9.
6511 * ( atan(zMaxAbs*pow(k,-0.5))
6512 - atan(zMinAbs*pow(k,-0.5)))*pow(k,-0.5);
6518 wt *= as2Pi(pT2min);
6524 double Dire_isr_qcd_Q2QbarQQId::overestimateDiff(
double z,
double m2dip,
6528 int order = (orderNow > -1) ? orderNow : correctionOrder;
6529 if (order < 3)
return 0.0;
6532 double preFac = symmetryFactor() * gaugeFactor();
6533 double pT2min = pow2(settingsPtr->parm(
"SpaceShower:pTmin"));
6534 double kappa2 = pT2min/m2dip;
6536 wt = preFac * TR * 20./9. * 1. / ( z + kappa2);
6540 if ( splitInfo.recBef()->isFinal && splitInfo.radBef()->id < 0 )
6541 wt = preFac * TR * 20./ 9. * 1. / (z*z + pow(kappa2,1));
6546 wt *= as2Pi(pT2min);
6552 bool Dire_isr_qcd_Q2QbarQQId::calc(
const Event& state,
int orderNow) {
6555 if (
false) cout << state[0].e() << orderNow << endl;
6558 double z(splitInfo.kinematics()->z),
6559 pT2(splitInfo.kinematics()->pT2),
6560 m2dip(splitInfo.kinematics()->m2Dip),
6561 xa(splitInfo.kinematics()->xa),
6562 sai(splitInfo.kinematics()->sai),
6563 m2aij(splitInfo.kinematics()->m2RadBef),
6564 m2a(splitInfo.kinematics()->m2RadAft),
6565 m2i(splitInfo.kinematics()->m2EmtAft),
6566 m2j(splitInfo.kinematics()->m2EmtAft2),
6567 m2k(splitInfo.kinematics()->m2Rec);
6570 unordered_map<string,double> wts;
6571 int order = (orderNow > -1) ? orderNow : correctionOrder;
6572 if (order < 3 || m2aij > 0. || m2a > 0. || m2i > 0. || m2j > 0. || m2k > 0.){
6573 wts.insert( make_pair(
"base", 0.) );
6574 if (doVariations && settingsPtr->parm(
"Variations:muRisrDown") != 1.)
6575 wts.insert( make_pair(
"Variations:muRisrDown", 0.));
6576 if (doVariations && settingsPtr->parm(
"Variations:muRisrUp") != 1.)
6577 wts.insert( make_pair(
"Variations:muRisrUp", 0.));
6579 for ( unordered_map<string,double>::iterator it = wts.begin();
6580 it != wts.end(); ++it )
6581 kernelVals.insert(make_pair( it->first, it->second ));
6587 bool isEndpoint = (rndmPtr->flat() < 0.5);
6589 Event trialEvent(state);
6590 bool physical =
true;
6591 if (splitInfo.recBef()->isFinal)
6592 physical = isr->branch_IF(trialEvent,
true, &splitInfo);
6594 physical = isr->branch_II(trialEvent,
true, &splitInfo);
6597 Vec4 pa(trialEvent[splitInfo.iRadAft].p());
6598 Vec4 pk(trialEvent[splitInfo.iRecAft].p());
6599 Vec4 pj(trialEvent[splitInfo.iEmtAft].p());
6600 Vec4 pi(trialEvent[splitInfo.iEmtAft2].p());
6601 double sign = (splitInfo.recBef()->isFinal) ? 1. : -1.;
6602 double p2ai(-sai + m2a + m2i),
6603 p2aj( (-pa+pj).m2Calc()),
6604 p2ak( (-pa+sign*pk).m2Calc()),
6605 p2ij( (pi+pj).m2Calc()),
6606 p2ik( (pi+sign*pk).m2Calc()),
6607 p2jk( (pj+sign*pk).m2Calc());
6608 double saij = (-pa+pi+pj).m2Calc();
6609 double q2 = (-pa + sign*pk + pi + pj).m2Calc();
6610 double z1(-sign*pa*pk/(-sign*pk*(pa-pi-pj))),
6611 z2(sign*pi*pk/(-sign*pk*(pa-pi-pj))),
6613 double pT2min = pow2(settingsPtr->parm(
"SpaceShower:pTmin"));
6614 if ( z1< 1. || z2 > 0. || z3 > 0.)
6616 if ( splitInfo.recBef()->isFinal && -(q2+pT2/xa-p2ai) < pT2min)
6620 if ( abs(pa.m2Calc()-m2a) > sai || abs(pi.m2Calc()-m2i) > sai
6621 || abs(pj.m2Calc()-m2j) > sai || abs(pk.m2Calc()-m2k) > sai)
6626 wts.insert( make_pair(
"base", 0.) );
6627 if (doVariations && settingsPtr->parm(
"Variations:muRisrDown") != 1.)
6628 wts.insert( make_pair(
"Variations:muRisrDown", 0.));
6629 if (doVariations && settingsPtr->parm(
"Variations:muRisrUp") != 1.)
6630 wts.insert( make_pair(
"Variations:muRisrUp", 0.));
6632 for ( unordered_map<string,double>::iterator it = wts.begin();
6633 it != wts.end(); ++it )
6634 kernelVals.insert(make_pair( it->first, it->second ));
6642 prob = CF*TR*((1.0+z3*z3)/(1.0-z3)
6643 +(1.0-2.0*z1*z2/pow2(z1+z2))*(1.0-z3+(1.0+z3*z3)/(1.0-z3)
6644 *(log(z2/z1*z3/(1-z3))-1.0)));
6646 prob+= CF*TR*((1.0+z2*z2)/(1.0-z2)
6647 +(1.0-2.0*z1*z3/pow2(z1+z3))*(1.0-z2+(1.0+z2*z2)/(1.0-z2)
6648 *(log(z3/z1*z2/(1-z2))-1.0)));
6650 prob-= CF*TR*2.0*((1.0+z3*z3)/(1.0-z3)*log(-z3/(1.0-z3)) +1.0-z3)
6651 *(1.0-2.0*z1*z2/pow2(z1+z2));
6653 prob-= CF*TR*2.0*((1.0+z2*z2)/(1.0-z2)*log(-z2/(1.0-z2)) +1.0-z2)
6654 *(1.0-2.0*z1*z3/pow2(z1+z3));
6661 prob *= z/xa * 1. / (1.-p2ai/saij);
6665 double s12(p2ai), s13(p2aj), s23(p2ij), s123(saij);
6666 double t123 = 2.*(z1*s23 - z2*s13)/(z1+z2) + (z1-z2)/(z1+z2)*s12;
6667 double CG = 0.5*CF*TR*s123/s12
6668 *( - pow2(t123)/ (s12*s123)
6669 + (4.*z3 + pow2(z1-z2))/(z1+z2) + z1 + z2 - s12/s123 );
6671 double t132 = 2.*(z1*s23 - z3*s12)/(z1+z3) + (z1-z3)/(z1+z3)*s13;
6672 CG += 0.5*CF*TR*s123/s13
6673 *( - pow2(t132)/ (s13*s123)
6674 + (4.*z2 + pow2(z1-z3))/(z1+z3) + z1 + z3 - s13/s123 );
6676 CG += CF*(CF-0.5*CA)
6678 + s123/s12 * ( (1.+z1*z1)/(1-z2) - 2.*z2/(1.-z3) )
6679 - s123*s123/(s12*s13) * 0.5*z1*(1.+z1*z1) / ((1.-z2)*(1.-z3)));
6681 CG += CF*(CF-0.5*CA)
6683 + s123/s13 * ( (1.+z1*z1)/(1-z3) - 2.*z3/(1.-z2) )
6684 - s123*s123/(s13*s12) * 0.5*z1*(1.+z1*z1) / ((1.-z3)*(1.-z2)));
6686 double cosPhiKT1KT3 = pow2(p2ij*p2ak - p2aj*p2ik + p2ai*p2jk)
6687 / (4.*p2ai*p2ij*p2ak*p2jk);
6688 double subt = CF*TR*s123/s12
6689 * ( (1.+z3*z3) / (1.-z3) * (1.-2.*z1*z2/pow2(1-z3))
6690 + 4.*z1*z2*z3 / pow(1.-z3,3) * (1-2.*cosPhiKT1KT3) );
6692 double cosPhiKT1KT2 = pow2(p2ij*p2ak + p2aj*p2ik - p2ai*p2jk)
6693 / (4.*p2aj*p2ij*p2ak*p2ik);
6694 subt += CF*TR*s123/s13
6695 * ( (1.+z2*z2) / (1.-z2) * (1.-2.*z1*z3/pow2(1-z2))
6696 + 4.*z1*z3*z2 / pow(1.-z2,3) * (1-2.*cosPhiKT1KT2) );
6699 if ( abs(s12) < 1e-10) prob = 0.0;
6706 prob *= z/xa * 1. / (1.-p2ai/saij);
6711 prob *= (1.-xa) / (1-z);
6714 if (isEndpoint) { splitInfo.set_sai(0.0); }
6717 double scale2 = couplingScale2 ( z, pT2, m2dip,
6718 make_pair (splitInfo.radBef()->id, splitInfo.radBef()->isFinal),
6719 make_pair (splitInfo.recBef()->id, splitInfo.recBef()->isFinal));
6720 if (scale2 < 0.) scale2 = pT2;
6723 wts.insert( make_pair(
"base", prob * as2Pi(scale2, order, renormMultFac) ));
6726 if (settingsPtr->parm(
"Variations:muRisrDown") != 1.)
6727 wts.insert( make_pair(
"Variations:muRisrDown", prob
6728 * as2Pi(scale2, order, (scale2 > pT2minVariations)
6729 ? settingsPtr->parm(
"Variations:muRisrDown")*renormMultFac :
6731 if (settingsPtr->parm(
"Variations:muRisrUp") != 1.)
6732 wts.insert( make_pair(
"Variations:muRisrUp", prob
6733 * as2Pi(scale2, order, (scale2 > pT2minVariations)
6734 ? settingsPtr->parm(
"Variations:muRisrUp")*renormMultFac :
6739 for ( unordered_map<string,double>::iterator it = wts.begin();
6740 it != wts.end(); ++it )
6744 wts.insert( make_pair(
"base_order_as2", wts[
"base"] ));
6748 for ( unordered_map<string,double>::iterator it = wts.begin();
6749 it != wts.end(); ++it )
6750 kernelVals.insert(make_pair( it->first, it->second ));
6759 bool Dire_fsr_qcd_Q2QG_notPartial::canRadiate (
const Event& state,
6761 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*) {
6762 return ( state[ints.first].isFinal()
6763 && state[ints.second].colType() == 0
6764 && state[ints.first].isQuark() );
6767 bool Dire_fsr_qcd_Q2QG_notPartial::canRadiate (
const Event& state,
int iRadBef,
6768 int iRecBef, Settings*, PartonSystems*, BeamParticle*) {
6769 return ( state[iRadBef].isFinal()
6770 && state[iRecBef].colType() == 0
6771 && state[iRadBef].isQuark());
6774 int Dire_fsr_qcd_Q2QG_notPartial::kinMap() {
return 1;}
6775 int Dire_fsr_qcd_Q2QG_notPartial::motherID(
int idDaughter) {
return idDaughter;}
6776 int Dire_fsr_qcd_Q2QG_notPartial::sisterID(
int) {
return 21;}
6777 double Dire_fsr_qcd_Q2QG_notPartial::gaugeFactor (
int,
int ) {
return CF;}
6778 double Dire_fsr_qcd_Q2QG_notPartial::symmetryFactor (
int,
int ) {
return 1.;}
6780 int Dire_fsr_qcd_Q2QG_notPartial::radBefID(
int idRA,
int) {
6781 if (particleDataPtr->isQuark(idRA))
return idRA;
6785 vector<pair<int,int> > Dire_fsr_qcd_Q2QG_notPartial::radAndEmtCols(
int iRad,
6787 vector< pair<int,int> > ret;
6788 if (!state[iRad].isQuark() || state[splitInfo.iRecBef].colType() != 0)
6791 int colType = (state[iRad].id() > 0) ? 1 : -1;
6792 int newCol1 = state.nextColTag();
6793 int colRadAft = (colType > 0) ? newCol1 : state[iRad].col();
6794 int acolRadAft = (colType > 0) ? state[iRad].acol() : newCol1;
6795 int colEmtAft1 = (colType > 0) ? state[iRad].col() : newCol1;
6796 int acolEmtAft1 = (colType > 0) ? newCol1 : state[iRad].acol();
6798 ret = createvector<pair<int,int> >
6799 (make_pair(colRadAft, acolRadAft))
6800 (make_pair(colEmtAft1, acolEmtAft1));
6805 pair<int,int> Dire_fsr_qcd_Q2QG_notPartial::radBefCols(
6806 int colRadAfter,
int,
6807 int colEmtAfter,
int acolEmtAfter) {
6808 bool isQuark = (colRadAfter > 0);
6809 if (isQuark)
return make_pair(colEmtAfter,0);
6810 return make_pair(0,acolEmtAfter);
6813 vector <int> Dire_fsr_qcd_Q2QG_notPartial::recPositions(
const Event&,
6815 return vector<int>();
6819 double Dire_fsr_qcd_Q2QG_notPartial::zSplit(
double zMinAbs,
double,
6821 double Rz = rndmPtr->flat();
6823 double kappaMin4 = pow4(settingsPtr->parm(
"TimeShower:pTmin"))/pow2(m2dip);
6824 double p = pow( 1. + pow2(1-zMinAbs)/kappaMin4, Rz );
6825 double res = 1. - sqrt( p - 1. )*sqrt(kappaMin4);
6830 double Dire_fsr_qcd_Q2QG_notPartial::overestimateInt(
double zMinAbs,
double,
6831 double,
double m2dip,
int) {
6834 double preFac = symmetryFactor() * gaugeFactor();
6835 double kappaMin4 = pow4(settingsPtr->parm(
"TimeShower:pTmin"))/pow2(m2dip);
6837 *2. * 0.5 * log( 1. + pow2(1.-zMinAbs)/kappaMin4);
6842 double Dire_fsr_qcd_Q2QG_notPartial::overestimateDiff(
double z,
double m2dip,
6845 double preFac = symmetryFactor() * gaugeFactor();
6846 double kappaMin4 = pow4(settingsPtr->parm(
"TimeShower:pTmin"))/pow2(m2dip);
6848 *2. * (1.-z) / ( pow2(1.-z) + kappaMin4);
6853 bool Dire_fsr_qcd_Q2QG_notPartial::calc(
const Event& state,
int) {
6856 if (
false) cout << state[0].e() << endl;
6859 double z(splitInfo.kinematics()->z), pT2(splitInfo.kinematics()->pT2),
6860 m2dip(splitInfo.kinematics()->m2Dip),
6861 m2RadBef(splitInfo.kinematics()->m2RadBef),
6862 m2Rad(splitInfo.kinematics()->m2RadAft),
6863 m2Rec(splitInfo.kinematics()->m2Rec),
6864 m2Emt(splitInfo.kinematics()->m2EmtAft);
6865 int splitType(splitInfo.type);
6869 double preFac = symmetryFactor() * gaugeFactor();
6870 double kappa2 = max(pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip,
6873 unordered_map<string,double> wts;
6874 double wt_base_as1 = preFac * 2. / (1.-z);
6876 wts.insert( make_pair(
"base", wt_base_as1 ) );
6879 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
6880 wts.insert( make_pair(
"Variations:muRfsrDown", wt_base_as1 ));
6881 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
6882 wts.insert( make_pair(
"Variations:muRfsrUp", wt_base_as1 ));
6886 bool doMassive = (abs(splitType) == 2);
6890 wt_base_as1 += -preFac * ( 1.+z );
6891 for ( unordered_map<string,double>::iterator it = wts.begin();
6892 it != wts.end(); ++it)
6893 it->second += -preFac * ( 1.+z );
6899 double pipj = 0., vijkt = 1., vijk = 1.;
6902 if (splitType == 2) {
6905 double yCS = kappa2 / (1.-z);
6906 double nu2RadBef = m2RadBef/m2dip;
6907 double nu2Rad = m2Rad/m2dip;
6908 double nu2Emt = m2Emt/m2dip;
6909 double nu2Rec = m2Rec/m2dip;
6910 vijk = pow2(1.-yCS) - 4.*(yCS+nu2Rad+nu2Emt)*nu2Rec;
6911 double Q2mass = m2dip + m2Rad + m2Rec + m2Emt;
6912 vijkt = pow2(Q2mass/m2dip - nu2RadBef - nu2Rec)
6913 - 4.*nu2RadBef*nu2Rec;
6914 vijk = sqrt(vijk) / (1-yCS);
6915 vijkt = sqrt(vijkt)/ (Q2mass/m2dip - nu2RadBef - nu2Rec);
6916 pipj = m2dip * yCS/2.;
6919 }
else if (splitType ==-2) {
6922 double xCS = 1 - kappa2/(1.-z);
6925 pipj = m2dip/2. * (1-xCS)/xCS;
6929 double massCorr = -1.*vijkt/vijk*( 1. + z + m2RadBef/pipj);
6930 for ( unordered_map<string,double>::iterator it = wts.begin();
6931 it != wts.end(); ++it)
6932 it->second += preFac * massCorr;
6934 wt_base_as1 += preFac * massCorr;
6938 wts.insert( make_pair(
"base_order_as2", wts[
"base"] - wt_base_as1 ));
6942 for ( unordered_map<string,double>::iterator it = wts.begin();
6943 it != wts.end(); ++it )
6944 kernelVals.insert(make_pair( it->first, it->second ));
6953 bool Dire_fsr_qcd_G2GG_notPartial::canRadiate (
const Event& state,
6955 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*) {
6956 return ( state[ints.first].isFinal()
6957 && state[ints.second].colType() == 0
6958 && state[ints.first].id() == 21 );
6961 bool Dire_fsr_qcd_G2GG_notPartial::canRadiate (
const Event& state,
int iRadBef,
6962 int iRecBef, Settings*, PartonSystems*, BeamParticle*) {
6963 return ( state[iRadBef].isFinal()
6964 && state[iRecBef].colType() == 0
6965 && state[iRadBef].
id() == 21);
6969 int Dire_fsr_qcd_G2GG_notPartial::kinMap() {
return 1;}
6970 int Dire_fsr_qcd_G2GG_notPartial::motherID(
int) {
return 21;}
6971 int Dire_fsr_qcd_G2GG_notPartial::sisterID(
int) {
return 21;}
6972 double Dire_fsr_qcd_G2GG_notPartial::gaugeFactor (
int,
int ) {
return 2.*CA;}
6973 double Dire_fsr_qcd_G2GG_notPartial::symmetryFactor (
int,
int ) {
return 0.5;}
6974 int Dire_fsr_qcd_G2GG_notPartial::radBefID(
int idRA,
int) {
6975 if (idRA == 21)
return idRA;
6979 vector<pair<int,int> > Dire_fsr_qcd_G2GG_notPartial::radAndEmtCols(
int iRad,
6980 int colType,
Event state) {
6981 vector< pair<int,int> > ret;
6982 if (state[iRad].
id() != 21 || state[splitInfo.iRecBef].colType() != 0)
6985 int newCol1 = state.nextColTag();
6986 int colRadAft = (colType > 0) ? newCol1 : state[iRad].col();
6987 int acolRadAft = (colType > 0) ? state[iRad].acol() : newCol1;
6988 int colEmtAft1 = (colType > 0) ? state[iRad].col() : newCol1;
6989 int acolEmtAft1 = (colType > 0) ? newCol1 : state[iRad].acol();
6991 ret = createvector<pair<int,int> >
6992 (make_pair(colRadAft, acolRadAft))
6993 (make_pair(colEmtAft1, acolEmtAft1));
6998 pair<int,int> Dire_fsr_qcd_G2GG_notPartial::radBefCols(
6999 int colRadAfter,
int acolRadAfter,
7000 int colEmtAfter,
int acolEmtAfter) {
7001 int colRemove = (colRadAfter == acolEmtAfter)
7002 ? colRadAfter : acolRadAfter;
7003 int col = (colRadAfter == colRemove)
7004 ? colEmtAfter : colRadAfter;
7005 int acol = (acolRadAfter == colRemove)
7006 ? acolEmtAfter : acolRadAfter;
7007 return make_pair(col,acol);
7010 vector <int> Dire_fsr_qcd_G2GG_notPartial::recPositions(
const Event&,
int,
7012 return vector <int>();
7016 double Dire_fsr_qcd_G2GG_notPartial::zSplit(
double zMinAbs,
double,
7019 double R = rndmPtr->flat();
7020 double kappaMin4 = pow4(settingsPtr->parm(
"TimeShower:pTmin"))/pow2(m2dip);
7021 double p = pow( 1. + pow2(1-zMinAbs)/kappaMin4, R );
7022 double res = 1. - sqrt( p - 1. )*sqrt(kappaMin4);
7027 double Dire_fsr_qcd_G2GG_notPartial::overestimateInt(
double zMinAbs,
double,
7028 double,
double m2dip,
int) {
7031 double preFac = symmetryFactor() * gaugeFactor();
7032 double kappaMin4 = pow4(settingsPtr->parm(
"TimeShower:pTmin"))/pow2(m2dip);
7033 double wt = preFac * 0.5 * log( 1. + pow2(1.-zMinAbs)/kappaMin4);
7038 double Dire_fsr_qcd_G2GG_notPartial::overestimateDiff(
double z,
double m2dip,
7041 double preFac = symmetryFactor() * gaugeFactor();
7042 double kappaMin4 = pow4(settingsPtr->parm(
"TimeShower:pTmin"))/pow2(m2dip);
7043 double wt = preFac * (1.-z) / ( pow2(1.-z) + kappaMin4);
7048 bool Dire_fsr_qcd_G2GG_notPartial::calc(
const Event& state,
int) {
7051 if (
false) cout << state[0].e() << endl;
7054 double z(splitInfo.kinematics()->z), pT2(splitInfo.kinematics()->pT2),
7055 m2dip(splitInfo.kinematics()->m2Dip),
7057 m2Rad(splitInfo.kinematics()->m2RadAft),
7058 m2Rec(splitInfo.kinematics()->m2Rec),
7059 m2Emt(splitInfo.kinematics()->m2EmtAft);
7060 int splitType(splitInfo.type);
7062 double preFac = symmetryFactor() * gaugeFactor();
7063 double kappa2 = max(pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip,
7068 unordered_map<string,double> wts;
7069 double wt_base_as1 = preFac * (1 / (1.-z) + 1/z);
7071 wts.insert( make_pair(
"base", wt_base_as1 ));
7074 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
7075 wts.insert( make_pair(
"Variations:muRfsrDown", wt_base_as1 ));
7076 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
7077 wts.insert( make_pair(
"Variations:muRfsrUp", wt_base_as1 ));
7081 bool doMassive = (abs(splitType) == 2);
7085 for ( unordered_map<string,double>::iterator it = wts.begin();
7086 it != wts.end(); ++it)
7087 it->second += preFac * ( -2. + z*(1.-z) );
7088 wt_base_as1 += preFac * ( -2. + z*(1.-z) );
7097 if (splitType == 2) {
7099 double yCS = kappa2 / (1.-z);
7100 double nu2Rad = m2Rad/m2dip;
7101 double nu2Emt = m2Emt/m2dip;
7102 double nu2Rec = m2Rec/m2dip;
7103 vijk = pow2(1.-yCS) - 4.*(yCS+nu2Rad+nu2Emt)*nu2Rec;
7104 vijk = sqrt(vijk) / (1-yCS);
7107 }
else if (splitType ==-2) {
7113 for ( unordered_map<string,double>::iterator it = wts.begin();
7114 it != wts.end(); ++it)
7115 it->second += preFac * 1./ vijk * ( -2. + z*(1.-z) );
7117 wt_base_as1 += preFac * 1./ vijk * ( -2. + z*(1.-z) );
7121 wts.insert( make_pair(
"base_order_as2", wts[
"base"] - wt_base_as1 ));
7125 for ( unordered_map<string,double>::iterator it = wts.begin();
7126 it != wts.end(); ++it)
7127 kernelVals.insert(make_pair( it->first, it->second ));
7140 bool Dire_fsr_qcd_G2QQ_notPartial::canRadiate (
const Event& state,
7142 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*) {
7143 return ( state[ints.first].isFinal()
7144 && state[ints.second].colType() == 0
7145 && state[ints.first].id() == 21 );
7148 bool Dire_fsr_qcd_G2QQ_notPartial::canRadiate (
const Event& state,
int iRadBef,
7149 int iRecBef, Settings*, PartonSystems*, BeamParticle*) {
7150 return ( state[iRadBef].isFinal()
7151 && state[iRecBef].colType() == 0
7152 && state[iRadBef].
id() == 21);
7155 int Dire_fsr_qcd_G2QQ_notPartial::kinMap() {
return 1;}
7156 int Dire_fsr_qcd_G2QQ_notPartial::motherID(
int) {
return 1;}
7157 int Dire_fsr_qcd_G2QQ_notPartial::sisterID(
int) {
return 1;}
7158 double Dire_fsr_qcd_G2QQ_notPartial::gaugeFactor (
int,
int ) {
7159 return 2.*NF_qcd_fsr*TR;}
7160 double Dire_fsr_qcd_G2QQ_notPartial::symmetryFactor (
int,
int ) {
return 0.5;}
7162 int Dire_fsr_qcd_G2QQ_notPartial::radBefID(
int idRA,
int) {
7163 if (particleDataPtr->isQuark(idRA))
return 21;
7167 vector<pair<int,int> > Dire_fsr_qcd_G2QQ_notPartial::radAndEmtCols(
int iRad,
7168 int colType,
Event state) {
7169 vector< pair<int,int> > ret;
7170 if ( !particleDataPtr->isQuark(state[iRad].id())
7171 || state[splitInfo.iRecBef].colType() != 0)
7174 int newCol1 = state.nextColTag();
7175 int colRadAft = (colType > 0) ? newCol1 : state[iRad].col();
7176 int acolRadAft = (colType > 0) ? state[iRad].acol() : newCol1;
7177 int colEmtAft1 = (colType > 0) ? state[iRad].col() : newCol1;
7178 int acolEmtAft1 = (colType > 0) ? newCol1 : state[iRad].acol();
7180 ret = createvector<pair<int,int> >
7181 (make_pair(colRadAft, acolRadAft))
7182 (make_pair(colEmtAft1, acolEmtAft1));
7187 pair<int,int> Dire_fsr_qcd_G2QQ_notPartial::radBefCols(
7188 int colRadAfter,
int acolRadAfter,
7189 int colEmtAfter,
int acolEmtAfter) {
7190 int col = (colRadAfter > 0) ? colRadAfter : colEmtAfter;
7191 int acol = (acolRadAfter > 0) ? acolRadAfter : acolEmtAfter;
7192 return make_pair(col,acol);
7195 vector <int> Dire_fsr_qcd_G2QQ_notPartial::recPositions(
const Event&,
int,
7197 return vector <int>();
7201 double Dire_fsr_qcd_G2QQ_notPartial::zSplit(
double zMinAbs,
double zMaxAbs,
7203 return (zMinAbs + rndmPtr->flat() * (zMaxAbs - zMinAbs));
7207 double Dire_fsr_qcd_G2QQ_notPartial::overestimateInt(
double zMinAbs,
7208 double zMaxAbs,
double,
double,
int) {
7210 double preFac = symmetryFactor() * gaugeFactor();
7211 wt = 2.*preFac * 0.5 * ( zMaxAbs - zMinAbs);
7216 double Dire_fsr_qcd_G2QQ_notPartial::overestimateDiff(
double,
double,
int) {
7218 double preFac = symmetryFactor() * gaugeFactor();
7219 wt = 2.*preFac * 0.5;
7224 bool Dire_fsr_qcd_G2QQ_notPartial::calc(
const Event& state,
int) {
7227 if (
false) cout << state[0].e() << endl;
7230 double z(splitInfo.kinematics()->z), pT2(splitInfo.kinematics()->pT2),
7231 m2dip(splitInfo.kinematics()->m2Dip),
7232 m2Rad(splitInfo.kinematics()->m2RadAft),
7233 m2Rec(splitInfo.kinematics()->m2Rec),
7234 m2Emt(splitInfo.kinematics()->m2EmtAft);
7235 int splitType(splitInfo.type);
7237 double preFac = symmetryFactor() * gaugeFactor();
7238 double kappa2 = max(pow2(settingsPtr->parm(
"TimeShower:pTmin"))
7241 unordered_map<string,double> wts;
7242 double wt_base_as1 = preFac * ( pow(1.-z,2.) + pow(z,2.) );
7243 wts.insert( make_pair(
"base", wt_base_as1 ));
7246 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
7247 wts.insert( make_pair(
"Variations:muRfsrDown", wt_base_as1 ));
7248 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
7249 wts.insert( make_pair(
"Variations:muRfsrUp", wt_base_as1 ));
7253 bool doMassive = (abs(splitType) == 2);
7257 double vijk = 1., pipj = 0.;
7260 if (splitType == 2) {
7262 double yCS = kappa2 / (1.-z);
7263 double nu2Rad = m2Rad/m2dip;
7264 double nu2Emt = m2Emt/m2dip;
7265 double nu2Rec = m2Rec/m2dip;
7266 vijk = pow2(1.-yCS) - 4.*(yCS+nu2Rad+nu2Emt)*nu2Rec;
7267 vijk = sqrt(vijk) / (1-yCS);
7268 pipj = m2dip * yCS /2.;
7271 }
else if (splitType ==-2) {
7273 double xCS = 1 - kappa2/(1.-z);
7275 pipj = m2dip/2. * (1-xCS)/xCS;
7279 for ( unordered_map<string,double>::iterator it = wts.begin();
7280 it != wts.end(); ++it)
7281 it->second = preFac * 1. / vijk * ( pow2(1.-z) + pow2(z)
7282 + m2Emt / ( pipj + m2Emt) );
7284 wt_base_as1 = preFac * 1. / vijk * ( pow2(1.-z) + pow2(z)
7285 + m2Emt / ( pipj + m2Emt) );
7289 wts.insert( make_pair(
"base_order_as2", wts[
"base"] - wt_base_as1 ));
7293 for ( unordered_map<string,double>::iterator it = wts.begin();
7294 it != wts.end(); ++it )
7295 kernelVals.insert(make_pair( it->first, it->second ));