Line data Source code
1 : //--------------------------------------------------------------------------
2 : //
3 : // Environment:
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.
7 : //
8 : // Copyright Information: See EvtGen/COPYRIGHT
9 : // Copyright (C) 1998 Caltech, UCSB
10 : //
11 : // Module: EvtGen/EvtGammaMatrix.hh
12 : //
13 : // Description: Class to manipulate gamma matrices. The reperesentation
14 : // used is the "standard" Dirac representation.
15 : //
16 : // Modification history:
17 : //
18 : // DJL/RYD September 25, 1998 Module created
19 : //
20 : //------------------------------------------------------------------------
21 :
22 : #ifndef EVTGAMMAMATRIX_HH
23 : #define EVTGAMMAMATRIX_HH
24 :
25 : #include "EvtGenBase/EvtComplex.hh"
26 : #include "EvtGenBase/EvtDiracSpinor.hh" // needed for adjoint
27 : //#include <iostream.h>
28 : #include <iosfwd>
29 : class EvtGammaMatrix;
30 : class EvtVector4C;
31 :
32 : namespace EvtGenFunctions {
33 : // slash or Feynman slash a 4-vector
34 : EvtGammaMatrix slash( const EvtVector4C& p ) ;
35 : EvtGammaMatrix slash( const EvtVector4R& p ) ;
36 : };
37 :
38 : class EvtGammaMatrix {
39 :
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;
49 :
50 :
51 : public:
52 :
53 : EvtGammaMatrix();
54 : virtual ~EvtGammaMatrix();
55 : EvtGammaMatrix(const EvtGammaMatrix& gm);
56 : EvtGammaMatrix& operator=(const EvtGammaMatrix& gm);
57 :
58 : void init();
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);
77 :
78 : EvtGammaMatrix& operator+=(const EvtGammaMatrix &g);
79 : EvtGammaMatrix& operator-=(const EvtGammaMatrix &g);
80 : EvtGammaMatrix& operator*=(const EvtGammaMatrix &g);
81 :
82 : private:
83 : EvtComplex _gamma[4][4];
84 :
85 : };
86 :
87 :
88 : inline EvtGammaMatrix operator+(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2){
89 0 : return EvtGammaMatrix(g1)+=g2;
90 0 : }
91 :
92 : inline EvtGammaMatrix operator-(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2){
93 0 : return EvtGammaMatrix(g1)-=g2;
94 0 : }
95 :
96 : inline EvtGammaMatrix operator*(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2){
97 0 : return EvtGammaMatrix(g1)*=g2;
98 0 : }
99 :
100 : inline EvtGammaMatrix operator/(const EvtGammaMatrix& g, const double d)
101 : {
102 0 : return g * EvtComplex(1/d,0);
103 : }
104 :
105 :
106 :
107 :
108 : #endif
|