9 #include "Pythia8/DireSplittingsEW.h"
10 #include "Pythia8/DireSpace.h"
11 #include "Pythia8/DireTimes.h"
12 #include "Pythia8/DireHistory.h"
22 void DireSplittingEW::init() {
25 int alphaEMorder = settingsPtr->mode(
"SpaceShower:alphaEMorder");
27 alphaEM.init( alphaEMorder, settingsPtr);
30 mZ = particleDataPtr->m0(23);
31 gammaZ = particleDataPtr->mWidth(23);
32 thetaW = 1. / (16. * coupSMPtr->sin2thetaW()
33 * coupSMPtr->cos2thetaW());
34 mW = particleDataPtr->m0(24);
35 gammaW = particleDataPtr->mWidth(24);
37 aem0 = settingsPtr->parm(
"StandardModel:alphaEM0");
39 enhance = settingsPtr->parm(
"Enhance:"+
id);
41 doQEDshowerByQ = (is_fsr) ? settingsPtr->flag(
"TimeShower:QEDshowerByQ")
42 : settingsPtr->flag(
"SpaceShower:QEDshowerByQ");
43 doQEDshowerByL = (is_fsr) ? settingsPtr->flag(
"TimeShower:QEDshowerByL")
44 : settingsPtr->flag(
"SpaceShower:QEDshowerByL");
53 double DireSplittingEW::aem2Pi(
double pT2 ) {
55 double scale = pT2*renormMultFac;
58 double aemPT2pi = alphaEM.alphaEM(scale) / (2.*M_PI);
72 bool Dire_fsr_ew_Q2QZ::canRadiate (
const Event& state, pair<int,int> ints,
73 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*){
74 int nFinPartons(0), nFinQ(0), nFinOther(0);
75 for(
int i=0; i < state.size(); ++i) {
76 if (!state[i].isFinal())
continue;
77 if ( state[i].colType() !=0) {
79 if ( abs(state[i].colType()) == 1) nFinQ++;
82 return ( nFinPartons == 2 && nFinQ > 0 && nFinOther == 0
83 && state[ints.first].isFinal()
84 && state[ints.first].isQuark() );
87 int Dire_fsr_ew_Q2QZ::kinMap() {
return 1;}
88 int Dire_fsr_ew_Q2QZ::motherID(
int idDaughter) {
return idDaughter;}
89 int Dire_fsr_ew_Q2QZ::sisterID(
int) {
return 23;}
90 double Dire_fsr_ew_Q2QZ::gaugeFactor (
int,
int) {
return thetaW; }
91 double Dire_fsr_ew_Q2QZ::symmetryFactor (
int,
int ) {
return 1.;}
92 int Dire_fsr_ew_Q2QZ::radBefID(
int idRA,
int) {
return idRA;}
94 pair<int,int> Dire_fsr_ew_Q2QZ::radBefCols(
95 int colRadAfter,
int acolRadAfter,
96 int,
int) {
return make_pair(colRadAfter,acolRadAfter); }
99 double Dire_fsr_ew_Q2QZ::zSplit(
double zMinAbs,
double,
double m2dip) {
100 double Rz = rndmPtr->flat();
101 double kappa2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
102 double p = pow( 1. + pow2(1-zMinAbs)/kappa2, Rz );
103 double res = 1. - sqrt( p - 1. )*sqrt(kappa2);
108 double Dire_fsr_ew_Q2QZ::overestimateInt(
double zMinAbs,
double,
109 double,
double m2dip,
int) {
111 double preFac = symmetryFactor() * gaugeFactor();
113 double kappa2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
114 wt = preFac * 2. * 0.5 * log( 1. + pow2(1.-zMinAbs)/kappa2);
119 double Dire_fsr_ew_Q2QZ::overestimateDiff(
double z,
double m2dip,
int) {
121 double preFac = symmetryFactor() * gaugeFactor();
122 double kappaOld2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
123 wt = preFac * 2.* (1.-z) / ( pow2(1.-z) + kappaOld2);
128 bool Dire_fsr_ew_Q2QZ::calc(
const Event& state,
int orderNow) {
131 if (
false) cout << state[0].e() << orderNow << endl;
134 double z(splitInfo.kinematics()->z);
137 if ( fsr->weights->hasME(fsr->makeHardEvent(0,state,
true)) ) {
140 Event trialEvent(state);
141 if (splitInfo.recBef()->isFinal)
142 fsr->branch_FF(trialEvent,
true, &splitInfo);
144 fsr->branch_FI(trialEvent,
true, &splitInfo);
147 if ( fsr->weights->hasME(fsr->makeHardEvent(0,trialEvent,
true)) ) {
151 splitInfo.addExtra(
"unitKernel",1.0);
154 double wtNum = fsr->weights->getME(trialEvent);
160 string procSave = settingsPtr->word(
"Merging:process");
161 int nRequestedSave = settingsPtr->mode(
"Merging:nRequested");
164 string procNow =
"pp>jj";
165 settingsPtr->word(
"Merging:process", procNow);
166 fsr->mergingHooksPtr->hardProcess->clear();
167 fsr->mergingHooksPtr->hardProcess->initOnProcess
168 (procNow, particleDataPtr);
169 fsr->mergingHooksPtr->processSave = procNow;
172 fsr->mergingHooksPtr->orderHistories(
false);
173 Event newProcess( fsr->mergingHooksPtr->bareEvent(
174 fsr->makeHardEvent(0, trialEvent,
true),
true) );
178 int nQuarksMerge = settingsPtr->mode(
"Merging:nQuarksMerge");
180 for(
int i=0; i < int(newProcess.size()); ++i)
181 if ( newProcess[i].isFinal()
182 && newProcess[i].colType()!= 0
183 && ( newProcess[i].id() == 21
184 || newProcess[i].idAbs() <= nQuarksMerge))
189 settingsPtr->mode(
"Merging:nRequested", nPartons);
190 fsr->mergingHooksPtr->nRequestedSave
191 = settingsPtr->mode(
"Merging:nRequested");
194 fsr->mergingHooksPtr->storeHardProcessCandidates( newProcess );
200 newProcess.scale(0.0);
202 DireHistory myHistory( nSteps, 0.0, newProcess, DireClustering(),
203 fsr->mergingHooksPtr, (*beamAPtr), (*beamBPtr), particleDataPtr,
205 NULL, fsr, isr, fsr->weights, coupSMPtr,
true,
true,
206 1.0, 1.0, 1.0, 1.0, 0);
208 myHistory.projectOntoDesiredHistories();
211 for ( map<double, DireHistory*>::iterator it =
212 myHistory.goodBranches.begin();
213 it != myHistory.goodBranches.end(); ++it ) {
214 Event psppoint = it->second->state;
215 wtDen += fsr->weights->getME(psppoint);
219 settingsPtr->word(
"Merging:process", procSave);
220 settingsPtr->mode(
"Merging:nRequested",nRequestedSave);
221 fsr->mergingHooksPtr->nRequestedSave
222 = settingsPtr->mode(
"Merging:nRequested");
223 fsr->mergingHooksPtr->hardProcess->initOnProcess
224 (procSave, particleDataPtr);
225 fsr->mergingHooksPtr->processSave = procSave;
226 unordered_map<string, double>::iterator it =
227 splitInfo.extras.find(
"unitKernel");
228 splitInfo.extras.erase(it);
231 if (myHistory.goodBranches.size() == 0) { wtNum = 0.; wtDen = 1.; }
242 unordered_map<string,double> wts;
243 wts.insert( make_pair(
"base", wt ));
246 if (settingsPtr->parm(
"Variations:muRfrDown") != 1.)
247 wts.insert( make_pair(
"Variations:muRfsrDown", wt ));
248 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
249 wts.insert( make_pair(
"Variations:muRfsrUp", wt ));
254 for ( unordered_map<string,double>::iterator it = wts.begin();
255 it != wts.end(); ++it )
256 kernelVals.insert(make_pair( it->first, it->second ));
269 bool Dire_fsr_ew_Q2ZQ::canRadiate (
const Event& state, pair<int,int> ints,
270 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*){
271 int nFinPartons(0), nFinQ(0), nFinOther(0);
272 for(
int i=0; i < state.size(); ++i) {
273 if (!state[i].isFinal())
continue;
274 if ( state[i].colType() !=0) {
276 if ( abs(state[i].colType()) == 1) nFinQ++;
279 return ( nFinPartons == 2 && nFinQ > 0 && nFinOther == 0
280 && state[ints.first].isFinal()
281 && state[ints.first].isQuark() );
284 int Dire_fsr_ew_Q2ZQ::kinMap() {
return 1;}
285 int Dire_fsr_ew_Q2ZQ::motherID(
int idDaughter) {
return idDaughter;}
286 int Dire_fsr_ew_Q2ZQ::sisterID(
int) {
return 23;}
287 double Dire_fsr_ew_Q2ZQ::gaugeFactor (
int,
int) {
return thetaW; }
288 double Dire_fsr_ew_Q2ZQ::symmetryFactor (
int,
int ) {
return 1.;}
289 int Dire_fsr_ew_Q2ZQ::radBefID(
int idRA,
int) {
return idRA;}
291 pair<int,int> Dire_fsr_ew_Q2ZQ::radBefCols(
int colRadAfter,
int acolRadAfter,
292 int,
int) {
return make_pair(colRadAfter,acolRadAfter); }
295 double Dire_fsr_ew_Q2ZQ::zSplit(
double zMinAbs,
double,
double m2dip) {
296 double Rz = rndmPtr->flat();
297 double kappa2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
298 double p = pow( 1. + pow2(1-zMinAbs)/kappa2, Rz );
299 double res = 1. - sqrt( p - 1. )*sqrt(kappa2);
304 double Dire_fsr_ew_Q2ZQ::overestimateInt(
double zMinAbs,
double,
305 double,
double m2dip,
int) {
307 double preFac = symmetryFactor() * gaugeFactor();
309 double kappa2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
310 wt = preFac * 2. * 0.5 * log( 1. + pow2(1.-zMinAbs)/kappa2);
315 double Dire_fsr_ew_Q2ZQ::overestimateDiff(
double z,
double m2dip,
int) {
317 double preFac = symmetryFactor() * gaugeFactor();
318 double kappaOld2 = pow2(settingsPtr->parm(
"TimeShower:pTmin"))/m2dip;
319 wt = preFac * 2.* (1.-z) / ( pow2(1.-z) + kappaOld2);
324 bool Dire_fsr_ew_Q2ZQ::calc(
const Event& state,
int orderNow) {
327 if (
false) cout << state[0].e() << orderNow << endl;
330 double z(splitInfo.kinematics()->z);
333 if ( fsr->weights->hasME(fsr->makeHardEvent(0,state,
true)) ) {
336 Event trialEvent(state);
337 if (splitInfo.recBef()->isFinal)
338 fsr->branch_FF(trialEvent,
true, &splitInfo);
340 fsr->branch_FI(trialEvent,
true, &splitInfo);
343 if ( fsr->weights->hasME(fsr->makeHardEvent(0,trialEvent,
true)) ) {
347 splitInfo.addExtra(
"unitKernel",1.0);
350 double wtNum = fsr->weights->getME(trialEvent);
356 string procSave = settingsPtr->word(
"Merging:process");
357 int nRequestedSave = settingsPtr->mode(
"Merging:nRequested");
360 string procNow =
"pp>jj";
361 settingsPtr->word(
"Merging:process", procNow);
362 fsr->mergingHooksPtr->hardProcess->clear();
363 fsr->mergingHooksPtr->hardProcess->initOnProcess
364 (procNow, particleDataPtr);
365 fsr->mergingHooksPtr->processSave = procNow;
368 fsr->mergingHooksPtr->orderHistories(
false);
369 Event newProcess( fsr->mergingHooksPtr->bareEvent(
370 fsr->makeHardEvent(0, trialEvent,
true),
true) );
374 int nQuarksMerge = settingsPtr->mode(
"Merging:nQuarksMerge");
376 for(
int i=0; i < int(newProcess.size()); ++i)
377 if ( newProcess[i].isFinal()
378 && newProcess[i].colType()!= 0
379 && ( newProcess[i].id() == 21
380 || newProcess[i].idAbs() <= nQuarksMerge))
385 settingsPtr->mode(
"Merging:nRequested", nPartons);
386 fsr->mergingHooksPtr->nRequestedSave
387 = settingsPtr->mode(
"Merging:nRequested");
390 fsr->mergingHooksPtr->storeHardProcessCandidates( newProcess );
396 newProcess.scale(0.0);
398 DireHistory myHistory( nSteps, 0.0, newProcess, DireClustering(),
399 fsr->mergingHooksPtr, (*beamAPtr), (*beamBPtr), particleDataPtr,
401 NULL, fsr, isr, fsr->weights, coupSMPtr,
true,
true,
402 1.0, 1.0, 1.0, 1.0, 0);
404 myHistory.projectOntoDesiredHistories();
407 for ( map<double, DireHistory*>::iterator it =
408 myHistory.goodBranches.begin();
409 it != myHistory.goodBranches.end(); ++it ) {
410 Event psppoint = it->second->state;
411 wtDen += fsr->weights->getME(psppoint);
415 settingsPtr->word(
"Merging:process", procSave);
416 settingsPtr->mode(
"Merging:nRequested",nRequestedSave);
417 fsr->mergingHooksPtr->nRequestedSave
418 = settingsPtr->mode(
"Merging:nRequested");
419 fsr->mergingHooksPtr->hardProcess->initOnProcess
420 (procSave, particleDataPtr);
421 fsr->mergingHooksPtr->processSave = procSave;
423 unordered_map<string, double>::iterator it = splitInfo.extras.find
425 splitInfo.extras.erase(it);
428 if (myHistory.goodBranches.size() == 0) { wtNum = 0.; wtDen = 1.; }
439 unordered_map<string,double> wts;
440 wts.insert( make_pair(
"base", wt ));
443 if (settingsPtr->parm(
"Variations:muRfrDown") != 1.)
444 wts.insert( make_pair(
"Variations:muRfsrDown", wt ));
445 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
446 wts.insert( make_pair(
"Variations:muRfsrUp", wt ));
451 for ( unordered_map<string,double>::iterator it = wts.begin();
452 it != wts.end(); ++it )
453 kernelVals.insert(make_pair( it->first, it->second ));
465 bool Dire_fsr_ew_Z2QQ1::canRadiate (
const Event& state, pair<int,int> ints,
466 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*){
467 return ( state[ints.first].isFinal()
468 && state[ints.first].idAbs() == 23 );
471 int Dire_fsr_ew_Z2QQ1::kinMap() {
return 1;}
472 int Dire_fsr_ew_Z2QQ1::motherID(
int) {
return 1;}
473 int Dire_fsr_ew_Z2QQ1::sisterID(
int) {
return 1;}
474 double Dire_fsr_ew_Z2QQ1::gaugeFactor (
int,
int ) {
return 1.;}
475 double Dire_fsr_ew_Z2QQ1::symmetryFactor (
int,
int ) {
return 1.0;}
477 int Dire_fsr_ew_Z2QQ1::radBefID(
int,
int) {
return 23;}
478 pair<int,int> Dire_fsr_ew_Z2QQ1::radBefCols(
int,
int,
int,
int)
479 {
return make_pair(0,0); }
482 double Dire_fsr_ew_Z2QQ1::zSplit(
double zMinAbs,
double zMaxAbs,
double) {
483 return (zMinAbs + rndmPtr->flat() * (zMaxAbs - zMinAbs));
487 double Dire_fsr_ew_Z2QQ1::overestimateInt(
double zMinAbs,
double zMaxAbs,
488 double,
double,
int) {
490 double preFac = symmetryFactor() * gaugeFactor();
491 wt = 2.*preFac * 0.5 * ( zMaxAbs - zMinAbs);
496 double Dire_fsr_ew_Z2QQ1::overestimateDiff(
double,
double,
int) {
498 double preFac = symmetryFactor() * gaugeFactor();
499 wt = 2.*preFac * 0.5;
504 bool Dire_fsr_ew_Z2QQ1::calc(
const Event& state,
int orderNow) {
507 if (
false) cout << state[0].e() << orderNow << endl;
510 double z(splitInfo.kinematics()->z), pT2(splitInfo.kinematics()->pT2),
511 m2dip(splitInfo.kinematics()->m2Dip),
512 m2Rad(splitInfo.kinematics()->m2RadAft),
513 m2Rec(splitInfo.kinematics()->m2Rec),
514 m2Emt(splitInfo.kinematics()->m2EmtAft);
515 int splitType(splitInfo.type);
518 double preFac = symmetryFactor() * gaugeFactor();
519 double kappa2 = pT2/m2dip;
521 * (pow(1.-z,2.) + pow(z,2.));
524 bool doMassive = (abs(splitType) == 2);
528 double vijk = 1., pipj = 0.;
531 if (splitType == 2) {
533 double yCS = kappa2 / (1.-z);
534 double nu2Rad = m2Rad/m2dip;
535 double nu2Emt = m2Emt/m2dip;
536 double nu2Rec = m2Rec/m2dip;
537 vijk = pow2(1.-yCS) - 4.*(yCS+nu2Rad+nu2Emt)*nu2Rec;
538 vijk = sqrt(vijk) / (1-yCS);
539 pipj = m2dip * yCS /2.;
542 }
else if (splitType ==-2) {
544 double xCS = 1 - kappa2/(1.-z);
546 pipj = m2dip/2. * (1-xCS)/xCS;
550 wt = preFac * 1. / vijk * ( pow2(1.-z) + pow2(z)
551 + m2Emt / ( pipj + m2Emt) );
559 unordered_map<string,double> wts;
560 wts.insert( make_pair(
"base", wt ));
563 if (settingsPtr->parm(
"Variations:muRfrDown") != 1.)
564 wts.insert( make_pair(
"Variations:muRfsrDown", wt ));
565 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
566 wts.insert( make_pair(
"Variations:muRfsrUp", wt ));
571 for ( unordered_map<string,double>::iterator it = wts.begin();
572 it != wts.end(); ++it )
573 kernelVals.insert(make_pair( it->first, it->second ));
586 bool Dire_fsr_ew_Z2QQ2::canRadiate (
const Event& state, pair<int,int> ints,
587 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*){
588 return ( state[ints.first].isFinal()
589 && state[ints.first].idAbs() == 23 );
592 int Dire_fsr_ew_Z2QQ2::kinMap() {
return 1;}
593 int Dire_fsr_ew_Z2QQ2::motherID(
int) {
return -1;}
594 int Dire_fsr_ew_Z2QQ2::sisterID(
int) {
return -1;}
595 double Dire_fsr_ew_Z2QQ2::gaugeFactor (
int,
int ) {
return 1.;}
596 double Dire_fsr_ew_Z2QQ2::symmetryFactor (
int,
int ) {
return 1.0;}
598 int Dire_fsr_ew_Z2QQ2::radBefID(
int,
int){
return 23;}
599 pair<int,int> Dire_fsr_ew_Z2QQ2::radBefCols(
int,
int,
int,
int)
600 {
return make_pair(0,0); }
603 double Dire_fsr_ew_Z2QQ2::zSplit(
double zMinAbs,
double zMaxAbs,
double) {
604 return (zMinAbs + rndmPtr->flat() * (zMaxAbs - zMinAbs));
608 double Dire_fsr_ew_Z2QQ2::overestimateInt(
double zMinAbs,
double zMaxAbs,
609 double pT2old,
double,
int) {
611 double preFac = symmetryFactor() * gaugeFactor();
612 double m2z = particleDataPtr->m0(23);
613 wt = 2.* preFac * 0.5 * ( zMaxAbs - zMinAbs)
619 double Dire_fsr_ew_Z2QQ2::overestimateDiff(
double,
double,
int) {
621 double preFac = symmetryFactor() * gaugeFactor();
622 wt = 2.*preFac * 0.5;
627 bool Dire_fsr_ew_Z2QQ2::calc(
const Event& state,
int orderNow) {
630 if (
false) cout << state[0].e() << orderNow << endl;
633 double z(splitInfo.kinematics()->z), pT2(splitInfo.kinematics()->pT2),
634 m2dip(splitInfo.kinematics()->m2Dip),
635 m2Rad(splitInfo.kinematics()->m2RadAft),
636 m2Rec(splitInfo.kinematics()->m2Rec),
637 m2Emt(splitInfo.kinematics()->m2EmtAft);
638 int splitType(splitInfo.type);
641 double preFac = symmetryFactor() * gaugeFactor();
642 double kappa2 = pT2/m2dip;
644 * (pow(1.-z,2.) + pow(z,2.));
647 bool doMassive = (abs(splitType) == 2);
651 double vijk = 1., pipj = 0.;
654 if (splitType == 2) {
656 double yCS = kappa2 / (1.-z);
657 double nu2Rad = m2Rad/m2dip;
658 double nu2Emt = m2Emt/m2dip;
659 double nu2Rec = m2Rec/m2dip;
660 vijk = pow2(1.-yCS) - 4.*(yCS+nu2Rad+nu2Emt)*nu2Rec;
661 vijk = sqrt(vijk) / (1-yCS);
662 pipj = m2dip * yCS /2.;
665 }
else if (splitType ==-2) {
667 double xCS = 1 - kappa2/(1.-z);
669 pipj = m2dip/2. * (1-xCS)/xCS;
673 wt = preFac * 1. / vijk * ( pow2(1.-z) + pow2(z)
674 + m2Emt / ( pipj + m2Emt) );
681 unordered_map<string,double> wts;
682 wts.insert( make_pair(
"base", wt ));
685 if (settingsPtr->parm(
"Variations:muRfrDown") != 1.)
686 wts.insert( make_pair(
"Variations:muRfsrDown", wt ));
687 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
688 wts.insert( make_pair(
"Variations:muRfsrUp", wt ));
693 for ( unordered_map<string,double>::iterator it = wts.begin();
694 it != wts.end(); ++it )
695 kernelVals.insert(make_pair( it->first, it->second ));
707 bool Dire_fsr_ew_W2QQ1::canRadiate (
const Event& state, pair<int,int> ints,
708 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*){
709 return ( state[ints.first].isFinal()
710 && state[ints.first].idAbs() == 24 );
713 int Dire_fsr_ew_W2QQ1::kinMap() {
return 1;}
714 int Dire_fsr_ew_W2QQ1::motherID(
int) {
return 1;}
715 int Dire_fsr_ew_W2QQ1::sisterID(
int) {
return 1;}
716 double Dire_fsr_ew_W2QQ1::gaugeFactor (
int,
int ) {
return 1.;}
717 double Dire_fsr_ew_W2QQ1::symmetryFactor (
int,
int ) {
return 1.0;}
719 int Dire_fsr_ew_W2QQ1::radBefID(
int idRad,
int idEmt) {
720 int chg = particleDataPtr->charge(idRad) + particleDataPtr->charge(idEmt);
721 if (chg > 0)
return 24;
725 pair<int,int> Dire_fsr_ew_W2QQ1::radBefCols(
int,
int,
int,
int)
726 {
return make_pair(0,0); }
729 double Dire_fsr_ew_W2QQ1::zSplit(
double zMinAbs,
double zMaxAbs,
double) {
730 return (zMinAbs + rndmPtr->flat() * (zMaxAbs - zMinAbs));
734 double Dire_fsr_ew_W2QQ1::overestimateInt(
double zMinAbs,
double zMaxAbs,
735 double,
double,
int) {
737 double preFac = symmetryFactor() * gaugeFactor();
738 wt = 2.*preFac * 0.5 * ( zMaxAbs - zMinAbs);
743 double Dire_fsr_ew_W2QQ1::overestimateDiff(
double,
double,
int) {
745 double preFac = symmetryFactor() * gaugeFactor();
746 wt = 2.*preFac * 0.5;
751 bool Dire_fsr_ew_W2QQ1::calc(
const Event& state,
int orderNow) {
754 if (
false) cout << state[0].e() << orderNow << endl;
757 double z(splitInfo.kinematics()->z);
760 double preFac = symmetryFactor() * gaugeFactor();
762 * (pow(1.-z,2.) + pow(z,2.));
769 unordered_map<string,double> wts;
770 wts.insert( make_pair(
"base", wt ));
773 if (settingsPtr->parm(
"Variations:muRfrDown") != 1.)
774 wts.insert( make_pair(
"Variations:muRfsrDown", wt ));
775 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
776 wts.insert( make_pair(
"Variations:muRfsrUp", wt ));
781 for ( unordered_map<string,double>::iterator it = wts.begin();
782 it != wts.end(); ++it )
783 kernelVals.insert(make_pair( it->first, it->second ));
796 bool Dire_fsr_ew_H2AA::canRadiate (
const Event& state, pair<int,int> ints,
797 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*){
798 return ( state[ints.first].isFinal()
799 && state[ints.first].idAbs() == 25 );
802 int Dire_fsr_ew_H2AA::couplingType (
int,
int) {
return 2; }
803 double Dire_fsr_ew_H2AA::coupling (
double,
double,
double,
double,
804 pair<int,bool>, pair<int,bool>) {
808 bool Dire_fsr_ew_H2AA::canRadiate (
const Event& state,
int iRadBef,
809 int, Settings*, PartonSystems*, BeamParticle*){
810 return ( state[iRadBef].isFinal() && state[iRadBef].
id() == 25);
813 int Dire_fsr_ew_H2AA::kinMap() {
return 1;}
814 int Dire_fsr_ew_H2AA::motherID(
int) {
return 22;}
815 int Dire_fsr_ew_H2AA::sisterID(
int) {
return 22;}
816 double Dire_fsr_ew_H2AA::gaugeFactor (
int,
int ) {
return widthToAA;}
817 double Dire_fsr_ew_H2AA::symmetryFactor (
int,
int ) {
return 1.0;}
819 int Dire_fsr_ew_H2AA::radBefID(
int idRA,
int idEA){
820 if (idRA == 22 && idEA == 22)
return 25;
824 pair<int,int> Dire_fsr_ew_H2AA::radBefCols(
int,
int,
int,
int)
825 {
return make_pair(0,0); }
827 vector<int>Dire_fsr_ew_H2AA::recPositions(
const Event& state,
int iRad,
831 if ( !state[iRad].isFinal()
832 || state[iRad].
id() != 22
833 || state[iEmt].
id() != 22)
return recs;
836 vector<int> iExc(createvector<int>(iRad)(iEmt));
838 for (
int i=0; i < state.size(); ++i) {
839 if ( find(iExc.begin(), iExc.end(), i) != iExc.end() )
continue;
840 if ( state[i].
id() == 21) {
841 if (state[i].isFinal())
843 if (state[i].mother1() == 1 && state[i].mother2() == 0)
845 if (state[i].mother1() == 2 && state[i].mother2() == 0)
855 double Dire_fsr_ew_H2AA::zSplit(
double zMinAbs,
double zMaxAbs,
double) {
856 return (zMinAbs + rndmPtr->flat() * (zMaxAbs - zMinAbs));
860 double Dire_fsr_ew_H2AA::overestimateInt(
double zMinAbs,
double zMaxAbs,
861 double,
double,
int) {
863 double preFac = symmetryFactor() * gaugeFactor();
864 wt = 2.* preFac * 0.5 * ( zMaxAbs - zMinAbs);
869 double Dire_fsr_ew_H2AA::overestimateDiff(
double,
double,
int) {
871 double preFac = symmetryFactor() * gaugeFactor();
872 wt = 2.*preFac * 0.5;
877 bool Dire_fsr_ew_H2AA::calc(
const Event& state,
int orderNow) {
880 if (
false) cout << state[0].e() << orderNow << endl;
881 double preFac = symmetryFactor();
884 double sH = splitInfo.radBef()->m2;
885 double mH = sqrt(sH);
887 double m2Res = pow2(particleDataPtr->m0(25));
888 double widthTotNow = (widthTot > 0.) ? widthTot
889 : particleDataPtr->particleDataEntryPtr(25)->resWidth
891 double sigBW = 8. * M_PI/ ( pow2(sH - m2Res) + pow2(mH * widthTotNow) );
895 double wt = preFac * sigBW * pow2(sH);
898 unordered_map<string,double> wts;
899 wts.insert( make_pair(
"base", wt ));
902 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
903 wts.insert( make_pair(
"Variations:muRfsrDown", wt ));
904 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
905 wts.insert( make_pair(
"Variations:muRfsrUp", wt ));
910 for ( unordered_map<string,double>::iterator it = wts.begin();
911 it != wts.end(); ++it )
912 kernelVals.insert(make_pair( it->first, it->second ));
925 bool Dire_fsr_ew_H2GG::canRadiate (
const Event& state, pair<int,int> ints,
926 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*){
927 return ( state[ints.first].isFinal()
928 && state[ints.first].idAbs() == 25 );
931 int Dire_fsr_ew_H2GG::couplingType (
int,
int) {
return 2; }
932 double Dire_fsr_ew_H2GG::coupling (
double,
double,
double,
double,
933 pair<int,bool>, pair<int,bool>) {
937 bool Dire_fsr_ew_H2GG::canRadiate (
const Event& state,
int iRadBef,
938 int, Settings*, PartonSystems*, BeamParticle*){
939 return ( state[iRadBef].isFinal() && state[iRadBef].
id() == 25);
942 int Dire_fsr_ew_H2GG::kinMap() {
return 1;}
943 int Dire_fsr_ew_H2GG::motherID(
int) {
return 21;}
944 int Dire_fsr_ew_H2GG::sisterID(
int) {
return 21;}
945 double Dire_fsr_ew_H2GG::gaugeFactor (
int,
int ) {
return widthToGG;}
946 double Dire_fsr_ew_H2GG::symmetryFactor (
int,
int ) {
return 1.0;}
948 int Dire_fsr_ew_H2GG::radBefID(
int idRA,
int idEA){
949 if (idRA == 21 && idEA == 21)
return 25;
953 pair<int,int> Dire_fsr_ew_H2GG::radBefCols(
int,
int,
int,
int)
954 {
return make_pair(0,0); }
956 vector<int>Dire_fsr_ew_H2GG::recPositions(
const Event& state,
int iRad,
960 if ( !state[iRad].isFinal()
961 || state[iRad].
id() != 21
962 || state[iEmt].
id() != 21
963 || state[iRad].col() != state[iEmt].acol()
964 || state[iRad].acol() != state[iEmt].col())
return recs;
967 vector<int> iExc(createvector<int>(iRad)(iEmt));
969 for (
int i=0; i < state.size(); ++i) {
970 if ( find(iExc.begin(), iExc.end(), i) != iExc.end() )
continue;
971 if ( state[i].
id() == 21) {
972 if (state[i].isFinal())
974 if (state[i].mother1() == 1 && state[i].mother2() == 0)
976 if (state[i].mother1() == 2 && state[i].mother2() == 0)
986 double Dire_fsr_ew_H2GG::zSplit(
double zMinAbs,
double zMaxAbs,
double) {
987 return (zMinAbs + rndmPtr->flat() * (zMaxAbs - zMinAbs));
991 double Dire_fsr_ew_H2GG::overestimateInt(
double zMinAbs,
double zMaxAbs,
992 double,
double,
int) {
994 double preFac = symmetryFactor() * gaugeFactor();
995 wt = 2.* preFac * 0.5 * ( zMaxAbs - zMinAbs);
1000 double Dire_fsr_ew_H2GG::overestimateDiff(
double,
double,
int) {
1002 double preFac = symmetryFactor() * gaugeFactor();
1003 wt = 2.*preFac * 0.5;
1008 bool Dire_fsr_ew_H2GG::calc(
const Event& state,
int orderNow) {
1011 if (
false) cout << state[0].e() << orderNow << endl;
1013 double preFac = symmetryFactor();
1015 double sH = splitInfo.radBef()->m2;
1016 double mH = sqrt(sH);
1018 double m2Res = pow2(particleDataPtr->m0(25));
1019 double widthTotNow = (widthTot > 0.) ? widthTot
1020 : particleDataPtr->particleDataEntryPtr(25)->resWidth
1022 double sigBW = 8. * M_PI/ ( pow2(sH - m2Res) + pow2(mH * widthTotNow) );
1025 double wt = preFac * sigBW * pow2(sH);
1028 unordered_map<string,double> wts;
1029 wts.insert( make_pair(
"base", wt ));
1032 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
1033 wts.insert( make_pair(
"Variations:muRfsrDown", wt ));
1034 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
1035 wts.insert( make_pair(
"Variations:muRfsrUp", wt ));
1040 for ( unordered_map<string,double>::iterator it = wts.begin();
1041 it != wts.end(); ++it )
1042 kernelVals.insert(make_pair( it->first, it->second ));
1056 bool Dire_fsr_ew_H2WW::canRadiate (
const Event& state, pair<int,int> ints,
1057 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*){
1058 return ( state[ints.first].isFinal()
1059 && state[ints.first].idAbs() == 25 );
1062 int Dire_fsr_ew_H2WW::kinMap() {
return 1;}
1063 int Dire_fsr_ew_H2WW::motherID(
int) {
return 24;}
1064 int Dire_fsr_ew_H2WW::sisterID(
int) {
return 24;}
1065 double Dire_fsr_ew_H2WW::gaugeFactor (
int,
int ) {
return 1.;}
1066 double Dire_fsr_ew_H2WW::symmetryFactor (
int,
int ) {
return 1.0;}
1068 int Dire_fsr_ew_H2WW::radBefID(
int,
int) {
return 25; }
1070 pair<int,int> Dire_fsr_ew_H2WW::radBefCols(
int,
int,
int,
int)
1071 {
return make_pair(0,0); }
1074 double Dire_fsr_ew_H2WW::zSplit(
double zMinAbs,
double zMaxAbs,
double) {
1075 return (zMinAbs + rndmPtr->flat() * (zMaxAbs - zMinAbs));
1079 double Dire_fsr_ew_H2WW::overestimateInt(
double zMinAbs,
double zMaxAbs,
1080 double,
double,
int) {
1082 double preFac = symmetryFactor() * gaugeFactor();
1083 wt = 2.* preFac * 0.5 * ( zMaxAbs - zMinAbs);
1088 double Dire_fsr_ew_H2WW::overestimateDiff(
double,
double,
int) {
1090 double preFac = symmetryFactor() * gaugeFactor();
1091 wt = 2.*preFac * 0.5;
1096 bool Dire_fsr_ew_H2WW::calc(
const Event& state,
int orderNow) {
1099 if (
false) cout << state[0].e() << orderNow << endl;
1101 Event trialEvent(state);
1102 if (splitInfo.recBef()->isFinal)
1103 fsr->branch_FF(trialEvent,
true, &splitInfo);
1105 fsr->branch_FI(trialEvent,
true, &splitInfo);
1107 Vec4 pW1(trialEvent[trialEvent.size()-3].p());
1108 Vec4 pW2(trialEvent[trialEvent.size()-2].p());
1109 Vec4 pRec(trialEvent[trialEvent.size()-1].p());
1112 double m2Bef = pW1.m2Calc();
1116 double yCS = (m2Bef - m2Emt - m2Rad)
1117 / (m2Bef - m2Emt - m2Rad + 2.*pW1*pRec);
1118 double zCS = rndmPtr->flat();
1119 double phi = 2.*M_PI*rndmPtr->flat();
1120 pair < Vec4, Vec4 > decayW1( fsr->decayWithOnshellRec( zCS, yCS, phi, m2Rec,
1121 m2Rad, m2Emt, pW1, pRec) );
1123 m2Bef = pW2.m2Calc();
1127 yCS = (m2Bef - m2Emt - m2Rad) / (m2Bef - m2Emt - m2Rad + 2.*pW2*pRec);
1128 zCS = rndmPtr->flat();
1129 phi = 2.*M_PI*rndmPtr->flat();
1130 pair < Vec4, Vec4 > decayW2( fsr->decayWithOnshellRec( zCS, yCS, phi, m2Rec,
1131 m2Rad, m2Emt, pW2, pRec) );
1133 if (
false) cout << decayW1.first << decayW1.second
1134 << decayW2.first << decayW2.second;
1138 unordered_map<string,double> wts;
1139 wts.insert( make_pair(
"base", wt ));
1142 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
1143 wts.insert( make_pair(
"Variations:muRfsrDown", wt ));
1144 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
1145 wts.insert( make_pair(
"Variations:muRfsrUp", wt ));
1150 for ( unordered_map<string,double>::iterator it = wts.begin();
1151 it != wts.end(); ++it )
1152 kernelVals.insert(make_pair( it->first, it->second ));
1165 bool Dire_fsr_ew_W2QQ2::canRadiate (
const Event& state, pair<int,int> ints,
1166 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*){
1167 return ( state[ints.first].isFinal()
1168 && state[ints.first].idAbs() == 24 );
1171 int Dire_fsr_ew_W2QQ2::kinMap() {
return 1;}
1172 int Dire_fsr_ew_W2QQ2::motherID(
int) {
return -1;}
1173 int Dire_fsr_ew_W2QQ2::sisterID(
int) {
return -1;}
1174 double Dire_fsr_ew_W2QQ2::gaugeFactor (
int,
int ) {
return 1.;}
1175 double Dire_fsr_ew_W2QQ2::symmetryFactor (
int,
int ) {
return 1.0;}
1177 int Dire_fsr_ew_W2QQ2::radBefID(
int idRad,
int idEmt) {
1178 int chg = particleDataPtr->charge(idRad) + particleDataPtr->charge(idEmt);
1179 if (chg > 0)
return 24;
1183 pair<int,int> Dire_fsr_ew_W2QQ2::radBefCols(
int,
int,
int,
int)
1184 {
return make_pair(0,0); }
1187 double Dire_fsr_ew_W2QQ2::zSplit(
double zMinAbs,
double zMaxAbs,
double) {
1188 return (zMinAbs + rndmPtr->flat() * (zMaxAbs - zMinAbs));
1192 double Dire_fsr_ew_W2QQ2::overestimateInt(
double zMinAbs,
double zMaxAbs,
1193 double pT2old,
double,
int) {
1195 double preFac = symmetryFactor() * gaugeFactor();
1196 double m2z = particleDataPtr->m0(23);
1197 wt = 2.* preFac * 0.5 * ( zMaxAbs - zMinAbs)
1203 double Dire_fsr_ew_W2QQ2::overestimateDiff(
double,
double,
int) {
1205 double preFac = symmetryFactor() * gaugeFactor();
1206 wt = 2.*preFac * 0.5;
1211 bool Dire_fsr_ew_W2QQ2::calc(
const Event& state,
int orderNow) {
1214 if (
false) cout << state[0].e() << orderNow << endl;
1217 double z(splitInfo.kinematics()->z);
1220 double preFac = symmetryFactor() * gaugeFactor();
1222 * (pow(1.-z,2.) + pow(z,2.));
1228 unordered_map<string,double> wts;
1229 wts.insert( make_pair(
"base", wt ));
1232 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
1233 wts.insert( make_pair(
"Variations:muRfsrDown", wt ));
1234 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
1235 wts.insert( make_pair(
"Variations:muRfsrUp", wt ));
1240 for ( unordered_map<string,double>::iterator it = wts.begin();
1241 it != wts.end(); ++it )
1242 kernelVals.insert(make_pair( it->first, it->second ));
1251 bool Dire_fsr_ew_W2WA::canRadiate (
const Event& state, pair<int,int> ints,
1252 unordered_map<string,bool> bools, Settings*, PartonSystems*, BeamParticle*){
1253 return ( state[ints.first].isFinal()
1254 && state[ints.first].idAbs() == 24
1255 && state[ints.second].isCharged()
1256 && (bools[
"doQEDshowerByL"] || bools[
"doQEDshowerByQ"]));
1259 bool Dire_fsr_ew_W2WA::canRadiate (
const Event& state,
int iRadBef,
1260 int iRecBef, Settings*, PartonSystems*, BeamParticle*){
1261 return ( state[iRadBef].isFinal()
1262 && state[iRadBef].idAbs() == 24
1263 && state[iRecBef].isCharged()
1264 && (doQEDshowerByL || doQEDshowerByQ));
1267 int Dire_fsr_ew_W2WA::kinMap() {
return 1;}
1268 int Dire_fsr_ew_W2WA::motherID(
int idDaughter) {
return idDaughter;}
1269 int Dire_fsr_ew_W2WA::sisterID(
int) {
return 22;}
1271 double Dire_fsr_ew_W2WA::gaugeFactor (
int idRadBef,
int idRecBef) {
1272 double chgRad = particleDataPtr->charge(idRadBef);
1273 double chgRec = particleDataPtr->charge(idRecBef);
1274 double charge = -1.*chgRad*chgRec;
1275 if (!splitInfo.radBef()->isFinal) charge *= -1.;
1276 if (!splitInfo.recBef()->isFinal) charge *= -1.;
1277 if (idRadBef != 0 && idRecBef != 0)
return charge;
1282 double Dire_fsr_ew_W2WA::symmetryFactor (
int,
int ) {
return 1.;}
1284 int Dire_fsr_ew_W2WA::radBefID(
int idRad,
int idEmt) {
1285 if (idEmt == 22 && abs(idRad) == 24)
return idRad;
1289 pair<int,int> Dire_fsr_ew_W2WA::radBefCols(
int,
int,
int,
int) {
1290 return make_pair(0,0);
1293 vector<int>Dire_fsr_ew_W2WA::recPositions(
const Event&,
int,
int) {
1300 double Dire_fsr_ew_W2WA::zSplit(
double zMinAbs,
double,
double m2dip) {
1301 double Rz = rndmPtr->flat();
1302 double kappa2 = pow2(settingsPtr->parm(
"TimeShower:pTminChgL"))/m2dip;
1303 double p = pow( 1. + pow2(1-zMinAbs)/kappa2, Rz );
1304 double res = 1. - sqrt( p - 1. )*sqrt(kappa2);
1309 double Dire_fsr_ew_W2WA::overestimateInt(
double zMinAbs,
double,
1310 double,
double m2dip,
int) {
1312 double charge = gaugeFactor(splitInfo.radBef()->id, splitInfo.recBef()->id);
1313 double preFac = symmetryFactor() * abs(charge);
1315 double kappa2 = pow2(settingsPtr->parm(
"TimeShower:pTminChgL"))/m2dip;
1316 wt = enhance * preFac * 2. * 0.5 * log( 1. + pow2(1.-zMinAbs)/kappa2);
1321 double Dire_fsr_ew_W2WA::overestimateDiff(
double z,
double m2dip,
int) {
1323 double charge = gaugeFactor(splitInfo.radBef()->id, splitInfo.recBef()->id);
1324 double preFac = symmetryFactor() * abs(charge);
1325 double kappaOld2 = pow2(settingsPtr->parm(
"TimeShower:pTminChgL"))/m2dip;
1326 wt = enhance * preFac * 2.* (1.-z) / ( pow2(1.-z) + kappaOld2);
1331 bool Dire_fsr_ew_W2WA::calc(
const Event& state,
int orderNow) {
1334 if (
false) cout << state[0].e() << orderNow << endl;
1337 double z(splitInfo.kinematics()->z), pT2(splitInfo.kinematics()->pT2),
1338 m2dip(splitInfo.kinematics()->m2Dip),
1339 m2RadBef(splitInfo.kinematics()->m2RadBef),
1340 m2Rad(splitInfo.kinematics()->m2RadAft),
1341 m2Rec(splitInfo.kinematics()->m2Rec),
1342 m2Emt(splitInfo.kinematics()->m2EmtAft);
1343 int splitType(splitInfo.type);
1351 double chargeFac = gaugeFactor(splitInfo.radBef()->id,
1352 splitInfo.recBef()->id);
1353 double preFac = symmetryFactor() * chargeFac;
1354 double kappa2 = pT2/m2dip;
1355 wt = preFac * ( 2. * z * (1.-z) / ( pow2(1.-z) + kappa2) );
1358 bool doMassive = (abs(splitType) == 2);
1361 if (!doMassive && orderNow >= 0) wt += preFac * ( 1.-z );
1364 if (doMassive && orderNow >= 0) {
1366 double pipj = 0., vijkt = 1., vijk = 1.;
1369 if (splitType == 2) {
1372 double yCS = kappa2 / (1.-z);
1373 double nu2RadBef = m2RadBef/m2dip;
1374 double nu2Rad = m2Rad/m2dip;
1375 double nu2Emt = m2Emt/m2dip;
1376 double nu2Rec = m2Rec/m2dip;
1377 vijk = pow2(1.-yCS) - 4.*(yCS+nu2Rad+nu2Emt)*nu2Rec;
1378 double Q2mass = m2dip + m2Rad + m2Rec + m2Emt;
1379 vijkt = pow2(Q2mass/m2dip - nu2RadBef - nu2Rec)
1380 - 4.*nu2RadBef*nu2Rec;
1381 vijk = sqrt(vijk) / (1-yCS);
1382 vijkt = sqrt(vijkt)/ (Q2mass/m2dip - nu2RadBef - nu2Rec);
1383 pipj = m2dip * yCS/2.;
1385 }
else if (splitType ==-2) {
1388 double xCS = 1 - kappa2/(1.-z);
1391 pipj = m2dip/2. * (1-xCS)/xCS;
1395 double massCorr = vijkt/vijk*( 1. - z - m2RadBef/pipj);
1396 wt += preFac*massCorr;
1400 if (orderNow < 0 && chargeFac < 0.) wt = 0.;
1403 unordered_map<string,double> wts;
1404 wts.insert( make_pair(
"base", wt ));
1407 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
1408 wts.insert( make_pair(
"Variations:muRfsrDown", wt ));
1409 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
1410 wts.insert( make_pair(
"Variations:muRfsrUp", wt ));
1415 for ( unordered_map<string,double>::iterator it = wts.begin();
1416 it != wts.end(); ++it )
1417 kernelVals.insert(make_pair( it->first, it->second ));
1430 bool Dire_isr_ew_Q2QZ::canRadiate (
const Event& state, pair<int,int> ints,
1431 unordered_map<string,bool>, Settings*, PartonSystems*, BeamParticle*) {
1432 int nFinPartons(0), nFinOther(0);
1433 for(
int i=0; i < state.size(); ++i) {
1434 if (!state[i].isFinal())
continue;
1435 if ( state[i].colType() !=0)
1439 return ( nFinPartons == 2 && nFinOther == 0
1440 && !state[ints.first].isFinal()
1441 && state[ints.first].isQuark() );
1444 int Dire_isr_ew_Q2QZ::kinMap() {
return 1;}
1445 int Dire_isr_ew_Q2QZ::motherID(
int idDaughter) {
return idDaughter;}
1446 int Dire_isr_ew_Q2QZ::sisterID(
int) {
return 23;}
1447 double Dire_isr_ew_Q2QZ::gaugeFactor (
int,
int ) {
return thetaW;}
1448 double Dire_isr_ew_Q2QZ::symmetryFactor (
int,
int ) {
return 1.;}
1450 int Dire_isr_ew_Q2QZ::radBefID(
int idRA,
int){
return idRA;}
1451 pair<int,int> Dire_isr_ew_Q2QZ::radBefCols(
1452 int colRadAfter,
int acolRadAfter,
1454 return make_pair(colRadAfter,acolRadAfter);
1458 double Dire_isr_ew_Q2QZ::zSplit(
double zMinAbs,
double,
double m2dip) {
1459 double Rz = rndmPtr->flat();
1460 double kappa2 = pow2(settingsPtr->parm(
"SpaceShower:pTmin"))/m2dip;
1461 double p = pow( 1. + pow2(1-zMinAbs)/kappa2, Rz );
1462 double res = 1. - sqrt( p - 1. )*sqrt(kappa2);
1467 double Dire_isr_ew_Q2QZ::overestimateInt(
double zMinAbs,
double,
1468 double,
double m2dip,
int ) {
1470 double preFac = symmetryFactor() * gaugeFactor();
1471 double kappa2 = pow2(settingsPtr->parm(
"SpaceShower:pTmin"))/m2dip;
1472 wt = preFac * 2. * 0.5 * log( 1. + pow2(1.-zMinAbs)/kappa2);
1477 double Dire_isr_ew_Q2QZ::overestimateDiff(
double z,
double m2dip,
int ) {
1479 double preFac = symmetryFactor() * gaugeFactor();
1480 double kappaOld2 = pow2(settingsPtr->parm(
"SpaceShower:pTmin"))/m2dip;
1481 wt = preFac * 2.* (1.-z) / ( pow2(1.-z) + kappaOld2);
1486 bool Dire_isr_ew_Q2QZ::calc(
const Event& state,
int orderNow) {
1489 if (
false) cout << state[0].e() << orderNow << endl;
1492 if ( isr->weights->hasME(isr->makeHardEvent(0,state,
true)) ) {
1495 Event trialEvent(state);
1496 if (splitInfo.recBef()->isFinal)
1497 isr->branch_IF(trialEvent,
true, &splitInfo);
1499 isr->branch_II(trialEvent,
true, &splitInfo);
1502 if ( isr->weights->hasME(isr->makeHardEvent(0,trialEvent,
true)) ) {
1506 splitInfo.addExtra(
"unitKernel",1.0);
1509 double wtNum = isr->weights->getME(trialEvent);
1515 string procSave = settingsPtr->word(
"Merging:process");
1516 int nRequestedSave = settingsPtr->mode(
"Merging:nRequested");
1519 string procNow =
"pp>jj";
1520 settingsPtr->word(
"Merging:process", procNow);
1521 isr->mergingHooksPtr->hardProcess->clear();
1522 isr->mergingHooksPtr->hardProcess->
1523 initOnProcess(procNow, particleDataPtr);
1524 isr->mergingHooksPtr->processSave = procNow;
1527 isr->mergingHooksPtr->orderHistories(
false);
1528 Event newProcess( isr->mergingHooksPtr->bareEvent(
1529 isr->makeHardEvent(0, trialEvent,
true),
true) );
1533 int nQuarksMerge = settingsPtr->mode(
"Merging:nQuarksMerge");
1535 for(
int i=0; i < int(newProcess.size()); ++i)
1536 if ( newProcess[i].isFinal()
1537 && newProcess[i].colType()!= 0
1538 && ( newProcess[i].id() == 21
1539 || newProcess[i].idAbs() <= nQuarksMerge))
1544 settingsPtr->mode(
"Merging:nRequested", nPartons);
1545 isr->mergingHooksPtr->nRequestedSave
1546 = settingsPtr->mode(
"Merging:nRequested");
1549 isr->mergingHooksPtr->storeHardProcessCandidates( newProcess );
1555 newProcess.scale(0.0);
1557 DireHistory myHistory( nSteps, 0.0, newProcess, DireClustering(),
1558 isr->mergingHooksPtr, (*beamAPtr), (*beamBPtr), particleDataPtr,
1560 NULL, fsr, isr, isr->weights, coupSMPtr,
true,
true,
1561 1.0, 1.0, 1.0, 1.0, 0);
1563 myHistory.projectOntoDesiredHistories();
1566 for ( map<double, DireHistory*>::iterator it =
1567 myHistory.goodBranches.begin();
1568 it != myHistory.goodBranches.end(); ++it ) {
1569 Event psppoint = it->second->state;
1570 wtDen += isr->weights->getME(psppoint);
1574 settingsPtr->word(
"Merging:process", procSave);
1575 settingsPtr->mode(
"Merging:nRequested",nRequestedSave);
1576 isr->mergingHooksPtr->nRequestedSave
1577 = settingsPtr->mode(
"Merging:nRequested");
1578 isr->mergingHooksPtr->hardProcess->initOnProcess
1579 (procSave, particleDataPtr);
1580 isr->mergingHooksPtr->processSave = procSave;
1582 unordered_map<string, double>::iterator it =
1583 splitInfo.extras.find(
"unitKernel");
1584 splitInfo.extras.erase(it);
1587 if (myHistory.goodBranches.size() == 0) { wtNum = 0.; wtDen = 1.; }
1593 unordered_map<string,double> wts;
1594 wts.insert( make_pair(
"base", wt) );
1598 if (settingsPtr->parm(
"Variations:muRisrDown") != 1.)
1599 wts.insert( make_pair(
"Variations:muRisrDown", wt));
1600 if (settingsPtr->parm(
"Variations:muRisrUp") != 1.)
1601 wts.insert( make_pair(
"Variations:muRisrUp", wt));
1606 for ( unordered_map<string,double>::iterator it = wts.begin();
1607 it != wts.end(); ++it )
1608 kernelVals.insert(make_pair( it->first, it->second ));