Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 10:23:21

0001 // DireSplittingsQCD.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 of QCD splittings for the Dire parton shower.
0007 
0008 #ifndef Pythia8_DireSplittingsQCD_H
0009 #define Pythia8_DireSplittingsQCD_H
0010 
0011 #define ZETA3 1.202056903159594
0012 #define DIRE_SPLITTINGSQCD_VERSION "2.002"
0013 
0014 #include "Pythia8/Basics.h"
0015 #include "Pythia8/BeamParticle.h"
0016 #include "Pythia8/ParticleData.h"
0017 #include "Pythia8/PythiaStdlib.h"
0018 #include "Pythia8/Settings.h"
0019 #include "Pythia8/StandardModel.h"
0020 
0021 #include "Pythia8/DireSplittings.h"
0022 
0023 namespace Pythia8 {
0024 
0025 //==========================================================================
0026 
0027 class DireSplittingQCD : public DireSplitting {
0028 
0029 public:
0030 
0031   // Constructor and destructor.
0032   DireSplittingQCD(string idIn, int softRS, Settings* settings,
0033     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0034     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0035     DireSplitting(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0036       coupSM, info, direInfo) {
0037     init();
0038     asSchemeISR=settingsPtr->mode("DireSpace:alphasScheme");
0039     asSchemeFSR=settingsPtr->mode("DireTimes:alphasScheme");}
0040   virtual ~DireSplittingQCD() {}
0041 
0042   void init();
0043 
0044   // VARIABLES
0045   double CA, TR, CF, pTmin, pT2minVariations;
0046   int NF_qcd_fsr, orderSave;
0047   bool usePDFalphas, doVariations, doCorrelations, doMECs;
0048   double alphaSorder, alphaS2pi;
0049 
0050   AlphaStrong alphaS;
0051 
0052   static const double SMALL_TEVOL;
0053 
0054   // AUXILIARY FUNCTIONS
0055   double getNF(double pT2);
0056   double GammaQCD2(double NF=5.);
0057   double GammaQCD3(double NF=5.);
0058   double betaQCD0(double NF=5.);
0059   double betaQCD1(double NF=5.);
0060   double betaQCD2(double NF=5.);
0061 
0062   // Function to calculate the correct running coupling/2*Pi value, including
0063   // renormalisation scale variations + threshold matching.
0064   double as2Pi(double pT2, int orderNow = -1, double renormMultFacNow = -1.);
0065 
0066   double softRescaleInt(int order);
0067   double softRescaleDiff(int order, double pT2, double renormMultFacNow = -1.);
0068   double beta0Endpoint(int order, double m2dip, double pT2, double z,
0069     double renormMultFacNow = -1.);
0070 
0071   double polevl(double x,double* coef,int N );
0072   double  DiLog(double x);
0073 
0074   vector<int> sharedColor(const Event& event, int iRad, int iRec);
0075   bool hasSharedColor(const Event& event, int iRad, int iRec);
0076 
0077   int findCol(int col, vector<int> iExc, const Event&, int type);
0078 
0079   bool useFastFunctions() { return true; }
0080 
0081   virtual vector <int> radAndEmt(int idDaughter, int)
0082    { return createvector<int>(motherID(idDaughter))(sisterID(idDaughter)); }
0083   virtual bool isPartial()  { return true; }
0084 
0085   virtual int couplingType (int, int) { return 1; }
0086   virtual double coupling (double z, double pT2, double m2dip,
0087     double renormMultFacNow = -1.,
0088     pair<int,bool> radBef = pair<int,bool>(),
0089     pair<int,bool> recBef = pair<int,bool>()) {
0090     if (!usePDFalphas && alphaSorder == 0) return alphaS2pi;
0091     double scale2 = couplingScale2 ( z, pT2, m2dip, radBef, recBef);
0092     if (scale2 < 0.) scale2 = pT2;
0093     if (z      < 0.) scale2 = pT2;
0094     // Return coupling. Set up such the argument is NOT RESCALED in as2Pi
0095     // function - rather guarantee that INPUT pT2/scale has desired value.
0096     double fac = (renormMultFacNow > 0.) ? renormMultFacNow : renormMultFac;
0097     return as2Pi(scale2, orderSave, fac);
0098   }
0099 
0100   // Function determining the argument of the running coupling based on the
0101   // splitting variables. Current default: Evolution variable.
0102   // DireTimes:alphasScheme = 0 : default
0103   // DireTimes:alphasScheme = 1 : collinear kinematic kT for all splittings
0104   //                              involving incoming particles.
0105   // DireTimes:alphasScheme = 2 : eikonal factor sij*sjk/sik
0106   int asSchemeISR, asSchemeFSR;
0107   virtual double couplingScale2 (double z, double pT2, double m2dip,
0108     pair<int,bool> radBef, pair<int,bool> recBef) {
0109     if        ( radBef.second &&  recBef.second) {
0110       if (asSchemeFSR == 0) return pT2;
0111       if (asSchemeFSR == 1) return pT2;
0112       if (asSchemeFSR == 2) {
0113         double ycs = pT2/m2dip/(1.-z);
0114         double sij = ycs*m2dip;
0115         double sjk = (1.-z)*m2dip;
0116         double sik = m2dip - sij - sjk;
0117         return sij*sjk/sik;
0118       }
0119     } else if ( radBef.second && !recBef.second) {
0120       if (asSchemeFSR == 0) return pT2;
0121       if (asSchemeFSR == 1) {
0122         double zcs = z;
0123         double xcs = m2dip * zcs * (1.-zcs) / (pT2 + m2dip * zcs * (1.-zcs));
0124         double kt2 = m2dip * (1.-xcs) / xcs * zcs * (1.-zcs);
0125         return kt2;
0126       }
0127       if (asSchemeFSR == 2) {
0128         double zcs = z;
0129         double xcs = m2dip * zcs * (1.-zcs) / (pT2 + m2dip * zcs * (1.-zcs));
0130         return (1-zcs)*(1-xcs)/xcs/zcs*m2dip;
0131       }
0132     } else if (!radBef.second &&  recBef.second) {
0133       if (asSchemeISR == 0) return pT2;
0134       if (asSchemeISR == 1) {
0135         double xcs = z;
0136         double ucs = pT2/m2dip / (1.-z);
0137         double kt2 = m2dip * (1-xcs) / xcs * ucs * (1.-ucs);
0138         return kt2;
0139       }
0140       if (asSchemeISR == 2) {
0141         double xcs = z;
0142         double ucs = pT2/m2dip / (1.-z);
0143         return  (1-xcs)/xcs*ucs/(1-ucs)*m2dip;
0144       }
0145     } else if (!radBef.second && !recBef.second) {
0146       if (asSchemeISR == 0) return pT2;
0147       if (asSchemeISR == 1) {
0148         double xcs = ( z * (1.-z) - pT2/m2dip) / (1.-z);
0149         double vcs = pT2/m2dip / (1.-z);
0150         double kt2 = m2dip * vcs * (1.-xcs-vcs) / xcs;
0151         return kt2;
0152       }
0153       if (asSchemeISR == 2) {
0154         double xcs = ( z * (1.-z) - pT2/m2dip) / (1.-z);
0155         double vcs = pT2/m2dip / (1.-z);
0156         double sab = m2dip/xcs;
0157         double saj = vcs*sab;
0158         double sjb = sab-saj-m2dip;
0159         return abs(saj*sjb/sab);
0160       }
0161     }
0162     return -1.;
0163   }
0164 
0165   // Functions that allow different ordering variables for emissions.
0166   // Note: Only works after splitInfo has been properly filled.
0167   virtual double getJacobian( const Event& = Event(),
0168     PartonSystems* partonSystems = 0);
0169   virtual unordered_map<string, double> getPhasespaceVars(
0170     const Event& = Event(), PartonSystems* = 0);
0171 
0172   bool useBackboneGluons, doGeneralizedKernel;
0173   double sCoef(int powz) { vector<double> tmp
0174     = settingsPtr->pvec("DireGeneralizedKernel:softCoeffs:" + name());
0175     return tmp[powz+1]; }
0176   double sExp(int powz) { vector<double> tmp
0177     = settingsPtr->pvec("DireGeneralizedKernel:softExps:" + name());
0178     return tmp[powz+1]; }
0179   double kCoef(int powz) { vector<double> tmp
0180     = settingsPtr->pvec("DireGeneralizedKernel:kappaCoeffs:" + name());
0181     return tmp[powz+1]; }
0182   double kExp(int powz){ vector<double> tmp
0183     = settingsPtr->pvec("DireGeneralizedKernel:kappaExps:" + name());
0184     return tmp[powz+1]; }
0185   double cCoef(int powz) { vector<double> tmp
0186     = settingsPtr->pvec("DireGeneralizedKernel:collCoeffs:" + name());
0187     return tmp[powz+1]; }
0188   double cExp(int powz) { vector<double> tmp
0189     = settingsPtr->pvec("DireGeneralizedKernel:collExps:" + name());
0190     return tmp[powz+1]; }
0191   double fCoef() { double tmp
0192     = settingsPtr->parm("DireGeneralizedKernel:finCoeffs:" + name());
0193     return tmp; }
0194 
0195   bool hasMECBef(const Event& state, double pT2);
0196   bool hasMECAft(const Event& state, double pT2);
0197 
0198 };
0199 
0200 //==========================================================================
0201 
0202 class Dire_fsr_qcd_Q2QGG : public DireSplittingQCD {
0203 
0204 public:
0205 
0206   Dire_fsr_qcd_Q2QGG(string idIn, int softRS, Settings* settings,
0207     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0208     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0209     DireSplittingQCD(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0210       coupSM, info, direInfo), is_sai_endpoint_save(false) {}
0211 
0212   bool canRadiate ( const Event&, pair<int,int>,
0213     unordered_map<string,bool> = unordered_map<string,bool>(),
0214     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0215 
0216   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0217     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0218 
0219   vector <int> radAndEmt(int idDaughter, int) {
0220     return createvector<int>(idDaughter)(21)(21);}
0221   int nEmissions()          { return 2; }
0222   int kinMap()              { return 2;}
0223   bool canUseForBranching() { return true; }
0224 
0225   vector<pair<int,int> > radAndEmtCols(int iRad, int colType, Event state);
0226 
0227   // Return colours of recombined radiator (before splitting!)
0228   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0229     int colEmtAfter, int acolEmtAfter);
0230 
0231   // Return id of recombined radiator (before splitting!)
0232   int radBefID(int idRadAfter, int idEmtAfter);
0233 
0234   double gaugeFactor ( int=0, int=0 );
0235   double symmetryFactor ( int=0, int=0 );
0236 
0237   // Pick z for new splitting.
0238   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0239 
0240   // New overestimates, z-integrated versions.
0241   double overestimateInt(double zMinAbs,double zMaxAbs,
0242     double pT2Old, double m2dip, int order = -1);
0243 
0244   // Return kernel for new splitting.
0245   double overestimateDiff(double z, double m2dip, int order = -1);
0246 
0247   // Functions to calculate the kernel from SplitInfo information.
0248   bool calc(const Event& state = Event(), int order = -1);
0249 
0250   double counterTerm(double si1, double si2, double sj1,
0251     double sj2, double sij, double s12);
0252 
0253   // Treatment of additional virtual corrections.
0254   bool allow_sai_endpoint_for_kinematics() { return true; }
0255   bool allow_xa_endpoint_for_kinematics()  { return false; }
0256   // Functions to set if kernel should contribute to a kinematical endpoint.
0257   void try_sai_endpoint() { is_sai_endpoint_save = (rndmPtr->flat() < 0.5); }
0258   void try_xa_endpoint()                   { return; }
0259   // Return endpoint information.
0260   bool is_sai_endpoint()                   { return is_sai_endpoint_save; }
0261   bool is_xa_endpoint()                    { return false; }
0262   bool is_sai_endpoint_save;
0263 
0264 };
0265 
0266 //==========================================================================
0267 
0268 class Dire_fsr_qcd_G2GGG : public DireSplittingQCD {
0269 
0270 public:
0271 
0272   Dire_fsr_qcd_G2GGG(string idIn, int softRS, Settings* settings,
0273     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0274     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0275     DireSplittingQCD(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0276       coupSM, info, direInfo), is_sai_endpoint_save(false) {}
0277 
0278   bool canRadiate ( const Event&, pair<int,int>,
0279     unordered_map<string,bool> = unordered_map<string,bool>(),
0280     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0281 
0282   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0283     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0284 
0285   vector <int> radAndEmt(int,int) { return createvector<int>(21)(21)(21);}
0286   int nEmissions()                { return 2; }
0287   int kinMap()                    { return 2;}
0288   bool canUseForBranching()       { return true; }
0289 
0290   vector<pair<int,int> > radAndEmtCols(int iRad, int colType, Event state);
0291 
0292   // Return colours of recombined radiator (before splitting!)
0293   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0294     int colEmtAfter, int acolEmtAfter);
0295 
0296   // Return id of recombined radiator (before splitting!)
0297   int radBefID(int idRadAfter, int idEmtAfter);
0298 
0299   double gaugeFactor ( int=0, int=0 );
0300   double symmetryFactor ( int=0, int=0 );
0301 
0302   // Pick z for new splitting.
0303   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0304 
0305   // New overestimates, z-integrated versions.
0306   double overestimateInt(double zMinAbs,double zMaxAbs,
0307     double pT2Old, double m2dip, int order = -1);
0308 
0309   // Return kernel for new splitting.
0310   double overestimateDiff(double z, double m2dip, int order = -1);
0311 
0312   // Functions to calculate the kernel from SplitInfo information.
0313   bool calc(const Event& state = Event(), int order = -1);
0314 
0315   double counterTerm(double si1, double si2, double sj1,
0316     double sj2, double sij, double s12);
0317 
0318   // Treatment of additional virtual corrections.
0319   bool allow_sai_endpoint_for_kinematics() { return true; }
0320   bool allow_xa_endpoint_for_kinematics()  { return false; }
0321   // Functions to set if kernel should contribute to a kinematical endpoint.
0322   void try_sai_endpoint() { is_sai_endpoint_save = (rndmPtr->flat() < 0.5); }
0323   void try_xa_endpoint()                   { return; }
0324   // Return endpoint information.
0325   bool is_sai_endpoint()                   { return is_sai_endpoint_save; }
0326   bool is_xa_endpoint()                    { return false; }
0327   bool is_sai_endpoint_save;
0328 
0329 };
0330 
0331 //==========================================================================
0332 
0333 class Dire_fsr_qcd_Q2Qqqbar : public DireSplittingQCD {
0334 
0335 public:
0336 
0337   Dire_fsr_qcd_Q2Qqqbar(int idEmtAfterIn, string idIn, int softRS,
0338     Settings* settings,
0339     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0340     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0341     DireSplittingQCD(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0342       coupSM, info, direInfo), idEmtAfterSave(idEmtAfterIn),
0343       is_sai_endpoint_save(false)
0344       { nGluonToQuark = settingsPtr->mode("TimeShower:nGluonToQuark"); }
0345 
0346   bool canRadiate ( const Event&, pair<int,int>,
0347     unordered_map<string,bool> = unordered_map<string,bool>(),
0348     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0349 
0350   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0351     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0352 
0353   virtual vector <int> radAndEmt(int idRadBef, int) {
0354     return createvector<int>(idRadBef)(idEmtAfterSave)(-idEmtAfterSave);
0355   }
0356 
0357   int nEmissions()            { return 2;}
0358   int kinMap()                { return 2;}
0359   bool canUseForBranching()   { return true; }
0360 
0361   vector<pair<int,int> > radAndEmtCols(int iRad, int colType, Event state);
0362 
0363   // Return colours of recombined radiator (before splitting!)
0364   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0365     int colEmtAfter, int acolEmtAfter);
0366 
0367   // Return id of recombined radiator (before splitting!)
0368   int radBefID(int idRadAfter, int idEmtAfter);
0369 
0370   double gaugeFactor ( int=0, int=0 );
0371   double symmetryFactor ( int=0, int=0 );
0372 
0373   // Pick z for new splitting.
0374   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0375 
0376   // New overestimates, z-integrated versions.
0377   double overestimateInt(double zMinAbs,double zMaxAbs,
0378     double pT2Old, double m2dip, int order = -1);
0379 
0380   // Return kernel for new splitting.
0381   double overestimateDiff(double z, double m2dip, int order = -1);
0382 
0383   // Functions to calculate the kernel from SplitInfo information.
0384   bool calc(const Event& state = Event(), int order = -1);
0385 
0386   int nGluonToQuark, idEmtAfterSave;
0387 
0388   double counterTerm(double si1, double si2, double sj1,
0389     double sj2, double sij, double s12);
0390 
0391   // Treatment of additional virtual corrections.
0392   bool allow_sai_endpoint_for_kinematics() { return true; }
0393   bool allow_xa_endpoint_for_kinematics()  { return false; }
0394   // Functions to set if kernel should contribute to a kinematical endpoint.
0395   void try_sai_endpoint() { is_sai_endpoint_save = (rndmPtr->flat() < 0.5); }
0396   void try_xa_endpoint()                   { return; }
0397   // Return endpoint information.
0398   bool is_sai_endpoint()                   { return is_sai_endpoint_save; }
0399   bool is_xa_endpoint()                    { return false; }
0400   bool is_sai_endpoint_save;
0401 
0402 };
0403 
0404 //==========================================================================
0405 
0406 class Dire_fsr_qcd_G2Gqqbar : public DireSplittingQCD {
0407 
0408 public:
0409 
0410   Dire_fsr_qcd_G2Gqqbar(int idEmtAfterIn, string idIn, int softRS,
0411     Settings* settings, ParticleData* particleData, Rndm* rndm,
0412     BeamParticle* beamA, BeamParticle* beamB, CoupSM* coupSM, Info* info,
0413     DireInfo* direInfo) :
0414     DireSplittingQCD(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0415       coupSM, info, direInfo),
0416     idEmtAfterSave(idEmtAfterIn), is_sai_endpoint_save(false)
0417       { nGluonToQuark = settingsPtr->mode("TimeShower:nGluonToQuark"); }
0418 
0419   bool canRadiate ( const Event&, pair<int,int>,
0420     unordered_map<string,bool> = unordered_map<string,bool>(),
0421     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0422 
0423   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0424     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0425 
0426   virtual vector <int> radAndEmt(int, int colType) {
0427     int sign = (colType > 0) ? 1 : -1;
0428     int idEmtAft = sign * idEmtAfterSave;
0429     return createvector<int>(21)(idEmtAft)(-idEmtAft);
0430   }
0431 
0432   int nEmissions()            { return 2; }
0433   int kinMap()                { return 2;}
0434   bool canUseForBranching()   { return true; }
0435 
0436   vector<pair<int,int> > radAndEmtCols(int iRad, int colType, Event state);
0437 
0438   // Return colours of recombined radiator (before splitting!)
0439   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0440     int colEmtAfter, int acolEmtAfter);
0441 
0442   // Return id of recombined radiator (before splitting!)
0443   int radBefID(int idRadAfter, int idEmtAfter);
0444 
0445   double gaugeFactor ( int=0, int=0 );
0446   double symmetryFactor ( int=0, int=0 );
0447 
0448   // Pick z for new splitting.
0449   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0450 
0451   // New overestimates, z-integrated versions.
0452   double overestimateInt(double zMinAbs,double zMaxAbs,
0453     double pT2Old, double m2dip, int order = -1);
0454 
0455   // Return kernel for new splitting.
0456   double overestimateDiff(double z, double m2dip, int order = -1);
0457 
0458   // Functions to calculate the kernel from SplitInfo information.
0459   bool calc(const Event& state = Event(), int order = -1);
0460 
0461   int nGluonToQuark, idEmtAfterSave;
0462 
0463   double counterTerm(double si1, double si2, double sj1,
0464     double sj2, double sij, double s12);
0465 
0466   // Treatment of additional virtual corrections.
0467   bool allow_sai_endpoint_for_kinematics() { return true; }
0468   bool allow_xa_endpoint_for_kinematics()  { return false; }
0469   // Functions to set if kernel should contribute to a kinematical endpoint.
0470   void try_sai_endpoint() { is_sai_endpoint_save = (rndmPtr->flat() < 0.5); }
0471   void try_xa_endpoint()                   { return; }
0472   // Return endpoint information.
0473   bool is_sai_endpoint()                   { return is_sai_endpoint_save; }
0474   bool is_xa_endpoint()                    { return false; }
0475   bool is_sai_endpoint_save;
0476 
0477 };
0478 
0479 //==========================================================================
0480 
0481 class Dire_fsr_qcd_Q2QG : public DireSplittingQCD {
0482 
0483 public:
0484 
0485   Dire_fsr_qcd_Q2QG(string idIn, int softRS, Settings* settings,
0486     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0487     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0488     DireSplittingQCD(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0489       coupSM, info, direInfo){}
0490 
0491   bool canRadiate ( const Event&, pair<int,int>,
0492     unordered_map<string,bool> = unordered_map<string,bool>(),
0493     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0494   int nEmissions() { return 1; }
0495 
0496   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0497     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0498 
0499   int kinMap ();
0500 
0501   // Return id of mother after splitting.
0502   int motherID(int idDaughter);
0503 
0504   // Return id of emission.
0505   int sisterID(int idDaughter);
0506 
0507   // Return id of recombined radiator (before splitting!)
0508   int radBefID(int idRadAfter, int idEmtAfter);
0509 
0510   vector <int> recPositions( const Event&, int, int);
0511 
0512   // Return colours of recombined radiator (before splitting!)
0513   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0514     int colEmtAfter, int acolEmtAfter);
0515 
0516   double gaugeFactor ( int=0, int=0 );
0517   double symmetryFactor ( int=0, int=0 );
0518 
0519   // Pick z for new splitting.
0520   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0521 
0522   // New overestimates, z-integrated versions.
0523   double overestimateInt(double zMinAbs,double zMaxAbs,
0524     double pT2Old, double m2dip, int order = -1);
0525 
0526   // Return kernel for new splitting.
0527   double overestimateDiff(double z, double m2dip, int order = -1);
0528 
0529   // Functions to calculate the kernel from SplitInfo information.
0530   bool calc(const Event& state = Event(), int order = -1);
0531 
0532 };
0533 
0534 //==========================================================================
0535 
0536 class Dire_fsr_qcd_Q2GQ : public DireSplittingQCD {
0537 
0538 public:
0539 
0540   Dire_fsr_qcd_Q2GQ(string idIn, int softRS, Settings* settings,
0541     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0542     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0543     DireSplittingQCD(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0544       coupSM, info, direInfo){}
0545 
0546   bool canRadiate ( const Event&, pair<int,int>,
0547     unordered_map<string,bool> = unordered_map<string,bool>(),
0548     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0549 
0550   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0551     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0552 
0553   int nEmissions() { return 1; }
0554 
0555   int kinMap ();
0556 
0557   // Return id of mother after splitting.
0558   int motherID(int idDaughter);
0559 
0560   // Return id of emission.
0561   int sisterID(int idDaughter);
0562 
0563   // Return id of recombined radiator (before splitting!)
0564   int radBefID(int idRadAfter, int idEmtAfter);
0565 
0566   vector <int> recPositions( const Event&, int, int);
0567 
0568   // Return colours of recombined radiator (before splitting!)
0569   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0570     int colEmtAfter, int acolEmtAfter);
0571 
0572   double gaugeFactor ( int=0, int=0 );
0573   double symmetryFactor ( int=0, int=0 );
0574 
0575   // Pick z for new splitting.
0576   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0577 
0578   // New overestimates, z-integrated versions.
0579   double overestimateInt(double zMinAbs,double zMaxAbs,
0580     double pT2Old, double m2dip, int order = -1);
0581 
0582   // Return kernel for new splitting.
0583   double overestimateDiff(double z, double m2dip, int order = -1);
0584 
0585   // Functions to calculate the kernel from SplitInfo information.
0586   bool calc(const Event& state = Event(), int order = -1);
0587 
0588 };
0589 
0590 //==========================================================================
0591 
0592 class Dire_fsr_qcd_G2GG1 : public DireSplittingQCD {
0593 
0594 public:
0595 
0596   Dire_fsr_qcd_G2GG1(string idIn, int softRS, Settings* settings,
0597     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0598     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0599     DireSplittingQCD(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0600       coupSM, info, direInfo){}
0601 
0602   bool canRadiate ( const Event&, pair<int,int>,
0603     unordered_map<string,bool> = unordered_map<string,bool>(),
0604     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0605 
0606   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0607     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0608 
0609   int nEmissions() { return 1; }
0610 
0611   int kinMap ();
0612 
0613   // Return id of mother after splitting.
0614   int motherID(int idDaughter);
0615 
0616   // Return id of emission.
0617   int sisterID(int idDaughter);
0618 
0619   // Return id of recombined radiator (before splitting!)
0620   int radBefID(int idRadAfter, int idEmtAfter);
0621 
0622   vector <int> recPositions( const Event&, int, int);
0623 
0624   // Return colours of recombined radiator (before splitting!)
0625   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0626     int colEmtAfter, int acolEmtAfter);
0627 
0628   double gaugeFactor ( int=0, int=0 );
0629   double symmetryFactor ( int=0, int=0 );
0630 
0631   // Pick z for new splitting.
0632   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0633 
0634   // New overestimates, z-integrated versions.
0635   double overestimateInt(double zMinAbs,double zMaxAbs,
0636     double pT2Old, double m2dip, int order = -1);
0637 
0638   // Return kernel for new splitting.
0639   double overestimateDiff(double z, double m2dip, int order = -1);
0640 
0641   // Functions to calculate the kernel from SplitInfo information.
0642   bool calc(const Event& state = Event(), int order = -1);
0643 
0644 };
0645 
0646 //==========================================================================
0647 
0648 class Dire_fsr_qcd_G2GG2 : public DireSplittingQCD {
0649 
0650 public:
0651 
0652   Dire_fsr_qcd_G2GG2(string idIn, int softRS, Settings* settings,
0653     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0654     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0655     DireSplittingQCD(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0656       coupSM, info, direInfo){}
0657 
0658   bool canRadiate ( const Event&, pair<int,int>,
0659     unordered_map<string,bool> = unordered_map<string,bool>(),
0660     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0661 
0662   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0663     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0664 
0665   int nEmissions() { return 1; }
0666 
0667   int kinMap ();
0668 
0669   // Return id of mother after splitting.
0670   int motherID(int idDaughter);
0671 
0672   // Return id of emission.
0673   int sisterID(int idDaughter);
0674 
0675   // Return id of recombined radiator (before splitting!)
0676   int radBefID(int idRadAfter, int idEmtAfter);
0677 
0678   vector <int> recPositions( const Event&, int, int);
0679 
0680   // Return colours of recombined radiator (before splitting!)
0681   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0682     int colEmtAfter, int acolEmtAfter);
0683 
0684   double gaugeFactor ( int=0, int=0 );
0685   double symmetryFactor ( int=0, int=0 );
0686 
0687   // Pick z for new splitting.
0688   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0689 
0690   // New overestimates, z-integrated versions.
0691   double overestimateInt(double zMinAbs,double zMaxAbs,
0692     double pT2Old, double m2dip, int order = -1);
0693 
0694   // Return kernel for new splitting.
0695   double overestimateDiff(double z, double m2dip, int order = -1);
0696 
0697   // Functions to calculate the kernel from SplitInfo information.
0698   bool calc(const Event& state = Event(), int order = -1);
0699 
0700 };
0701 
0702 //==========================================================================
0703 
0704 class Dire_fsr_qcd_G2QQ1 : public DireSplittingQCD {
0705 
0706 public:
0707 
0708   Dire_fsr_qcd_G2QQ1(string idIn, int softRS, Settings* settings,
0709     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0710     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0711     DireSplittingQCD(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0712       coupSM, info, direInfo){}
0713 
0714   bool canRadiate ( const Event&, pair<int,int>,
0715     unordered_map<string,bool> = unordered_map<string,bool>(),
0716     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0717 
0718   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0719     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0720 
0721   int nEmissions() { return 1; }
0722   bool isPartial() { return false; }
0723   int kinMap ();
0724 
0725   // Return id of mother after splitting.
0726   int motherID(int idDaughter);
0727 
0728   // Return id of emission.
0729   int sisterID(int idDaughter);
0730 
0731   // Return id of recombined radiator (before splitting!)
0732   int radBefID(int idRadAfter, int idEmtAfter);
0733 
0734   vector <int> recPositions( const Event&, int, int);
0735 
0736   // Return colours of recombined radiator (before splitting!)
0737   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0738     int colEmtAfter, int acolEmtAfter);
0739 
0740   double gaugeFactor ( int=0, int=0 );
0741   double symmetryFactor ( int=0, int=0 );
0742 
0743   // Pick z for new splitting.
0744   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0745 
0746   // New overestimates, z-integrated versions.
0747   double overestimateInt(double zMinAbs,double zMaxAbs,
0748     double pT2Old, double m2dip, int order = -1);
0749 
0750   // Return kernel for new splitting.
0751   double overestimateDiff(double z, double m2dip, int order = -1);
0752 
0753   // Functions to calculate the kernel from SplitInfo information.
0754   bool calc(const Event& state = Event(), int order = -1);
0755 
0756 };
0757 
0758 //==========================================================================
0759 
0760 class Dire_fsr_qcd_G2QQ2 : public DireSplittingQCD {
0761 
0762 public:
0763 
0764   Dire_fsr_qcd_G2QQ2(string idIn, int softRS, Settings* settings,
0765     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0766     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0767     DireSplittingQCD(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0768       coupSM, info, direInfo){}
0769 
0770   bool canRadiate ( const Event&, pair<int,int>,
0771     unordered_map<string,bool> = unordered_map<string,bool>(),
0772     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0773 
0774   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0775     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0776 
0777   int nEmissions() { return 1; }
0778   bool isPartial() { return false; }
0779 
0780   int kinMap ();
0781 
0782   // Return id of mother after splitting.
0783   int motherID(int idDaughter);
0784 
0785   // Return id of emission.
0786   int sisterID(int idDaughter);
0787 
0788   // Return id of recombined radiator (before splitting!)
0789   int radBefID(int idRadAfter, int idEmtAfter);
0790 
0791   vector <int> recPositions( const Event&, int, int);
0792 
0793   // Return colours of recombined radiator (before splitting!)
0794   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0795     int colEmtAfter, int acolEmtAfter);
0796 
0797   double gaugeFactor ( int=0, int=0 );
0798   double symmetryFactor ( int=0, int=0 );
0799 
0800   // Pick z for new splitting.
0801   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0802 
0803   // New overestimates, z-integrated versions.
0804   double overestimateInt(double zMinAbs,double zMaxAbs,
0805     double pT2Old, double m2dip, int order = -1);
0806 
0807   // Return kernel for new splitting.
0808   double overestimateDiff(double z, double m2dip, int order = -1);
0809 
0810   // Functions to calculate the kernel from SplitInfo information.
0811   bool calc(const Event& state = Event(), int order = -1);
0812 
0813 };
0814 
0815 //==========================================================================
0816 
0817 class Dire_fsr_qcd_Q2qQqbarDist : public DireSplittingQCD {
0818 
0819 public:
0820 
0821   Dire_fsr_qcd_Q2qQqbarDist(string idIn, int softRS, Settings* settings,
0822     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0823     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0824     DireSplittingQCD(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0825       coupSM, info, direInfo){}
0826 
0827   bool canRadiate ( const Event&, pair<int,int>,
0828     unordered_map<string,bool> = unordered_map<string,bool>(),
0829     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0830 
0831   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0832     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0833 
0834   int nEmissions() { return 2; }
0835   bool isPartial() { return false; }
0836 
0837   int kinMap ();
0838 
0839   // Return id of mother after splitting.
0840   int motherID(int idDaughter);
0841 
0842   // Return id of emission.
0843   int sisterID(int idDaughter);
0844 
0845   // Return id of recombined radiator (before splitting!)
0846   int radBefID(int idRadAfter, int idEmtAfter);
0847 
0848   // Return colours of recombined radiator (before splitting!)
0849   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0850     int colEmtAfter, int acolEmtAfter);
0851 
0852   double gaugeFactor ( int=0, int=0 );
0853   double symmetryFactor ( int=0, int=0 );
0854 
0855   // Pick z for new splitting.
0856   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0857 
0858   // New overestimates, z-integrated versions.
0859   double overestimateInt(double zMinAbs,double zMaxAbs,
0860     double pT2Old, double m2dip, int order = -1);
0861 
0862   // Return kernel for new splitting.
0863   double overestimateDiff(double z, double m2dip, int order = -1);
0864 
0865   // Functions to calculate the kernel from SplitInfo information.
0866   bool calc(const Event& state = Event(), int order = -1);
0867 
0868 };
0869 
0870 //==========================================================================
0871 
0872 class Dire_fsr_qcd_Q2QbarQQId : public DireSplittingQCD {
0873 
0874 public:
0875 
0876   Dire_fsr_qcd_Q2QbarQQId(string idIn, int softRS, Settings* settings,
0877     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0878     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0879     DireSplittingQCD(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0880       coupSM, info, direInfo){}
0881 
0882   bool canRadiate ( const Event&, pair<int,int>,
0883     unordered_map<string,bool> = unordered_map<string,bool>(),
0884     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0885 
0886   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0887     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0888 
0889   int nEmissions() { return 2; }
0890   bool isPartial() { return false; }
0891 
0892   int kinMap ();
0893 
0894   // Return id of mother after splitting.
0895   int motherID(int idDaughter);
0896 
0897   // Return id of emission.
0898   int sisterID(int idDaughter);
0899 
0900   // Return id of recombined radiator (before splitting!)
0901   int radBefID(int idRadAfter, int idEmtAfter);
0902 
0903   // Return colours of recombined radiator (before splitting!)
0904   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0905     int colEmtAfter, int acolEmtAfter);
0906 
0907   double gaugeFactor ( int=0, int=0 );
0908   double symmetryFactor ( int=0, int=0 );
0909 
0910   // Pick z for new splitting.
0911   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0912 
0913   // New overestimates, z-integrated versions.
0914   double overestimateInt(double zMinAbs,double zMaxAbs,
0915     double pT2Old, double m2dip, int order = -1);
0916 
0917   // Return kernel for new splitting.
0918   double overestimateDiff(double z, double m2dip, int order = -1);
0919 
0920   // Functions to calculate the kernel from SplitInfo information.
0921   bool calc(const Event& state = Event(), int order = -1);
0922 
0923 };
0924 
0925 //==========================================================================
0926 
0927 class Dire_isr_qcd_Q2QG : public DireSplittingQCD {
0928 
0929 public:
0930 
0931   Dire_isr_qcd_Q2QG(string idIn, int softRS, Settings* settings,
0932     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0933     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0934     DireSplittingQCD(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0935       coupSM, info, direInfo){}
0936 
0937   bool canRadiate ( const Event&, pair<int,int>,
0938     unordered_map<string,bool> = unordered_map<string,bool>(),
0939     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0940 
0941   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0942     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0943 
0944   int nEmissions() { return 1; }
0945 
0946   int kinMap ();
0947 
0948   // Return id of mother after splitting.
0949   int motherID(int idDaughter);
0950 
0951   // Return id of emission.
0952   int sisterID(int idDaughter);
0953 
0954   // Return id of recombined radiator (before splitting!)
0955   int radBefID(int idRadAfter, int idEmtAfter);
0956 
0957   vector <int> recPositions( const Event&, int, int);
0958 
0959   // Return colours of recombined radiator (before splitting!)
0960   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
0961     int colEmtAfter, int acolEmtAfter);
0962 
0963   double gaugeFactor ( int=0, int=0 );
0964   double symmetryFactor ( int=0, int=0 );
0965 
0966   // Pick z for new splitting.
0967   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
0968 
0969   // New overestimates, z-integrated versions.
0970   double overestimateInt(double zMinAbs,double zMaxAbs,
0971     double pT2Old, double m2dip, int order = -1);
0972 
0973   // Return kernel for new splitting.
0974   double overestimateDiff(double z, double m2dip, int order = -1);
0975 
0976   // Functions to calculate the kernel from SplitInfo information.
0977   bool calc(const Event& state = Event(), int order = -1);
0978 
0979 };
0980 
0981 //==========================================================================
0982 
0983 class Dire_isr_qcd_G2GG1 : public DireSplittingQCD {
0984 
0985 public:
0986 
0987   Dire_isr_qcd_G2GG1(string idIn, int softRS, Settings* settings,
0988     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
0989     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
0990     DireSplittingQCD(idIn, softRS, settings, particleData, rndm, beamA, beamB,
0991       coupSM, info, direInfo){}
0992 
0993   bool canRadiate ( const Event&, pair<int,int>,
0994     unordered_map<string,bool> = unordered_map<string,bool>(),
0995     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0996 
0997   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
0998     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
0999 
1000   int nEmissions() { return 1; }
1001 
1002   int kinMap ();
1003 
1004   // Return id of mother after splitting.
1005   int motherID(int idDaughter);
1006 
1007   // Return id of emission.
1008   int sisterID(int idDaughter);
1009 
1010   // Return id of recombined radiator (before splitting!)
1011   int radBefID(int idRadAfter, int idEmtAfter);
1012 
1013   vector <int> recPositions( const Event&, int, int);
1014 
1015   // Return colours of recombined radiator (before splitting!)
1016   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
1017     int colEmtAfter, int acolEmtAfter);
1018 
1019   double gaugeFactor ( int=0, int=0 );
1020   double symmetryFactor ( int=0, int=0 );
1021 
1022   // Pick z for new splitting.
1023   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
1024 
1025   // New overestimates, z-integrated versions.
1026   double overestimateInt(double zMinAbs,double zMaxAbs,
1027     double pT2Old, double m2dip, int order = -1);
1028 
1029   // Return kernel for new splitting.
1030   double overestimateDiff(double z, double m2dip, int order = -1);
1031 
1032   // Functions to calculate the kernel from SplitInfo information.
1033   bool calc(const Event& state = Event(), int order = -1);
1034 
1035 };
1036 
1037 //==========================================================================
1038 
1039 class Dire_isr_qcd_G2GG2 : public DireSplittingQCD {
1040 
1041 public:
1042 
1043   Dire_isr_qcd_G2GG2(string idIn, int softRS, Settings* settings,
1044     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
1045     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
1046     DireSplittingQCD(idIn, softRS, settings, particleData, rndm, beamA, beamB,
1047       coupSM, info, direInfo){}
1048 
1049   bool canRadiate ( const Event&, pair<int,int>,
1050     unordered_map<string,bool> = unordered_map<string,bool>(),
1051     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
1052 
1053   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
1054     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
1055 
1056   int nEmissions() { return 1; }
1057 
1058   int kinMap ();
1059 
1060   // Return id of mother after splitting.
1061   int motherID(int idDaughter);
1062 
1063   // Return id of emission.
1064   int sisterID(int idDaughter);
1065 
1066   // Return id of recombined radiator (before splitting!)
1067   int radBefID(int idRadAfter, int idEmtAfter);
1068 
1069   vector <int> recPositions( const Event&, int, int);
1070 
1071   // Return colours of recombined radiator (before splitting!)
1072   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
1073     int colEmtAfter, int acolEmtAfter);
1074 
1075   double gaugeFactor ( int=0, int=0 );
1076   double symmetryFactor ( int=0, int=0 );
1077 
1078   // Pick z for new splitting.
1079   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
1080 
1081   // New overestimates, z-integrated versions.
1082   double overestimateInt(double zMinAbs,double zMaxAbs,
1083     double pT2Old, double m2dip, int order = -1);
1084 
1085   // Return kernel for new splitting.
1086   double overestimateDiff(double z, double m2dip, int order = -1);
1087 
1088   // Functions to calculate the kernel from SplitInfo information.
1089   bool calc(const Event& state = Event(), int order = -1);
1090 
1091 };
1092 
1093 //==========================================================================
1094 
1095 class Dire_isr_qcd_G2QQ : public DireSplittingQCD {
1096 
1097 public:
1098 
1099   Dire_isr_qcd_G2QQ(string idIn, int softRS, Settings* settings,
1100     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
1101     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
1102     DireSplittingQCD(idIn, softRS, settings, particleData, rndm, beamA, beamB,
1103       coupSM, info, direInfo){}
1104 
1105   bool canRadiate ( const Event&, pair<int,int>,
1106     unordered_map<string,bool> = unordered_map<string,bool>(),
1107     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
1108 
1109   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
1110     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
1111 
1112   int nEmissions() { return 1; }
1113   bool isPartial() { return false; }
1114 
1115   int kinMap ();
1116 
1117   // Return id of mother after splitting.
1118   int motherID(int idDaughter);
1119 
1120   // Return id of emission.
1121   int sisterID(int idDaughter);
1122 
1123   // Return id of recombined radiator (before splitting!)
1124   int radBefID(int idRadAfter, int idEmtAfter);
1125 
1126   vector <int> recPositions( const Event&, int, int);
1127 
1128   // Return colours of recombined radiator (before splitting!)
1129   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
1130     int colEmtAfter, int acolEmtAfter);
1131 
1132   double gaugeFactor ( int=0, int=0 );
1133   double symmetryFactor ( int=0, int=0 );
1134 
1135   // Pick z for new splitting.
1136   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
1137 
1138   // New overestimates, z-integrated versions.
1139   double overestimateInt(double zMinAbs,double zMaxAbs,
1140     double pT2Old, double m2dip, int order = -1);
1141 
1142   // Return kernel for new splitting.
1143   double overestimateDiff(double z, double m2dip, int order = -1);
1144 
1145   // Functions to calculate the kernel from SplitInfo information.
1146   bool calc(const Event& state = Event(), int order = -1);
1147 
1148 };
1149 
1150 //==========================================================================
1151 
1152 class Dire_isr_qcd_Q2GQ : public DireSplittingQCD {
1153 
1154 public:
1155 
1156   Dire_isr_qcd_Q2GQ(string idIn, int softRS, Settings* settings,
1157     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
1158     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
1159     DireSplittingQCD(idIn, softRS, settings, particleData, rndm, beamA, beamB,
1160       coupSM, info, direInfo){}
1161 
1162   bool canRadiate ( const Event&, pair<int,int>,
1163     unordered_map<string,bool> = unordered_map<string,bool>(),
1164     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
1165 
1166   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
1167     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
1168 
1169   int nEmissions() { return 1; }
1170   bool isPartial() { return false; }
1171 
1172   int kinMap ();
1173 
1174   // Return id of mother after splitting.
1175   int motherID(int idDaughter);
1176 
1177   // Return id of emission.
1178   int sisterID(int idDaughter);
1179 
1180   // Return id of recombined radiator (before splitting!)
1181   int radBefID(int idRadAfter, int idEmtAfter);
1182 
1183   vector <int> recPositions( const Event&, int, int);
1184 
1185   // Return colours of recombined radiator (before splitting!)
1186   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
1187     int colEmtAfter, int acolEmtAfter);
1188 
1189   double gaugeFactor ( int=0, int=0 );
1190   double symmetryFactor ( int=0, int=0 );
1191 
1192   // Pick z for new splitting.
1193   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
1194 
1195   // New overestimates, z-integrated versions.
1196   double overestimateInt(double zMinAbs,double zMaxAbs,
1197     double pT2Old, double m2dip, int order = -1);
1198 
1199   // Return kernel for new splitting.
1200   double overestimateDiff(double z, double m2dip, int order = -1);
1201 
1202   // Functions to calculate the kernel from SplitInfo information.
1203   bool calc(const Event& state = Event(), int order = -1);
1204 
1205 };
1206 
1207 //==========================================================================
1208 
1209 // Class inheriting from SplittingQCD class.
1210 class Dire_isr_qcd_Q2qQqbarDist : public DireSplittingQCD {
1211 
1212 public:
1213 
1214   Dire_isr_qcd_Q2qQqbarDist(string idIn, int softRS, Settings* settings,
1215     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
1216     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
1217     DireSplittingQCD(idIn, softRS, settings, particleData, rndm, beamA, beamB,
1218       coupSM, info, direInfo){}
1219 
1220   bool canRadiate ( const Event&, pair<int,int>,
1221     unordered_map<string,bool> = unordered_map<string,bool>(),
1222     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
1223 
1224   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
1225     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
1226 
1227   int nEmissions() { return 2; }
1228   bool isPartial() { return false; }
1229 
1230   int kinMap ();
1231 
1232   // Return id of mother after splitting.
1233   int motherID(int idDaughter);
1234 
1235   // Return id of emission.
1236   int sisterID(int idDaughter);
1237 
1238   // Return id of recombined radiator (before splitting!)
1239   int radBefID(int idRadAfter, int idEmtAfter);
1240 
1241   // Return colours of recombined radiator (before splitting!)
1242   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
1243     int colEmtAfter, int acolEmtAfter);
1244 
1245   double gaugeFactor ( int=0, int=0 );
1246   double symmetryFactor ( int=0, int=0 );
1247 
1248   // Pick z for new splitting.
1249   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
1250 
1251   // New overestimates, z-integrated versions.
1252   double overestimateInt(double zMinAbs,double zMaxAbs,
1253     double pT2Old, double m2dip, int order = -1);
1254 
1255   // Return kernel for new splitting.
1256   double overestimateDiff(double z, double m2dip, int order = -1);
1257 
1258   // Functions to calculate the kernel from SplitInfo information.
1259   bool calc(const Event& state = Event(), int order = -1);
1260 
1261 };
1262 
1263 //==========================================================================
1264 
1265 class Dire_isr_qcd_Q2QbarQQId : public DireSplittingQCD {
1266 
1267 public:
1268 
1269   Dire_isr_qcd_Q2QbarQQId(string idIn, int softRS, Settings* settings,
1270     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
1271     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
1272     DireSplittingQCD(idIn, softRS, settings, particleData, rndm, beamA, beamB,
1273       coupSM, info, direInfo){}
1274 
1275   bool canRadiate ( const Event&, pair<int,int>,
1276     unordered_map<string,bool> = unordered_map<string,bool>(),
1277     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
1278 
1279   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
1280     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
1281 
1282   int nEmissions() { return 2; }
1283   bool isPartial() { return false; }
1284 
1285   int kinMap ();
1286 
1287   // Return id of mother after splitting.
1288   int motherID(int idDaughter);
1289 
1290   // Return id of emission.
1291   int sisterID(int idDaughter);
1292 
1293   // Return id of recombined radiator (before splitting!)
1294   int radBefID(int idRadAfter, int idEmtAfter);
1295 
1296   // Return colours of recombined radiator (before splitting!)
1297   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
1298     int colEmtAfter, int acolEmtAfter);
1299 
1300   double gaugeFactor ( int=0, int=0 );
1301   double symmetryFactor ( int=0, int=0 );
1302 
1303   // Pick z for new splitting.
1304   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
1305 
1306   // New overestimates, z-integrated versions.
1307   double overestimateInt(double zMinAbs,double zMaxAbs,
1308     double pT2Old, double m2dip, int order = -1);
1309 
1310   // Return kernel for new splitting.
1311   double overestimateDiff(double z, double m2dip, int order = -1);
1312 
1313   // Functions to calculate the kernel from SplitInfo information.
1314   bool calc(const Event& state = Event(), int order = -1);
1315 
1316 };
1317 
1318 //==========================================================================
1319 
1320 class Dire_fsr_qcd_Q2QG_notPartial : public DireSplittingQCD {
1321 
1322 public:
1323 
1324   Dire_fsr_qcd_Q2QG_notPartial(string idIn, int softRS, Settings* settings,
1325     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
1326     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
1327     DireSplittingQCD(idIn, softRS, settings, particleData, rndm, beamA, beamB,
1328       coupSM, info, direInfo){}
1329 
1330   bool canRadiate ( const Event&, pair<int,int>,
1331     unordered_map<string,bool> = unordered_map<string,bool>(),
1332     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
1333 
1334   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
1335     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
1336 
1337   int nEmissions() { return 1; }
1338 
1339   int kinMap ();
1340   bool canUseForBranching() { return true; }
1341   bool isPartial()  { return false; }
1342   vector<pair<int,int> > radAndEmtCols(int iRad, int, Event state);
1343 
1344   // Return id of mother after splitting.
1345   int motherID(int idDaughter);
1346 
1347   // Return id of emission.
1348   int sisterID(int idDaughter);
1349 
1350   // Return id of recombined radiator (before splitting!)
1351   int radBefID(int idRadAfter, int idEmtAfter);
1352 
1353   vector <int> recPositions( const Event&, int, int);
1354 
1355   // Return colours of recombined radiator (before splitting!)
1356   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
1357     int colEmtAfter, int acolEmtAfter);
1358 
1359   double gaugeFactor ( int=0, int=0 );
1360   double symmetryFactor ( int=0, int=0 );
1361 
1362   // Pick z for new splitting.
1363   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
1364 
1365   // New overestimates, z-integrated versions.
1366   double overestimateInt(double zMinAbs,double zMaxAbs,
1367     double pT2Old, double m2dip, int order = -1);
1368 
1369   // Return kernel for new splitting.
1370   double overestimateDiff(double z, double m2dip, int order = -1);
1371 
1372   // Functions to calculate the kernel from SplitInfo information.
1373   bool calc(const Event& state = Event(), int order = -1);
1374 
1375 };
1376 
1377 
1378 //==========================================================================
1379 
1380 class Dire_fsr_qcd_G2GG_notPartial : public DireSplittingQCD {
1381 
1382 public:
1383 
1384   Dire_fsr_qcd_G2GG_notPartial(string idIn, int softRS, Settings* settings,
1385     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
1386     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
1387     DireSplittingQCD(idIn, softRS, settings, particleData, rndm, beamA, beamB,
1388       coupSM, info, direInfo){}
1389 
1390   bool canRadiate ( const Event&, pair<int,int>,
1391     unordered_map<string,bool> = unordered_map<string,bool>(),
1392     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
1393 
1394   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
1395     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
1396 
1397   int nEmissions() { return 1; }
1398 
1399   int kinMap ();
1400   bool canUseForBranching() { return true; }
1401   bool isPartial()  { return false; }
1402   vector<pair<int,int> > radAndEmtCols(int iRad, int, Event state);
1403 
1404   // Return id of mother after splitting.
1405   int motherID(int idDaughter);
1406 
1407   // Return id of emission.
1408   int sisterID(int idDaughter);
1409 
1410   // Return id of recombined radiator (before splitting!)
1411   int radBefID(int idRadAfter, int idEmtAfter);
1412 
1413   vector <int> recPositions( const Event&, int, int);
1414 
1415   // Return colours of recombined radiator (before splitting!)
1416   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
1417     int colEmtAfter, int acolEmtAfter);
1418 
1419   double gaugeFactor ( int=0, int=0 );
1420   double symmetryFactor ( int=0, int=0 );
1421 
1422   // Pick z for new splitting.
1423   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
1424 
1425   // New overestimates, z-integrated versions.
1426   double overestimateInt(double zMinAbs,double zMaxAbs,
1427     double pT2Old, double m2dip, int order = -1);
1428 
1429   // Return kernel for new splitting.
1430   double overestimateDiff(double z, double m2dip, int order = -1);
1431 
1432   // Functions to calculate the kernel from SplitInfo information.
1433   bool calc(const Event& state = Event(), int order = -1);
1434 
1435 };
1436 
1437 //==========================================================================
1438 
1439 class Dire_fsr_qcd_G2QQ_notPartial : public DireSplittingQCD {
1440 
1441 public:
1442 
1443   Dire_fsr_qcd_G2QQ_notPartial(string idIn, int softRS, Settings* settings,
1444     ParticleData* particleData, Rndm* rndm, BeamParticle* beamA,
1445     BeamParticle* beamB, CoupSM* coupSM, Info* info, DireInfo* direInfo) :
1446     DireSplittingQCD(idIn, softRS, settings, particleData, rndm, beamA, beamB,
1447       coupSM, info, direInfo){}
1448 
1449   bool canRadiate ( const Event&, pair<int,int>,
1450     unordered_map<string,bool> = unordered_map<string,bool>(),
1451     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
1452 
1453   bool canRadiate ( const Event&, int iRadBef, int iRecBef,
1454     Settings* = nullptr, PartonSystems* = nullptr, BeamParticle* = nullptr);
1455 
1456   int nEmissions() { return 1; }
1457 
1458   int kinMap ();
1459   bool canUseForBranching() { return true; }
1460   bool isPartial()  { return false; }
1461   vector<pair<int,int> > radAndEmtCols(int iRad, int, Event state);
1462 
1463   // Return id of mother after splitting.
1464   int motherID(int idDaughter);
1465 
1466   // Return id of emission.
1467   int sisterID(int idDaughter);
1468 
1469   // Return id of recombined radiator (before splitting!)
1470   int radBefID(int idRadAfter, int idEmtAfter);
1471 
1472   vector <int> recPositions( const Event&, int, int);
1473 
1474   // Return colours of recombined radiator (before splitting!)
1475   pair<int,int> radBefCols(int colRadAfter, int acolRadAfter,
1476     int colEmtAfter, int acolEmtAfter);
1477 
1478   double gaugeFactor ( int=0, int=0 );
1479   double symmetryFactor ( int=0, int=0 );
1480 
1481   // Pick z for new splitting.
1482   double zSplit(double zMinAbs, double zMaxAbs, double m2dip);
1483 
1484   // New overestimates, z-integrated versions.
1485   double overestimateInt(double zMinAbs,double zMaxAbs,
1486     double pT2Old, double m2dip, int order = -1);
1487 
1488   // Return kernel for new splitting.
1489   double overestimateDiff(double z, double m2dip, int order = -1);
1490 
1491   // Functions to calculate the kernel from SplitInfo information.
1492   bool calc(const Event& state = Event(), int order = -1);
1493 
1494 };
1495 
1496 //==========================================================================
1497 
1498 } // end namespace Pythia8
1499 
1500 #endif // Pythia8_DireSplittingsQCD_H