1 //--------------------------------------------------------------------------
4 // This software is part of the EvtGen package developed jointly
5 // for the BaBar and CLEO collaborations. If you use all or part
6 // of it, please give an appropriate acknowledgement.
8 // Copyright Information: See EvtGen/COPYRIGHT
9 // Copyright (C) 1998 Caltech, UCSB
11 // Module: EvtGen/EvtGammaMatrix.hh
13 // Description: Class to manipulate gamma matrices. The reperesentation
14 // used is the "standard" Dirac representation.
16 // Modification history:
18 // DJL/RYD September 25, 1998 Module created
20 //------------------------------------------------------------------------
22 #ifndef EVTGAMMAMATRIX_HH
23 #define EVTGAMMAMATRIX_HH
25 #include "EvtGenBase/EvtComplex.hh"
26 #include "EvtGenBase/EvtDiracSpinor.hh" // needed for adjoint
27 //#include <iostream.h>
32 namespace EvtGenFunctions {
33 // slash or Feynman slash a 4-vector
34 EvtGammaMatrix slash( const EvtVector4C& p ) ;
35 EvtGammaMatrix slash( const EvtVector4R& p ) ;
38 class EvtGammaMatrix {
40 friend EvtGammaMatrix operator*(const EvtComplex& c,const EvtGammaMatrix& g);
41 friend EvtGammaMatrix operator*(const EvtGammaMatrix& g, const EvtComplex& c);
42 friend EvtGammaMatrix operator/(const EvtGammaMatrix& g, const double d);
43 friend EvtDiracSpinor operator*(const EvtGammaMatrix& g,const EvtDiracSpinor& d);
44 friend EvtGammaMatrix operator+(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2);
45 friend EvtGammaMatrix operator-(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2);
46 friend EvtGammaMatrix operator*(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2);
47 friend std::ostream& operator<<(std::ostream& s, const EvtGammaMatrix& v);
48 friend EvtDiracSpinor EvtDiracSpinor::adjoint() const;
54 virtual ~EvtGammaMatrix();
55 EvtGammaMatrix(const EvtGammaMatrix& gm);
56 EvtGammaMatrix& operator=(const EvtGammaMatrix& gm);
59 static const EvtGammaMatrix& g(int);
60 static const EvtGammaMatrix& g0();
61 static const EvtGammaMatrix& g1();
62 static const EvtGammaMatrix& g2();
63 static const EvtGammaMatrix& g3();
64 static const EvtGammaMatrix& g5();
65 static const EvtGammaMatrix& id();
66 static const EvtGammaMatrix& va0();
67 static const EvtGammaMatrix& va1();
68 static const EvtGammaMatrix& va2();
69 static const EvtGammaMatrix& va3();
70 static const EvtGammaMatrix& v0();
71 static const EvtGammaMatrix& v1();
72 static const EvtGammaMatrix& v2();
73 static const EvtGammaMatrix& v3();
74 // Dirac sigma matrix with upper or lower indices (only one element)
75 static const EvtGammaMatrix& sigmaUpper(unsigned int mu, unsigned int nu);
76 static const EvtGammaMatrix& sigmaLower(unsigned int mu, unsigned int nu);
78 EvtGammaMatrix& operator+=(const EvtGammaMatrix &g);
79 EvtGammaMatrix& operator-=(const EvtGammaMatrix &g);
80 EvtGammaMatrix& operator*=(const EvtGammaMatrix &g);
83 EvtComplex _gamma[4][4];
88 inline EvtGammaMatrix operator+(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2){
89 return EvtGammaMatrix(g1)+=g2;
92 inline EvtGammaMatrix operator-(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2){
93 return EvtGammaMatrix(g1)-=g2;
96 inline EvtGammaMatrix operator*(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2){
97 return EvtGammaMatrix(g1)*=g2;
100 inline EvtGammaMatrix operator/(const EvtGammaMatrix& g, const double d)
102 return g * EvtComplex(1/d,0);