8 #ifndef Pythia8_DireSplittingsQED_H
9 #define Pythia8_DireSplittingsQED_H
11 #define DIRE_SPLITTINGSQED_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, aem0, enhance, pT2min,
43 pT2minL, pT2minQ, pT2minForcePos;
44 bool doQEDshowerByQ, doQEDshowerByL, doForcePos;
50 double aem2Pi (
double pT2,
int = 0);
52 bool useFastFunctions() {
return true; }
54 virtual vector <int> radAndEmt(
int idDaughter,
int)
56 virtual int nEmissions() {
return 1; }
57 virtual bool isPartial() {
return true; }
59 virtual int couplingType (
int,
int) {
return 2; }
60 virtual double coupling (
double = 0.,
double = 0.,
double = 0.,
double = -1,
61 pair<int,bool> = pair<int,bool>(), pair<int,bool> = pair<int,bool>()) {
62 return (aem0 / (2.*M_PI));
64 virtual double couplingScale2 (
double = 0.,
double = 0.,
double = 0.,
65 pair<int,bool> = pair<int,bool>(), pair<int,bool> = pair<int,bool>()) {
69 virtual bool aboveCutoff(
double t,
const Particle& radBef,
84 coupSM, info, direInfo){}
86 bool canRadiate (
const Event&, pair<int,int>,
87 unordered_map<string,bool> = unordered_map<string,bool>(),
89 bool canRadiate (
const Event&,
int iRadBef,
int iRecBef,
95 int motherID(
int idDaughter);
98 int sisterID(
int idDaughter);
101 int radBefID(
int idRadAfter,
int idEmtAfter);
104 pair<int,int> radBefCols(
int colRadAfter,
int acolRadAfter,
105 int colEmtAfter,
int acolEmtAfter);
107 vector<pair<int,int> > radAndEmtCols(
int iRad,
int,
Event state) {
109 (make_pair(state[iRad].col(),state[iRad].acol()))(make_pair(0, 0));
112 double gaugeFactor (
int=0,
int=0 );
113 double symmetryFactor (
int=0,
int=0 );
115 vector <int> recPositions(
const Event& state,
int iRad,
int iEmt);
118 double zSplit(
double zMinAbs,
double zMaxAbs,
double m2dip);
121 double overestimateInt(
double zMinAbs,
double zMaxAbs,
122 double pT2Old,
double m2dip,
int order = -1);
125 double overestimateDiff(
double z,
double m2dip,
int order = -1);
128 bool calc(
const Event& state =
Event(),
int order = -1);
142 coupSM, info, direInfo){}
144 bool canRadiate (
const Event&, pair<int,int>,
145 unordered_map<string,bool> = unordered_map<string,bool>(),
147 bool canRadiate (
const Event&,
int iRadBef,
int iRecBef,
153 int motherID(
int idDaughter);
155 vector<pair<int,int> > radAndEmtCols(
int iRad,
int,
Event state) {
157 (make_pair(state[iRad].col(),state[iRad].acol()))(make_pair(0, 0));
161 int sisterID(
int idDaughter);
164 int radBefID(
int idRadAfter,
int idEmtAfter);
167 pair<int,int> radBefCols(
int colRadAfter,
int acolRadAfter,
168 int colEmtAfter,
int acolEmtAfter);
170 double gaugeFactor (
int=0,
int=0 );
171 double symmetryFactor (
int=0,
int=0 );
173 vector <int> recPositions(
const Event& state,
int iRad,
int iEmt);
176 double zSplit(
double zMinAbs,
double zMaxAbs,
double m2dip);
179 double overestimateInt(
double zMinAbs,
double zMaxAbs,
180 double pT2Old,
double m2dip,
int order = -1);
183 double overestimateDiff(
double z,
double m2dip,
int order = -1);
186 bool calc(
const Event& state =
Event(),
int order = -1);
200 coupSM, info, direInfo){}
202 bool canRadiate (
const Event&, pair<int,int>,
203 unordered_map<string,bool> = unordered_map<string,bool>(),
205 bool canRadiate (
const Event&,
int iRadBef,
int iRecBef,
211 int motherID(
int idDaughter);
214 int sisterID(
int idDaughter);
217 int radBefID(
int idRadAfter,
int idEmtAfter);
220 pair<int,int> radBefCols(
int colRadAfter,
int acolRadAfter,
221 int colEmtAfter,
int acolEmtAfter);
223 vector<pair<int,int> > radAndEmtCols(
int,
int,
Event) {
227 double gaugeFactor (
int=0,
int=0 );
228 double symmetryFactor (
int=0,
int=0 );
230 vector <int> recPositions(
const Event& state,
int iRad,
int iEmt);
233 double zSplit(
double zMinAbs,
double zMaxAbs,
double m2dip);
236 double overestimateInt(
double zMinAbs,
double zMaxAbs,
237 double pT2Old,
double m2dip,
int order = -1);
240 double overestimateDiff(
double z,
double m2dip,
int order = -1);
243 bool calc(
const Event& state =
Event(),
int order = -1);
257 coupSM, info, direInfo){}
259 bool canRadiate (
const Event&, pair<int,int>,
260 unordered_map<string,bool> = unordered_map<string,bool>(),
262 bool canRadiate (
const Event&,
int iRadBef,
int iRecBef,
268 int motherID(
int idDaughter);
271 int sisterID(
int idDaughter);
274 int radBefID(
int idRadAfter,
int idEmtAfter);
277 pair<int,int> radBefCols(
int colRadAfter,
int acolRadAfter,
278 int colEmtAfter,
int acolEmtAfter);
280 vector<pair<int,int> > radAndEmtCols(
int,
int,
Event) {
284 double gaugeFactor (
int=0,
int=0 );
285 double symmetryFactor (
int=0,
int=0 );
287 vector <int> recPositions(
const Event& state,
int iRad,
int iEmt);
290 double zSplit(
double zMinAbs,
double zMaxAbs,
double m2dip);
293 double overestimateInt(
double zMinAbs,
double zMaxAbs,
294 double pT2Old,
double m2dip,
int order = -1);
297 double overestimateDiff(
double z,
double m2dip,
int order = -1);
300 bool calc(
const Event& state =
Event(),
int order = -1);
318 softRS, settings, particleData, rndm, beamA, beamB, coupSM, info,
320 idRadAfterSave(idRadAfterIn), nchSaved(1) {}
321 bool canRadiate (
const Event& state, pair<int,int> ints,
322 unordered_map<string,bool> = unordered_map<string,bool>(),
324 return ( state[ints.first].isFinal()
325 && state[ints.first].id() == 22
326 && state[ints.second].isCharged());
328 bool canRadiate (
const Event& state,
int iRadBef,
int iRecBef,
330 return ( state[iRadBef].isFinal()
331 && state[iRadBef].
id() == 22
332 && state[iRecBef].isCharged());
335 int kinMap () {
return 1;};
336 bool canUseForBranching() {
return true; }
337 bool isPartial() {
return false; }
339 vector<pair<int,int> > radAndEmtCols(
int iRad,
int,
Event state) {
340 vector< pair<int,int> > ret;
341 if (state[iRad].
id() != 22)
return ret;
343 if (particleDataPtr->colType(idRadAfterSave) != 0) {
344 int sign = (idRadAfterSave > 0) ? 1 : -1;
345 int newCol = state.nextColTag();
347 ret[0].first = newCol;
350 ret[1].second = newCol;
353 ret[0].second = newCol;
354 ret[1].first = newCol;
363 {
return idRadAfterSave; }
365 {
return -idRadAfterSave; }
366 vector <int> radAndEmt(
int,
int)
369 double gaugeFactor (
int=0,
int=0 )
370 {
return pow2(particleDataPtr->charge(idRadAfterSave)); }
371 double symmetryFactor (
int=0,
int=0 )
372 {
return 1./double(nchSaved); }
374 int radBefID(
int idRadAfter,
int idEmtAfter) {
375 if ( idRadAfter == idRadAfterSave
376 && particleDataPtr->isQuark(idRadAfter)
377 && particleDataPtr->isQuark(idEmtAfter))
return 22;
381 pair<int,int> radBefCols(
int,
int,
int,
int) {
return make_pair(0,0); }
384 vector <int> recPositions(
const Event& state,
int iRad,
int iEmt) {
385 if ( state[iRad].isFinal() || state[iRad].
id() != idRadAfterSave
386 || state[iEmt].
id() != -idRadAfterSave)
return vector<int>();
391 for (
int i=0; i < state.size(); ++i) {
392 if ( find(iExc.begin(), iExc.end(), i) != iExc.end() )
continue;
393 if ( state[i].isCharged() ) {
394 if (state[i].isFinal())
396 if (state[i].mother1() == 1 && state[i].mother2() == 0)
398 if (state[i].mother1() == 2 && state[i].mother2() == 0)
407 int set_nCharged(
const Event& state) {
410 for (
int i=0; i < state.size(); ++i) {
411 if ( state[i].isCharged() ) {
412 if (state[i].isFinal()) nch++;
413 if (state[i].mother1() == 1 && state[i].mother2() == 0) nch++;
414 if (state[i].mother1() == 2 && state[i].mother2() == 0) nch++;
423 double zSplit(
double zMinAbs,
double zMaxAbs,
double ) {
424 return (zMinAbs + rndmPtr->flat() * (zMaxAbs - zMinAbs));
428 double overestimateInt(
double zMinAbs,
double zMaxAbs,
429 double ,
double ,
int = -1) {
430 double preFac = symmetryFactor() * gaugeFactor();
431 double wt = 2. *enhance * preFac * 0.5 * ( zMaxAbs - zMinAbs);
436 double overestimateDiff(
double ,
double ,
int = -1) {
437 double preFac = symmetryFactor() * gaugeFactor();
438 double wt = 2. *enhance * preFac * 0.5;
443 bool calc(
const Event& state,
int orderNow) {
446 if (
false) cout << state[0].e() << orderNow << endl;
449 double z(splitInfo.kinematics()->z), pT2(splitInfo.kinematics()->pT2),
450 m2dip(splitInfo.kinematics()->m2Dip),
452 m2Rad(splitInfo.kinematics()->m2RadAft),
453 m2Rec(splitInfo.kinematics()->m2Rec),
454 m2Emt(splitInfo.kinematics()->m2EmtAft);
455 int splitType(splitInfo.type);
461 double preFac = symmetryFactor() * gaugeFactor();
462 double kappa2 = pT2/m2dip;
464 * (pow(1.-z,2.) + pow(z,2.));
467 bool doMassive = (abs(splitType) == 2);
471 double vijk = 1., pipj = 0.;
474 if (splitType == 2) {
476 double yCS = kappa2 / (1.-z);
477 double nu2Rad = m2Rad/m2dip;
478 double nu2Emt = m2Emt/m2dip;
479 double nu2Rec = m2Rec/m2dip;
480 vijk = pow2(1.-yCS) - 4.*(yCS+nu2Rad+nu2Emt)*nu2Rec;
481 vijk = sqrt(vijk) / (1-yCS);
482 pipj = m2dip * yCS /2.;
485 }
else if (splitType ==-2) {
487 double xCS = 1 - kappa2/(1.-z);
489 pipj = m2dip/2. * (1-xCS)/xCS;
493 wt = preFac * 1. / vijk * ( pow2(1.-z) + pow2(z)
494 + m2Emt / ( pipj + m2Emt) );
498 if (idRadAfterSave > 0) wt *= z;
502 unordered_map<string,double> wts;
503 wts.insert( make_pair(
"base", wt ));
506 if (settingsPtr->parm(
"Variations:muRfsrDown") != 1.)
507 wts.insert( make_pair(
"Variations:muRfsrDown", wt ));
508 if (settingsPtr->parm(
"Variations:muRfsrUp") != 1.)
509 wts.insert( make_pair(
"Variations:muRfsrUp", wt ));
514 for ( unordered_map<string,double>::iterator it = wts.begin();
515 it != wts.end(); ++it )
516 kernelVals.insert(make_pair( it->first, it->second ));
534 coupSM, info, direInfo){}
536 bool canRadiate (
const Event&, pair<int,int>,
537 unordered_map<string,bool> = unordered_map<string,bool>(),
539 bool canRadiate (
const Event&,
int iRadBef,
int iRecBef,
545 int motherID(
int idDaughter);
548 int sisterID(
int idDaughter);
551 int radBefID(
int idRadAfter,
int idEmtAfter);
554 pair<int,int> radBefCols(
int colRadAfter,
int acolRadAfter,
555 int colEmtAfter,
int acolEmtAfter);
557 vector<pair<int,int> > radAndEmtCols(
int iRad,
int,
Event state) {
559 (make_pair(state[iRad].col(),state[iRad].acol()))(make_pair(0, 0));
562 double gaugeFactor (
int=0,
int=0 );
563 double symmetryFactor (
int=0,
int=0 );
565 vector <int> recPositions(
const Event& state,
int iRad,
int iEmt);
568 double zSplit(
double zMinAbs,
double zMaxAbs,
double m2dip);
571 double overestimateInt(
double zMinAbs,
double zMaxAbs,
572 double pT2Old,
double m2dip,
int order = -1);
575 double overestimateDiff(
double z,
double m2dip,
int order = -1);
578 bool calc(
const Event& state =
Event(),
int order = -1);
590 coupSM, info, direInfo){}
592 bool canRadiate (
const Event&, pair<int,int>,
593 unordered_map<string,bool> = unordered_map<string,bool>(),
595 bool canRadiate (
const Event&,
int iRadBef,
int iRecBef,
601 int motherID(
int idDaughter);
604 int sisterID(
int idDaughter);
607 int radBefID(
int idRadAfter,
int idEmtAfter);
610 pair<int,int> radBefCols(
int colRadAfter,
int acolRadAfter,
611 int colEmtAfter,
int acolEmtAfter);
613 vector<pair<int,int> > radAndEmtCols(
int iRad,
int,
Event state) {
615 (make_pair(0, 0))(make_pair(state[iRad].acol(),state[iRad].col()));
618 double gaugeFactor (
int=0,
int=0 );
619 double symmetryFactor (
int=0,
int=0 );
622 double zSplit(
double zMinAbs,
double zMaxAbs,
double m2dip);
625 double overestimateInt(
double zMinAbs,
double zMaxAbs,
626 double pT2Old,
double m2dip,
int order = -1);
629 double overestimateDiff(
double z,
double m2dip,
int order = -1);
632 bool calc(
const Event& state =
Event(),
int order = -1);
644 coupSM, info, direInfo){}
646 bool canRadiate (
const Event&, pair<int,int>,
647 unordered_map<string,bool> = unordered_map<string,bool>(),
649 bool canRadiate (
const Event&,
int iRadBef,
int iRecBef,
655 int motherID(
int idDaughter);
658 int sisterID(
int idDaughter);
661 int radBefID(
int idRadAfter,
int idEmtAfter);
664 pair<int,int> radBefCols(
int colRadAfter,
int acolRadAfter,
665 int colEmtAfter,
int acolEmtAfter);
667 vector<pair<int,int> > radAndEmtCols(
int,
int colType,
Event state) {
668 int newCol = state.nextColTag();
670 (make_pair(newCol,0))(make_pair(newCol,0));
672 (make_pair(0,newCol))(make_pair(0,newCol));
675 double gaugeFactor (
int=0,
int=0 );
676 double symmetryFactor (
int=0,
int=0 );
679 double zSplit(
double zMinAbs,
double zMaxAbs,
double m2dip);
682 double overestimateInt(
double zMinAbs,
double zMaxAbs,
683 double pT2Old,
double m2dip,
int order = -1);
686 double overestimateDiff(
double z,
double m2dip,
int order = -1);
689 bool calc(
const Event& state =
Event(),
int order = -1);
701 coupSM, info, direInfo){}
703 bool canRadiate (
const Event&, pair<int,int>,
704 unordered_map<string,bool> = unordered_map<string,bool>(),
706 bool canRadiate (
const Event&,
int iRadBef,
int iRecBef,
712 int motherID(
int idDaughter);
715 int sisterID(
int idDaughter);
718 int radBefID(
int idRadAfter,
int idEmtAfter);
721 pair<int,int> radBefCols(
int colRadAfter,
int acolRadAfter,
722 int colEmtAfter,
int acolEmtAfter);
724 vector<pair<int,int> > radAndEmtCols(
int,
int,
Event) {
728 double gaugeFactor (
int=0,
int=0 );
729 double symmetryFactor (
int=0,
int=0 );
731 vector <int> recPositions(
const Event& state,
int iRad,
int iEmt);
734 double zSplit(
double zMinAbs,
double zMaxAbs,
double m2dip);
737 double overestimateInt(
double zMinAbs,
double zMaxAbs,
738 double pT2Old,
double m2dip,
int order = -1);
741 double overestimateDiff(
double z,
double m2dip,
int order = -1);
744 bool calc(
const Event& state =
Event(),
int order = -1);
756 coupSM, info, direInfo){}
758 bool canRadiate (
const Event&, pair<int,int>,
759 unordered_map<string,bool> = unordered_map<string,bool>(),
761 bool canRadiate (
const Event&,
int iRadBef,
int iRecBef,
767 int motherID(
int idDaughter);
770 int sisterID(
int idDaughter);
773 int radBefID(
int idRadAfter,
int idEmtAfter);
776 pair<int,int> radBefCols(
int colRadAfter,
int acolRadAfter,
777 int colEmtAfter,
int acolEmtAfter);
779 vector<pair<int,int> > radAndEmtCols(
int,
int,
Event) {
783 double gaugeFactor (
int=0,
int=0 );
784 double symmetryFactor (
int=0,
int=0 );
787 double zSplit(
double zMinAbs,
double zMaxAbs,
double m2dip);
790 double overestimateInt(
double zMinAbs,
double zMaxAbs,
791 double pT2Old,
double m2dip,
int order = -1);
794 double overestimateDiff(
double z,
double m2dip,
int order = -1);
797 bool calc(
const Event& state =
Event(),
int order = -1);
809 coupSM, info, direInfo){}
811 bool canRadiate (
const Event&, pair<int,int>,
812 unordered_map<string,bool> = unordered_map<string,bool>(),
814 bool canRadiate (
const Event&,
int iRadBef,
int iRecBef,
820 int motherID(
int idDaughter);
823 int sisterID(
int idDaughter);
826 int radBefID(
int idRadAfter,
int idEmtAfter);
829 pair<int,int> radBefCols(
int colRadAfter,
int acolRadAfter,
830 int colEmtAfter,
int acolEmtAfter);
832 vector<pair<int,int> > radAndEmtCols(
int,
int,
Event) {
836 double gaugeFactor (
int=0,
int=0 );
837 double symmetryFactor (
int=0,
int=0 );
840 double zSplit(
double zMinAbs,
double zMaxAbs,
double m2dip);
843 double overestimateInt(
double zMinAbs,
double zMaxAbs,
844 double pT2Old,
double m2dip,
int order = -1);
847 double overestimateDiff(
double z,
double m2dip,
int order = -1);
850 bool calc(
const Event& state =
Event(),
int order = -1);
864 coupSM, info, direInfo){}
866 bool canRadiate (
const Event&, pair<int,int>,
867 unordered_map<string,bool> = unordered_map<string,bool>(),
869 bool canRadiate (
const Event&,
int iRadBef,
int iRecBef,
873 bool canUseForBranching() {
return true; }
874 bool isPartial() {
return false; }
877 int motherID(
int idDaughter);
880 int sisterID(
int idDaughter);
883 int radBefID(
int idRadAfter,
int idEmtAfter);
886 pair<int,int> radBefCols(
int colRadAfter,
int acolRadAfter,
887 int colEmtAfter,
int acolEmtAfter);
889 vector<pair<int,int> > radAndEmtCols(
int iRad,
int,
Event state) {
891 (make_pair(state[iRad].col(),state[iRad].acol()))(make_pair(0, 0));
894 double gaugeFactor (
int=0,
int=0 );
895 double symmetryFactor (
int=0,
int=0 );
897 vector <int> recPositions(
const Event& state,
int iRad,
int iEmt);
900 double zSplit(
double zMinAbs,
double zMaxAbs,
double m2dip);
903 double overestimateInt(
double zMinAbs,
double zMaxAbs,
904 double pT2Old,
double m2dip,
int order = -1);
907 double overestimateDiff(
double z,
double m2dip,
int order = -1);
910 bool calc(
const Event& state =
Event(),
int order = -1);
924 coupSM, info, direInfo){}
926 bool canRadiate (
const Event&, pair<int,int>,
927 unordered_map<string,bool> = unordered_map<string,bool>(),
929 bool canRadiate (
const Event&,
int iRadBef,
int iRecBef,
933 bool canUseForBranching() {
return true; }
934 bool isPartial() {
return false; }
937 int motherID(
int idDaughter);
940 int sisterID(
int idDaughter);
943 int radBefID(
int idRadAfter,
int idEmtAfter);
946 pair<int,int> radBefCols(
int colRadAfter,
int acolRadAfter,
947 int colEmtAfter,
int acolEmtAfter);
949 vector<pair<int,int> > radAndEmtCols(
int,
int,
Event) {
953 double gaugeFactor (
int=0,
int=0 );
954 double symmetryFactor (
int=0,
int=0 );
956 vector <int> recPositions(
const Event& state,
int iRad,
int iEmt);
959 double zSplit(
double zMinAbs,
double zMaxAbs,
double m2dip);
962 double overestimateInt(
double zMinAbs,
double zMaxAbs,
963 double pT2Old,
double m2dip,
int order = -1);
966 double overestimateDiff(
double z,
double m2dip,
int order = -1);
969 bool calc(
const Event& state =
Event(),
int order = -1);
975 #endif // end Pythia8_DireSplittingsQED_H