Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:06:31

0001 // SigmaQCD.h is a part of the PYTHIA event generator.
0002 // Copyright (C) 2024 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 QCD process differential cross sections.
0007 // Contains classes derived from SigmaProcess via Sigma(0/2)Process.
0008 
0009 #ifndef Pythia8_SigmaQCD_H
0010 #define Pythia8_SigmaQCD_H
0011 
0012 #include "Pythia8/SigmaProcess.h"
0013 
0014 namespace Pythia8 {
0015 
0016 //==========================================================================
0017 
0018 // A derived class for minimum-bias (inelastic, nondiffractive) events.
0019 
0020 class Sigma0nonDiffractive : public Sigma0Process {
0021 
0022 public:
0023 
0024   // Constructor.
0025   Sigma0nonDiffractive() {}
0026 
0027   // Evaluate sigma.
0028   virtual double sigmaHat() {if (!doVarE) return sigmaTotPtr->sigmaND();
0029     return sigmaCmbPtr->sigmaPartial(idA, idB, infoPtr->eCM(), mA, mB, 1);}
0030 
0031   // Select flavour, colour and anticolour.
0032   virtual void setIdColAcol() {}
0033 
0034   // Info on the subprocess.
0035   virtual string name()      const {return "non-diffractive";}
0036   virtual int    code()      const {return 101;}
0037   virtual bool   isNonDiff() const {return true;}
0038 
0039 private:
0040 
0041 };
0042 
0043 //==========================================================================
0044 
0045 // A derived class for elastic scattering A B -> A B.
0046 
0047 class Sigma0AB2AB : public Sigma0Process {
0048 
0049 public:
0050 
0051   // Constructor.
0052   Sigma0AB2AB() {}
0053 
0054   // Evaluate sigma.
0055   virtual double sigmaHat() {if (!doVarE) return sigmaTotPtr->sigmaEl();
0056     return sigmaCmbPtr->sigmaPartial(idA, idB, infoPtr->eCM(), mA, mB, 2);}
0057 
0058   // Select flavour, colour and anticolour.
0059   virtual void setIdColAcol();
0060 
0061   // Info on the subprocess.
0062   virtual string name()       const {return "A B -> A B elastic";}
0063   virtual int    code()       const {return 102;}
0064   virtual bool   isResolved() const {return false;}
0065 
0066 private:
0067 
0068 };
0069 
0070 //==========================================================================
0071 
0072 // A derived class for single diffractive scattering A B -> X B.
0073 
0074 class Sigma0AB2XB : public Sigma0Process {
0075 
0076 public:
0077 
0078   // Constructor.
0079   Sigma0AB2XB() {}
0080 
0081   // Evaluate sigma.
0082   virtual double sigmaHat() {if (!doVarE) return sigmaTotPtr->sigmaXB();
0083     return sigmaCmbPtr->sigmaPartial(idA, idB, infoPtr->eCM(), mA, mB, 3);}
0084 
0085   // Select flavour, colour and anticolour.
0086   virtual void setIdColAcol();
0087 
0088   // Info on the subprocess.
0089   virtual string name()       const {return "A B -> X B single diffractive";}
0090   virtual int    code()       const {return 103;}
0091   virtual bool   isResolved() const {return false;}
0092   virtual bool   isDiffA()    const {return true;};
0093 
0094 private:
0095 
0096 };
0097 
0098 //==========================================================================
0099 
0100 // A derived class for single diffractive scattering A B -> A X.
0101 
0102 class Sigma0AB2AX : public Sigma0Process {
0103 
0104 public:
0105 
0106   // Constructor.
0107   Sigma0AB2AX() {}
0108 
0109   // Evaluate sigma.
0110   virtual double sigmaHat() {if (!doVarE) return sigmaTotPtr->sigmaAX();
0111     return sigmaCmbPtr->sigmaPartial(idA, idB, infoPtr->eCM(), mA, mB, 4);}
0112 
0113   // Select flavour, colour and anticolour.
0114   virtual void setIdColAcol();
0115 
0116   // Info on the subprocess.
0117   virtual string name()       const {return "A B -> A X single diffractive";}
0118   virtual int    code()       const {return 104;}
0119   virtual bool   isResolved() const {return false;}
0120   virtual bool   isDiffB()    const {return true;};
0121 
0122 private:
0123 
0124 };
0125 
0126 //==========================================================================
0127 
0128 // A derived class for double diffractive scattering A B -> X X.
0129 
0130 class Sigma0AB2XX : public Sigma0Process {
0131 
0132 public:
0133 
0134   // Constructor.
0135   Sigma0AB2XX() {}
0136 
0137   // Evaluate sigma.
0138   virtual double sigmaHat() {if (!doVarE) return sigmaTotPtr->sigmaXX();
0139     return sigmaCmbPtr->sigmaPartial(idA, idB, infoPtr->eCM(), mA, mB, 5);}
0140 
0141   // Select flavour, colour and anticolour.
0142   virtual void setIdColAcol();
0143 
0144   // Info on the subprocess.
0145   virtual string name()       const {return "A B -> X X double diffractive";}
0146   virtual int    code()       const {return 105;}
0147   virtual bool   isResolved() const {return false;}
0148   virtual bool   isDiffA()    const {return true;};
0149   virtual bool   isDiffB()    const {return true;};
0150 
0151 private:
0152 
0153 };
0154 
0155 //==========================================================================
0156 
0157 // A derived class for central diffractive scattering A B -> A X B.
0158 
0159 class Sigma0AB2AXB : public Sigma0Process {
0160 
0161 public:
0162 
0163   // Constructor.
0164   Sigma0AB2AXB() {}
0165 
0166   // Evaluate sigma.
0167   virtual double sigmaHat() {if (!doVarE) return sigmaTotPtr->sigmaAXB();
0168     return sigmaCmbPtr->sigmaPartial(idA, idB, infoPtr->eCM(), mA, mB, 6);}
0169 
0170   // Select flavour, colour and anticolour.
0171   virtual void setIdColAcol();
0172 
0173   // Info on the subprocess.
0174   virtual string name()      const {return "A B -> A X B central diffractive";}
0175   virtual int    code()       const {return 106;}
0176   virtual int    nFinal()     const {return 3;}
0177   virtual bool   isResolved() const {return false;}
0178   virtual bool   isDiffC()    const {return true;};
0179 
0180 private:
0181 
0182 };
0183 
0184 //==========================================================================
0185 
0186 // A derived class for g g -> g g.
0187 
0188 class Sigma2gg2gg : public Sigma2Process {
0189 
0190 public:
0191 
0192   // Constructor.
0193   Sigma2gg2gg() : sigTS(), sigUS(), sigTU(), sigSum(), sigma() {}
0194 
0195   // Calculate flavour-independent parts of cross section.
0196   virtual void sigmaKin();
0197 
0198   // Evaluate d(sigmaHat)/d(tHat).
0199   virtual double sigmaHat() {return sigma;}
0200 
0201   // Select flavour, colour and anticolour.
0202   virtual void setIdColAcol();
0203 
0204   // Info on the subprocess.
0205   virtual string name()   const {return "g g -> g g";}
0206   virtual int    code()   const {return 111;}
0207   virtual string inFlux() const {return "gg";}
0208 
0209 private:
0210 
0211   // Values stored for colour flow selection.
0212   double sigTS, sigUS, sigTU, sigSum, sigma;
0213 
0214 };
0215 
0216 //==========================================================================
0217 
0218 // A derived class for g g -> q qbar (q = u, d, s, i.e. almost massless).
0219 
0220 class Sigma2gg2qqbar : public Sigma2Process {
0221 
0222 public:
0223 
0224   // Constructor.
0225   Sigma2gg2qqbar() : nQuarkNew(), idNew(), mNew(), m2New(), sigTS(), sigUS(),
0226     sigSum(), sigma() {}
0227 
0228   // Initialize process.
0229   virtual void initProc();
0230 
0231   // Calculate flavour-independent parts of cross section.
0232   virtual void sigmaKin();
0233 
0234   // Evaluate d(sigmaHat)/d(tHat).
0235   virtual double sigmaHat() {return sigma;}
0236 
0237   // Select flavour, colour and anticolour.
0238   virtual void setIdColAcol();
0239 
0240   // Info on the subprocess.
0241   virtual string name()   const {return "g g -> q qbar (uds)";}
0242   virtual int    code()   const {return 112;}
0243   virtual string inFlux() const {return "gg";}
0244 
0245 private:
0246 
0247   // Number of quarks to be considered in massless approximation.
0248   int    nQuarkNew;
0249 
0250   // Values stored for colour flow selection.
0251   int    idNew;
0252   double mNew, m2New, sigTS, sigUS, sigSum, sigma;
0253 
0254 };
0255 
0256 //==========================================================================
0257 
0258 // A derived class for q g -> q g (q = u, d, s, c, b).
0259 // Use massless approximation also for Q since no alternative.
0260 
0261 class Sigma2qg2qg : public Sigma2Process {
0262 
0263 public:
0264 
0265   // Constructor.
0266   Sigma2qg2qg() : sigTS(), sigTU(), sigSum(), sigma() {}
0267 
0268   // Calculate flavour-independent parts of cross section.
0269   virtual void sigmaKin();
0270 
0271   // Evaluate d(sigmaHat)/d(tHat).
0272   virtual double sigmaHat() {return sigma;}
0273 
0274   // Select flavour, colour and anticolour.
0275   virtual void setIdColAcol();
0276 
0277   // Info on the subprocess.
0278   virtual string name()   const {return "q g -> q g";}
0279   virtual int    code()   const {return 113;}
0280   virtual string inFlux() const {return "qg";}
0281 
0282 private:
0283 
0284   // Values stored for colour flow selection.
0285   double sigTS, sigTU, sigSum, sigma;
0286 
0287 };
0288 
0289 //==========================================================================
0290 
0291 // A derived class for q qbar' -> q qbar' or q q' -> q q'
0292 // (qbar qbar' -> qbar qbar'), q' may be same as q.
0293 
0294 class Sigma2qq2qq : public Sigma2Process {
0295 
0296 public:
0297 
0298   // Constructor.
0299   Sigma2qq2qq() : sigT(), sigU(), sigTU(), sigST(), sigSum() {}
0300 
0301   // Calculate flavour-independent parts of cross section.
0302   virtual void sigmaKin();
0303 
0304   // Evaluate d(sigmaHat)/d(tHat).
0305   virtual double sigmaHat();
0306 
0307   // Select flavour, colour and anticolour.
0308   virtual void setIdColAcol();
0309 
0310   // Info on the subprocess.
0311   virtual string name()   const {return "q q(bar)' -> q q(bar)'";}
0312   virtual int    code()   const {return 114;}
0313   virtual string inFlux() const {return "qq";}
0314 
0315  private:
0316 
0317   // Values stored for colour flow selection.
0318   double sigT, sigU, sigTU, sigST, sigSum;
0319 
0320 };
0321 
0322 //==========================================================================
0323 
0324 // A derived class for q qbar -> g g.
0325 
0326 class Sigma2qqbar2gg : public Sigma2Process {
0327 
0328 public:
0329 
0330   // Constructor.
0331   Sigma2qqbar2gg() : sigTS(), sigUS(), sigSum(), sigma() {}
0332 
0333   // Calculate flavour-independent parts of cross section.
0334   virtual void sigmaKin();
0335 
0336   // Evaluate d(sigmaHat)/d(tHat).
0337   virtual double sigmaHat() {return sigma;}
0338 
0339   // Select flavour, colour and anticolour.
0340   virtual void setIdColAcol();
0341 
0342   // Info on the subprocess.
0343   virtual string name()   const {return "q qbar -> g g";}
0344   virtual int    code()   const {return 115;}
0345   virtual string inFlux() const {return "qqbarSame";}
0346 
0347  private:
0348 
0349   // Values stored for colour flow selection.
0350   double sigTS, sigUS, sigSum, sigma;
0351 
0352 };
0353 
0354 //==========================================================================
0355 
0356 // A derived class for q qbar -> q' qbar'.
0357 
0358 class Sigma2qqbar2qqbarNew : public Sigma2Process {
0359 
0360 public:
0361 
0362   // Constructor.
0363   Sigma2qqbar2qqbarNew() : nQuarkNew(), idNew(), mNew(), m2New(), sigS(),
0364     sigma() {}
0365 
0366   // Initialize process.
0367   virtual void initProc();
0368 
0369   // Calculate flavour-independent parts of cross section.
0370   virtual void sigmaKin();
0371 
0372   // Evaluate d(sigmaHat)/d(tHat).
0373   virtual double sigmaHat() {return sigma;}
0374 
0375   // Select flavour, colour and anticolour.
0376   virtual void setIdColAcol();
0377 
0378   // Info on the subprocess.
0379   virtual string name()   const {return "q qbar -> q' qbar' (uds)";}
0380   virtual int    code()   const {return 116;}
0381   virtual string inFlux() const {return "qqbarSame";}
0382 
0383  private:
0384 
0385   // Number of quarks to be considered in massless approximation.
0386   int    nQuarkNew;
0387 
0388   // Values stored for colour flow selection.
0389   int    idNew;
0390   double mNew, m2New, sigS, sigma;
0391 
0392 };
0393 
0394 //==========================================================================
0395 
0396 // A derived class for g g -> Q Qbar (Q = c, b or t).
0397 
0398 class Sigma2gg2QQbar : public Sigma2Process {
0399 
0400 public:
0401 
0402   // Constructor.
0403   Sigma2gg2QQbar(int idIn, int codeIn) : idNew(idIn), codeSave(codeIn),
0404     sigTS(), sigUS(), sigSum(), sigma(), openFracPair() {}
0405 
0406   // Initialize process.
0407   virtual void initProc();
0408 
0409   // Calculate flavour-independent parts of cross section.
0410   virtual void sigmaKin();
0411 
0412   // Evaluate d(sigmaHat)/d(tHat).
0413   virtual double sigmaHat() {return sigma;}
0414 
0415   // Select flavour, colour and anticolour.
0416   virtual void setIdColAcol();
0417 
0418   // Evaluate weight for W decay angles in top decay (else inactive).
0419   virtual double weightDecay( Event& process, int iResBeg, int iResEnd);
0420 
0421   // Info on the subprocess.
0422   virtual string name()    const {return nameSave;}
0423   virtual int    code()    const {return codeSave;}
0424   virtual string inFlux()  const {return "gg";}
0425   virtual int    id3Mass() const {return idNew;}
0426   virtual int    id4Mass() const {return idNew;}
0427 
0428  private:
0429 
0430   // Values stored for process type and colour flow selection.
0431   int    idNew, codeSave;
0432   string nameSave;
0433   double sigTS, sigUS, sigSum, sigma, openFracPair;
0434 
0435 };
0436 
0437 //==========================================================================
0438 
0439 // A derived class for q qbar -> Q Qbar (Q = c, b or t).
0440 
0441 class Sigma2qqbar2QQbar : public Sigma2Process {
0442 
0443 public:
0444 
0445   // Constructor.
0446   Sigma2qqbar2QQbar(int idIn, int codeIn) : idNew(idIn), codeSave(codeIn),
0447     sigma(), openFracPair() {}
0448 
0449   // Initialize process.
0450   virtual void initProc();
0451 
0452   // Calculate flavour-independent parts of cross section.
0453   virtual void sigmaKin();
0454 
0455   // Evaluate d(sigmaHat)/d(tHat).
0456   virtual double sigmaHat() {return sigma;}
0457 
0458   // Select flavour, colour and anticolour.
0459   virtual void setIdColAcol();
0460 
0461   // Evaluate weight for W decay angles in top decay (else inactive).
0462   virtual double weightDecay( Event& process, int iResBeg, int iResEnd);
0463 
0464   // Info on the subprocess.
0465   virtual string name()    const {return nameSave;}
0466   virtual int    code()    const {return codeSave;}
0467   virtual string inFlux()  const {return "qqbarSame";}
0468   virtual int    id3Mass() const {return idNew;}
0469   virtual int    id4Mass() const {return idNew;}
0470 
0471  private:
0472 
0473   // Values stored for process type.
0474   int    idNew, codeSave;
0475   string nameSave;
0476   double sigma, openFracPair;
0477 
0478 };
0479 
0480 //==========================================================================
0481 
0482 // A derived class for g g -> g g g.
0483 
0484 class Sigma3gg2ggg : public Sigma3Process {
0485 
0486 public:
0487 
0488   // Constructor.
0489   Sigma3gg2ggg() : sigma(), pp() {}
0490 
0491   // Calculate flavour-independent parts of cross section.
0492   virtual void sigmaKin();
0493 
0494   // Evaluate d(sigmaHat)/d(tHat).
0495   virtual double sigmaHat() {return sigma;}
0496 
0497   // Select flavour, colour and anticolour.
0498   virtual void setIdColAcol();
0499 
0500   // Info on the subprocess.
0501   virtual string name()       const {return "g g -> g g g";}
0502   virtual int    code()       const {return 131;}
0503   virtual int    nFinal()     const {return 3;}
0504   virtual string inFlux()     const {return "gg";}
0505   virtual bool   isQCD3body() const {return true;}
0506 
0507 private:
0508 
0509   // Values stored for colour flow selection.
0510   double sigma;
0511 
0512   // Intermediate storage and calculation of four-products.
0513   double pp[6][6];
0514   double cycle(int i1, int i2, int i3, int i4, int i5) {return
0515     pp[i1][i2] * pp[i2][i3] * pp[i3][i4] * pp[i4][i5] * pp[i5][i1];}
0516 
0517 };
0518 
0519 //==========================================================================
0520 
0521 // A derived class for q qbar -> g g g.
0522 
0523 class Sigma3qqbar2ggg : public Sigma3Process {
0524 
0525 public:
0526 
0527   // Constructor.
0528   Sigma3qqbar2ggg() : config(), a(), b(), pp(), ab(), sigma() {}
0529 
0530   // Calculate flavour-independent parts of cross section.
0531   virtual void sigmaKin();
0532 
0533   // Evaluate d(sigmaHat)/d(tHat).
0534   virtual double sigmaHat() {return sigma;}
0535 
0536   // Select flavour, colour and anticolour.
0537   virtual void setIdColAcol();
0538 
0539   // Info on the subprocess.
0540   virtual string name()       const {return "q qbar -> g g g";}
0541   virtual int    code()       const {return 132;}
0542   virtual int    nFinal()     const {return 3;}
0543   virtual string inFlux()     const {return "qqbarSame";}
0544   virtual bool   isQCD3body() const {return true;}
0545 
0546 protected:
0547 
0548   // Pick/map a random final state configuration
0549   int         config;
0550   inline void pickFinal() { config = int( 6 * rndmPtr->flat() ); }
0551   inline void mapFinal();
0552 
0553   // |M|^2 calculation
0554   inline double m2Calc();
0555 
0556   // Four-vectors for |M|^2 calculation
0557   Vec4 pCM[5];
0558 
0559   // Intermediate storage and calculation of four-products
0560   double a[3], b[3], pp[3][3], ab[3][3];
0561 
0562   // Values stored for colour flow selection.
0563   double sigma;
0564 
0565 };
0566 
0567 //==========================================================================
0568 
0569 // A derived class for q g -> q g g
0570 // Derived from Sigma3qqbar2ggg
0571 
0572 class Sigma3qg2qgg : public Sigma3qqbar2ggg {
0573 
0574 public:
0575 
0576   // Constructor.
0577   Sigma3qg2qgg() : sigma() {}
0578 
0579   // Calculate flavour-independent parts of cross section.
0580   virtual void sigmaKin();
0581 
0582   // Evaluate d(sigmaHat)/d(tHat).
0583   virtual double sigmaHat();
0584 
0585   // Select flavour, colour and anticolour.
0586   virtual void setIdColAcol();
0587 
0588   // Info on the subprocess.
0589   virtual string name()       const {return "q g -> q g g";}
0590   virtual int    code()       const {return 133;}
0591   virtual int    nFinal()     const {return 3;}
0592   virtual string inFlux()     const {return "qg";}
0593   virtual bool   isQCD3body() const {return true;}
0594 
0595 private:
0596 
0597   // Sigma for (qg) and (gq) incoming
0598   double sigma[2];
0599 
0600 };
0601 
0602 //==========================================================================
0603 
0604 // A derived class for g g -> q qbar g
0605 // Derived from Sigma3qqbar2ggg
0606 
0607 class Sigma3gg2qqbarg : public Sigma3qqbar2ggg {
0608 
0609 public:
0610 
0611   // Constructor.
0612   Sigma3gg2qqbarg() : nQuarkNew() {}
0613 
0614   // Initialize process.
0615   virtual void initProc();
0616 
0617   // Calculate flavour-independent parts of cross section.
0618   virtual void sigmaKin();
0619 
0620   // Select flavour, colour and anticolour.
0621   virtual void setIdColAcol();
0622 
0623   // Info on the subprocess.
0624   virtual string name()       const {return "g g -> q qbar g";}
0625   virtual int    code()       const {return 138;}
0626   virtual int    nFinal()     const {return 3;}
0627   virtual string inFlux()     const {return "gg";}
0628   virtual bool   isQCD3body() const {return true;}
0629 
0630 private:
0631 
0632   // Number of quarks to be considered in massless approximation.
0633   int    nQuarkNew;
0634 
0635 };
0636 
0637 //==========================================================================
0638 
0639 // A derived class for q q' -> q q' g
0640 
0641 class Sigma3qq2qqgDiff : public Sigma3Process {
0642 
0643 public:
0644 
0645   // Constructor.
0646   Sigma3qq2qqgDiff() : config(), s(), t(), u(), sp(), tp(), up(), sigma() {}
0647 
0648   // Calculate flavour-independent parts of cross section.
0649   virtual void sigmaKin();
0650 
0651   // Evaluate d(sigmaHat)/d(tHat).
0652   virtual double sigmaHat();
0653 
0654   // Select flavour, colour and anticolour.
0655   virtual void setIdColAcol();
0656 
0657   // Info on the subprocess.
0658   virtual string name()       const
0659     {return "q(bar) q(bar)' -> q(bar) q(bar)' g";}
0660   virtual int    code()       const {return 134;}
0661   virtual int    nFinal()     const {return 3;}
0662   virtual string inFlux()     const {return "qq";}
0663   virtual bool   isQCD3body() const {return true;}
0664 
0665 protected:
0666 
0667   // Pick/map a random final state configuration
0668   int         config;
0669   inline void pickFinal() { config = int( 6 * rndmPtr->flat() ); }
0670   inline void mapFinal();
0671 
0672   // |M|^2 calculation
0673   inline double m2Calc();
0674 
0675   // Kinematic configuration
0676   Vec4 pCM[5];
0677 
0678   // Four-products
0679   double s, t, u, sp, tp, up;
0680 
0681   // Cross section
0682   double sigma;
0683 
0684 };
0685 
0686 //==========================================================================
0687 
0688 // A derived class for q qbar -> q' qbar' g
0689 // Derived from Sigma3qq2qqgDiff
0690 
0691 class Sigma3qqbar2qqbargDiff : public Sigma3qq2qqgDiff {
0692 
0693 public:
0694 
0695   // Constructor.
0696   Sigma3qqbar2qqbargDiff() : nQuarkNew() {}
0697 
0698   // Initialize process.
0699   virtual void initProc();
0700 
0701   // Calculate flavour-independent parts of cross section.
0702   virtual void sigmaKin();
0703 
0704   // Evaluate d(sigmaHat)/d(tHat).
0705   virtual double sigmaHat() {return sigma;}
0706 
0707   // Select flavour, colour and anticolour.
0708   virtual void setIdColAcol();
0709 
0710   // Info on the subprocess.
0711   virtual string name()       const {return "q qbar -> q' qbar' g";}
0712   virtual int    code()       const {return 136;}
0713   virtual int    nFinal()     const {return 3;}
0714   virtual string inFlux()     const {return "qqbarSame";}
0715   virtual bool   isQCD3body() const {return true;}
0716 
0717 private:
0718 
0719   // Number of quarks to be considered in massless approximation.
0720   int    nQuarkNew;
0721 
0722 };
0723 
0724 //==========================================================================
0725 
0726 // A derived class for q g -> q q' qbar'
0727 // Derived from Sigma3qq2qqgDiff
0728 
0729 class Sigma3qg2qqqbarDiff : public Sigma3qq2qqgDiff {
0730 
0731 public:
0732 
0733   // Constructor.
0734   Sigma3qg2qqqbarDiff() : nQuarkNew(), sigma() {}
0735 
0736   // Initialize process.
0737   virtual void initProc();
0738 
0739   // Calculate flavour-independent parts of cross section.
0740   virtual void sigmaKin();
0741 
0742   // Evaluate d(sigmaHat)/d(tHat).
0743   virtual double sigmaHat();
0744 
0745   // Select flavour, colour and anticolour.
0746   virtual void setIdColAcol();
0747 
0748   // Info on the subprocess.
0749   virtual string name()       const {return "q g -> q q' qbar'";}
0750   virtual int    code()       const {return 139;}
0751   virtual int    nFinal()     const {return 3;}
0752   virtual string inFlux()     const {return "qg";}
0753   virtual bool   isQCD3body() const {return true;}
0754 
0755 private:
0756 
0757   // Number of quarks to be considered in massless approximation.
0758   int    nQuarkNew;
0759 
0760   // gq and qg incoming
0761   double sigma[2];
0762 
0763 };
0764 
0765 //==========================================================================
0766 
0767 // A derived class for q q -> q q g
0768 
0769 class Sigma3qq2qqgSame : public Sigma3Process {
0770 
0771 public:
0772 
0773   // Constructor.
0774   Sigma3qq2qqgSame() : config(), s(), t(), u(), sp(), tp(), up(), ssp(),
0775     ttp(), uup(), s_sp(), t_tp(), u_up(), sigma() {}
0776 
0777   // Calculate flavour-independent parts of cross section.
0778   virtual void sigmaKin();
0779 
0780   // Evaluate d(sigmaHat)/d(tHat).
0781   virtual double sigmaHat();
0782 
0783   // Select flavour, colour and anticolour.
0784   virtual void setIdColAcol();
0785 
0786   // Info on the subprocess.
0787   virtual string name()       const
0788     {return "q(bar) q(bar) -> q(bar) q(bar) g";}
0789   virtual int    code()       const {return 135;}
0790   virtual int    nFinal()     const {return 3;}
0791   virtual string inFlux()     const {return "qq";}
0792   virtual bool   isQCD3body() const {return true;}
0793 
0794 protected:
0795 
0796   // Pick/map a random final state configuration
0797   int         config;
0798   inline void pickFinal() { config = int( 6 * rndmPtr->flat() ); }
0799   inline void mapFinal();
0800 
0801   // |M|^2 calculation
0802   inline double m2Calc();
0803 
0804   // Kinematic configuration
0805   Vec4 pCM[5];
0806 
0807   // Four-products
0808   double s, t, u, sp, tp, up;
0809   double ssp, ttp, uup, s_sp, t_tp, u_up;
0810 
0811   // Cross section
0812   double sigma;
0813 
0814 };
0815 
0816 //==========================================================================
0817 
0818 // A derived class for q q -> q q g
0819 // Derived from Sigma3qq2qqgSame
0820 
0821 class Sigma3qqbar2qqbargSame : public Sigma3qq2qqgSame {
0822 
0823 public:
0824 
0825   // Constructor.
0826   Sigma3qqbar2qqbargSame() {}
0827 
0828   // Calculate flavour-independent parts of cross section.
0829   virtual void sigmaKin();
0830 
0831   // Evaluate d(sigmaHat)/d(tHat).
0832   virtual double sigmaHat() {return sigma;}
0833 
0834   // Select flavour, colour and anticolour.
0835   virtual void setIdColAcol();
0836 
0837   // Info on the subprocess.
0838   virtual string name()       const {return "q qbar -> q qbar g";}
0839   virtual int    code()       const {return 137;}
0840   virtual int    nFinal()     const {return 3;}
0841   virtual string inFlux()     const {return "qqbarSame";}
0842   virtual bool   isQCD3body() const {return true;}
0843 
0844 private:
0845 
0846 };
0847 
0848 //==========================================================================
0849 
0850 // A derived class for q g -> q qbar q; same flavour.
0851 // Derived from Sigma3qq2qqgSame
0852 
0853 class Sigma3qg2qqqbarSame : public Sigma3qq2qqgSame {
0854 
0855 public:
0856 
0857   // Constructor.
0858   Sigma3qg2qqqbarSame() : sigma() {}
0859 
0860   // Calculate flavour-independent parts of cross section.
0861   virtual void sigmaKin();
0862 
0863   // Evaluate d(sigmaHat)/d(tHat).
0864   virtual double sigmaHat();
0865 
0866   // Select flavour, colour and anticolour.
0867   virtual void setIdColAcol();
0868 
0869   // Info on the subprocess.
0870   virtual string name()       const {return "q g -> q q qbar";}
0871   virtual int    code()       const {return 140;}
0872   virtual int    nFinal()     const {return 3;}
0873   virtual string inFlux()     const {return "qg";}
0874   virtual bool   isQCD3body() const {return true;}
0875 
0876 private:
0877 
0878   // gq and qg incoming
0879   double sigma[2];
0880 
0881 };
0882 
0883 //==========================================================================
0884 
0885 } // end namespace Pythia8
0886 
0887 #endif // Pythia8_SigmaQCD_H