File indexing completed on 2026-08-06 09:20:02
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #ifndef EVTGAMMAMATRIX_HH
0022 #define EVTGAMMAMATRIX_HH
0023
0024 #include "EvtGenBase/EvtComplex.hh"
0025 #include "EvtGenBase/EvtDiracSpinor.hh" // needed for adjoint
0026
0027 #include <iosfwd>
0028 class EvtGammaMatrix;
0029 class EvtVector4C;
0030
0031 namespace EvtGenFunctions {
0032
0033 EvtGammaMatrix slash( const EvtVector4C& p );
0034 EvtGammaMatrix slash( const EvtVector4R& p );
0035 }
0036
0037
0038
0039
0040 class EvtGammaMatrix final {
0041 friend EvtGammaMatrix operator*( const EvtComplex& c,
0042 const EvtGammaMatrix& g );
0043 friend EvtGammaMatrix operator*( const EvtGammaMatrix& g,
0044 const EvtComplex& c );
0045 friend EvtGammaMatrix operator/( const EvtGammaMatrix& g, const double d );
0046 friend EvtDiracSpinor operator*( const EvtGammaMatrix& g,
0047 const EvtDiracSpinor& d );
0048 friend EvtGammaMatrix operator+( const EvtGammaMatrix& g1,
0049 const EvtGammaMatrix& g2 );
0050 friend EvtGammaMatrix operator-( const EvtGammaMatrix& g1,
0051 const EvtGammaMatrix& g2 );
0052 friend EvtGammaMatrix operator*( const EvtGammaMatrix& g1,
0053 const EvtGammaMatrix& g2 );
0054 friend std::ostream& operator<<( std::ostream& s, const EvtGammaMatrix& v );
0055 friend EvtDiracSpinor EvtDiracSpinor::adjoint() const;
0056
0057 public:
0058 EvtGammaMatrix();
0059 EvtGammaMatrix( const EvtGammaMatrix& gm );
0060 EvtGammaMatrix& operator=( const EvtGammaMatrix& gm );
0061
0062 void init();
0063 static const EvtGammaMatrix& g( int );
0064 static const EvtGammaMatrix& g0();
0065 static const EvtGammaMatrix& g1();
0066 static const EvtGammaMatrix& g2();
0067 static const EvtGammaMatrix& g3();
0068 static const EvtGammaMatrix& g5();
0069 static const EvtGammaMatrix& id();
0070 static const EvtGammaMatrix& va0();
0071 static const EvtGammaMatrix& va1();
0072 static const EvtGammaMatrix& va2();
0073 static const EvtGammaMatrix& va3();
0074 static const EvtGammaMatrix& v0();
0075 static const EvtGammaMatrix& v1();
0076 static const EvtGammaMatrix& v2();
0077 static const EvtGammaMatrix& v3();
0078
0079 static const EvtGammaMatrix& sigmaUpper( unsigned int mu, unsigned int nu );
0080 static const EvtGammaMatrix& sigmaLower( unsigned int mu, unsigned int nu );
0081
0082 EvtGammaMatrix& operator+=( const EvtGammaMatrix& g );
0083 EvtGammaMatrix& operator-=( const EvtGammaMatrix& g );
0084 EvtGammaMatrix& operator*=( const EvtGammaMatrix& g );
0085
0086 private:
0087 EvtComplex _gamma[4][4];
0088 };
0089
0090 inline EvtGammaMatrix operator+( const EvtGammaMatrix& g1,
0091 const EvtGammaMatrix& g2 )
0092 {
0093 return EvtGammaMatrix( g1 ) += g2;
0094 }
0095
0096 inline EvtGammaMatrix operator-( const EvtGammaMatrix& g1,
0097 const EvtGammaMatrix& g2 )
0098 {
0099 return EvtGammaMatrix( g1 ) -= g2;
0100 }
0101
0102 inline EvtGammaMatrix operator*( const EvtGammaMatrix& g1,
0103 const EvtGammaMatrix& g2 )
0104 {
0105 return EvtGammaMatrix( g1 ) *= g2;
0106 }
0107
0108 inline EvtGammaMatrix operator/( const EvtGammaMatrix& g, const double d )
0109 {
0110 return g * EvtComplex( 1 / d, 0 );
0111 }
0112
0113 #endif