Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // SigmaProcess.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 hard-process differential cross sections.
0007 // SigmaProcess: base class for cross sections.
0008 // Sigma0Process: base class for unresolved processes, derived from above.
0009 // Sigma1Process: base class for 2 -> 1 processes, derived from above.
0010 // Sigma2Process: base class for 2 -> 2 processes, derived from above.
0011 // Sigma3Process: base class for 2 -> 3 processes, derived from above.
0012 // SigmaLHAProcess: wrapper class for Les Houches Accord external input.
0013 // Actual physics processes are found in separate files:
0014 // SigmaQCD for QCD processes;
0015 // SigmaEW for electroweak processes (including photon production);
0016 // SigmaOnia for charmonium and bottomonium processes;
0017 // SigmaHiggs for Higgs processes;
0018 // SigmaSUSY for supersymmetric production;
0019 // SigmaLeftRightSym for  processes in left-right-symmetric scenarios;
0020 // SigmaLeptoquark for leptoquark production.
0021 // SigmaExtraDim for processes in scenarios for extra dimensions;
0022 // SigmaGeneric for generic scalar/fermion/vector pair production.
0023 
0024 #ifndef Pythia8_SigmaProcess_H
0025 #define Pythia8_SigmaProcess_H
0026 
0027 #include "Pythia8/Basics.h"
0028 #include "Pythia8/BeamParticle.h"
0029 #include "Pythia8/Event.h"
0030 #include "Pythia8/Info.h"
0031 #include "Pythia8/SigmaLowEnergy.h"
0032 #include "Pythia8/LesHouches.h"
0033 #include "Pythia8/ParticleData.h"
0034 #include "Pythia8/PartonDistributions.h"
0035 #include "Pythia8/PhysicsBase.h"
0036 #include "Pythia8/PythiaComplex.h"
0037 #include "Pythia8/PythiaStdlib.h"
0038 #include "Pythia8/ResonanceWidths.h"
0039 #include "Pythia8/Settings.h"
0040 #include "Pythia8/SigmaTotal.h"
0041 #include "Pythia8/StandardModel.h"
0042 #include "Pythia8/SLHAinterface.h"
0043 #include "Pythia8/SusyLesHouches.h"
0044 
0045 namespace Pythia8 {
0046 
0047 //==========================================================================
0048 
0049 // InBeam is a simple helper class for partons and their flux in a beam.
0050 
0051 class InBeam {
0052 
0053 public:
0054 
0055   // Constructor.
0056   InBeam( int idIn = 0) : id(idIn), pdf(0.) {}
0057 
0058   // Values.
0059   int    id;
0060   double pdf;
0061 
0062 };
0063 
0064 //==========================================================================
0065 
0066 // InPair is a simple helper class for colliding parton pairs and their flux.
0067 
0068 class InPair {
0069 
0070 public:
0071 
0072   // Constructor.
0073   InPair( int idAIn = 0, int idBIn = 0) : idA(idAIn), idB(idBIn),
0074     pdfA(0.), pdfB(0.), pdfSigma(0.) {}
0075 
0076   // Values.
0077   int    idA, idB;
0078   double pdfA, pdfB, pdfSigma;
0079 
0080 };
0081 
0082 //==========================================================================
0083 
0084 // SigmaProcess is the base class for cross section calculations.
0085 
0086 class SigmaProcess : public PhysicsBase {
0087 
0088 public:
0089 
0090   // Destructor.
0091   virtual ~SigmaProcess() {}
0092 
0093   // Perform simple initialization and store pointers.
0094   void init(BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn,
0095     SLHAinterface* slhaInterfacePtrIn = 0);
0096 
0097   // Store or replace Les Houches pointer.
0098   void setLHAPtr( LHAupPtr lhaUpPtrIn) {lhaUpPtr = lhaUpPtrIn;}
0099 
0100   // Switch to new beam particle identities; for similar hadrons only.
0101   void updateBeamIDs() { idA = beamAPtr->id(); idB = beamBPtr->id();
0102     mA = beamAPtr->m(); mB = beamBPtr->m();}
0103 
0104   // Initialize process. Only used for some processes.
0105   virtual void initProc() {}
0106 
0107   // Set up allowed flux of incoming partons. Default is no flux.
0108   virtual bool initFlux();
0109 
0110   // Input and complement kinematics for resolved 2 -> 1 process.
0111   // Usage: set1Kin( x1in, x2in, sHin).
0112   virtual void set1Kin( double , double , double ) {}
0113 
0114   // Input and complement kinematics for resolved 2 -> 2 process.
0115   // Usage: set2Kin( x1in, x2in, sHin, tHin, m3in, m4in, runBW3in, runBW4in).
0116   virtual void set2Kin( double , double , double , double , double ,
0117     double, double, double ) {}
0118 
0119   // Ditto, but for Multiparton Interactions applications, so different input.
0120   // Usage: set2KinMPI( x1in, x2in, sHin, tHin, uHin,
0121   //                   alpSin, alpEMin, needMasses, m3in, m4in)
0122   virtual void set2KinMPI( double , double , double , double ,
0123     double , double , double , bool , double , double ) {}
0124 
0125   // Input and complement kinematics for resolved 2 -> 3 process.
0126   // Usage: set3Kin( x1in, x2in, sHin, p3prel, p4prel, p5prel,
0127   //                 m3in, m4in, m5in, runBW3in, runBW4in, runBW5in);
0128   virtual void set3Kin( double , double , double , Vec4 , Vec4 , Vec4 ,
0129     double , double , double , double , double , double ) {}
0130 
0131   // Calculate flavour-independent parts of cross section.
0132   virtual void sigmaKin() {}
0133 
0134   // Evaluate sigma for unresolved, sigmaHat(sHat) for 2 -> 1 processes,
0135   // d(sigmaHat)/d(tHat) for (resolved) 2 -> 2 processes, and |M|^2 for
0136   // 2 -> 3 processes. Answer in "native" units, either mb or GeV^-2.
0137   virtual double sigmaHat() {return 0.;}
0138 
0139   // Wrapper to sigmaHat, to (a) store current incoming flavours and
0140   // (b) convert from GeV^-2 to mb where required.
0141   // For 2 -> 1/2 also (c) convert from from |M|^2 to d(sigmaHat)/d(tHat).
0142   virtual double sigmaHatWrap(int id1in = 0, int id2in = 0) {
0143     id1 = id1in; id2 = id2in;
0144     return ( convert2mb() ? CONVERT2MB * sigmaHat() : sigmaHat() ); }
0145 
0146   // Convolute above with parton flux and K factor. Sum over open channels.
0147   // Possibly different PDF in initialization phase or no sampling for x_gamma
0148   // (photons in leptons).
0149   virtual double sigmaPDF(bool initPS = false, bool samexGamma = false,
0150     bool useNewXvalues = false, double x1New = 0., double x2New = 0.);
0151 
0152   // Select incoming parton channel and extract parton densities (resolved).
0153   void pickInState(int id1in = 0, int id2in = 0);
0154 
0155   // Select flavour, colour and anticolour.
0156   virtual void setIdColAcol() {}
0157 
0158   // Perform kinematics for a Multiparton Interaction, in its rest frame.
0159   virtual bool final2KinMPI( int = 0, int = 0, Vec4 = 0., Vec4 = 0.,
0160     double = 0., double = 0.) {return true;}
0161 
0162   // Evaluate weight for simultaneous flavours (only gamma*/Z0 gamma*/Z0).
0163   // Usage: weightDecayFlav( process).
0164   virtual double weightDecayFlav( Event&) {return 1.;}
0165 
0166   // Evaluate weight for decay angular configuration.
0167   // Usage: weightDecay( process, iResBeg, iResEnd), where
0168   // iResBeg <= i < iResEnd is range of sister partons to test decays of.
0169   virtual double weightDecay( Event&, int, int) {return 1.;}
0170 
0171   // Set scale, when that is missing for an external LHA process.
0172   virtual void setScale() {}
0173 
0174   // Process name and code, and the number of final-state particles.
0175   virtual string name()            const {return "unnamed process";}
0176   virtual int    code()            const {return 0;}
0177   virtual int    nFinal()          const {return 2;}
0178 
0179   // Need to know which incoming partons to set up interaction for.
0180   virtual string inFlux()          const {return "unknown";}
0181 
0182   // Need to know whether to convert cross section answer from GeV^-2 to mb.
0183   virtual bool   convert2mb()      const {return true;}
0184 
0185   // For 2 -> 2 process optional conversion from |M|^2 to d(sigmaHat)/d(tHat).
0186   virtual bool   convertM2()       const {return false;}
0187 
0188   // Special treatment needed for Les Houches processes.
0189   virtual bool   isLHA()           const {return false;}
0190 
0191   // Special treatment needed for elastic and diffractive processes.
0192   virtual bool   isNonDiff()       const {return false;}
0193   virtual bool   isResolved()      const {return true;}
0194   virtual bool   isDiffA()         const {return false;}
0195   virtual bool   isDiffB()         const {return false;}
0196   virtual bool   isDiffC()         const {return false;}
0197 
0198   // Special treatment needed for SUSY processes.
0199   virtual bool   isSUSY()          const {return false;}
0200 
0201   // Special treatment needed if negative cross sections allowed.
0202   virtual bool   allowNegativeSigma() const {return false;}
0203 
0204   // Flavours in 2 -> 2/3 processes where masses needed from beginning.
0205   // (For a light quark masses will be used in the final kinematics,
0206   // but not at the matrix-element level. For a gluon no masses at all.)
0207   virtual int    id3Mass()         const {return 0;}
0208   virtual int    id4Mass()         const {return 0;}
0209   virtual int    id5Mass()         const {return 0;}
0210 
0211   // Special treatment needed if process contains an s-channel resonance.
0212   virtual int    resonanceA()      const {return 0;}
0213   virtual int    resonanceB()      const {return 0;}
0214 
0215   // 2 -> 2 and 2 -> 3 processes only through s-channel exchange.
0216   virtual bool   isSChannel()      const {return false;}
0217 
0218   // NOAM: Insert an intermediate resonance in 2 -> 1 -> 2 (or 3) listings.
0219   virtual int    idSChannel()      const {return 0;}
0220 
0221   // QCD 2 -> 3 processes need special phase space selection machinery.
0222   virtual bool   isQCD3body()      const {return false;}
0223 
0224   // Special treatment in 2 -> 3 with two massive propagators.
0225   virtual int    idTchan1()        const {return 0;}
0226   virtual int    idTchan2()        const {return 0;}
0227   virtual double tChanFracPow1()   const {return 0.3;}
0228   virtual double tChanFracPow2()   const {return 0.3;}
0229   virtual bool   useMirrorWeight() const {return false;}
0230 
0231   // Special process-specific gamma*/Z0 choice if >=0 (e.g. f fbar -> H0 Z0).
0232   virtual int    gmZmode()         const {return -1;}
0233 
0234   // Tell whether tHat and uHat are swapped (= same as swap 3 and 4).
0235   bool swappedTU()          const {return swapTU;}
0236 
0237   // Give back particle properties: flavours, colours, masses, or all.
0238   int    id(int i)          const {return idSave[i];}
0239   int    col(int i)         const {return colSave[i];}
0240   int    acol(int i)        const {return acolSave[i];}
0241   double m(int i)           const {return mSave[i];}
0242   Particle getParton(int i) const {return parton[i];}
0243 
0244   // Give back couplings and parton densities.
0245   // Not all known for nondiffractive.
0246   double Q2Ren()            const {return Q2RenSave;}
0247   double alphaEMRen()       const {return alpEM;}
0248   double alphaSRen()        const {return alpS;}
0249   double Q2Fac()            const {return Q2FacSave;}
0250   double pdf1()             const {return pdf1Save;}
0251   double pdf2()             const {return pdf2Save;}
0252 
0253   // Give back angles; relevant only for multipe-interactions processes.
0254   double thetaMPI()         const {return atan2( sinTheta, cosTheta);}
0255   double phiMPI()           const {return phi;}
0256   double sHBetaMPI()        const {return sHBeta;}
0257   double pT2MPI()           const {return pT2Mass;}
0258   double pTMPIFin()         const {return pTFin;}
0259 
0260   // Save and load kinematics for trial interactions
0261   void saveKin() {
0262     for (int i = 0; i < 12; i++) { partonT[i] = parton[i];
0263       mSaveT[i] = mSave[i]; }
0264     pTFinT = pTFin; phiT = phi; cosThetaT = cosTheta; sinThetaT = sinTheta; }
0265   void loadKin() {
0266     for (int i = 0; i < 12; i++) { parton[i] = partonT[i];
0267     mSave[i] = mSaveT[i]; }
0268     pTFin = pTFinT; cosTheta = cosThetaT; sinTheta = sinThetaT; phi = phiT;
0269   }
0270   void swapKin() {
0271     for (int i = 0; i < 12; i++) { swap(parton[i], partonT[i]);
0272                                   swap(mSave[i], mSaveT[i]); }
0273     swap(pTFin, pTFinT); swap(cosTheta, cosThetaT);
0274     swap(sinTheta, sinThetaT); swap(phi, phiT); }
0275 
0276   // Set the incoming ids for diffraction.
0277   virtual void setIdInDiff(int, int) {}
0278 
0279 protected:
0280 
0281   // Constructor.
0282   SigmaProcess() : slhaPtr(0), lhaUpPtr(0), doVarE(), nQuarkIn(),
0283     renormScale1(), renormScale2(), renormScale3(), renormScale3VV(),
0284     factorScale1(), factorScale2(), factorScale3(), factorScale3VV(),
0285     Kfactor(), mcME(), mbME(), mmuME(), mtauME(), renormMultFac(),
0286     renormFixScale(), factorMultFac(), factorFixScale(), higgsH1parity(),
0287     higgsH2parity(), higgsA3parity(), higgsH1eta(), higgsH2eta(), higgsA3eta(),
0288     higgsH1phi(), higgsH2phi(), higgsA3phi(), idA(), idB(), mA(), mB(),
0289     isLeptonA(), isLeptonB(), hasLeptonBeams(), beamA2gamma(), beamB2gamma(),
0290     hasGamma(), mH(), sH(), sH2(), x1Save(), x2Save(), sigmaSumSave(),
0291     id1(), id2(), id3(), id4(), id5(), idSave(), colSave(), acolSave(),
0292     mSave(), cosTheta(), sinTheta(), phi(), sHMass(), sHBeta(), pT2Mass(),
0293     pTFin(), mSaveT(), pTFinT(), cosThetaT(), sinThetaT(), phiT(), mME(),
0294     swapTU() {
0295     for (int i = 0; i < 12; ++i) mSave[i] = 0.;
0296     Q2RenSave = alpEM = alpS = Q2FacSave = pdf1Save = pdf2Save = 0.; }
0297 
0298   // Constants: could only be changed in the code itself.
0299   static const double CONVERT2MB, MASSMARGIN, COMPRELERR;
0300   static const int    NCOMPSTEP;
0301 
0302   // Pointer to an SLHA object.
0303   SusyLesHouches* slhaPtr;
0304 
0305   // Pointer to LHAup for generating external events.
0306   LHAupPtr        lhaUpPtr;
0307 
0308   // Initialization data, normally only set once.
0309   bool   doVarE;
0310   int    nQuarkIn, renormScale1, renormScale2, renormScale3, renormScale3VV,
0311          factorScale1, factorScale2, factorScale3, factorScale3VV;
0312   double Kfactor, mcME, mbME, mmuME, mtauME, renormMultFac, renormFixScale,
0313          factorMultFac, factorFixScale;
0314 
0315   // CP violation parameters for Higgs sector, normally only set once.
0316   int    higgsH1parity, higgsH2parity, higgsA3parity;
0317   double higgsH1eta, higgsH2eta, higgsA3eta, higgsH1phi, higgsH2phi,
0318          higgsA3phi;
0319 
0320   // Information on incoming beams.
0321   int    idA, idB;
0322   double mA, mB;
0323   bool   isLeptonA, isLeptonB, hasLeptonBeams, beamA2gamma, beamB2gamma,
0324          hasGamma;
0325 
0326   // Partons in beams, with PDF's.
0327   vector<InBeam> inBeamA;
0328   vector<InBeam> inBeamB;
0329   void addBeamA(int idIn) {inBeamA.push_back(InBeam(idIn));}
0330   void addBeamB(int idIn) {inBeamB.push_back(InBeam(idIn));}
0331   int sizeBeamA() const {return inBeamA.size();}
0332   int sizeBeamB() const {return inBeamB.size();}
0333 
0334   // Allowed colliding parton pairs, with pdf's.
0335   vector<InPair> inPair;
0336   void addPair(int idAIn, int idBIn) {
0337     inPair.push_back(InPair(idAIn, idBIn));}
0338   int sizePair() const {return inPair.size();}
0339 
0340   // Store common subprocess kinematics quantities.
0341   double mH, sH, sH2;
0342 
0343   // Store Q2 renormalization and factorization scales, and related values.
0344   double Q2RenSave, alpEM, alpS, Q2FacSave, x1Save, x2Save, pdf1Save,
0345          pdf2Save, sigmaSumSave;
0346 
0347   // Store flavour, colour, anticolour, mass, angles and the whole particle.
0348   int      id1, id2, id3, id4, id5;
0349   int      idSave[12], colSave[12], acolSave[12];
0350   double   mSave[12], cosTheta, sinTheta, phi, sHMass, sHBeta, pT2Mass, pTFin;
0351   Particle parton[12];
0352 
0353   // Minimal set of saved kinematics for trial interactions when
0354   // using the x-dependent matter profile of multiparton interactions.
0355   Particle partonT[12];
0356   double   mSaveT[12], pTFinT, cosThetaT, sinThetaT, phiT;
0357 
0358   // Calculate and store all modified masses and four-vectors
0359   // intended for matrix elements. Return false if failed.
0360   virtual bool setupForME() {return true;}
0361   bool     setupForMEin();
0362   double   mME[12];
0363   Vec4     pME[12];
0364 
0365   // Store whether tHat and uHat are swapped (= same as swap 3 and 4).
0366   bool swapTU;
0367 
0368   // Set flavour, colour and anticolour.
0369   void setId( int id1in = 0, int id2in = 0, int id3in = 0, int id4in = 0,
0370     int id5in = 0) {idSave[1] = id1in; idSave[2] = id2in; idSave[3] = id3in;
0371     idSave[4] = id4in; idSave[5] = id5in;}
0372   void setColAcol( int col1 = 0, int acol1 = 0,
0373     int col2 = 0, int acol2 = 0, int col3 = 0, int acol3 = 0,
0374     int col4 = 0, int acol4 = 0, int col5 = 0, int acol5 = 0) {
0375     colSave[1] = col1; acolSave[1] = acol1; colSave[2] = col2;
0376     acolSave[2] = acol2; colSave[3] = col3; acolSave[3] = acol3;
0377     colSave[4] = col4; acolSave[4] = acol4; colSave[5] = col5;
0378     acolSave[5] = acol5; }
0379   void swapColAcol() { swap(colSave[1], acolSave[1]);
0380     swap(colSave[2], acolSave[2]); swap(colSave[3], acolSave[3]);
0381     swap(colSave[4], acolSave[4]); swap(colSave[5], acolSave[5]);}
0382   void swapCol1234() { swap(colSave[1], colSave[2]);
0383     swap(colSave[3], colSave[4]); swap(acolSave[1], acolSave[2]);
0384     swap(acolSave[3], acolSave[4]);}
0385   void swapCol12() { swap(colSave[1], colSave[2]);
0386     swap(acolSave[1], acolSave[2]);}
0387   void swapCol34() { swap(colSave[3], colSave[4]);
0388     swap(acolSave[3], acolSave[4]);}
0389 
0390   // Common code for top and Higgs secondary decay angular weights.
0391   double weightTopDecay( Event& process, int iResBeg, int iResEnd);
0392   double weightHiggsDecay( Event& process, int iResBeg, int iResEnd);
0393 
0394 };
0395 
0396 //==========================================================================
0397 
0398 // Sigma0Process is the base class for unresolved and minimum-bias processes.
0399 // It is derived from SigmaProcess.
0400 
0401 class Sigma0Process : public SigmaProcess {
0402 
0403 public:
0404 
0405   // Destructor.
0406   virtual ~Sigma0Process() {}
0407 
0408   // Number of final-state particles.
0409   virtual int    nFinal() const {return 2;};
0410 
0411   // No partonic flux to be set up.
0412   virtual bool   initFlux() {return true;}
0413 
0414   // Evaluate sigma for unresolved processes.
0415   virtual double sigmaHat() {return 0.;}
0416 
0417   // Since no PDF's there is no difference from above.
0418   virtual double sigmaPDF(bool, bool, bool, double, double )
0419     {return sigmaHat();}
0420 
0421   // Answer for these processes already in mb, so do not convert.
0422   virtual bool convert2mb() const {return false;}
0423 
0424   // Set the incoming ids for diffraction.
0425   virtual void setIdInDiff(int idAin, int idBin) { idA = idAin; idB = idBin; }
0426 
0427 protected:
0428 
0429   // Constructor.
0430   Sigma0Process() {}
0431 
0432 };
0433 
0434 //==========================================================================
0435 
0436 // Sigma1Process is the base class for 2 -> 1 processes.
0437 // It is derived from SigmaProcess.
0438 
0439 class Sigma1Process : public SigmaProcess {
0440 
0441 public:
0442 
0443   // Destructor.
0444   virtual ~Sigma1Process() {}
0445 
0446   // Number of final-state particles.
0447   virtual int    nFinal() const {return 1;};
0448 
0449   // Input and complement kinematics for resolved 2 -> 1 process.
0450   virtual void   set1Kin( double x1in, double x2in, double sHin) {
0451     store1Kin( x1in, x2in, sHin); sigmaKin();}
0452 
0453   // Evaluate sigmaHat(sHat) for resolved 2 -> 1 processes.
0454   virtual double sigmaHat() {return 0.;}
0455 
0456   // Wrapper to sigmaHat, to (a) store current incoming flavours,
0457   // (b) convert from GeV^-2 to mb where required, and
0458   // (c) convert from |M|^2 to d(sigmaHat)/d(tHat) where required.
0459   virtual double sigmaHatWrap(int id1in = 0, int id2in = 0);
0460 
0461 protected:
0462 
0463   // Constructor.
0464   Sigma1Process() {}
0465 
0466   // Store kinematics and set scales for resolved 2 -> 1 process.
0467   virtual void   store1Kin( double x1in, double x2in, double sHin);
0468 
0469   // Calculate modified masses and four-vectors for matrix elements.
0470   virtual bool   setupForME();
0471 
0472 };
0473 
0474 //==========================================================================
0475 
0476 // Sigma2Process is the base class for 2 -> 2 processes.
0477 // It is derived from SigmaProcess.
0478 
0479 class Sigma2Process : public SigmaProcess {
0480 
0481 public:
0482 
0483   // Destructor.
0484   virtual ~Sigma2Process() {}
0485 
0486   // Number of final-state particles.
0487   virtual int    nFinal() const {return 2;};
0488 
0489   // Input and complement kinematics for resolved 2 -> 2 process.
0490   virtual void   set2Kin( double x1in, double x2in, double sHin,
0491     double tHin, double m3in, double m4in, double runBW3in,
0492     double runBW4in) { store2Kin( x1in, x2in, sHin, tHin, m3in, m4in,
0493     runBW3in, runBW4in); sigmaKin();}
0494 
0495   // Ditto, but for Multiparton Interactions applications, so different input.
0496   virtual void   set2KinMPI( double x1in, double x2in, double sHin,
0497     double tHin, double uHin, double alpSin, double alpEMin,
0498     bool needMasses, double m3in, double m4in) {
0499     store2KinMPI( x1in, x2in, sHin, tHin, uHin, alpSin, alpEMin,
0500     needMasses, m3in, m4in); sigmaKin();}
0501 
0502   // Evaluate d(sigmaHat)/d(tHat) for resolved 2 -> 2 processes.
0503   virtual double sigmaHat() {return 0.;}
0504 
0505   // Wrapper to sigmaHat, to (a) store current incoming flavours,
0506   // (b) convert from GeV^-2 to mb where required, and
0507   // (c) convert from |M|^2 to d(sigmaHat)/d(tHat) where required.
0508   virtual double sigmaHatWrap(int id1in = 0, int id2in = 0) {
0509     id1 = id1in; id2 = id2in; double sigmaTmp = sigmaHat();
0510     if (convertM2())  sigmaTmp /= 16. * M_PI * sH2;
0511     if (convert2mb()) sigmaTmp *= CONVERT2MB;
0512     return sigmaTmp;}
0513 
0514   // Perform kinematics for a Multiparton Interaction, in its rest frame.
0515   virtual bool   final2KinMPI( int i1Res = 0, int i2Res = 0, Vec4 p1Res = 0.,
0516     Vec4 p2Res = 0., double m1Res = 0., double m2Res = 0.);
0517 
0518 protected:
0519 
0520   // Constructor.
0521   Sigma2Process() : tH(0.), uH(0.), tH2(0.), uH2(0.), m3(0.), s3(0.),
0522     m4(0.), s4(0.), pT2(0.), runBW3(0.), runBW4(0.) {}
0523 
0524   // Store kinematics and set scales for resolved 2 -> 2 process.
0525   virtual void   store2Kin( double x1in, double x2in, double sHin,
0526     double tHin, double m3in, double m4in, double runBW3in,
0527     double runBW4in);
0528   virtual void   store2KinMPI( double x1in, double x2in, double sHin,
0529     double tHin, double uHin, double alpSin, double alpEMin,
0530     bool needMasses, double m3in, double m4in);
0531 
0532   // Calculate modified masses and four-vectors for matrix elements.
0533   virtual bool   setupForME();
0534 
0535   // Store subprocess kinematics quantities.
0536   double tH, uH, tH2, uH2, m3, s3, m4, s4, pT2, runBW3, runBW4;
0537 
0538 };
0539 
0540 //==========================================================================
0541 
0542 // Sigma3Process is the base class for 2 -> 3 processes.
0543 // It is derived from SigmaProcess.
0544 
0545 class Sigma3Process : public SigmaProcess {
0546 
0547 public:
0548 
0549   // Destructor.
0550   virtual ~Sigma3Process() {}
0551 
0552   // Number of final-state particles.
0553   virtual int    nFinal() const {return 3;};
0554 
0555   // Input and complement kinematics for resolved 2 -> 3 process.
0556   virtual void   set3Kin( double x1in, double x2in, double sHin,
0557     Vec4 p3cmIn, Vec4 p4cmIn, Vec4 p5cmIn, double m3in, double m4in,
0558     double m5in, double runBW3in, double runBW4in, double runBW5in) {
0559     store3Kin( x1in, x2in, sHin, p3cmIn, p4cmIn, p5cmIn, m3in, m4in, m5in,
0560     runBW3in, runBW4in, runBW5in); sigmaKin();}
0561 
0562   // Evaluate d(sigmaHat)/d(tHat) for resolved 2 -> 3 processes.
0563   virtual double sigmaHat() {return 0.;}
0564 
0565 protected:
0566 
0567   // Constructor.
0568   Sigma3Process() : m3(), s3(), m4(), s4(), m5(), s5(), runBW3(),
0569     runBW4(), runBW5() {}
0570 
0571   // Store kinematics and set scales for resolved 2 -> 3 process.
0572   virtual void   store3Kin( double x1in, double x2in, double sHin,
0573     Vec4 p3cmIn, Vec4 p4cmIn, Vec4 p5cmIn, double m3in, double m4in,
0574     double m5in, double runBW3in, double runBW4in, double runBW5in);
0575 
0576   // Calculate modified masses and four-vectors for matrix elements.
0577   virtual bool   setupForME();
0578 
0579   // Store subprocess kinematics quantities.
0580   double m3, s3, m4, s4, m5, s5, runBW3, runBW4, runBW5;
0581   Vec4   p3cm, p4cm, p5cm;
0582 
0583 };
0584 
0585 //==========================================================================
0586 
0587 // SigmaLHAProcess is a wrapper class for Les Houches Accord external input.
0588 // It is derived from SigmaProcess.
0589 
0590 class SigmaLHAProcess : public SigmaProcess {
0591 
0592 public:
0593 
0594   // Constructor.
0595   SigmaLHAProcess() {}
0596 
0597   // Destructor.
0598   virtual ~SigmaLHAProcess() {}
0599 
0600   // No partonic flux to be set up.
0601   virtual bool   initFlux() {return true;}
0602 
0603   // Dummy function: action is put in PhaseSpaceLHA.
0604   virtual double sigmaPDF(bool, bool, bool, double, double ) {return 1.;}
0605 
0606   // Evaluate weight for decay angular configuration, where relevant.
0607   virtual double weightDecay( Event& process, int iResBeg, int iResEnd);
0608 
0609   // Set scale, when that is missing for an external LHA process.
0610   virtual void   setScale();
0611 
0612   // Info on the subprocess.
0613   virtual string name()     const {return "Les Houches User Process(es)";}
0614   virtual int    code()     const {return 9999;}
0615 
0616   // Number of final-state particles depends on current process choice.
0617   virtual int    nFinal()   const;
0618 
0619   // Answer for these processes not in GeV^-2, so do not do this conversion.
0620   virtual bool   convert2mb() const {return false;}
0621 
0622   // Ensure special treatment of Les Houches processes.
0623   virtual bool   isLHA()    const {return true;}
0624 
0625   // Special treatment needed if negative cross sections allowed.
0626   virtual bool   allowNegativeSigma() const {
0627     return (lhaUpPtr->strategy() < 0);}
0628 
0629 private:
0630 
0631 };
0632 
0633 //==========================================================================
0634 
0635 } // end namespace Pythia8
0636 
0637 #endif // Pythia8_SigmaProcess_H