]>
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); | |
59 | friend EvtComplex operator*(const EvtDiracSpinor& d, const EvtDiracSpinor& dp); | |
60 | ||
61 | ||
62 | friend std::ostream& operator<<(std::ostream& s, const EvtDiracSpinor& c); | |
63 | ||
64 | public: | |
65 | ||
66 | inline EvtDiracSpinor(); | |
67 | EvtDiracSpinor(const EvtComplex& sp0,const EvtComplex& sp1, | |
68 | const EvtComplex& sp2,const EvtComplex& sp3); | |
69 | virtual ~EvtDiracSpinor(); | |
70 | inline EvtDiracSpinor(const EvtDiracSpinor& dspinor); | |
71 | inline EvtDiracSpinor& operator=(const EvtDiracSpinor& dspinor); | |
72 | ||
73 | inline EvtDiracSpinor& operator+=(const EvtDiracSpinor& u2); | |
74 | inline EvtDiracSpinor& operator-=(const EvtDiracSpinor& u2); | |
75 | ||
76 | void set(const EvtComplex& sp0,const EvtComplex& sp1, | |
77 | const EvtComplex& sp2,const EvtComplex& sp3); | |
78 | void set_spinor(int i,const EvtComplex& sp); | |
79 | const EvtComplex& get_spinor(int i) const; | |
80 | EvtDiracSpinor conj() const; | |
81 | void applyRotateEuler(double alpha,double beta,double gamma); | |
82 | void applyBoostTo(const EvtVector4R& p4); | |
83 | void applyBoostTo(const EvtVector3R& boost); | |
84 | EvtDiracSpinor adjoint() const; | |
85 | ||
86 | private: | |
87 | ||
88 | EvtComplex spinor[4]; | |
89 | ||
90 | }; | |
91 | ||
92 | EvtDiracSpinor::EvtDiracSpinor(){ | |
93 | ||
94 | spinor[0]=EvtComplex(); spinor[1]=EvtComplex(); | |
95 | spinor[2]=EvtComplex(); spinor[3]=EvtComplex(); | |
96 | ||
97 | } | |
98 | ||
99 | EvtDiracSpinor::EvtDiracSpinor(const EvtDiracSpinor& dspinor){ | |
100 | ||
101 | spinor[0]=dspinor.spinor[0]; | |
102 | spinor[1]=dspinor.spinor[1]; | |
103 | spinor[2]=dspinor.spinor[2]; | |
104 | spinor[3]=dspinor.spinor[3]; | |
105 | ||
106 | } | |
107 | ||
108 | EvtDiracSpinor& EvtDiracSpinor::operator=(const EvtDiracSpinor& dspinor){ | |
109 | ||
110 | spinor[0]=dspinor.spinor[0]; | |
111 | spinor[1]=dspinor.spinor[1]; | |
112 | spinor[2]=dspinor.spinor[2]; | |
113 | spinor[3]=dspinor.spinor[3]; | |
114 | ||
115 | return *this; | |
116 | ||
117 | } | |
118 | ||
119 | inline EvtDiracSpinor& EvtDiracSpinor::operator+=(const EvtDiracSpinor& u2){ | |
120 | ||
121 | spinor[0]+=u2.spinor[0]; | |
122 | spinor[1]+=u2.spinor[1]; | |
123 | spinor[2]+=u2.spinor[2]; | |
124 | spinor[3]+=u2.spinor[3]; | |
125 | ||
126 | return *this; | |
127 | } | |
128 | ||
129 | inline EvtDiracSpinor operator+(const EvtDiracSpinor& u1, | |
130 | const EvtDiracSpinor& u2){ | |
131 | ||
132 | return EvtDiracSpinor(u1)+=u2; | |
133 | ||
134 | } | |
135 | ||
136 | inline EvtDiracSpinor& EvtDiracSpinor::operator-=(const EvtDiracSpinor& u2){ | |
137 | ||
138 | spinor[0]-=u2.spinor[0]; | |
139 | spinor[1]-=u2.spinor[1]; | |
140 | spinor[2]-=u2.spinor[2]; | |
141 | spinor[3]-=u2.spinor[3]; | |
142 | ||
143 | return *this; | |
144 | } | |
145 | ||
146 | inline EvtDiracSpinor operator-(const EvtDiracSpinor& u1, | |
147 | const EvtDiracSpinor& u2){ | |
148 | ||
149 | return EvtDiracSpinor(u1)-=u2; | |
150 | ||
151 | } | |
152 | ||
153 | #endif | |
154 | ||
155 |