Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:24:11

0001 // -*- C++ -*- 
0002 //
0003 // MatchboxCurrents.h is a part of Herwig - A multi-purpose Monte Carlo event generator
0004 // Copyright (C) 2002-2019 The Herwig Collaboration
0005 //
0006 // Herwig is licenced under version 3 of the GPL, see COPYING for details.
0007 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0008 //
0009 #ifndef Herwig_MatchboxCurrents_H
0010 #define Herwig_MatchboxCurrents_H
0011 //
0012 // This is the declaration of the MatchboxCurrents class.
0013 //
0014 
0015 #include "Herwig/MatrixElement/Matchbox/Utility/AmplitudeCache.h"
0016 #include "Herwig/MatrixElement/Matchbox/Utility/SpinorHelicity.h"
0017 #include "Herwig/Models/StandardModel/StandardCKM.h"
0018 #include "ThePEG/StandardModel/StandardModelBase.h"
0019 
0020 namespace Herwig {
0021 
0022 using namespace ThePEG;
0023 using namespace SpinorHelicity;
0024 
0025 /**
0026  * \ingroup Matchbox
0027  * \author Simon Platzer
0028  *
0029  * \brief MatchboxCurrents
0030  */
0031 struct MatchboxCurrents
0032   : public AmplitudeCache<pair<size_t,size_t> > {
0033 
0034     
0035   /**
0036    * The Herwig StandardCKM object
0037    */
0038   Ptr<StandardCKM>::tcptr theStandardCKM;
0039   
0040   /**
0041    * Return the Herwig StandardCKM object
0042    */
0043   Ptr<StandardCKM>::tcptr standardCKM(const StandardModelBase& SM) {
0044     if ( !theStandardCKM )
0045       theStandardCKM = dynamic_ptr_cast<Ptr<StandardCKM>::tcptr>(SM.CKM());
0046     assert(theStandardCKM);
0047     return theStandardCKM;
0048   }
0049 
0050   /**
0051    * The Z mass
0052    */
0053   Energy MZ;
0054 
0055   /**
0056    * The Z width
0057    */
0058   Energy GZ;
0059 
0060   /**
0061    * The W mass
0062    */
0063   Energy MW;
0064 
0065   /**
0066    * The W width
0067    */
0068   Energy GW;
0069 
0070   /**
0071    * CA
0072    */
0073   double CA;
0074 
0075   /**
0076    * CF
0077    */
0078   double CF;
0079 
0080   /**
0081    * Generate a hash value for the current; 
0082    * second member of the pair reserved for combinations
0083    */
0084   template<size_t slot>
0085   pair<size_t,size_t> hash(const int ct,      const int tl,
0086                const int p1,      const int h1,
0087                const int p2,      const int h2,
0088                const int p3 = -1, const int h3 = -2,
0089                const int p4 = -1, const int h4 = -2) const {
0090     return 
0091       pair<size_t,size_t>(slot,
0092               (p4 + 1)*1 +         (h4 + 2)*10 +
0093               (p3 + 1)*100 +       (h3 + 2)*1000 +
0094               (p2 + 1)*10000 +     (h2 + 2)*100000 +
0095               (p1 + 1)*1000000 +   (h1 + 2)*10000000 +
0096               (ct + 1)*100000000 + (tl + 1)*1000000000);
0097   }
0098 
0099   /**
0100    * Setup the lepton reference momenta
0101    */
0102   void setupLeptons(const int l,    const Lorentz5Momentum& pl,
0103             const int lbar, const Lorentz5Momentum& plbar);
0104 
0105   /**
0106    * Setup the quark reference momenta
0107    */
0108   void setupQuarks(const int q,    const Lorentz5Momentum& pq,
0109            const int qbar, const Lorentz5Momentum& pqbar);
0110 
0111   /**
0112    * Tree level left-handed llbar current
0113    */
0114   const LorentzVector<Complex>& llbarLeftCurrent(const int l,    const int lHel,
0115                          const int lbar, const int lbarHel);
0116 
0117   /**
0118    * Tree level right-handed llbar current
0119    */
0120   const LorentzVector<Complex>& llbarRightCurrent(const int l,    const int lHel,
0121                           const int lbar, const int lbarHel);
0122 
0123   /**
0124    * Tree level left-handed qqbar current
0125    */
0126   const LorentzVector<Complex>& qqbarLeftCurrent(const int q,    const int qHel,
0127                          const int qbar, const int qbarHel);
0128 
0129   /**
0130    * Tree level right-handed qqbar current
0131    */
0132   const LorentzVector<Complex>& qqbarRightCurrent(const int q,    const int qHel,
0133                           const int qbar, const int qbarHel);
0134 
0135   /**
0136    * Tree level left-handed qqbarg current
0137    */
0138   const LorentzVector<Complex>& qqbargLeftCurrent(const int q,    const int qHel,
0139                           const int qbar, const int qbarHel,
0140                           const int g,    const int gHel);
0141 
0142   /**
0143    * Tree level right-handed qqbarg current
0144    */
0145   const LorentzVector<Complex>& qqbargRightCurrent(const int q,    const int qHel,
0146                            const int qbar, const int qbarHel,
0147                            const int g,    const int gHel);
0148 
0149   /**
0150    * Tree level left-handed qqbargg current
0151    */
0152   const LorentzVector<Complex>& qqbarggLeftCurrent(const int q,    const int qHel,
0153                            const int qbar, const int qbarHel,
0154                            const int g1,   const int g1Hel,
0155                            const int g2,   const int g2Hel);
0156 
0157   /**
0158    * Tree level right-handed qqbargg current
0159    */
0160   const LorentzVector<Complex>& qqbarggRightCurrent(const int q,    const int qHel,
0161                             const int qbar, const int qbarHel,
0162                             const int g1,   const int g1Hel,
0163                             const int g2,   const int g2Hel);
0164 
0165   /**
0166    * Tree level left-handed qqbarkkbar current
0167    */
0168   const LorentzVector<Complex>& qqbarqqbarLeftCurrent(const int q,    const int qHel,
0169                               const int qbar, const int qbarHel,
0170                               const int k,    const int kHel,
0171                               const int kbar, const int kbarHel);
0172 
0173   /**
0174    * Tree level right-handed qqbarkkbar current
0175    */
0176   const LorentzVector<Complex>& qqbarqqbarRightCurrent(const int q,    const int qHel,
0177                                const int qbar, const int qbarHel,
0178                                const int k,    const int kHel,
0179                                const int kbar, const int kbarHel);
0180 
0181   /**
0182    * One-loop left-handed qqbar current
0183    */
0184   const LorentzVector<Complex>& qqbarLeftOneLoopCurrent(const int q,    const int qHel,
0185                             const int qbar, const int qbarHel);
0186 
0187   /**
0188    * One-loop right-handed qqbar current
0189    */
0190   const LorentzVector<Complex>& qqbarRightOneLoopCurrent(const int q,    const int qHel,
0191                              const int qbar, const int qbarHel);
0192 
0193   /**
0194    * One-loop left-handed qqbarg current
0195    */
0196   const LorentzVector<Complex>& qqbargLeftOneLoopCurrent(const int q,    const int qHel,
0197                              const int qbar, const int qbarHel,
0198                              const int g,    const int gHel);
0199 
0200   /**
0201    * One-loop right-handed qqbarg current
0202    */
0203   const LorentzVector<Complex>& qqbargRightOneLoopCurrent(const int q,    const int qHel,
0204                               const int qbar, const int qbarHel,
0205                               const int g,    const int gHel);
0206 
0207 private:
0208 
0209   /**
0210    * Tree level left-handed qqbargg current, full reference vector dependence
0211    */
0212   LorentzVector<Complex> qqbarggGeneralLeftCurrent(const int q,    const int qHel,
0213                            const int qbar, const int qbarHel,
0214                            const int g1,   const int g1Hel,
0215                            const int g2,   const int g2Hel,
0216                            const int n);
0217 
0218   /**
0219    * Tree level left-handed qqbargg current, fixed reference vector choice
0220    */
0221   LorentzVector<Complex> qqbarggFixedLeftCurrent(const int q,    const int qHel,
0222                          const int qbar, const int qbarHel,
0223                          const int g1,   const int g1Hel,
0224                          const int g2,   const int g2Hel);
0225 
0226   /**
0227    * Tree level left-handed qqbargg current, full reference vector dependence
0228    */
0229   LorentzVector<Complex> qqbarggGeneralRightCurrent(const int q,    const int qHel,
0230                            const int qbar, const int qbarHel,
0231                            const int g1,   const int g1Hel,
0232                            const int g2,   const int g2Hel,
0233                            const int n);
0234 
0235   /**
0236    * Tree level left-handed qqbargg current, fixed reference vector choice
0237    */
0238   LorentzVector<Complex> qqbarggFixedRightCurrent(const int q,    const int qHel,
0239                           const int qbar, const int qbarHel,
0240                           const int g1,   const int g1Hel,
0241                           const int g2,   const int g2Hel);
0242 
0243   /**
0244    * Container for the coefficients of the standard matrix elements for the
0245    * one-loop qqbarg currents.
0246    */
0247   vector<Complex> qqbargLoops;
0248 
0249   /**
0250    * Work out the coefficients of the standard matrix elements for the
0251    * one-loop qqbarg currents.
0252    */
0253   void qqbargLoopCoefficients(const int q, const int qbar, const int g);
0254 
0255   /**
0256    * Evaluate the six-dimensional box
0257    */
0258   Complex box6(const int i, const int j, const int k);
0259 
0260   /**
0261    * One-loop left-handed qqbarg current, full reference vector dependence
0262    */
0263   LorentzVector<Complex> qqbargGeneralLeftLoopCurrent(const int q,    const int qHel,
0264                               const int qbar, const int qbarHel,
0265                               const int g,    const int gHel,
0266                               const int n);
0267 
0268   /**
0269    * One-loop left-handed qqbarg current, fixed reference vector choice
0270    */
0271   LorentzVector<Complex> qqbargFixedLeftLoopCurrent(const int q,    const int qHel,
0272                             const int qbar, const int qbarHel,
0273                             const int g,    const int gHel);
0274 
0275   /**
0276    * One-loop left-handed qqbarg current, full reference vector dependence
0277    */
0278   LorentzVector<Complex> qqbargGeneralRightLoopCurrent(const int q,    const int qHel,
0279                                const int qbar, const int qbarHel,
0280                                const int g,    const int gHel,
0281                                const int n);
0282 
0283   /**
0284    * One-loop left-handed qqbarg current, fixed reference vector choice
0285    */
0286   LorentzVector<Complex> qqbargFixedRightLoopCurrent(const int q,    const int qHel,
0287                              const int qbar, const int qbarHel,
0288                              const int g,    const int gHel);
0289 
0290 
0291 //#define CHECK_MatchboxCurrents
0292 
0293 #ifdef CHECK_MatchboxCurrents
0294 
0295 private:
0296 
0297   /**
0298    * Ostreams to write precision data to
0299    */
0300   static map<string,ofstream*>& checkStreams();
0301 
0302   /**
0303    * Return check stream for given name
0304    */
0305   static ostream& checkStream(const string&);
0306 
0307   /**
0308    * Check if the given current is conserved
0309    */
0310   void checkCurrent(const string& id,
0311             const LorentzVector<Complex>& current,
0312             const LorentzVector<double>& q);
0313 
0314 #endif // CHECK_MatchboxCurrents
0315 
0316 };
0317 
0318 }
0319 
0320 #endif // Herwig_MatchboxCurrents_H