Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // SigmaEW.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 electroweak process differential cross sections.
0007 // Contains classes derived from SigmaProcess via Sigma(1/2)Process.
0008 
0009 #ifndef Pythia8_SigmaEW_H
0010 #define Pythia8_SigmaEW_H
0011 
0012 #include "Pythia8/PythiaComplex.h"
0013 #include "Pythia8/SigmaProcess.h"
0014 
0015 namespace Pythia8 {
0016 
0017 
0018 //==========================================================================
0019 
0020 // A derived class for q g -> q gamma (q = u, d, s, c, b).
0021 // Use massless approximation also for Q since no alternative.
0022 
0023 class Sigma2qg2qgamma : public Sigma2Process {
0024 
0025 public:
0026 
0027   // Constructor.
0028   Sigma2qg2qgamma() : sigUS(), sigma0() {}
0029 
0030   // Calculate flavour-independent parts of cross section.
0031   virtual void sigmaKin();
0032 
0033   // Evaluate d(sigmaHat)/d(tHat).
0034   virtual double sigmaHat();
0035 
0036   // Select flavour, colour and anticolour.
0037   virtual void setIdColAcol();
0038 
0039   // Info on the subprocess.
0040   virtual string name()   const {return "q g -> q gamma (udscb)";}
0041   virtual int    code()   const {return 201;}
0042   virtual string inFlux() const {return "qg";}
0043 
0044 private:
0045 
0046   // Values stored for later use.
0047   double sigUS, sigma0;
0048 
0049 };
0050 
0051 //==========================================================================
0052 
0053 // A derived class for q qbar -> g gamma.
0054 
0055 class Sigma2qqbar2ggamma : public Sigma2Process {
0056 
0057 public:
0058 
0059   // Constructor.
0060   Sigma2qqbar2ggamma() : sigma0() {}
0061 
0062   // Calculate flavour-independent parts of cross section.
0063   virtual void sigmaKin();
0064 
0065   // Evaluate d(sigmaHat)/d(tHat).
0066   virtual double sigmaHat();
0067 
0068   // Select flavour, colour and anticolour.
0069   virtual void setIdColAcol();
0070 
0071   // Info on the subprocess.
0072   virtual string name()   const {return "q qbar -> g gamma";}
0073   virtual int    code()   const {return 202;}
0074   virtual string inFlux() const {return "qqbarSame";}
0075 
0076 private:
0077 
0078   // Values stored for later use.
0079   double sigma0;
0080 
0081 };
0082 
0083 //==========================================================================
0084 
0085 // A derived class for g g -> g gamma.
0086 
0087 class Sigma2gg2ggamma : public Sigma2Process {
0088 
0089 public:
0090 
0091   // Constructor.
0092   Sigma2gg2ggamma() : chargeSum(), sigma() {}
0093 
0094   // Initialize process.
0095   virtual void initProc();
0096 
0097   // Calculate flavour-independent parts of cross section.
0098   virtual void sigmaKin();
0099 
0100   // Evaluate d(sigmaHat)/d(tHat).
0101   virtual double sigmaHat() {return sigma;}
0102 
0103   // Select flavour, colour and anticolour.
0104   virtual void setIdColAcol();
0105 
0106   // Info on the subprocess.
0107   virtual string name()   const {return "g g -> g gamma";}
0108   virtual int    code()   const {return 203;}
0109   virtual string inFlux() const {return "gg";}
0110 
0111 private:
0112 
0113   // Values stored for later use.
0114   double chargeSum, sigma;
0115 
0116 };
0117 
0118 //==========================================================================
0119 
0120 // A derived class for f fbar -> gamma gamma.
0121 
0122 class Sigma2ffbar2gammagamma : public Sigma2Process {
0123 
0124 public:
0125 
0126   // Constructor.
0127   Sigma2ffbar2gammagamma() : sigTU(), sigma0() {}
0128 
0129   // Calculate flavour-independent parts of cross section.
0130   virtual void sigmaKin();
0131 
0132   // Evaluate d(sigmaHat)/d(tHat).
0133   virtual double sigmaHat();
0134 
0135   // Select flavour, colour and anticolour.
0136   virtual void setIdColAcol();
0137 
0138   // Info on the subprocess.
0139   virtual string name()   const {return "f fbar -> gamma gamma";}
0140   virtual int    code()   const {return 204;}
0141   virtual string inFlux() const {return "ffbarSame";}
0142 
0143 private:
0144 
0145   // Values stored for later use.
0146   double sigTU, sigma0;
0147 
0148 };
0149 
0150 //==========================================================================
0151 
0152 // A derived class for g g -> gamma gamma.
0153 
0154 class Sigma2gg2gammagamma : public Sigma2Process {
0155 
0156 public:
0157 
0158   // Constructor.
0159   Sigma2gg2gammagamma() : charge2Sum(), sigma() {}
0160 
0161   // Initialize process.
0162   virtual void initProc();
0163 
0164   // Calculate flavour-independent parts of cross section.
0165   virtual void sigmaKin();
0166 
0167   // Evaluate d(sigmaHat)/d(tHat).
0168   virtual double sigmaHat() {return sigma;}
0169 
0170   // Select flavour, colour and anticolour.
0171   virtual void setIdColAcol();
0172 
0173   // Info on the subprocess.
0174   virtual string name()   const {return "g g -> gamma gamma";}
0175   virtual int    code()   const {return 205;}
0176   virtual string inFlux() const {return "gg";}
0177 
0178 private:
0179 
0180   double charge2Sum, sigma;
0181 
0182 };
0183 
0184 //==========================================================================
0185 
0186 // A derived class for f f' -> f f' via t-channel gamma*/Z0 exchange.
0187 
0188 class Sigma2ff2fftgmZ : public Sigma2Process {
0189 
0190 public:
0191 
0192   // Constructor.
0193   Sigma2ff2fftgmZ() : gmZmode(), mZ(), mZS(), thetaWRat(), sigmagmgm(),
0194     sigmagmZ(), sigmaZZ() {}
0195 
0196   // Initialize process.
0197   virtual void initProc();
0198 
0199   // Calculate flavour-independent parts of cross section.
0200   virtual void sigmaKin();
0201 
0202   // Evaluate sigmaHat(sHat).
0203   virtual double sigmaHat();
0204 
0205   // Select flavour, colour and anticolour.
0206   virtual void setIdColAcol();
0207 
0208   // Info on the subprocess.
0209   virtual string name()   const {return "f f' -> f f' (t-channel gamma*/Z0)";}
0210   virtual int    code()   const {return 211;}
0211   virtual string inFlux() const {return "ff";}
0212 
0213 private:
0214 
0215   //  Z parameters for propagator.
0216   int    gmZmode;
0217   double mZ, mZS, thetaWRat, sigmagmgm, sigmagmZ, sigmaZZ;
0218 
0219 };
0220 
0221 //==========================================================================
0222 
0223 // A derived class for f_1 f_2 -> f_3 f_4 via t-channel W+- exchange.
0224 
0225 class Sigma2ff2fftW : public Sigma2Process {
0226 
0227 public:
0228 
0229   // Constructor.
0230   Sigma2ff2fftW() : mW(), mWS(), thetaWRat(), sigma0() {}
0231 
0232   // Initialize process.
0233   virtual void initProc();
0234 
0235   // Calculate flavour-independent parts of cross section.
0236   virtual void sigmaKin();
0237 
0238   // Evaluate sigmaHat(sHat).
0239   virtual double sigmaHat();
0240 
0241   // Select flavour, colour and anticolour.
0242   virtual void setIdColAcol();
0243 
0244   // Info on the subprocess.
0245   virtual string name()   const {return "f_1 f_2 -> f_3 f_4 (t-channel W+-)";}
0246   virtual int    code()   const {return 212;}
0247   virtual string inFlux() const {return "ff";}
0248 
0249 private:
0250 
0251   //  W parameters for propagator.
0252   double mW, mWS, thetaWRat, sigma0;
0253 
0254 };
0255 
0256 //==========================================================================
0257 
0258 // A derived class for q q' -> Q q" via t-channel W+- exchange.
0259 // Related to Sigma2ff2fftW class, but with massive matrix elements.
0260 
0261 class Sigma2qq2QqtW : public Sigma2Process {
0262 
0263 public:
0264 
0265   // Constructor.
0266   Sigma2qq2QqtW(int idIn, int codeIn) : idNew(idIn), codeSave(codeIn), mW(),
0267     mWS(), thetaWRat(), sigma0(), openFracPos(), openFracNeg() {}
0268 
0269   // Initialize process.
0270   virtual void initProc();
0271 
0272   // Calculate flavour-independent parts of cross section.
0273   virtual void sigmaKin();
0274 
0275   // Evaluate sigmaHat(sHat).
0276   virtual double sigmaHat();
0277 
0278   // Select flavour, colour and anticolour.
0279   virtual void setIdColAcol();
0280 
0281   // Evaluate weight for W decay angles in top decay (else inactive).
0282   virtual double weightDecay( Event& process, int iResBeg, int iResEnd);
0283 
0284   // Info on the subprocess.
0285   virtual string name()    const {return nameSave;}
0286   virtual int    code()    const {return codeSave;}
0287   virtual string inFlux()  const {return "ff";}
0288   virtual int    id3Mass() const {return idNew;}
0289 
0290 private:
0291 
0292   // Values stored for process type. W parameters for propagator.
0293   int    idNew, codeSave;
0294   string nameSave;
0295   double mW, mWS, thetaWRat, sigma0, openFracPos, openFracNeg;
0296 
0297 };
0298 
0299 //==========================================================================
0300 
0301 // A derived class for f fbar -> gamma*/Z0.
0302 
0303 class Sigma1ffbar2gmZ : public Sigma1Process {
0304 
0305 public:
0306 
0307   // Constructor.
0308   Sigma1ffbar2gmZ() : gmZmode(), mRes(), GammaRes(), m2Res(), GamMRat(),
0309     thetaWRat(), gamSum(), intSum(), resSum(), gamProp(), intProp(),
0310     resProp(), particlePtr() {}
0311 
0312   // Initialize process.
0313   virtual void initProc();
0314 
0315   // Calculate flavour-independent parts of cross section.
0316   virtual void sigmaKin();
0317 
0318   // Evaluate sigmaHat(sHat).
0319   virtual double sigmaHat();
0320 
0321   // Select flavour, colour and anticolour.
0322   virtual void setIdColAcol();
0323 
0324   // Evaluate weight for Z decay angle.
0325   virtual double weightDecay( Event& process, int iResBeg, int iResEnd);
0326 
0327   // Info on the subprocess.
0328   virtual string name()       const {return "f fbar -> gamma*/Z0";}
0329   virtual int    code()       const {return 221;}
0330   virtual string inFlux()     const {return "ffbarSame";}
0331   virtual int    resonanceA() const {return 23;}
0332 
0333 private:
0334 
0335   // Parameters set at initialization or for each new event.
0336   int    gmZmode;
0337   double mRes, GammaRes, m2Res, GamMRat, thetaWRat,
0338          gamSum, intSum, resSum, gamProp, intProp, resProp;
0339 
0340   // Pointer to properties of the particle species, to access decay channels.
0341   ParticleDataEntryPtr particlePtr;
0342 
0343 };
0344 
0345 //==========================================================================
0346 
0347 // A derived class for f fbar' -> W+-.
0348 
0349 class Sigma1ffbar2W : public Sigma1Process {
0350 
0351 public:
0352 
0353   // Constructor.
0354   Sigma1ffbar2W() : mRes(), GammaRes(), m2Res(), GamMRat(), thetaWRat(),
0355     sigma0Pos(), sigma0Neg(), particlePtr() {}
0356 
0357   // Initialize process.
0358   virtual void initProc();
0359 
0360   // Calculate flavour-independent parts of cross section.
0361   virtual void sigmaKin();
0362 
0363   // Evaluate sigmaHat(sHat).
0364   virtual double sigmaHat();
0365 
0366   // Select flavour, colour and anticolour.
0367   virtual void setIdColAcol();
0368 
0369   // Evaluate weight for W decay angle.
0370   virtual double weightDecay( Event& process, int iResBeg, int iResEnd);
0371 
0372   // Info on the subprocess.
0373   virtual string name()       const {return "f fbar' -> W+-";}
0374   virtual int    code()       const {return 222;}
0375   virtual string inFlux()     const {return "ffbarChg";}
0376   virtual int    resonanceA() const {return 24;}
0377 
0378 private:
0379 
0380   // Parameters set at initialization.
0381   double mRes, GammaRes, m2Res, GamMRat, thetaWRat, sigma0Pos, sigma0Neg;
0382 
0383   // Pointer to properties of the particle species, to access decay channels.
0384   ParticleDataEntryPtr particlePtr;
0385 
0386 };
0387 
0388 //==========================================================================
0389 
0390 // A derived class for f fbar -> gamma* -> f' fbar', summed over light f'.
0391 // Allows pT-ordered evolution for multiparton interactions.
0392 
0393 class Sigma2ffbar2ffbarsgm : public Sigma2Process {
0394 
0395 public:
0396 
0397   // Constructor.
0398   Sigma2ffbar2ffbarsgm() : idNew(), sigma0() {}
0399 
0400   // Calculate flavour-independent parts of cross section.
0401   virtual void sigmaKin();
0402 
0403   // Evaluate sigmaHat(sHat).
0404   virtual double sigmaHat();
0405 
0406   // Select flavour, colour and anticolour.
0407   virtual void setIdColAcol();
0408 
0409   // Info on the subprocess.
0410   virtual string name()       const {
0411     return "f fbar -> f' fbar' (s-channel gamma*)";}
0412   virtual int    code()       const {return 223;}
0413   virtual string inFlux()     const {return "ffbarSame";}
0414   virtual bool   isSChannel() const {return true;}
0415 
0416 private:
0417 
0418   // Values stored for later use.
0419   int    idNew;
0420   double sigma0;
0421 
0422 };
0423 
0424 //==========================================================================
0425 
0426 // A derived class for f fbar -> gamma*/Z0 -> f' fbar', summed over light f.
0427 
0428 class Sigma2ffbar2ffbarsgmZ : public Sigma2Process {
0429 
0430 public:
0431 
0432   // Constructor.
0433   Sigma2ffbar2ffbarsgmZ() : gmZmode(), mRes(), GammaRes(), m2Res(),
0434     GamMRat(), thetaWRat(), colQ(), gamSumT(), gamSumL(), intSumT(),
0435     intSumL(), intSumA(), resSumT(), resSumL(), resSumA(), gamProp(),
0436     intProp(), resProp(), cThe(), particlePtr() {}
0437 
0438   // Initialize process.
0439   virtual void initProc();
0440 
0441   // Calculate flavour-independent parts of cross section.
0442   virtual void sigmaKin();
0443 
0444   // Evaluate sigmaHat(sHat).
0445   virtual double sigmaHat();
0446 
0447   // Select flavour, colour and anticolour.
0448   virtual void setIdColAcol();
0449 
0450   // Info on the subprocess.
0451   virtual string name()       const {
0452     return "f fbar -> f' fbar' (s-channel gamma*/Z0)";}
0453   virtual int    code()       const {return 224;}
0454   virtual string inFlux()     const {return "ffbarSame";}
0455   virtual bool   isSChannel() const {return true;}
0456   virtual int    idSChannel() const {return 23;}
0457   virtual int    resonanceA() const {return 23;}
0458 
0459 private:
0460 
0461   // Parameters set at initialization or for each new event.
0462   int    gmZmode;
0463   double mRes, GammaRes, m2Res, GamMRat, thetaWRat, colQ,
0464          gamSumT, gamSumL, intSumT, intSumL, intSumA, resSumT, resSumL,
0465          resSumA, gamProp, intProp, resProp, cThe;
0466   vector<int> idVec;
0467   vector<double> gamT, gamL, intT, intL, intA, resT, resL, resA, sigTLA;
0468 
0469   // Pointer to properties of the particle species, to access decay channels.
0470   ParticleDataEntryPtr particlePtr;
0471 
0472 };
0473 
0474 //==========================================================================
0475 
0476 // A derived class for f_1 fbar_2 -> W+- -> f_3 fbar_4, summed over light f.
0477 
0478 class Sigma2ffbar2ffbarsW : public Sigma2Process {
0479 
0480 public:
0481 
0482   // Constructor.
0483   Sigma2ffbar2ffbarsW() : id3New(), id4New(), mRes(), GammaRes(), m2Res(),
0484     GamMRat(), thetaWRat(), sigma0(), particlePtr() {}
0485 
0486   // Initialize process.
0487   virtual void initProc();
0488 
0489   // Calculate flavour-independent parts of cross section.
0490   virtual void sigmaKin();
0491 
0492   // Evaluate sigmaHat(sHat).
0493   virtual double sigmaHat();
0494 
0495   // Select flavour, colour and anticolour.
0496   virtual void setIdColAcol();
0497 
0498   // Info on the subprocess.
0499   virtual string name()       const {
0500     return "f_1 fbar_2 -> f_3 fbar_4 (s-channel W+-)";}
0501   virtual int    code()       const {return 225;}
0502   virtual string inFlux()     const {return "ffbarChg";}
0503   virtual bool   isSChannel() const {return true;}
0504   virtual int    idSChannel() const {return 24;}
0505   virtual int    resonanceA() const {return 24;}
0506 
0507 private:
0508 
0509   // Parameters set at initialization or stored for later use.
0510   int    id3New, id4New;
0511   double mRes, GammaRes, m2Res, GamMRat, thetaWRat, sigma0;
0512 
0513   // Pointer to properties of the particle species, to access decay channels.
0514   ParticleDataEntryPtr particlePtr;
0515 
0516 };
0517 
0518 //==========================================================================
0519 
0520 // A derived class for f fbar -> gamma*/Z0 -> F Fbar, for one heavy F.
0521 // Allows pT cuts as for other 2 -> 2 processes.
0522 
0523 class Sigma2ffbar2FFbarsgmZ : public Sigma2Process {
0524 
0525 public:
0526 
0527   // Constructor.
0528   Sigma2ffbar2FFbarsgmZ(int idIn, int codeIn) : idNew(idIn),
0529     codeSave(codeIn), gmZmode(), isPhysical(), ef(), vf(), af(), mRes(),
0530     GammaRes(), m2Res(), GamMRat(), thetaWRat(), mr(), betaf(), cosThe(),
0531     gamProp(), intProp(), resProp(), openFracPair() {}
0532 
0533   // Initialize process.
0534   virtual void initProc();
0535 
0536   // Calculate flavour-independent parts of cross section.
0537   virtual void sigmaKin();
0538 
0539   // Evaluate sigmaHat(sHat).
0540   virtual double sigmaHat();
0541 
0542   // Select flavour, colour and anticolour.
0543   virtual void setIdColAcol();
0544 
0545   // Evaluate weight for W decay angles in top decay (else inactive).
0546   virtual double weightDecay( Event& process, int iResBeg, int iResEnd);
0547 
0548   // Info on the subprocess.
0549   virtual string name()       const {return nameSave;}
0550   virtual int    code()       const {return codeSave;}
0551   virtual string inFlux()     const {return "ffbarSame";}
0552   virtual bool   isSChannel() const {return true;}
0553   virtual int    id3Mass()    const {return idNew;}
0554   virtual int    id4Mass()    const {return idNew;}
0555   virtual int    resonanceA() const {return 23;}
0556 
0557 private:
0558 
0559   // Values stored for process type. Z parameters for propagator.
0560   int    idNew, codeSave, gmZmode;
0561   string nameSave;
0562   bool   isPhysical;
0563   double ef, vf, af, mRes, GammaRes, m2Res, GamMRat, thetaWRat,
0564          mr, betaf, cosThe, gamProp, intProp, resProp, openFracPair;
0565 
0566 };
0567 
0568 //==========================================================================
0569 
0570 // A derived class for f fbar' -> W+- -> F fbar", for one or two heavy F.
0571 // Allows pT cuts as for other 2 -> 2 processes.
0572 
0573 class Sigma2ffbar2FfbarsW : public Sigma2Process {
0574 
0575 public:
0576 
0577   // Constructor.
0578   Sigma2ffbar2FfbarsW(int idIn, int idIn2, int codeIn) : idNew(idIn),
0579     idNew2(idIn2), codeSave(codeIn), idPartner(), isPhysical(), V2New(),
0580     mRes(), GammaRes(), m2Res(), GamMRat(), thetaWRat(), sigma0(),
0581     openFracPos(), openFracNeg() {}
0582 
0583   // Initialize process.
0584   virtual void initProc();
0585 
0586   // Calculate flavour-independent parts of cross section.
0587   virtual void sigmaKin();
0588 
0589   // Evaluate sigmaHat(sHat).
0590   virtual double sigmaHat();
0591 
0592   // Select flavour, colour and anticolour.
0593   virtual void setIdColAcol();
0594 
0595   // Evaluate weight for W decay angles in top decay (else inactive).
0596   virtual double weightDecay( Event& process, int iResBeg, int iResEnd);
0597 
0598   // Info on the subprocess.
0599   virtual string name()       const {return nameSave;}
0600   virtual int    code()       const {return codeSave;}
0601   virtual string inFlux()     const {return "ffbarChg";}
0602   virtual bool   isSChannel() const {return true;}
0603   virtual int    id3Mass()    const {return idNew;}
0604   virtual int    id4Mass()    const {return idPartner;}
0605   virtual int    resonanceA() const {return 24;}
0606 
0607 private:
0608 
0609   // Values stored for process type. W parameters for propagator.
0610   int    idNew, idNew2, codeSave, idPartner;
0611   string nameSave;
0612   bool   isPhysical;
0613   double V2New, mRes, GammaRes, m2Res, GamMRat, thetaWRat, sigma0,
0614          openFracPos, openFracNeg;
0615 
0616 };
0617 
0618 //==========================================================================
0619 
0620 // An intermediate class for f fbar -> gamma*/Z0/W+- gamma*/Z0/W-+.
0621 
0622 class Sigma2ffbargmZWgmZW : public Sigma2Process {
0623 
0624 public:
0625 
0626   // Constructor.
0627   Sigma2ffbargmZWgmZW() {}
0628 
0629 protected:
0630 
0631   // Internal products.
0632   Vec4    pRot[7];
0633   complex hA[7][7];
0634   complex hC[7][7];
0635 
0636   // Calculate and store internal products.
0637   void setupProd( Event& process, int i1, int i2, int i3, int i4,
0638     int i5, int i6);
0639 
0640   // Evaluate the F function of Gunion and Kunszt.
0641   complex fGK(int i1, int i2, int i3, int i4, int i5, int i6);
0642 
0643   // Evaluate the Xi function of Gunion and Kunszt.
0644   double xiGK( double tHnow, double uHnow);
0645 
0646   // Evaluate the Xj function of Gunion and Kunszt.
0647   double xjGK( double tHnow, double uHnow);
0648 
0649 private:
0650 
0651 };
0652 
0653 //==========================================================================
0654 
0655 // A derived class for f fbar -> gamma*/Z0 gamma*/Z0.
0656 
0657 class Sigma2ffbar2gmZgmZ : public Sigma2ffbargmZWgmZW {
0658 
0659 public:
0660 
0661   // Constructor.
0662   Sigma2ffbar2gmZgmZ() : gmZmode(), i1(), i2(), i3(), i4(), i5(), i6(),
0663     mRes(), GammaRes(), m2Res(), GamMRat(), thetaWRat(), sigma0(), gamSum3(),
0664     intSum3(), resSum3(), gamProp3(), intProp3(), resProp3(), gamSum4(),
0665     intSum4(), resSum4(), gamProp4(), intProp4(), resProp4(), c3LL(), c3LR(),
0666     c3RL(), c3RR(), c4LL(), c4LR(), c4RL(), c4RR(), flavWt(),
0667     particlePtr() {}
0668 
0669   // Initialize process.
0670   virtual void initProc();
0671 
0672   // Calculate flavour-independent parts of cross section.
0673   virtual void sigmaKin();
0674 
0675   // Evaluate d(sigmaHat)/d(tHat).
0676   virtual double sigmaHat();
0677 
0678   // Select flavour, colour and anticolour.
0679   virtual void setIdColAcol();
0680 
0681   // Evaluate weight for simultaneous flavour choices.
0682   virtual double weightDecayFlav( Event& process);
0683 
0684   // Evaluate weight for decay angles of the two gamma*/Z0.
0685   virtual double weightDecay( Event& process, int iResBeg, int iResEnd);
0686 
0687   // Info on the subprocess.
0688   virtual string name()    const {return "f fbar -> gamma*/Z0 gamma*/Z0";}
0689   virtual int    code()    const {return 231;}
0690   virtual string inFlux()  const {return "ffbarSame";}
0691   virtual int    id3Mass() const {return 23;}
0692   virtual int    id4Mass() const {return 23;}
0693 
0694 private:
0695 
0696   // Parameters set at initialization or for each new event.
0697   int    gmZmode, i1, i2, i3, i4, i5, i6;
0698   double mRes, GammaRes, m2Res, GamMRat, thetaWRat, sigma0,
0699          gamSum3, intSum3, resSum3, gamProp3, intProp3, resProp3,
0700          gamSum4, intSum4, resSum4, gamProp4, intProp4, resProp4,
0701          c3LL, c3LR, c3RL, c3RR, c4LL, c4LR, c4RL, c4RR, flavWt;
0702 
0703   // Pointer to properties of the particle species, to access decay channels.
0704   ParticleDataEntryPtr particlePtr;
0705 
0706 };
0707 
0708 //==========================================================================
0709 
0710 // A derived class for f fbar' -> Z0 W+-. (Here pure Z0, unfortunately.)
0711 
0712 class Sigma2ffbar2ZW : public Sigma2ffbargmZWgmZW {
0713 
0714 public:
0715 
0716   // Constructor.
0717   Sigma2ffbar2ZW() : mW(), widW(), mWS(), mwWS(), sin2thetaW(), cos2thetaW(),
0718     thetaWRat(), cotT(), thetaWpt(), thetaWmm(), lun(), lde(), sigma0(),
0719     openFracPos(), openFracNeg() {}
0720 
0721   // Initialize process.
0722   virtual void initProc();
0723 
0724   // Calculate flavour-independent parts of cross section.
0725   virtual void sigmaKin();
0726 
0727   // Evaluate d(sigmaHat)/d(tHat).
0728   virtual double sigmaHat();
0729 
0730   // Select flavour, colour and anticolour.
0731   virtual void setIdColAcol();
0732 
0733   // Evaluate weight for Z0 and W+- decay angles.
0734   virtual double weightDecay( Event& process, int iResBeg, int iResEnd);
0735 
0736   // Info on the subprocess.
0737   virtual string name()       const {return "f fbar' -> Z0 W+- (no gamma*!)";}
0738   virtual int    code()       const {return 232;}
0739   virtual string inFlux()     const {return "ffbarChg";}
0740   virtual int    id3Mass()    const {return 23;}
0741   virtual int    id4Mass()    const {return 24;}
0742   virtual int    resonanceA() const {return 24;}
0743 
0744 private:
0745 
0746   // Store W+- mass and width, and couplings.
0747   double mW, widW, mWS, mwWS, sin2thetaW, cos2thetaW, thetaWRat, cotT,
0748          thetaWpt, thetaWmm, lun, lde, sigma0, openFracPos, openFracNeg;
0749 
0750 };
0751 
0752 //==========================================================================
0753 
0754 // A derived class for f fbar -> W+ W-.
0755 
0756 class Sigma2ffbar2WW : public Sigma2ffbargmZWgmZW {
0757 
0758 public:
0759 
0760   // Constructor.
0761   Sigma2ffbar2WW() : mZ(), widZ(), mZS(), mwZS(), thetaWRat(), sigma0(),
0762     cgg(), cgZ(), cZZ(), cfg(), cfZ(), cff(), gSS(), gTT(), gST(), gUU(),
0763     gSU(), openFracPair() {}
0764 
0765   // Initialize process.
0766   virtual void initProc();
0767 
0768   // Calculate flavour-independent parts of cross section.
0769   virtual void sigmaKin();
0770 
0771   // Evaluate d(sigmaHat)/d(tHat).
0772   virtual double sigmaHat();
0773 
0774   // Select flavour, colour and anticolour.
0775   virtual void setIdColAcol();
0776 
0777   // Evaluate weight for W+ and W- decay angles.
0778   virtual double weightDecay( Event& process, int iResBeg, int iResEnd);
0779 
0780   // Info on the subprocess.
0781   virtual string name()       const {return "f fbar -> W+ W-";}
0782   virtual int    code()       const {return 233;}
0783   virtual string inFlux()     const {return "ffbarSame";}
0784   virtual int    id3Mass()    const {return 24;}
0785   virtual int    id4Mass()    const {return -24;}
0786   virtual int    resonanceA() const {return 23;}
0787 
0788 private:
0789 
0790   // Store Z0 mass and width.
0791   double mZ, widZ, mZS, mwZS, thetaWRat, sigma0, cgg, cgZ, cZZ, cfg,
0792     cfZ, cff, gSS, gTT, gST, gUU, gSU, openFracPair;
0793 
0794 };
0795 
0796 //==========================================================================
0797 
0798 // An intermediate class for f fbar -> gamma*/Z0 g/gamma and permutations.
0799 
0800 class Sigma2ffbargmZggm : public Sigma2Process {
0801 
0802 public:
0803 
0804   // Constructor.
0805   Sigma2ffbargmZggm() : gmZmode(), mRes(), GammaRes(), m2Res(), GamMRat(),
0806     thetaWRat(), gamSum(), intSum(), resSum(), gamProp(), intProp(), resProp(),
0807     particlePtr() {}
0808 
0809   // Initialize process.
0810   virtual void initProc();
0811 
0812   // Evaluate weight for gamma&/Z0 decay angle.
0813   virtual double weightDecay( Event& process, int iResBeg, int iResEnd);
0814 
0815 protected:
0816 
0817   // Parameters set at initialization or for each new event.
0818   int    gmZmode;
0819   double mRes, GammaRes, m2Res, GamMRat, thetaWRat,
0820          gamSum, intSum, resSum, gamProp, intProp, resProp;
0821 
0822   // Evaluate current sum of flavour couplings times phase space.
0823   void flavSum();
0824 
0825   // Evaluate current propagator terms of cross section.
0826   void propTerm();
0827 
0828 private:
0829 
0830   // Pointer to properties of the particle species, to access decay channels.
0831   ParticleDataEntryPtr particlePtr;
0832 
0833 };
0834 
0835 //==========================================================================
0836 
0837 // A derived class for q qbar -> gamma*/Z0 g.
0838 
0839 class Sigma2qqbar2gmZg : public Sigma2ffbargmZggm {
0840 
0841 public:
0842 
0843   // Constructor.
0844   Sigma2qqbar2gmZg() : sigma0() {}
0845 
0846   // Calculate flavour-independent parts of cross section.
0847   virtual void sigmaKin();
0848 
0849   // Evaluate d(sigmaHat)/d(tHat).
0850   virtual double sigmaHat();
0851 
0852   // Select flavour, colour and anticolour.
0853   virtual void setIdColAcol();
0854 
0855   // Info on the subprocess.
0856   virtual string name()    const {return "q qbar -> gamma*/Z0 g";}
0857   virtual int    code()    const {return 241;}
0858   virtual string inFlux()  const {return "qqbarSame";}
0859   virtual int    id3Mass() const {return 23;}
0860 
0861 private:
0862 
0863   // Values stored for later use.
0864   double sigma0;
0865 
0866 };
0867 
0868 //==========================================================================
0869 
0870 // A derived class for q g -> gamma*/Z0 q.
0871 
0872 class Sigma2qg2gmZq : public Sigma2ffbargmZggm {
0873 
0874 public:
0875 
0876   // Constructor.
0877   Sigma2qg2gmZq() : sigma0() {}
0878 
0879   // Calculate flavour-independent parts of cross section.
0880   virtual void sigmaKin();
0881 
0882   // Evaluate d(sigmaHat)/d(tHat).
0883   virtual double sigmaHat();
0884 
0885   // Select flavour, colour and anticolour.
0886   virtual void setIdColAcol();
0887 
0888   // Info on the subprocess.
0889   virtual string name()    const {return "q g-> gamma*/Z0 q";}
0890   virtual int    code()    const {return 242;}
0891   virtual string inFlux()  const {return "qg";}
0892   virtual int    id3Mass() const {return 23;}
0893 
0894 private:
0895 
0896   // Values stored for later use.
0897   double sigma0;
0898 
0899 };
0900 
0901 //==========================================================================
0902 
0903 // A derived class for f fbar' -> gamma*/Z0 gamma.
0904 
0905 class Sigma2ffbar2gmZgm : public Sigma2ffbargmZggm {
0906 
0907 public:
0908 
0909   // Constructor.
0910   Sigma2ffbar2gmZgm() : sigma0() {}
0911 
0912   // Calculate flavour-independent parts of cross section.
0913   virtual void sigmaKin();
0914 
0915   // Evaluate d(sigmaHat)/d(tHat).
0916   virtual double sigmaHat();
0917 
0918   // Select flavour, colour and anticolour.
0919   virtual void setIdColAcol();
0920 
0921   // Info on the subprocess.
0922   virtual string name()    const {return "f fbar -> gamma*/Z0 gamma";}
0923   virtual int    code()    const {return 243;}
0924   virtual string inFlux()  const {return "ffbarSame";}
0925   virtual int    id3Mass() const {return 23;}
0926 
0927 private:
0928 
0929   // Values stored for later use.
0930   double sigma0;
0931 
0932 };
0933 
0934 //==========================================================================
0935 
0936 // A derived class for f gamma -> gamma*/Z0 f.
0937 
0938 class Sigma2fgm2gmZf : public Sigma2ffbargmZggm {
0939 
0940 public:
0941 
0942   // Constructor.
0943   Sigma2fgm2gmZf() : sigma0() {}
0944 
0945   // Calculate flavour-independent parts of cross section.
0946   virtual void sigmaKin();
0947 
0948   // Evaluate d(sigmaHat)/d(tHat).
0949   virtual double sigmaHat();
0950 
0951   // Select flavour, colour and anticolour.
0952   virtual void setIdColAcol();
0953 
0954   // Info on the subprocess.
0955   virtual string name()    const {return "f gamma -> gamma*/Z0 f";}
0956   virtual int    code()    const {return 244;}
0957   virtual string inFlux()  const {return "fgm";}
0958   virtual int    id3Mass() const {return 23;}
0959 
0960 private:
0961 
0962   // Values stored for later use.
0963   double sigma0;
0964 
0965 };
0966 
0967 //==========================================================================
0968 
0969 // An intermediate class for f fbar -> W+- g/gamma and permutations.
0970 
0971 class Sigma2ffbarWggm : public Sigma2Process {
0972 
0973 public:
0974 
0975   // Constructor.
0976   Sigma2ffbarWggm() {}
0977 
0978   // Evaluate weight for gamma&/Z0 decay angle.
0979   virtual double weightDecay( Event& process, int iResBeg, int iResEnd);
0980 
0981 private:
0982 
0983 };
0984 
0985 //==========================================================================
0986 
0987 // A derived class for q qbar' -> W+- g.
0988 
0989 class Sigma2qqbar2Wg : public Sigma2ffbarWggm {
0990 
0991 public:
0992 
0993   // Constructor.
0994   Sigma2qqbar2Wg() : sigma0(), openFracPos(), openFracNeg() {}
0995 
0996   // Initialize process.
0997   virtual void initProc();
0998 
0999   // Calculate flavour-independent parts of cross section.
1000   virtual void sigmaKin();
1001 
1002   // Evaluate d(sigmaHat)/d(tHat).
1003   virtual double sigmaHat();
1004 
1005   // Select flavour, colour and anticolour.
1006   virtual void setIdColAcol();
1007 
1008   // Info on the subprocess.
1009   virtual string name()    const {return "q qbar' -> W+- g";}
1010   virtual int    code()    const {return 251;}
1011   virtual string inFlux()  const {return "ffbarChg";}
1012   virtual int    id3Mass() const {return 24;}
1013 
1014 private:
1015 
1016   // Values stored for later use.
1017   double sigma0, openFracPos, openFracNeg;
1018 
1019 };
1020 
1021 //==========================================================================
1022 
1023 // A derived class for q g -> W+- q'.
1024 
1025 class Sigma2qg2Wq : public Sigma2ffbarWggm {
1026 
1027 public:
1028 
1029   // Constructor.
1030   Sigma2qg2Wq() : sigma0(), openFracPos(), openFracNeg() {}
1031 
1032   // Initialize process.
1033   virtual void initProc();
1034 
1035   // Calculate flavour-independent parts of cross section.
1036   virtual void sigmaKin();
1037 
1038   // Evaluate d(sigmaHat)/d(tHat).
1039   virtual double sigmaHat();
1040 
1041   // Select flavour, colour and anticolour.
1042   virtual void setIdColAcol();
1043 
1044   // Info on the subprocess.
1045   virtual string name()    const {return "q g-> W+- q'";}
1046   virtual int    code()    const {return 252;}
1047   virtual string inFlux()  const {return "qg";}
1048   virtual int    id3Mass() const {return 24;}
1049 
1050 private:
1051 
1052   // Values stored for later use.
1053   double sigma0, openFracPos, openFracNeg;
1054 
1055 };
1056 
1057 //==========================================================================
1058 
1059 // A derived class for f fbar' -> W+- gamma.
1060 
1061 class Sigma2ffbar2Wgm : public Sigma2ffbarWggm {
1062 
1063 public:
1064 
1065   // Constructor.
1066   Sigma2ffbar2Wgm() : sigma0(), openFracPos(), openFracNeg() {}
1067 
1068   // Initialize process.
1069   virtual void initProc();
1070 
1071   // Calculate flavour-independent parts of cross section.
1072   virtual void sigmaKin();
1073 
1074   // Evaluate d(sigmaHat)/d(tHat).
1075   virtual double sigmaHat();
1076 
1077   // Select flavour, colour and anticolour.
1078   virtual void setIdColAcol();
1079 
1080   // Info on the subprocess.
1081   virtual string name()    const {return "f fbar' -> W+- gamma";}
1082   virtual int    code()    const {return 253;}
1083   virtual string inFlux()  const {return "ffbarChg";}
1084   virtual int    id3Mass() const {return 24;}
1085 
1086 private:
1087 
1088   // Values stored for later use.
1089   double sigma0, openFracPos, openFracNeg;
1090 
1091 };
1092 
1093 //==========================================================================
1094 
1095 // A derived class for f gamma -> W+- f'.
1096 
1097 class Sigma2fgm2Wf : public Sigma2ffbarWggm {
1098 
1099 public:
1100 
1101   // Constructor.
1102   Sigma2fgm2Wf() : sigma0(), openFracPos(), openFracNeg() {}
1103 
1104   // Initialize process.
1105   virtual void initProc();
1106 
1107   // Calculate flavour-independent parts of cross section.
1108   virtual void sigmaKin();
1109 
1110   // Evaluate d(sigmaHat)/d(tHat).
1111   virtual double sigmaHat();
1112 
1113   // Select flavour, colour and anticolour.
1114   virtual void setIdColAcol();
1115 
1116   // Info on the subprocess.
1117   virtual string name()    const {return "f gamma -> W+- f'";}
1118   virtual int    code()    const {return 254;}
1119   virtual string inFlux()  const {return "fgm";}
1120   virtual int    id3Mass() const {return 24;}
1121 
1122 private:
1123 
1124   // Values stored for later use.
1125   double sigma0, openFracPos, openFracNeg;
1126 
1127 };
1128 //==========================================================================
1129 
1130 // A derived class for gamma gamma -> f fbar.
1131 
1132 class Sigma2gmgm2ffbar : public Sigma2Process {
1133 
1134 public:
1135 
1136   // Constructor.
1137   Sigma2gmgm2ffbar(int idIn, int codeIn) : idNew(idIn), codeSave(codeIn),
1138     idMass(), idNow(), ef4(), s34Avg(), sigTU(), sigma(), openFracPair() {}
1139 
1140   // Initialize process.
1141   virtual void initProc();
1142 
1143   // Calculate flavour-independent parts of cross section.
1144   virtual void sigmaKin();
1145 
1146   // Evaluate d(sigmaHat)/d(tHat).
1147   virtual double sigmaHat() {return sigma;}
1148 
1149   // Select flavour, colour and anticolour.
1150   virtual void setIdColAcol();
1151 
1152   // Info on the subprocess.
1153   virtual string name()    const {return nameSave;}
1154   virtual int    code()    const {return codeSave;}
1155   virtual string inFlux()  const {return "gmgm";}
1156   virtual int    id3Mass() const {return idMass;}
1157   virtual int    id4Mass() const {return idMass;}
1158 
1159 private:
1160 
1161   // Member variables.
1162   int    idNew, codeSave, idMass, idNow;
1163   string nameSave;
1164   double ef4, s34Avg, sigTU, sigma, openFracPair;
1165 
1166 };
1167 
1168 //==========================================================================
1169 
1170 // A derived class for g gamma -> q qbar (q = u, d, s, c, b).
1171 
1172 class Sigma2ggm2qqbar : public Sigma2Process {
1173 
1174 public:
1175 
1176   // Constructor.
1177   Sigma2ggm2qqbar(int idIn, int codeIn, string inFluxIn = "ggm")
1178     : idNew(idIn), codeSave(codeIn), idMass(), idNow(), inFluxSave(inFluxIn),
1179     ef2(), s34Avg(), sigTU(), sigma(), openFracPair() {}
1180 
1181   // Initialize process.
1182   virtual void initProc();
1183 
1184   // Calculate flavour-independent parts of cross section.
1185   virtual void sigmaKin();
1186 
1187   // Evaluate d(sigmaHat)/d(tHat).
1188   virtual double sigmaHat() {return sigma;}
1189 
1190   // Select flavour, colour and anticolour.
1191   virtual void setIdColAcol();
1192 
1193   // Info on the subprocess.
1194   virtual string name()    const {return nameSave;}
1195   virtual int    code()    const {return codeSave;}
1196   virtual string inFlux()  const {return inFluxSave;}
1197   virtual int    id3Mass() const {return idMass;}
1198   virtual int    id4Mass() const {return idMass;}
1199 
1200 private:
1201 
1202   // Member variables.
1203   int    idNew, codeSave, idMass, idNow;
1204   string nameSave, inFluxSave;
1205   double ef2, s34Avg, sigTU, sigma, openFracPair;
1206 
1207 };
1208 
1209 //==========================================================================
1210 
1211 // A derived class for q gamma -> q g (q = u, d, s, c, b).
1212 // Use massless approximation also for Q since no alternative.
1213 
1214 class Sigma2qgm2qg : public Sigma2Process {
1215 
1216 public:
1217 
1218   // Constructor.
1219   Sigma2qgm2qg(int codeIn, string inFluxIn = "qgm")
1220     : codeSave(codeIn), sigUS(), sigma0(), inFluxSave(inFluxIn) {}
1221 
1222   // Initialize process according to in flux.
1223   virtual void initProc();
1224 
1225   // Calculate flavour-independent parts of cross section.
1226   virtual void sigmaKin();
1227 
1228   // Evaluate d(sigmaHat)/d(tHat).
1229   virtual double sigmaHat();
1230 
1231   // Select flavour, colour and anticolour.
1232   virtual void setIdColAcol();
1233 
1234   // Info on the subprocess.
1235   virtual string name()   const {return nameSave;}
1236   virtual int    code()   const {return codeSave;}
1237   virtual string inFlux() const {return inFluxSave;}
1238 
1239 private:
1240 
1241   // Values stored for later use.
1242   int    codeSave;
1243   double sigUS, sigma0;
1244   string nameSave, inFluxSave;
1245 
1246 };
1247 
1248 //==========================================================================
1249 
1250 // A derived class for q gamma -> q gamma (q = u, d, s, c, b).
1251 // Use massless approximation also for Q since no alternative.
1252 
1253 class Sigma2qgm2qgm : public Sigma2Process {
1254 
1255 public:
1256 
1257   // Constructor.
1258   Sigma2qgm2qgm(int codeIn, string inFluxIn = "qgm")
1259     : codeSave(codeIn), sigUS(), sigma0(), inFluxSave(inFluxIn) {}
1260 
1261   // Initialize process.
1262   virtual void initProc();
1263 
1264   // Calculate flavour-independent parts of cross section.
1265   virtual void sigmaKin();
1266 
1267   // Evaluate d(sigmaHat)/d(tHat).
1268   virtual double sigmaHat();
1269 
1270   // Select flavour, colour and anticolour.
1271   virtual void setIdColAcol();
1272 
1273   // Info on the subprocess.
1274   virtual string name()   const {return nameSave;}
1275   virtual int    code()   const {return codeSave;}
1276   virtual string inFlux() const {return inFluxSave;}
1277 
1278 private:
1279 
1280   // Values stored for later use.
1281   int    codeSave;
1282   double sigUS, sigma0;
1283   string nameSave, inFluxSave;
1284 
1285 };
1286 
1287 //==========================================================================
1288 
1289 } // end namespace Pythia8
1290 
1291 #endif // Pythia8_SigmaEW_H