Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-10 09:20:13

0001 // StandardModel.h is a part of the PYTHIA event generator.
0002 // Copyright (C) 2025 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 // This file gives access to some Standard Model parameters.
0007 // AlphaStrong: fix or first-, second- or third-order running alpha_strong.
0008 
0009 #ifndef Pythia8_StandardModel_H
0010 #define Pythia8_StandardModel_H
0011 
0012 #include "Pythia8/Basics.h"
0013 #include "Pythia8/PythiaStdlib.h"
0014 #include "Pythia8/Settings.h"
0015 
0016 namespace Pythia8 {
0017 
0018 //==========================================================================
0019 
0020 // The AlphaStrong class calculates the alpha_strong value at an arbitrary
0021 // scale, given the value at m_Z, to first, second or third order.
0022 
0023 class AlphaStrong {
0024 
0025 public:
0026 
0027   // Constructors.
0028   AlphaStrong() : isInit(false), order(0), nfmax(),
0029     Lambda3Save(0.), Lambda4Save(0.), Lambda5Save(0.), Lambda6Save(0.),
0030     Lambda3Save2(0.), Lambda4Save2(0.), Lambda5Save2(0.), Lambda6Save2(0.),
0031     scale2Min(0.), mc(0.), mb(0.), mt(0.), mc2(0.), mb2(0.), mt2(0.), useCMW(),
0032     lastCallToFull(false), valueRef(0.), valueNow(0.), scale2Now(0.) {}
0033 
0034   // Destructor.
0035   virtual ~AlphaStrong() {}
0036 
0037   // Initialization for given value at M_Z and given order.
0038   virtual void init(double valueIn = 0.12, int orderIn = 1, int nfmaxIn = 6,
0039     bool useCMWIn = false, double valueMaxIn = -1., double renormShiftIn = 0.);
0040 
0041   // Set flavour threshold values: m_c, m_b, m_t.
0042   virtual void setThresholds(double mcIn, double mbIn, double mtIn) {
0043     mt=mtIn; mb=min(mt,mbIn); mc=min(mb,mcIn);}
0044 
0045   // alpha_S value and Lambda values.
0046   double alphaS(double scale2);
0047   double alphaS1Ord(double scale2);
0048   double alphaS2OrdCorr(double scale2);
0049   double Lambda3() const { return Lambda3Save; }
0050   double Lambda4() const { return Lambda4Save; }
0051   double Lambda5() const { return Lambda5Save; }
0052   double Lambda6() const { return (nfmax >= 6) ? Lambda6Save : Lambda5Save; }
0053 
0054   // Info: tell which scales we use for flavour thresholds.
0055   double muThres(int idQ);
0056   double muThres2(int idQ);
0057 
0058   // Return the CMW factor (for nF between 3 and 6).
0059   double facCMW( int nFin);
0060 
0061   // Return the alphaSmax value.
0062   double alphaSmax() { return valueMax; }
0063 
0064   // Return the poleShift value.
0065   double renormShift() { return renormShiftSave; }
0066 
0067 // Protected data members: accessible to derived classes.
0068 protected:
0069 
0070   // Initialization data member.
0071   bool   isInit;
0072 
0073   // Running order and max number of flavours to use in running.
0074   int    order, nfmax;
0075 
0076   // Lambda values.
0077   double Lambda3Save, Lambda4Save, Lambda5Save, Lambda6Save;
0078   double Lambda3Save2, Lambda4Save2, Lambda5Save2, Lambda6Save2;
0079 
0080   // Smallest allowed renormalization scale.
0081   double scale2Min;
0082 
0083   // Flavour thresholds.
0084   static const double MZ;
0085   double mc, mb, mt;
0086   double mc2, mb2, mt2;
0087 
0088   // CMW rescaling factors.
0089   bool useCMW;
0090   static const double FACCMW3, FACCMW4, FACCMW5, FACCMW6;
0091 
0092   // Safety margins to avoid getting too close to LambdaQCD.
0093   static const double SAFETYMARGIN1, SAFETYMARGIN2;
0094 
0095 // Private data members: not accessible to derived classes.
0096 private:
0097 
0098   // Private constants: could only be changed in the code itself.
0099   static const int    NITER;
0100 
0101   // Private data members.
0102   bool   lastCallToFull;
0103   double valueRef, valueNow, scale2Now;
0104   double valueMax{-1.}, renormShiftSave{0.};
0105 
0106 };
0107 
0108 //==========================================================================
0109 
0110 // The AlphaEM class calculates the alpha_electromagnetic value at an
0111 // arbitrary scale, given the value at 0 and m_Z, to zeroth or first order.
0112 
0113 class AlphaEM {
0114 
0115 public:
0116 
0117   // Constructors.
0118   AlphaEM() : order(), alpEM0(), alpEMmZ(), mZ2(), bRun(), alpEMstep() {}
0119 
0120   // Initialization for a given order.
0121   void init(int orderIn, Settings* settingsPtr);
0122 
0123   // alpha_EM value.
0124   double alphaEM(double scale2);
0125 
0126 private:
0127 
0128   // Constants: could only be changed in the code itself.
0129   static const double MZ, Q2STEP[5], BRUNDEF[5];
0130 
0131   // Data members.
0132   int    order;
0133   double alpEM0, alpEMmZ, mZ2, bRun[5], alpEMstep[5];
0134 
0135 };
0136 
0137 //==========================================================================
0138 
0139 // The CoupSM class stores and returns electroweak couplings,
0140 // including Cabibbo-Kobayashi-Maskawa mass mixing matrix elements.
0141 
0142 class CoupSM {
0143 
0144 public:
0145 
0146   // Constructor.
0147   CoupSM() : s2tW(), c2tW(), s2tWbar(), GFermi(), vfSave(), lfSave(), rfSave(),
0148     ef2Save(), vf2Save(), af2Save(), efvfSave(), vf2af2Save(), VCKMsave(),
0149     V2CKMsave(), V2CKMout(), rndmPtr() {}
0150 
0151   virtual ~CoupSM() {}
0152 
0153   // Initialize, normally from Pythia::init().
0154   void init(Settings& settings, Rndm* rndmPtrIn);
0155 
0156   // alpha_S value and Lambda values.
0157   double alphaS(double scale2) {return alphaSlocal.alphaS(scale2);}
0158   double alphaS1Ord(double scale2) {return alphaSlocal.alphaS1Ord(scale2);}
0159   double alphaS2OrdCorr(double scale2) {
0160     return alphaSlocal.alphaS2OrdCorr(scale2);}
0161   double Lambda3() const {return alphaSlocal.Lambda3();}
0162   double Lambda4() const {return alphaSlocal.Lambda4();}
0163   double Lambda5() const {return alphaSlocal.Lambda5();}
0164 
0165   // Return alpha_EM value.
0166   double alphaEM(double scale2) {return alphaEMlocal.alphaEM(scale2);}
0167 
0168   // Return electroweak mixing angle and Fermi constant.
0169   double sin2thetaW() {return s2tW;}
0170   double cos2thetaW() {return c2tW;}
0171   double sin2thetaWbar() {return s2tWbar;}
0172   double GF() {return GFermi;}
0173 
0174   // Return electroweak couplings of quarks and leptons.
0175   double ef(int idAbs) {return efSave[idAbs];}
0176   double vf(int idAbs) {return vfSave[idAbs];}
0177   double af(int idAbs) {return afSave[idAbs];}
0178   double t3f(int idAbs) {return 0.5*afSave[idAbs];}
0179   double lf(int idAbs) {return lfSave[idAbs];}
0180   double rf(int idAbs) {return rfSave[idAbs];}
0181 
0182   // Return some squared couplings and other combinations.
0183   double ef2(int idAbs) {return ef2Save[idAbs];}
0184   double vf2(int idAbs) {return vf2Save[idAbs];}
0185   double af2(int idAbs) {return af2Save[idAbs];}
0186   double efvf(int idAbs) {return efvfSave[idAbs];}
0187   double vf2af2(int idAbs) {return vf2af2Save[idAbs];}
0188 
0189   // Return CKM value or square:
0190   // first index 1/2/3/4 = u/c/t/t', second 1/2/3/4 = d/s/b/b'.
0191   double VCKMgen(int genU, int genD) {return VCKMsave[genU][genD];}
0192   double V2CKMgen(int genU, int genD) {return V2CKMsave[genU][genD];}
0193 
0194   // Return CKM value or square for incoming flavours (sign irrelevant).
0195   double VCKMid(int id1, int id2);
0196   double V2CKMid(int id1, int id2);
0197 
0198   // Return CKM sum of squares for given inflavour, or random outflavour.
0199   double V2CKMsum(int id) {return V2CKMout[abs(id)];}
0200   int    V2CKMpick(int id);
0201 
0202 protected:
0203 
0204   // Constants: could only be changed in the code itself.
0205   static const double efSave[20], afSave[20];
0206 
0207   // Couplings and VCKM matrix (index 0 not used).
0208   double s2tW, c2tW, s2tWbar, GFermi, vfSave[20], lfSave[20], rfSave[20],
0209          ef2Save[20], vf2Save[20], af2Save[20], efvfSave[20],
0210          vf2af2Save[20], VCKMsave[5][5], V2CKMsave[5][5], V2CKMout[20];
0211 
0212   // Pointer to the random number generator.
0213   Rndm*       rndmPtr;
0214 
0215   // An AlphaStrong instance for general use (but not MPI, ISR, FSR).
0216   AlphaStrong alphaSlocal;
0217 
0218   // An AlphaEM instance for general use (but not MPI, ISR, FSR).
0219   AlphaEM     alphaEMlocal;
0220 
0221 };
0222 
0223 // Backwards compatability for MG5ME plugin interface with Pythia.
0224 typedef CoupSM Couplings;
0225 
0226 //==========================================================================
0227 
0228 // The AlphaSUN class calculates the running coupling alpha in an SU(N) model,
0229 // as a function of the scale, to first, second or third order.
0230 // Formally part of beyond-the-Standard-Model scenarios, e.g. Hidden Valleys,
0231 // but put here since it is closely related to alpha_strong.
0232 
0233 class AlphaSUN {
0234 
0235 public:
0236 
0237   // Constructors.
0238   AlphaSUN() : nC(0), nF(0), order(0), LambdaSave(0.), Lambda2Save(0.),
0239     scale2Min(0.), b0(0.), b1(0.), b2(0.) {}
0240 
0241   // Destructor.
0242   virtual ~AlphaSUN() {}
0243 
0244   // Initialization for given value at M_Z and given order.
0245   virtual void initAlpha(int nCin, int nFin, int orderIn = 1,
0246     double alphaIn = 0.12, double scaleIn = 91.188) {
0247      initColFac( nCin, nFin, orderIn);
0248      findLambda(alphaIn, scaleIn); }
0249 
0250   // Initialization for given value of Lambda and given order.
0251   virtual void initLambda(int nCin, int nFin, int orderIn = 1,
0252     double LambdaIn = 0.2) { initColFac( nCin, nFin, orderIn);
0253     LambdaSave = LambdaIn; Lambda2Save = pow2(LambdaSave);
0254     scale2Min = (order == 1) ? pow2(SAFETYMARGIN1) * Lambda2Save
0255       : pow2(SAFETYMARGIN2) * Lambda2Save; }
0256 
0257   // alpha(Q^2), whole or split, and Lambda values.
0258   double alpha(double scale2in);
0259   double alpha1Ord(double scale2in);
0260   double alpha2OrdCorr(double scale2in);
0261   double Lambda() const { return LambdaSave; }
0262 
0263 private:
0264 
0265   // Constants: could only be changed in the code itself.
0266   static const int    NITER;
0267   static const double SAFETYMARGIN1, SAFETYMARGIN2;
0268 
0269   // Method to initialize required constants in the SU(N) group.
0270   void initColFac(int nCin, int nFin, int orderIn);
0271 
0272   // Method to convert an alpha at a scale into a Lambda.
0273   void findLambda(double alphaIn, double scaleIn);
0274 
0275   // Number of colours and flavours, and running of alpha.
0276   int    nC, nF, order;
0277   double LambdaSave, Lambda2Save, scale2Min, b0, b1, b2;
0278 
0279 };
0280 
0281 //==========================================================================
0282 
0283 } // end namespace Pythia8
0284 
0285 #endif // Pythia8_StandardModel_H