Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // SimpleColourBasis.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_SimpleColourBasis_H
0010 #define Herwig_SimpleColourBasis_H
0011 //
0012 // This is the declaration of the SimpleColourBasis class.
0013 //
0014 
0015 #include "Herwig/MatrixElement/Matchbox/Utility/ColourBasis.h"
0016 
0017 namespace Herwig {
0018 
0019 using namespace ThePEG;
0020 
0021 /**
0022  * \ingroup Matchbox
0023  * \author Simon Platzer
0024  *
0025  * \brief SimpleColourBasis implements the colour algebra needed for
0026  * electroweak boson and electroweak boson + jet production at NLO. It
0027  * mainly serves as an example for the general ColourBasis interface.
0028  *
0029  */
0030 class SimpleColourBasis: public ColourBasis {
0031 
0032 public:
0033 
0034   /**
0035    * Prepare the basis for the normal ordered legs and return the
0036    * dimensionality of the basis.
0037    */
0038   virtual size_t prepareBasis(const vector<PDT::Colour>&);
0039 
0040   /**
0041    * Return the scalar product of basis tensors labelled a and b in
0042    * the basis used for the given normal ordered legs.
0043    */
0044   virtual double scalarProduct(size_t a, size_t b,
0045                    const vector<PDT::Colour>& abBasis) const;
0046 
0047   /**
0048    * Return the matrix element of a colour charge
0049    * <c_{n+1,a}|T_i|c_{n,b}> between basis tensors a and b, with
0050    * respect to aBasis and bBasis
0051    */
0052   virtual double tMatrixElement(size_t i, size_t a, size_t b,
0053                 const vector<PDT::Colour>& aBasis,
0054                 const vector<PDT::Colour>& bBasis,
0055                 size_t k, size_t l,
0056                 const map<size_t,size_t>& dict
0057                 ) const;
0058 
0059   virtual double sMatrixElement(size_t, size_t, size_t,
0060                 const vector<PDT::Colour>&,
0061                 const vector<PDT::Colour>&,
0062                 size_t, size_t,
0063                 const map<size_t,size_t>&
0064                 ) const {
0065     assert( 0 == 1 );
0066     return 0;
0067   }
0068 
0069   /**
0070    * Return true, if this colour basis supports gluon splittings.
0071    */
0072   virtual bool canSplitGluons() const {
0073     return false;
0074   }
0075 
0076   /**
0077    * Return true, if a large-N colour connection exists for the
0078    * given external legs and basis tensor.
0079    */
0080   virtual bool colourConnected(const cPDVector&,
0081                    const vector<PDT::Colour>&,
0082                    const pair<int,bool>&, 
0083                    const pair<int,bool>&, 
0084                    size_t) const;
0085 
0086   /**
0087    * Return true, if the colour basis is capable of assigning colour
0088    * flows.
0089    */
0090   virtual bool haveColourFlows() const { return true; }
0091 
0092   /**
0093    * Create ids for bases
0094    */
0095   void makeIds() const;
0096 
0097 public:
0098 
0099   /** @name Functions used by the persistent I/O system. */
0100   //@{
0101   /**
0102    * Function used to write out object persistently.
0103    * @param os the persistent output stream written to.
0104    */
0105   void persistentOutput(PersistentOStream & os) const;
0106 
0107   /**
0108    * Function used to read in object persistently.
0109    * @param is the persistent input stream read from.
0110    * @param version the version number of the object when written.
0111    */
0112   void persistentInput(PersistentIStream & is, int version);
0113   //@}
0114 
0115   /**
0116    * The standard Init function used to initialize the interfaces.
0117    * Called exactly once for each class by the class description system
0118    * before the main function starts or
0119    * when this class is dynamically loaded.
0120    */
0121   static void Init();
0122 
0123 protected:
0124 
0125   /** @name Clone Methods. */
0126   //@{
0127   /**
0128    * Make a simple clone of this object.
0129    * @return a pointer to the new object.
0130    */
0131   virtual IBPtr clone() const;
0132 
0133   /** Make a clone of this object, possibly modifying the cloned object
0134    * to make it sane.
0135    * @return a pointer to the new object.
0136    */
0137   virtual IBPtr fullclone() const;
0138   //@}
0139 
0140 
0141 // If needed, insert declarations of virtual function defined in the
0142 // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
0143 
0144 
0145 private:
0146 
0147   /**
0148    * id for 88
0149    */
0150   mutable vector<PDT::Colour> id88;
0151 
0152   /**
0153    * id for 33bar
0154    */
0155   mutable vector<PDT::Colour> id33bar;
0156 
0157   /**
0158    * id for 888
0159    */
0160   mutable vector<PDT::Colour> id888;
0161 
0162   /**
0163    * id for 33bar8
0164    */
0165   mutable vector<PDT::Colour> id33bar8;
0166 
0167   /**
0168    * id for 8888
0169    */
0170   mutable vector<PDT::Colour> id8888;
0171 
0172   /**
0173    * id for 33bar88
0174    */
0175   mutable vector<PDT::Colour> id33bar88;
0176 
0177   /**
0178    * id for 33bar33bar
0179    */
0180   mutable vector<PDT::Colour> id33bar33bar;
0181 
0182 private:
0183 
0184   /**
0185    * The assignment operator is private and must never be called.
0186    * In fact, it should not even be implemented.
0187    */
0188   SimpleColourBasis & operator=(const SimpleColourBasis &) = delete;
0189 
0190 };
0191 
0192 }
0193 
0194 #endif /* Herwig_SimpleColourBasis_H */