]>
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/EvtDiracSpinor.hh | |
12 | // | |
13 | // Description:Class to manipulate dirac spinors | |
14 | // | |
15 | // Modification history: | |
16 | // | |
17 | // DJL/RYD September 25, 1996 Module created | |
18 | // | |
19 | //------------------------------------------------------------------------ | |
20 | ||
21 | #ifndef EVTDIRACSPINOR_HH | |
22 | #define EVTDIRACSPINOR_HH | |
23 | ||
24 | #include "EvtGenBase/EvtComplex.hh" | |
25 | #include "EvtGenBase/EvtVector4R.hh" | |
26 | #include "EvtGenBase/EvtVector3R.hh" | |
27 | ||
28 | class EvtTensor4C; | |
29 | class EvtVector4C; | |
30 | class EvtDiracSpinor ; | |
31 | ||
32 | ||
33 | class EvtDiracSpinor { | |
34 | ||
35 | friend EvtDiracSpinor rotateEuler(const EvtDiracSpinor& sp, | |
36 | double alpha,double beta,double gamma); | |
37 | friend EvtDiracSpinor boostTo(const EvtDiracSpinor& sp, | |
38 | const EvtVector4R p4); | |
39 | friend EvtDiracSpinor boostTo(const EvtDiracSpinor& sp, | |
40 | const EvtVector3R boost); | |
41 | friend EvtVector4C EvtLeptonVACurrent | |
42 | (const EvtDiracSpinor& d,const EvtDiracSpinor& dp); | |
43 | friend EvtVector4C EvtLeptonVCurrent | |
44 | (const EvtDiracSpinor& d,const EvtDiracSpinor& dp); | |
45 | friend EvtVector4C EvtLeptonACurrent | |
46 | (const EvtDiracSpinor& d,const EvtDiracSpinor& dp); | |
47 | friend EvtComplex EvtLeptonSCurrent | |
48 | (const EvtDiracSpinor& d,const EvtDiracSpinor& dp); | |
49 | friend EvtComplex EvtLeptonPCurrent | |
50 | (const EvtDiracSpinor& d,const EvtDiracSpinor& dp); | |
51 | friend EvtTensor4C EvtLeptonTCurrent | |
52 | (const EvtDiracSpinor& d,const EvtDiracSpinor& dp); | |
53 | friend EvtDiracSpinor operator+(const EvtDiracSpinor& u1, | |
54 | const EvtDiracSpinor& u2); | |
55 | friend EvtDiracSpinor operator-(const EvtDiracSpinor& u1, | |
56 | const EvtDiracSpinor& u2); | |
57 | friend EvtDiracSpinor operator*(const EvtComplex& c, | |
58 | const EvtDiracSpinor& d); | |
da0e9ce3 | 59 | |
0ca57c2f | 60 | friend EvtComplex operator*(const EvtDiracSpinor& d , |
61 | const EvtDiracSpinor& dp ) ; | |
da0e9ce3 | 62 | |
63 | friend std::ostream& operator<<(std::ostream& s, const EvtDiracSpinor& c); | |
64 | ||
65 | public: | |
66 | ||
67 | inline EvtDiracSpinor(); | |
68 | EvtDiracSpinor(const EvtComplex& sp0,const EvtComplex& sp1, | |
69 | const EvtComplex& sp2,const EvtComplex& sp3); | |
70 | virtual ~EvtDiracSpinor(); | |
71 | inline EvtDiracSpinor(const EvtDiracSpinor& dspinor); | |
72 | inline EvtDiracSpinor& operator=(const EvtDiracSpinor& dspinor); | |
73 | ||
74 | inline EvtDiracSpinor& operator+=(const EvtDiracSpinor& u2); | |
75 | inline EvtDiracSpinor& operator-=(const EvtDiracSpinor& u2); | |
76 | ||
77 | void set(const EvtComplex& sp0,const EvtComplex& sp1, | |
78 | const EvtComplex& sp2,const EvtComplex& sp3); | |
79 | void set_spinor(int i,const EvtComplex& sp); | |
80 | const EvtComplex& get_spinor(int i) const; | |
81 | EvtDiracSpinor conj() const; | |
82 | void applyRotateEuler(double alpha,double beta,double gamma); | |
83 | void applyBoostTo(const EvtVector4R& p4); | |
84 | void applyBoostTo(const EvtVector3R& boost); | |
85 | EvtDiracSpinor adjoint() const; | |
86 | ||
87 | private: | |
88 | ||
89 | EvtComplex spinor[4]; | |
90 | ||
91 | }; | |
92 | ||
93 | EvtDiracSpinor::EvtDiracSpinor(){ | |
94 | ||
95 | spinor[0]=EvtComplex(); spinor[1]=EvtComplex(); | |
96 | spinor[2]=EvtComplex(); spinor[3]=EvtComplex(); | |
97 | ||
98 | } | |
99 | ||
100 | EvtDiracSpinor::EvtDiracSpinor(const EvtDiracSpinor& dspinor){ | |
101 | ||
102 | spinor[0]=dspinor.spinor[0]; | |
103 | spinor[1]=dspinor.spinor[1]; | |
104 | spinor[2]=dspinor.spinor[2]; | |
105 | spinor[3]=dspinor.spinor[3]; | |
106 | ||
107 | } | |
108 | ||
109 | EvtDiracSpinor& EvtDiracSpinor::operator=(const EvtDiracSpinor& dspinor){ | |
110 | ||
111 | spinor[0]=dspinor.spinor[0]; | |
112 | spinor[1]=dspinor.spinor[1]; | |
113 | spinor[2]=dspinor.spinor[2]; | |
114 | spinor[3]=dspinor.spinor[3]; | |
115 | ||
116 | return *this; | |
117 | ||
118 | } | |
119 | ||
120 | inline EvtDiracSpinor& EvtDiracSpinor::operator+=(const EvtDiracSpinor& u2){ | |
121 | ||
122 | spinor[0]+=u2.spinor[0]; | |
123 | spinor[1]+=u2.spinor[1]; | |
124 | spinor[2]+=u2.spinor[2]; | |
125 | spinor[3]+=u2.spinor[3]; | |
126 | ||
127 | return *this; | |
128 | } | |
129 | ||
130 | inline EvtDiracSpinor operator+(const EvtDiracSpinor& u1, | |
131 | const EvtDiracSpinor& u2){ | |
132 | ||
133 | return EvtDiracSpinor(u1)+=u2; | |
134 | ||
135 | } | |
136 | ||
137 | inline EvtDiracSpinor& EvtDiracSpinor::operator-=(const EvtDiracSpinor& u2){ | |
138 | ||
139 | spinor[0]-=u2.spinor[0]; | |
140 | spinor[1]-=u2.spinor[1]; | |
141 | spinor[2]-=u2.spinor[2]; | |
142 | spinor[3]-=u2.spinor[3]; | |
143 | ||
144 | return *this; | |
145 | } | |
146 | ||
147 | inline EvtDiracSpinor operator-(const EvtDiracSpinor& u1, | |
148 | const EvtDiracSpinor& u2){ | |
149 | ||
150 | return EvtDiracSpinor(u1)-=u2; | |
151 | ||
152 | } | |
153 | ||
154 | #endif | |
155 | ||
156 |