8 #ifndef Pythia8_DireSplittingsU1new_H
9 #define Pythia8_DireSplittingsU1new_H
11 #define DIRE_SPLITTINGSU1NEW_VERSION "2.002"
13 #include "Pythia8/Basics.h"
14 #include "Pythia8/BeamParticle.h"
15 #include "Pythia8/ParticleData.h"
16 #include "Pythia8/PythiaStdlib.h"
17 #include "Pythia8/Settings.h"
18 #include "Pythia8/StandardModel.h"
20 #include "Pythia8/DireSplittingsQCD.h"
35 softRS,settings,particleData,rndm,beamA,beamB,coupSM,info, direInfo)
42 double sumCharge2Tot, sumCharge2L, sumCharge2Q, ax0, enhance;
43 bool doU1NEWshowerByQ, doU1NEWshowerByL;
49 double aem2Pi (
double pT2,
int = 0);
51 bool useFastFunctions() {
return true; }
53 virtual vector <int> radAndEmt(
int idDaughter,
int)
55 virtual int nEmissions() {
return 1; }
56 virtual bool isPartial() {
return true; }
58 virtual bool canUseForBranching() {
return true; }
60 virtual int couplingType (
int,
int) {
return 2; }
61 virtual double coupling (
double = 0.,
double = 0.,
double = 0.,
double = -1.,
62 pair<int,bool> = pair<int,bool>(), pair<int,bool> = pair<int,bool>()) {
63 return (ax0 / (2.*M_PI));
65 virtual double couplingScale2 (
double = 0.,
double = 0.,
double = 0.,
66 pair<int,bool> = pair<int,bool>(), pair<int,bool> = pair<int,bool>()) {
83 beamB, coupSM, info, direInfo){}
85 bool canRadiate (
const Event&, pair<int,int>,
86 unordered_map<string,bool> = unordered_map<string,bool>(),
88 bool canRadiate (
const Event&,
int iRadBef,
int iRecBef,
94 int motherID(
int idDaughter);
97 int sisterID(
int idDaughter);
100 int radBefID(
int idRadAfter,
int idEmtAfter);
103 pair<int,int> radBefCols(
int colRadAfter,
int acolRadAfter,
104 int colEmtAfter,
int acolEmtAfter);
106 double gaugeFactor (
int=0,
int=0 );
107 double symmetryFactor (
int=0,
int=0 );
109 vector <int> recPositions(
const Event& state,
int iRad,
int iEmt);
112 double zSplit(
double zMinAbs,
double zMaxAbs,
double m2dip);
115 double overestimateInt(
double zMinAbs,
double zMaxAbs,
116 double pT2Old,
double m2dip,
int order = -1);
119 double overestimateDiff(
double z,
double m2dip,
int order = -1);
122 bool calc(
const Event& state =
Event(),
int order = -1);
136 beamB, coupSM, info, direInfo){}
138 bool canRadiate (
const Event&, pair<int,int>,
139 unordered_map<string,bool> = unordered_map<string,bool>(),
141 bool canRadiate (
const Event&,
int iRadBef,
int iRecBef,
147 int motherID(
int idDaughter);
150 int sisterID(
int idDaughter);
153 int radBefID(
int idRadAfter,
int idEmtAfter);
156 pair<int,int> radBefCols(
int colRadAfter,
int acolRadAfter,
157 int colEmtAfter,
int acolEmtAfter);
159 double gaugeFactor (
int=0,
int=0 );
160 double symmetryFactor (
int=0,
int=0 );
162 vector <int> recPositions(
const Event& state,
int iRad,
int iEmt);
165 double zSplit(
double zMinAbs,
double zMaxAbs,
double m2dip);
168 double overestimateInt(
double zMinAbs,
double zMaxAbs,
169 double pT2Old,
double m2dip,
int order = -1);
172 double overestimateDiff(
double z,
double m2dip,
int order = -1);
175 bool calc(
const Event& state =
Event(),
int order = -1);
189 beamB, coupSM, info, direInfo){}
191 bool canRadiate (
const Event&, pair<int,int>,
192 unordered_map<string,bool> = unordered_map<string,bool>(),
194 bool canRadiate (
const Event&,
int iRadBef,
int iRecBef,
199 vector<pair<int,int> > radAndEmtCols(
int iRad,
int,
Event state) {
200 vector< pair<int,int> > ret
202 if (particleDataPtr->colType(state[iRad].id()) != 0) {
203 ret[0].first = state[iRad].col();
204 ret[0].second = state[iRad].acol();
212 int motherID(
int idDaughter);
215 int sisterID(
int idDaughter);
218 int radBefID(
int idRadAfter,
int idEmtAfter);
221 pair<int,int> radBefCols(
int colRadAfter,
int acolRadAfter,
222 int colEmtAfter,
int acolEmtAfter);
224 double gaugeFactor (
int=0,
int=0 );
225 double symmetryFactor (
int=0,
int=0 );
227 vector <int> recPositions(
const Event& state,
int iRad,
int iEmt);
230 double zSplit(
double zMinAbs,
double zMaxAbs,
double m2dip);
233 double overestimateInt(
double zMinAbs,
double zMaxAbs,
234 double pT2Old,
double m2dip,
int order = -1);
237 double overestimateDiff(
double z,
double m2dip,
int order = -1);
240 bool calc(
const Event& state =
Event(),
int order = -1);
254 beamB, coupSM, info, direInfo){}
256 bool canRadiate (
const Event&, pair<int,int>,
257 unordered_map<string,bool> = unordered_map<string,bool>(),
259 bool canRadiate (
const Event&,
int iRadBef,
int iRecBef,
264 vector<pair<int,int> > radAndEmtCols(
int iRad,
int,
Event state) {
265 vector< pair<int,int> > ret
267 if (particleDataPtr->colType(state[iRad].id()) != 0) {
268 ret[0].first = state[iRad].col();
269 ret[0].second = state[iRad].acol();
277 int motherID(
int idDaughter);
280 int sisterID(
int idDaughter);
283 int radBefID(
int idRadAfter,
int idEmtAfter);
286 pair<int,int> radBefCols(
int colRadAfter,
int acolRadAfter,
287 int colEmtAfter,
int acolEmtAfter);
289 double gaugeFactor (
int=0,
int=0 );
290 double symmetryFactor (
int=0,
int=0 );
292 vector <int> recPositions(
const Event& state,
int iRad,
int iEmt);
295 double zSplit(
double zMinAbs,
double zMaxAbs,
double m2dip);
298 double overestimateInt(
double zMinAbs,
double zMaxAbs,
299 double pT2Old,
double m2dip,
int order = -1);
302 double overestimateDiff(
double z,
double m2dip,
int order = -1);
305 bool calc(
const Event& state =
Event(),
int order = -1);
323 softRS, settings, particleData, rndm, beamA, beamB, coupSM, info,
325 idRadAfterSave(idRadAfterIn), nchSaved(1) {}
326 bool canRadiate (
const Event& state, pair<int,int> ints,
327 unordered_map<string,bool> = unordered_map<string,bool>(),
329 return ( state[ints.first].isFinal()
330 && state[ints.first].id() == 900032
331 && (state[ints.second].isLepton()
332 || state[ints.second].idAbs() == 900012));
334 bool canRadiate (
const Event& state,
int iRadBef,
int iRecBef,
336 return ( state[iRadBef].isFinal()
337 && state[iRadBef].
id() == 900032
338 && (state[iRecBef].isLepton()
339 || state[iRecBef].idAbs() == 900012));
342 int kinMap () {
return 1;};
343 bool isPartial() {
return false; }
345 vector<pair<int,int> > radAndEmtCols(
int iRad,
int,
Event state) {
346 vector< pair<int,int> > ret;
347 if (state[iRad].
id() != 900032)
return ret;
349 if (particleDataPtr->colType(idRadAfterSave) != 0) {
350 int sign = (idRadAfterSave > 0) ? 1 : -1;
351 int newCol = state.nextColTag();
353 ret[0].first = newCol;
356 ret[1].second = newCol;
359 ret[0].second = newCol;
360 ret[1].first = newCol;
370 {
return idRadAfterSave; }
372 {
return -idRadAfterSave; }
373 vector <int> radAndEmt(
int,
int)
376 double gaugeFactor (
int=0,
int=0 )
378 double symmetryFactor (
int=0,
int=0 )
379 {
return 1./double(nchSaved); }
381 int radBefID(
int idRadAfter,
int idEmtAfter) {
382 if ( idRadAfter == idRadAfterSave
383 && particleDataPtr->isQuark(idRadAfter)
384 && particleDataPtr->isQuark(idEmtAfter))
return 900032;
388 pair<int,int> radBefCols(
int,
int,
int,
int) {
return make_pair(0,0); }
391 vector <int> recPositions(
const Event& state,
int iRad,
int iEmt) {
392 if ( state[iRad].isFinal() || state[iRad].
id() != idRadAfterSave
393 || state[iEmt].
id() != -idRadAfterSave)
return vector<int>();
398 for (
int i=0; i < state.size(); ++i) {
399 if ( find(iExc.begin(), iExc.end(), i) != iExc.end() )
continue;
400 if ( state[i].isLepton() || state[i].idAbs() == 900012) {
401 if (state[i].isFinal())
403 if (state[i].mother1() == 1 && state[i].mother2() == 0)
405 if (state[i].mother1() == 2 && state[i].mother2() == 0)
414 int set_nCharged(
const Event& state) {
417 for (
int i=0; i < state.size(); ++i) {
418 if ( state[i].isLepton() || state[i].idAbs() == 900012 ) {
419 if (state[i].isFinal()) nch++;
420 if (state[i].mother1() == 1 && state[i].mother2() == 0) nch++;
421 if (state[i].mother1() == 2 && state[i].mother2() == 0) nch++;
430 double zSplit(
double zMinAbs,
double zMaxAbs,
double ) {
431 return (zMinAbs + rndmPtr->flat() * (zMaxAbs - zMinAbs));
435 double overestimateInt(
double zMinAbs,
double zMaxAbs,
436 double ,
double ,
int = -1) {
437 double preFac = symmetryFactor() * gaugeFactor();
438 double wt = 2. *enhance * preFac * 0.5 * ( zMaxAbs - zMinAbs);
443 double overestimateDiff(
double ,
double ,
int = -1) {
444 double preFac = symmetryFactor() * gaugeFactor();
445 double wt = 2. *enhance * preFac * 0.5;
450 bool calc(
const Event& state,
int orderNow) {
453 if (
false) cout << state[0].e() << orderNow << endl;
456 double z(splitInfo.kinematics()->z), pT2(splitInfo.kinematics()->pT2),
457 m2dip(splitInfo.kinematics()->m2Dip),
458 m2Rad(splitInfo.kinematics()->m2RadAft),
459 m2Rec(splitInfo.kinematics()->m2Rec),
460 m2Emt(splitInfo.kinematics()->m2EmtAft);
461 int splitType(splitInfo.type);
467 double preFac = symmetryFactor() * gaugeFactor();
468 double kappa2 = pT2/m2dip;
470 * (pow(1.-z,2.) + pow(z,2.));
473 bool doMassive = (abs(splitType) == 2);
477 double vijk = 1., pipj = 0.;
480 if (splitType == 2) {
482 double yCS = kappa2 / (1.-z);
483 double nu2Rad = m2Rad/m2dip;
484 double nu2Emt = m2Emt/m2dip;
485 double nu2Rec = m2Rec/m2dip;
486 vijk = pow2(1.-yCS) - 4.*(yCS+nu2Rad+nu2Emt)*nu2Rec;
487 vijk = sqrt(vijk) / (1-yCS);
488 pipj = m2dip * yCS /2.;
491 }
else if (splitType ==-2) {
493 double xCS = 1 - kappa2/(1.-z);
495 pipj = m2dip/2. * (1-xCS)/xCS;
499 wt = preFac * 1. / vijk * ( pow2(1.-z) + pow2(z)
500 + m2Emt / ( pipj + m2Emt) );
504 if (idRadAfterSave > 0) wt *= z;
508 unordered_map<string,double> wts;
509 wts.insert( make_pair(
"base", wt ));
512 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
513 wts.insert( make_pair(
"Variations:muRfsrDown", wt ));
514 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
515 wts.insert( make_pair(
"Variations:muRfsrUp", wt ));
520 for ( unordered_map<string,double>::iterator it = wts.begin();
521 it != wts.end(); ++it )
522 kernelVals.insert(make_pair( it->first, it->second ));
540 rndm, beamA, beamB, coupSM, info, direInfo) {}
554 beamB, coupSM, info, direInfo){}
556 bool canRadiate (
const Event&, pair<int,int>,
557 unordered_map<string,bool> = unordered_map<string,bool>(),
559 bool canRadiate (
const Event&,
int iRadBef,
int iRecBef,
565 int motherID(
int idDaughter);
568 int sisterID(
int idDaughter);
571 int radBefID(
int idRadAfter,
int idEmtAfter);
574 pair<int,int> radBefCols(
int colRadAfter,
int acolRadAfter,
575 int colEmtAfter,
int acolEmtAfter);
577 double gaugeFactor (
int=0,
int=0 );
578 double symmetryFactor (
int=0,
int=0 );
580 vector <int> recPositions(
const Event& state,
int iRad,
int iEmt);
583 double zSplit(
double zMinAbs,
double zMaxAbs,
double m2dip);
586 double overestimateInt(
double zMinAbs,
double zMaxAbs,
587 double pT2Old,
double m2dip,
int order = -1);
590 double overestimateDiff(
double z,
double m2dip,
int order = -1);
593 bool calc(
const Event& state =
Event(),
int order = -1);
605 beamB, coupSM, info, direInfo){}
607 bool canRadiate (
const Event&, pair<int,int>,
608 unordered_map<string,bool> = unordered_map<string,bool>(),
610 bool canRadiate (
const Event&,
int iRadBef,
int iRecBef,
616 int motherID(
int idDaughter);
619 int sisterID(
int idDaughter);
622 int radBefID(
int idRadAfter,
int idEmtAfter);
625 pair<int,int> radBefCols(
int colRadAfter,
int acolRadAfter,
626 int colEmtAfter,
int acolEmtAfter);
628 double gaugeFactor (
int=0,
int=0 );
629 double symmetryFactor (
int=0,
int=0 );
632 double zSplit(
double zMinAbs,
double zMaxAbs,
double m2dip);
635 double overestimateInt(
double zMinAbs,
double zMaxAbs,
636 double pT2Old,
double m2dip,
int order = -1);
639 double overestimateDiff(
double z,
double m2dip,
int order = -1);
642 bool calc(
const Event& state =
Event(),
int order = -1);
654 beamB, coupSM, info, direInfo){}
656 bool canRadiate (
const Event&, pair<int,int>,
657 unordered_map<string,bool> = unordered_map<string,bool>(),
659 bool canRadiate (
const Event&,
int iRadBef,
int iRecBef,
665 int motherID(
int idDaughter);
668 int sisterID(
int idDaughter);
671 int radBefID(
int idRadAfter,
int idEmtAfter);
674 pair<int,int> radBefCols(
int colRadAfter,
int acolRadAfter,
675 int colEmtAfter,
int acolEmtAfter);
677 double gaugeFactor (
int=0,
int=0 );
678 double symmetryFactor (
int=0,
int=0 );
681 double zSplit(
double zMinAbs,
double zMaxAbs,
double m2dip);
684 double overestimateInt(
double zMinAbs,
double zMaxAbs,
685 double pT2Old,
double m2dip,
int order = -1);
688 double overestimateDiff(
double z,
double m2dip,
int order = -1);
691 bool calc(
const Event& state =
Event(),
int order = -1);
703 beamB, coupSM, info, direInfo){}
705 bool canRadiate (
const Event&, pair<int,int>,
706 unordered_map<string,bool> = unordered_map<string,bool>(),
708 bool canRadiate (
const Event&,
int iRadBef,
int iRecBef,
714 int motherID(
int idDaughter);
717 int sisterID(
int idDaughter);
720 int radBefID(
int idRadAfter,
int idEmtAfter);
723 pair<int,int> radBefCols(
int colRadAfter,
int acolRadAfter,
724 int colEmtAfter,
int acolEmtAfter);
726 double gaugeFactor (
int=0,
int=0 );
727 double symmetryFactor (
int=0,
int=0 );
729 vector <int> recPositions(
const Event& state,
int iRad,
int iEmt);
732 double zSplit(
double zMinAbs,
double zMaxAbs,
double m2dip);
735 double overestimateInt(
double zMinAbs,
double zMaxAbs,
736 double pT2Old,
double m2dip,
int order = -1);
739 double overestimateDiff(
double z,
double m2dip,
int order = -1);
742 bool calc(
const Event& state =
Event(),
int order = -1);
754 beamB, coupSM, info, direInfo){}
756 bool canRadiate (
const Event&, pair<int,int>,
757 unordered_map<string,bool> = unordered_map<string,bool>(),
759 bool canRadiate (
const Event&,
int iRadBef,
int iRecBef,
765 int motherID(
int idDaughter);
768 int sisterID(
int idDaughter);
771 int radBefID(
int idRadAfter,
int idEmtAfter);
774 pair<int,int> radBefCols(
int colRadAfter,
int acolRadAfter,
775 int colEmtAfter,
int acolEmtAfter);
777 double gaugeFactor (
int=0,
int=0 );
778 double symmetryFactor (
int=0,
int=0 );
781 double zSplit(
double zMinAbs,
double zMaxAbs,
double m2dip);
784 double overestimateInt(
double zMinAbs,
double zMaxAbs,
785 double pT2Old,
double m2dip,
int order = -1);
788 double overestimateDiff(
double z,
double m2dip,
int order = -1);
791 bool calc(
const Event& state =
Event(),
int order = -1);
803 beamB, coupSM, info, direInfo){}
805 bool canRadiate (
const Event&, pair<int,int>,
806 unordered_map<string,bool> = unordered_map<string,bool>(),
808 bool canRadiate (
const Event&,
int iRadBef,
int iRecBef,
814 int motherID(
int idDaughter);
817 int sisterID(
int idDaughter);
820 int radBefID(
int idRadAfter,
int idEmtAfter);
823 pair<int,int> radBefCols(
int colRadAfter,
int acolRadAfter,
824 int colEmtAfter,
int acolEmtAfter);
826 double gaugeFactor (
int=0,
int=0 );
827 double symmetryFactor (
int=0,
int=0 );
830 double zSplit(
double zMinAbs,
double zMaxAbs,
double m2dip);
833 double overestimateInt(
double zMinAbs,
double zMaxAbs,
834 double pT2Old,
double m2dip,
int order = -1);
837 double overestimateDiff(
double z,
double m2dip,
int order = -1);
840 bool calc(
const Event& state =
Event(),
int order = -1);
848 #endif // end Pythia8_DireSplittingsU1new_H