]>
Commit | Line | Data |
---|---|---|
da0e9ce3 | 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 | EvtGammaMatrix slash(const EvtVector4C& p); | |
33 | ||
34 | class EvtGammaMatrix { | |
35 | ||
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); | |
48 | ||
49 | ||
50 | public: | |
51 | ||
52 | EvtGammaMatrix(); | |
53 | virtual ~EvtGammaMatrix(); | |
54 | EvtGammaMatrix(const EvtGammaMatrix& gm); | |
55 | EvtGammaMatrix& operator=(const EvtGammaMatrix& gm); | |
56 | ||
57 | void init(); | |
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); | |
76 | ||
77 | EvtGammaMatrix& operator+=(const EvtGammaMatrix &g); | |
78 | EvtGammaMatrix& operator-=(const EvtGammaMatrix &g); | |
79 | EvtGammaMatrix& operator*=(const EvtGammaMatrix &g); | |
80 | ||
81 | private: | |
82 | EvtComplex _gamma[4][4]; | |
83 | ||
84 | }; | |
85 | ||
86 | ||
87 | inline EvtGammaMatrix operator+(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2){ | |
88 | return EvtGammaMatrix(g1)+=g2; | |
89 | } | |
90 | ||
91 | inline EvtGammaMatrix operator-(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2){ | |
92 | return EvtGammaMatrix(g1)-=g2; | |
93 | } | |
94 | ||
95 | inline EvtGammaMatrix operator*(const EvtGammaMatrix& g1,const EvtGammaMatrix& g2){ | |
96 | return EvtGammaMatrix(g1)*=g2; | |
97 | } | |
98 | ||
19490ab9 | 99 | inline EvtGammaMatrix operator/(const EvtGammaMatrix& g, double d) |
da0e9ce3 | 100 | { |
101 | return g * EvtComplex(1/d,0); | |
102 | } | |
103 | ||
104 | ||
105 | ||
106 | ||
107 | #endif |