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 EvtGammaMatrix slash(const EvtVector4C& p);
34 class EvtGammaMatrix {
36 friend EvtGammaMatrix operator*(const EvtComplex& c,const EvtGammaMatrix& g);
37 friend EvtGammaMatrix operator*(const EvtGammaMatrix& g, const EvtComplex& c);
38 friend EvtGammaMatrix operator/(const EvtGammaMatrix& g, const double d);
39 friend EvtDiracSpinor operator*(const EvtGammaMatrix& g,const EvtDiracSpinor& d);
40 //friend EvtComplex operator*(const EvtDiracSpinor& d,const EvtDiracSpinor& dp);
41 friend EvtGammaMatrix operator+(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2);
42 friend EvtGammaMatrix operator-(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2);
43 friend EvtGammaMatrix operator*(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2);
44 friend std::ostream& operator<<(std::ostream& s, const EvtGammaMatrix& v);
45 friend EvtDiracSpinor EvtDiracSpinor::adjoint() const;
46 // slash or Feynman slash a 4-vector
47 friend EvtGammaMatrix slash(const EvtVector4C& p);
53 virtual ~EvtGammaMatrix();
54 EvtGammaMatrix(const EvtGammaMatrix& gm);
55 EvtGammaMatrix& operator=(const EvtGammaMatrix& gm);
58 static const EvtGammaMatrix& g(int);
59 static const EvtGammaMatrix& g0();
60 static const EvtGammaMatrix& g1();
61 static const EvtGammaMatrix& g2();
62 static const EvtGammaMatrix& g3();
63 static const EvtGammaMatrix& g5();
64 static const EvtGammaMatrix& id();
65 static const EvtGammaMatrix& va0();
66 static const EvtGammaMatrix& va1();
67 static const EvtGammaMatrix& va2();
68 static const EvtGammaMatrix& va3();
69 static const EvtGammaMatrix& v0();
70 static const EvtGammaMatrix& v1();
71 static const EvtGammaMatrix& v2();
72 static const EvtGammaMatrix& v3();
73 // Dirac sigma matrix with upper or lower indices (only one element)
74 static const EvtGammaMatrix& sigmaUpper(unsigned int mu, unsigned int nu);
75 static const EvtGammaMatrix& sigmaLower(unsigned int mu, unsigned int nu);
77 EvtGammaMatrix& operator+=(const EvtGammaMatrix &g);
78 EvtGammaMatrix& operator-=(const EvtGammaMatrix &g);
79 EvtGammaMatrix& operator*=(const EvtGammaMatrix &g);
82 EvtComplex _gamma[4][4];
87 inline EvtGammaMatrix operator+(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2){
88 return EvtGammaMatrix(g1)+=g2;
91 inline EvtGammaMatrix operator-(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2){
92 return EvtGammaMatrix(g1)-=g2;
95 inline EvtGammaMatrix operator*(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2){
96 return EvtGammaMatrix(g1)*=g2;
99 inline EvtGammaMatrix operator/(const EvtGammaMatrix& g, double d)
101 return g * EvtComplex(1/d,0);