Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 09:08:21

0001 // DireWeightContainer.h is a part of the PYTHIA event generator.
0002 // Copyright (C) 2025 Stefan Prestel, Torbjorn Sjostrand.
0003 // PYTHIA is licenced under the GNU GPL v2 or later, see COPYING for details.
0004 // Please respect the MCnet Guidelines, see GUIDELINES for details.
0005 
0006 // Header file for Dire QED splittings.
0007 
0008 #ifndef Pythia8_DireSplittingsQED_H
0009 #define Pythia8_DireSplittingsQED_H
0010 
0011 #define DIRE_SPLITTINGSQED_VERSION "2.002"
0012 
0013 #include "Pythia8/Basics.h"
0014 #include "Pythia8/BeamParticle.h"
0015 #include "Pythia8/ParticleData.h"
0016 #include "Pythia8/PythiaStdlib.h"
0017 #include "Pythia8/Settings.h"
0018 #include "Pythia8/StandardModel.h"
0019 
0020 #include "Pythia8/DireSplittingsQCD.h"
0021 
0022 namespace Pythia8 {
0023 
0024 //==========================================================================
0025 
0026 class DireSplittingQED : public DireSplittingQCD {
0027 
0028 public:
0029 
0030   // Constructor and destructor.
0031   DireSplittingQED(string idIn, int softRS, Settings* settings,
0032     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0033     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0034     DireSplittingQCD(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0035       coupSM,info, direInfo) {init();}
0036   virtual ~DireSplittingQED() {}
0037 
0038   void init();
0039 
0040   // Class members.
0041   double sumCharge2Tot, sumCharge2L, sumCharge2Q, aem0, enhance, pT2min,
0042          pT2minL, pT2minQ, pT2minA, pT2minForcePos;
0043   bool doQEDshowerByQ, doQEDshowerByL, doForcePos;
0044 
0045   AlphaEM     alphaEM;
0046 
0047   // Function to calculate the correct running coupling/2*Pi value, including
0048   // renormalisation scale variations + threshold matching.
0049   double aem2Pi ( double pT2, int = 0);
0050 
0051   bool useFastFunctions() { return true; }
0052 
0053   virtual vector <int> radAndEmt(int idDaughter, int)
0054    { return createvector<int>(motherID(idDaughter))(sisterID(idDaughter)); }
0055   virtual int nEmissions()  { return 1; }
0056   virtual bool isPartial()  { return true; }
0057 
0058   virtual int couplingType (int, int) { return 2; }
0059   virtual double coupling (double = 0., double = 0., double = 0., double = -1,
0060     pair<int,bool> = pair<int,bool>(), pair<int,bool> = pair<int,bool>()) {
0061     return (aem0 / (2.*M_PI));
0062   }
0063   virtual double couplingScale2 (double = 0., double = 0., double = 0.,
0064     pair<int,bool> = pair<int,bool>(), pair<int,bool> = pair<int,bool>()) {
0065     return -1.;
0066   }
0067 
0068   virtual bool aboveCutoff( double t, const Particle& radBef,
0069     const Particle& recBef, int iSys, PartonSystems* partonSystemsPtr);
0070 
0071 };
0072 
0073 //==========================================================================
0074 
0075 class Dire_fsr_qed_Q2QA : public DireSplittingQED {
0076 
0077 public:
0078 
0079   Dire_fsr_qed_Q2QA(string idIn, int softRS, Settings* settings,
0080     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0081     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0082     DireSplittingQED(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0083       coupSM, info, direInfo){}
0084 
0085   bool canRadiate ( const Event&, pair<int,int>,
0086     unordered_map<string,bool> = unordered_map<string,bool>(),
0087     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0088   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0089     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0090 
0091   int kinMap ();
0092 
0093   // Return id of mother after splitting.
0094   int motherID(int idDaughter);
0095 
0096   // Return id of emission.
0097   int sisterID(int idDaughter);
0098 
0099   // Return id of recombined radiator (before splitting!)
0100   int radBefID(int idRadAfter, int idEmtAfter);
0101 
0102   // Return colours of recombined radiator (before splitting!)
0103   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0104     int colEmtAfter, int acolEmtAfter);
0105 
0106   vector<pair<int,int> > radAndEmtCols(int iRad, int, Event state) {
0107     return createvector<pair<int,int> >
0108       (make_pair(state[iRad].col(),state[iRad].acol()))(make_pair(0, 0));
0109   }
0110 
0111   double gaugeFactor ( int=0, int=0 );
0112   double symmetryFactor ( int=0, int=0 );
0113 
0114   vector <int> recPositions( const Event& state, int iRad, int iEmt);
0115 
0116   // Pick z for new splitting.
0117   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0118 
0119   // New overestimates, z-integrated versions.
0120   double overestimateInt(double zMinAbs,double zMaxAbs,
0121     double pT2Old, double m2dip, int order = -1);
0122 
0123   // Return kernel for new splitting.
0124   double overestimateDiff(double z, double m2dip, int order = -1);
0125 
0126   // Functions to calculate the kernel from SplitInfo information.
0127   bool calc(const Event& state = Event(), int order = -1);
0128 
0129 };
0130 
0131 //==========================================================================
0132 
0133 class Dire_fsr_qed_Q2AQ : public DireSplittingQED {
0134 
0135 public:
0136 
0137   Dire_fsr_qed_Q2AQ(string idIn, int softRS, Settings* settings,
0138     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0139     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0140     DireSplittingQED(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0141       coupSM, info, direInfo){}
0142 
0143   bool canRadiate ( const Event&, pair<int,int>,
0144     unordered_map<string,bool> = unordered_map<string,bool>(),
0145     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0146   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0147     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0148 
0149   int kinMap ();
0150 
0151   // Return id of mother after splitting.
0152   int motherID(int idDaughter);
0153 
0154   vector<pair<int,int> > radAndEmtCols(int iRad, int, Event state) {
0155     return createvector<pair<int,int> >
0156       (make_pair(state[iRad].col(),state[iRad].acol()))(make_pair(0, 0));
0157   }
0158 
0159   // Return id of emission.
0160   int sisterID(int idDaughter);
0161 
0162   // Return id of recombined radiator (before splitting!)
0163   int radBefID(int idRadAfter, int idEmtAfter);
0164 
0165   // Return colours of recombined radiator (before splitting!)
0166   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0167     int colEmtAfter, int acolEmtAfter);
0168 
0169   double gaugeFactor ( int=0, int=0 );
0170   double symmetryFactor ( int=0, int=0 );
0171 
0172   vector <int> recPositions( const Event& state, int iRad, int iEmt);
0173 
0174   // Pick z for new splitting.
0175   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0176 
0177   // New overestimates, z-integrated versions.
0178   double overestimateInt(double zMinAbs,double zMaxAbs,
0179     double pT2Old, double m2dip, int order = -1);
0180 
0181   // Return kernel for new splitting.
0182   double overestimateDiff(double z, double m2dip, int order = -1);
0183 
0184   // Functions to calculate the kernel from SplitInfo information.
0185   bool calc(const Event& state = Event(), int order = -1);
0186 
0187 };
0188 
0189 //==========================================================================
0190 
0191 class Dire_fsr_qed_L2LA : public DireSplittingQED {
0192 
0193 public:
0194 
0195   Dire_fsr_qed_L2LA(string idIn, int softRS, Settings* settings,
0196     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0197     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0198     DireSplittingQED(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0199       coupSM, info, direInfo){}
0200 
0201   bool canRadiate ( const Event&, pair<int,int>,
0202     unordered_map<string,bool> = unordered_map<string,bool>(),
0203     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0204   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0205     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0206 
0207   int kinMap ();
0208 
0209   // Return id of mother after splitting.
0210   int motherID(int idDaughter);
0211 
0212   // Return id of emission.
0213   int sisterID(int idDaughter);
0214 
0215   // Return id of recombined radiator (before splitting!)
0216   int radBefID(int idRadAfter, int idEmtAfter);
0217 
0218   // Return colours of recombined radiator (before splitting!)
0219   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0220     int colEmtAfter, int acolEmtAfter);
0221 
0222   vector<pair<int,int> > radAndEmtCols(int, int, Event) {
0223     return createvector<pair<int,int> > (make_pair(0,0))(make_pair(0, 0));
0224   }
0225 
0226   double gaugeFactor ( int=0, int=0 );
0227   double symmetryFactor ( int=0, int=0 );
0228 
0229   vector <int> recPositions( const Event& state, int iRad, int iEmt);
0230 
0231   // Pick z for new splitting.
0232   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0233 
0234   // New overestimates, z-integrated versions.
0235   double overestimateInt(double zMinAbs,double zMaxAbs,
0236     double pT2Old, double m2dip, int order = -1);
0237 
0238   // Return kernel for new splitting.
0239   double overestimateDiff(double z, double m2dip, int order = -1);
0240 
0241   // Functions to calculate the kernel from SplitInfo information.
0242   bool calc(const Event& state = Event(), int order = -1);
0243 
0244 };
0245 
0246 //==========================================================================
0247 
0248 class Dire_fsr_qed_L2AL : public DireSplittingQED {
0249 
0250 public:
0251 
0252   Dire_fsr_qed_L2AL(string idIn, int softRS, Settings* settings,
0253     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0254     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0255     DireSplittingQED(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0256       coupSM, info, direInfo){}
0257 
0258   bool canRadiate ( const Event&, pair<int,int>,
0259     unordered_map<string,bool> = unordered_map<string,bool>(),
0260     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0261   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0262     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0263 
0264   int kinMap ();
0265 
0266   // Return id of mother after splitting.
0267   int motherID(int idDaughter);
0268 
0269   // Return id of emission.
0270   int sisterID(int idDaughter);
0271 
0272   // Return id of recombined radiator (before splitting!)
0273   int radBefID(int idRadAfter, int idEmtAfter);
0274 
0275   // Return colours of recombined radiator (before splitting!)
0276   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0277     int colEmtAfter, int acolEmtAfter);
0278 
0279   vector<pair<int,int> > radAndEmtCols(int, int, Event) {
0280     return createvector<pair<int,int> > (make_pair(0,0))(make_pair(0, 0));
0281   }
0282 
0283   double gaugeFactor ( int=0, int=0 );
0284   double symmetryFactor ( int=0, int=0 );
0285 
0286   vector <int> recPositions( const Event& state, int iRad, int iEmt);
0287 
0288   // Pick z for new splitting.
0289   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0290 
0291   // New overestimates, z-integrated versions.
0292   double overestimateInt(double zMinAbs,double zMaxAbs,
0293     double pT2Old, double m2dip, int order = -1);
0294 
0295   // Return kernel for new splitting.
0296   double overestimateDiff(double z, double m2dip, int order = -1);
0297 
0298   // Functions to calculate the kernel from SplitInfo information.
0299   bool calc(const Event& state = Event(), int order = -1);
0300 
0301 };
0302 
0303 //==========================================================================
0304 
0305 class Dire_fsr_qed_A2FF : public DireSplittingQED {
0306 
0307 public:
0308 
0309   int idRadAfterSave;
0310   double nchSaved;
0311 
0312   Dire_fsr_qed_A2FF(int idRadAfterIn, string idIn, int softRS,
0313     Settings* settings,
0314     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0315     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0316     DireSplittingQED(idIn,
0317     softRS, settings, particleData, rndm, beamA, beamB, coupSM, info,
0318     direInfo),
0319     idRadAfterSave(idRadAfterIn), nchSaved(1) {}
0320   bool canRadiate ( const Event& state, pair<int,int> ints,
0321     unordered_map<string,bool> = unordered_map<string,bool>(),
0322     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr) {
0323     return ( state[ints.first].isFinal()
0324           && state[ints.first].id() == 22
0325           && state[ints.second].isCharged());
0326   }
0327   bool canRadiate ( const Event& state, int iRadBef, int iRecBef,
0328     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr) {
0329     return ( state[iRadBef].isFinal()
0330           && state[iRadBef].id() == 22
0331           && state[iRecBef].isCharged());
0332   }
0333 
0334   int kinMap () { return 1;};
0335   bool canUseForBranching() { return true; }
0336   bool isPartial()  { return false; }
0337 
0338   vector<pair<int,int> > radAndEmtCols(int iRad, int, Event state) {
0339     vector< pair<int,int> > ret;
0340     if (state[iRad].id() != 22) return ret;
0341     ret = createvector<pair<int,int> >(make_pair(0, 0))(make_pair(0, 0));
0342     if (particleDataPtr->colType(idRadAfterSave) != 0) {
0343       int sign      = (idRadAfterSave > 0) ? 1 : -1;
0344       int newCol    = state.nextColTag();
0345       if (sign> 0) {
0346         ret[0].first  = newCol;
0347         ret[0].second = 0;
0348         ret[1].first  = 0;
0349         ret[1].second = newCol;
0350       } else {
0351         ret[0].first  = 0;
0352         ret[0].second = newCol;
0353         ret[1].first  = newCol;
0354         ret[1].second = 0;
0355       }
0356     }
0357     return ret;
0358   }
0359 
0360   // Return id of mother after splitting.
0361   int motherID(int)
0362     { return idRadAfterSave; }
0363   int sisterID(int)
0364     { return -idRadAfterSave; }
0365   vector <int> radAndEmt(int, int)
0366     { return createvector<int>(idRadAfterSave)(-idRadAfterSave); }
0367     //{ return createvector<int>(1)(-1); }
0368   double gaugeFactor    ( int=0, int=0 )
0369     { return pow2(particleDataPtr->charge(idRadAfterSave)); }
0370   double symmetryFactor ( int=0, int=0 )
0371     { return 1./double(nchSaved); }
0372   // Return id of recombined radiator (before splitting!)
0373   int radBefID(int idRadAfter, int idEmtAfter) {
0374     if ( idRadAfter == idRadAfterSave
0375       && particleDataPtr->isQuark(idRadAfter)
0376       && particleDataPtr->isQuark(idEmtAfter)) return 22;
0377     return 0;
0378   }
0379   // Return colours of recombined radiator (before splitting!)
0380   pair<int,int> radBefCols(int, int, int, int) { return make_pair(0,0); }
0381 
0382   // All charged particles are potential recoilers.
0383   vector <int> recPositions( const Event& state, int iRad, int iEmt) {
0384     if ( state[iRad].isFinal() || state[iRad].id() != idRadAfterSave
0385       || state[iEmt].id() != -idRadAfterSave) return vector<int>();
0386     // Particles to exclude as recoilers.
0387     vector<int> iExc(createvector<int>(iRad)(iEmt));
0388     // Find charged particles.
0389     vector<int> recs;
0390     for (int i=0; i < state.size(); ++i) {
0391       if ( find(iExc.begin(), iExc.end(), i) != iExc.end() ) continue;
0392       if ( state[i].isCharged() ) {
0393         if (state[i].isFinal())
0394           recs.push_back(i);
0395         if (state[i].mother1() == 1 && state[i].mother2() == 0)
0396           recs.push_back(i);
0397         if (state[i].mother1() == 2 && state[i].mother2() == 0)
0398           recs.push_back(i);
0399       }
0400     }
0401     // Done.
0402     return recs;
0403   }
0404 
0405   // All charged particles are potential recoilers.
0406   int set_nCharged( const Event& state) {
0407     // Find charged particles.
0408     int nch=0;
0409     for (int i=0; i < state.size(); ++i) {
0410       if ( state[i].isCharged() ) {
0411         if (state[i].isFinal()) nch++;
0412         if (state[i].mother1() == 1 && state[i].mother2() == 0) nch++;
0413         if (state[i].mother1() == 2 && state[i].mother2() == 0) nch++;
0414       }
0415     }
0416     // Done.
0417     nchSaved = nch;
0418     return nch;
0419   }
0420 
0421   // Pick z for new splitting.
0422   double zSplit(double zMinAbs, double zMaxAbs, double /*m2dip*/) {
0423       return (zMinAbs + rndmPtr->flat() * (zMaxAbs - zMinAbs));
0424   }
0425 
0426   // New overestimates, z-integrated versions.
0427   double overestimateInt(double zMinAbs,double zMaxAbs,
0428     double /*pT2Old*/, double /*m2dip*/, int /*order*/ = -1) {
0429     double preFac = symmetryFactor() * gaugeFactor();
0430     double wt     = 2. *enhance * preFac * 0.5 * ( zMaxAbs - zMinAbs);
0431     return wt;
0432   }
0433 
0434   // Return kernel for new splitting.
0435   double overestimateDiff(double /*z*/, double /*m2dip*/, int /*order*/ = -1) {
0436     double preFac = symmetryFactor() * gaugeFactor();
0437     double wt     = 2. *enhance * preFac * 0.5;
0438     return wt;
0439   }
0440 
0441   // Functions to calculate the kernel from SplitInfo information.
0442   bool calc(const Event& state, int orderNow) {
0443 
0444     // Dummy statement to avoid compiler warnings.
0445     if (false) cout << state[0].e() << orderNow << endl;
0446 
0447     // Read all splitting variables.
0448     double z(splitInfo.kinematics()->z), pT2(splitInfo.kinematics()->pT2),
0449       m2dip(splitInfo.kinematics()->m2Dip),
0450       //m2RadBef(splitInfo.kinematics()->m2RadBef),
0451       m2Rad(splitInfo.kinematics()->m2RadAft),
0452       m2Rec(splitInfo.kinematics()->m2Rec),
0453       m2Emt(splitInfo.kinematics()->m2EmtAft);
0454     int splitType(splitInfo.type);
0455 
0456     // Set number of recoilers.
0457     set_nCharged(state);
0458 
0459     double wt = 0.;
0460     double preFac = symmetryFactor() * gaugeFactor();
0461     double kappa2 = pT2/m2dip;
0462     wt  = preFac
0463         * (pow(1.-z,2.) + pow(z,2.));
0464 
0465     // Correction for massive splittings.
0466     bool doMassive = (abs(splitType) == 2);
0467 
0468     if (doMassive) {
0469 
0470       double vijk = 1., pipj = 0.;
0471 
0472       // splitType == 2 -> Massive FF
0473       if (splitType == 2) {
0474         // Calculate CS variables.
0475         double yCS = kappa2 / (1.-z);
0476         double nu2Rad = m2Rad/m2dip;
0477         double nu2Emt = m2Emt/m2dip;
0478         double nu2Rec = m2Rec/m2dip;
0479         vijk          = pow2(1.-yCS) - 4.*(yCS+nu2Rad+nu2Emt)*nu2Rec;
0480         vijk          = sqrt(vijk) / (1-yCS);
0481         pipj          = m2dip * yCS /2.;
0482 
0483       // splitType ==-2 -> Massive FI
0484       } else if (splitType ==-2) {
0485         // Calculate CS variables.
0486         double xCS = 1 - kappa2/(1.-z);
0487         vijk   = 1.;
0488         pipj   = m2dip/2. * (1-xCS)/xCS;
0489       }
0490 
0491       // Reset kernel for massive splittings.
0492       wt = preFac * 1. / vijk * ( pow2(1.-z) + pow2(z)
0493                                       + m2Emt / ( pipj + m2Emt) );
0494     }
0495 
0496     // Multiply with z factor
0497     if (idRadAfterSave > 0) wt *= z;
0498     else                    wt *= 1.-z;
0499 
0500     // Trivial map of values, since kernel does not depend on coupling.
0501     unordered_map<string,double> wts;
0502     wts.insert( make_pair("base", wt ));
0503     if (doVariations) {
0504       // Create muR-variations.
0505       if (settingsPtr->parm("Variations:muRfsrDown") != 1.)
0506         wts.insert( make_pair("Variations:muRfsrDown", wt ));
0507       if (settingsPtr->parm("Variations:muRfsrUp")   != 1.)
0508         wts.insert( make_pair("Variations:muRfsrUp", wt ));
0509     }
0510 
0511     // Store kernel values.
0512     clearKernels();
0513     for ( unordered_map<string,double>::iterator it = wts.begin();
0514       it != wts.end(); ++it )
0515       kernelVals.insert(make_pair( it->first, it->second ));
0516 
0517     return true;
0518   }
0519 
0520 };
0521 
0522 
0523 //==========================================================================
0524 
0525 class Dire_isr_qed_Q2QA : public DireSplittingQED {
0526 
0527 public:
0528 
0529   Dire_isr_qed_Q2QA(string idIn, int softRS, Settings* settings,
0530     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0531     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0532     DireSplittingQED(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0533       coupSM, info, direInfo){}
0534 
0535   bool canRadiate ( const Event&, pair<int,int>,
0536     unordered_map<string,bool> = unordered_map<string,bool>(),
0537     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0538   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0539     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0540 
0541   int kinMap ();
0542 
0543   // Return id of mother after splitting.
0544   int motherID(int idDaughter);
0545 
0546   // Return id of emission.
0547   int sisterID(int idDaughter);
0548 
0549   // Return id of recombined radiator (before splitting!)
0550   int radBefID(int idRadAfter, int idEmtAfter);
0551 
0552   // Return colours of recombined radiator (before splitting!)
0553   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0554     int colEmtAfter, int acolEmtAfter);
0555 
0556   vector<pair<int,int> > radAndEmtCols(int iRad, int, Event state) {
0557     return createvector<pair<int,int> >
0558       (make_pair(state[iRad].col(),state[iRad].acol()))(make_pair(0, 0));
0559   }
0560 
0561   double gaugeFactor ( int=0, int=0 );
0562   double symmetryFactor ( int=0, int=0 );
0563 
0564   vector <int> recPositions( const Event& state, int iRad, int iEmt);
0565 
0566   // Pick z for new splitting.
0567   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0568 
0569   // New overestimates, z-integrated versions.
0570   double overestimateInt(double zMinAbs,double zMaxAbs,
0571     double pT2Old, double m2dip, int order = -1);
0572 
0573   // Return kernel for new splitting.
0574   double overestimateDiff(double z, double m2dip, int order = -1);
0575 
0576   // Functions to calculate the kernel from SplitInfo information.
0577   bool calc(const Event& state = Event(), int order = -1);
0578 
0579 };
0580 
0581 class Dire_isr_qed_A2QQ : public DireSplittingQED {
0582 
0583 public:
0584 
0585   Dire_isr_qed_A2QQ(string idIn, int softRS, Settings* settings,
0586     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0587     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0588     DireSplittingQED(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0589       coupSM, info, direInfo){}
0590 
0591   bool canRadiate ( const Event&, pair<int,int>,
0592     unordered_map<string,bool> = unordered_map<string,bool>(),
0593     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0594   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0595     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0596 
0597   int kinMap ();
0598 
0599   // Return id of mother after splitting.
0600   int motherID(int idDaughter);
0601 
0602   // Return id of emission.
0603   int sisterID(int idDaughter);
0604 
0605   // Return id of recombined radiator (before splitting!)
0606   int radBefID(int idRadAfter, int idEmtAfter);
0607 
0608   // Return colours of recombined radiator (before splitting!)
0609   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0610     int colEmtAfter, int acolEmtAfter);
0611 
0612   vector<pair<int,int> > radAndEmtCols(int iRad, int, Event state) {
0613     return createvector<pair<int,int> >
0614       (make_pair(0, 0))(make_pair(state[iRad].acol(),state[iRad].col()));
0615   }
0616 
0617   double gaugeFactor ( int=0, int=0 );
0618   double symmetryFactor ( int=0, int=0 );
0619 
0620   // Pick z for new splitting.
0621   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0622 
0623   // New overestimates, z-integrated versions.
0624   double overestimateInt(double zMinAbs,double zMaxAbs,
0625     double pT2Old, double m2dip, int order = -1);
0626 
0627   // Return kernel for new splitting.
0628   double overestimateDiff(double z, double m2dip, int order = -1);
0629 
0630   // Functions to calculate the kernel from SplitInfo information.
0631   bool calc(const Event& state = Event(), int order = -1);
0632 
0633 };
0634 
0635 class Dire_isr_qed_Q2AQ : public DireSplittingQED {
0636 
0637 public:
0638 
0639   Dire_isr_qed_Q2AQ(string idIn, int softRS, Settings* settings,
0640     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0641     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0642     DireSplittingQED(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0643       coupSM, info, direInfo){}
0644 
0645   bool canRadiate ( const Event&, pair<int,int>,
0646     unordered_map<string,bool> = unordered_map<string,bool>(),
0647     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0648   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0649     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0650 
0651   int kinMap ();
0652 
0653   // Return id of mother after splitting.
0654   int motherID(int idDaughter);
0655 
0656   // Return id of emission.
0657   int sisterID(int idDaughter);
0658 
0659   // Return id of recombined radiator (before splitting!)
0660   int radBefID(int idRadAfter, int idEmtAfter);
0661 
0662   // Return colours of recombined radiator (before splitting!)
0663   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0664     int colEmtAfter, int acolEmtAfter);
0665 
0666   vector<pair<int,int> > radAndEmtCols(int, int colType, Event state) {
0667     int newCol    = state.nextColTag();
0668     if (colType > 0) return createvector<pair<int,int> >
0669       (make_pair(newCol,0))(make_pair(newCol,0));
0670     return createvector<pair<int,int> >
0671       (make_pair(0,newCol))(make_pair(0,newCol));
0672   }
0673 
0674   double gaugeFactor ( int=0, int=0 );
0675   double symmetryFactor ( int=0, int=0 );
0676 
0677   // Pick z for new splitting.
0678   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0679 
0680   // New overestimates, z-integrated versions.
0681   double overestimateInt(double zMinAbs,double zMaxAbs,
0682     double pT2Old, double m2dip, int order = -1);
0683 
0684   // Return kernel for new splitting.
0685   double overestimateDiff(double z, double m2dip, int order = -1);
0686 
0687   // Functions to calculate the kernel from SplitInfo information.
0688   bool calc(const Event& state = Event(), int order = -1);
0689 
0690 };
0691 
0692 class Dire_isr_qed_L2LA : public DireSplittingQED {
0693 
0694 public:
0695 
0696   Dire_isr_qed_L2LA(string idIn, int softRS, Settings* settings,
0697     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0698     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0699     DireSplittingQED(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0700       coupSM, info, direInfo){}
0701 
0702   bool canRadiate ( const Event&, pair<int,int>,
0703     unordered_map<string,bool> = unordered_map<string,bool>(),
0704     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0705   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0706     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0707 
0708   int kinMap ();
0709 
0710   // Return id of mother after splitting.
0711   int motherID(int idDaughter);
0712 
0713   // Return id of emission.
0714   int sisterID(int idDaughter);
0715 
0716   // Return id of recombined radiator (before splitting!)
0717   int radBefID(int idRadAfter, int idEmtAfter);
0718 
0719   // Return colours of recombined radiator (before splitting!)
0720   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0721     int colEmtAfter, int acolEmtAfter);
0722 
0723   vector<pair<int,int> > radAndEmtCols(int, int, Event) {
0724     return createvector<pair<int,int> > (make_pair(0,0))(make_pair(0,0));
0725   }
0726 
0727   double gaugeFactor ( int=0, int=0 );
0728   double symmetryFactor ( int=0, int=0 );
0729 
0730   vector <int> recPositions( const Event& state, int iRad, int iEmt);
0731 
0732   // Pick z for new splitting.
0733   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0734 
0735   // New overestimates, z-integrated versions.
0736   double overestimateInt(double zMinAbs,double zMaxAbs,
0737     double pT2Old, double m2dip, int order = -1);
0738 
0739   // Return kernel for new splitting.
0740   double overestimateDiff(double z, double m2dip, int order = -1);
0741 
0742   // Functions to calculate the kernel from SplitInfo information.
0743   bool calc(const Event& state = Event(), int order = -1);
0744 
0745 };
0746 
0747 class Dire_isr_qed_A2LL : public DireSplittingQED {
0748 
0749 public:
0750 
0751   Dire_isr_qed_A2LL(string idIn, int softRS, Settings* settings,
0752     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0753     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0754     DireSplittingQED(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0755       coupSM, info, direInfo){}
0756 
0757   bool canRadiate ( const Event&, pair<int,int>,
0758     unordered_map<string,bool> = unordered_map<string,bool>(),
0759     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0760   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0761     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0762 
0763   int kinMap ();
0764 
0765   // Return id of mother after splitting.
0766   int motherID(int idDaughter);
0767 
0768   // Return id of emission.
0769   int sisterID(int idDaughter);
0770 
0771   // Return id of recombined radiator (before splitting!)
0772   int radBefID(int idRadAfter, int idEmtAfter);
0773 
0774   // Return colours of recombined radiator (before splitting!)
0775   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0776     int colEmtAfter, int acolEmtAfter);
0777 
0778   vector<pair<int,int> > radAndEmtCols(int, int, Event) {
0779     return createvector<pair<int,int> > (make_pair(0,0))(make_pair(0,0));
0780   }
0781 
0782   double gaugeFactor ( int=0, int=0 );
0783   double symmetryFactor ( int=0, int=0 );
0784 
0785   // Pick z for new splitting.
0786   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0787 
0788   // New overestimates, z-integrated versions.
0789   double overestimateInt(double zMinAbs,double zMaxAbs,
0790     double pT2Old, double m2dip, int order = -1);
0791 
0792   // Return kernel for new splitting.
0793   double overestimateDiff(double z, double m2dip, int order = -1);
0794 
0795   // Functions to calculate the kernel from SplitInfo information.
0796   bool calc(const Event& state = Event(), int order = -1);
0797 
0798 };
0799 
0800 class Dire_isr_qed_L2AL : public DireSplittingQED {
0801 
0802 public:
0803 
0804   Dire_isr_qed_L2AL(string idIn, int softRS, Settings* settings,
0805     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0806     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0807     DireSplittingQED(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0808       coupSM, info, direInfo){}
0809 
0810   bool canRadiate ( const Event&, pair<int,int>,
0811     unordered_map<string,bool> = unordered_map<string,bool>(),
0812     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0813   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0814     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0815 
0816   int kinMap ();
0817 
0818   // Return id of mother after splitting.
0819   int motherID(int idDaughter);
0820 
0821   // Return id of emission.
0822   int sisterID(int idDaughter);
0823 
0824   // Return id of recombined radiator (before splitting!)
0825   int radBefID(int idRadAfter, int idEmtAfter);
0826 
0827   // Return colours of recombined radiator (before splitting!)
0828   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0829     int colEmtAfter, int acolEmtAfter);
0830 
0831   vector<pair<int,int> > radAndEmtCols(int, int, Event) {
0832     return createvector<pair<int,int> > (make_pair(0,0))(make_pair(0,0));
0833   }
0834 
0835   double gaugeFactor ( int=0, int=0 );
0836   double symmetryFactor ( int=0, int=0 );
0837 
0838   // Pick z for new splitting.
0839   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0840 
0841   // New overestimates, z-integrated versions.
0842   double overestimateInt(double zMinAbs,double zMaxAbs,
0843     double pT2Old, double m2dip, int order = -1);
0844 
0845   // Return kernel for new splitting.
0846   double overestimateDiff(double z, double m2dip, int order = -1);
0847 
0848   // Functions to calculate the kernel from SplitInfo information.
0849   bool calc(const Event& state = Event(), int order = -1);
0850 
0851 };
0852 
0853 //==========================================================================
0854 
0855 class Dire_fsr_qed_Q2QA_notPartial : public DireSplittingQED {
0856 
0857 public:
0858 
0859   Dire_fsr_qed_Q2QA_notPartial(string idIn, int softRS, Settings* settings,
0860     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0861     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0862     DireSplittingQED(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0863       coupSM, info, direInfo){}
0864 
0865   bool canRadiate ( const Event&, pair<int,int>,
0866     unordered_map<string,bool> = unordered_map<string,bool>(),
0867     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0868   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0869     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0870 
0871   int kinMap ();
0872   bool canUseForBranching() { return true; }
0873   bool isPartial()  { return false; }
0874 
0875   // Return id of mother after splitting.
0876   int motherID(int idDaughter);
0877 
0878   // Return id of emission.
0879   int sisterID(int idDaughter);
0880 
0881   // Return id of recombined radiator (before splitting!)
0882   int radBefID(int idRadAfter, int idEmtAfter);
0883 
0884   // Return colours of recombined radiator (before splitting!)
0885   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0886     int colEmtAfter, int acolEmtAfter);
0887 
0888   vector<pair<int,int> > radAndEmtCols(int iRad, int, Event state) {
0889     return createvector<pair<int,int> >
0890       (make_pair(state[iRad].col(),state[iRad].acol()))(make_pair(0, 0));
0891   }
0892 
0893   double gaugeFactor ( int=0, int=0 );
0894   double symmetryFactor ( int=0, int=0 );
0895 
0896   vector <int> recPositions( const Event& state, int iRad, int iEmt);
0897 
0898   // Pick z for new splitting.
0899   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0900 
0901   // New overestimates, z-integrated versions.
0902   double overestimateInt(double zMinAbs,double zMaxAbs,
0903     double pT2Old, double m2dip, int order = -1);
0904 
0905   // Return kernel for new splitting.
0906   double overestimateDiff(double z, double m2dip, int order = -1);
0907 
0908   // Functions to calculate the kernel from SplitInfo information.
0909   bool calc(const Event& state = Event(), int order = -1);
0910 
0911 };
0912 
0913 //==========================================================================
0914 
0915 class Dire_fsr_qed_L2LA_notPartial : public DireSplittingQED {
0916 
0917 public:
0918 
0919   Dire_fsr_qed_L2LA_notPartial(string idIn, int softRS, Settings* settings,
0920     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0921     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0922     DireSplittingQED(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0923       coupSM, info, direInfo){}
0924 
0925   bool canRadiate ( const Event&, pair<int,int>,
0926     unordered_map<string,bool> = unordered_map<string,bool>(),
0927     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0928   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0929     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0930 
0931   int kinMap ();
0932   bool canUseForBranching() { return true; }
0933   bool isPartial()  { return false; }
0934 
0935   // Return id of mother after splitting.
0936   int motherID(int idDaughter);
0937 
0938   // Return id of emission.
0939   int sisterID(int idDaughter);
0940 
0941   // Return id of recombined radiator (before splitting!)
0942   int radBefID(int idRadAfter, int idEmtAfter);
0943 
0944   // Return colours of recombined radiator (before splitting!)
0945   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0946     int colEmtAfter, int acolEmtAfter);
0947 
0948   vector<pair<int,int> > radAndEmtCols(int, int, Event) {
0949     return createvector<pair<int,int> > (make_pair(0,0))(make_pair(0,0));
0950   }
0951 
0952   double gaugeFactor ( int=0, int=0 );
0953   double symmetryFactor ( int=0, int=0 );
0954 
0955   vector <int> recPositions( const Event& state, int iRad, int iEmt);
0956 
0957   // Pick z for new splitting.
0958   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0959 
0960   // New overestimates, z-integrated versions.
0961   double overestimateInt(double zMinAbs,double zMaxAbs,
0962     double pT2Old, double m2dip, int order = -1);
0963 
0964   // Return kernel for new splitting.
0965   double overestimateDiff(double z, double m2dip, int order = -1);
0966 
0967   // Functions to calculate the kernel from SplitInfo information.
0968   bool calc(const Event& state = Event(), int order = -1);
0969 
0970 };
0971 
0972 //==========================================================================
0973 
0974 } // end namespace Pythia8
0975 
0976 #endif // Pythia8_DireSplittingsQED_H