EvtGen 2.2.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
Loading...
Searching...
No Matches
EvtRaritaSchwinger.cpp
Go to the documentation of this file.
1
2/***********************************************************************
3* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
4* *
5* This file is part of EvtGen. *
6* *
7* EvtGen is free software: you can redistribute it and/or modify *
8* it under the terms of the GNU General Public License as published by *
9* the Free Software Foundation, either version 3 of the License, or *
10* (at your option) any later version. *
11* *
12* EvtGen is distributed in the hope that it will be useful, *
13* but WITHOUT ANY WARRANTY; without even the implied warranty of *
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15* GNU General Public License for more details. *
16* *
17* You should have received a copy of the GNU General Public License *
18* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
19***********************************************************************/
20
22
23using std::endl;
24using std::ostream;
25
27 double beta, double gamma )
28{
29 EvtRaritaSchwinger tmp( rs );
30 tmp.applyRotateEuler( alpha, beta, gamma );
31 return tmp;
32}
33
35{
36 EvtRaritaSchwinger tmp( rs );
37 tmp.applyBoostTo( p4 );
38 return tmp;
39}
40
42{
43 EvtRaritaSchwinger tmp( rs );
44 tmp.applyBoostTo( boost );
45 return tmp;
46}
47
48void EvtRaritaSchwinger::set( int i, int j, const EvtComplex& sp )
49{
50 m_rs[i][j] = sp;
51}
52
54{
55 return m_rs[i][j];
56}
57
58void EvtRaritaSchwinger::applyRotateEuler( double alpha, double beta,
59 double gamma )
60{
61 //inefficient but simple to code...
62 EvtVector4C v0 = getVector( 0 );
63 EvtVector4C v1 = getVector( 1 );
64 EvtVector4C v2 = getVector( 2 );
65 EvtVector4C v3 = getVector( 3 );
66 v0.applyRotateEuler( alpha, beta, gamma );
67 v1.applyRotateEuler( alpha, beta, gamma );
68 v2.applyRotateEuler( alpha, beta, gamma );
69 v3.applyRotateEuler( alpha, beta, gamma );
70 setVector( 0, v0 );
71 setVector( 1, v1 );
72 setVector( 2, v2 );
73 setVector( 3, v3 );
74 EvtDiracSpinor sp0 = getSpinor( 0 );
75 EvtDiracSpinor sp1 = getSpinor( 1 );
76 EvtDiracSpinor sp2 = getSpinor( 2 );
77 EvtDiracSpinor sp3 = getSpinor( 3 );
78 sp0.applyRotateEuler( alpha, beta, gamma );
79 sp1.applyRotateEuler( alpha, beta, gamma );
80 sp2.applyRotateEuler( alpha, beta, gamma );
81 sp3.applyRotateEuler( alpha, beta, gamma );
82 setSpinor( 0, sp0 );
83 setSpinor( 1, sp1 );
84 setSpinor( 2, sp2 );
85 setSpinor( 3, sp3 );
86}
87
89{
90 double e = p4.get( 0 );
91
92 EvtVector3R boost( p4.get( 1 ) / e, p4.get( 2 ) / e, p4.get( 3 ) / e );
93
94 applyBoostTo( boost );
95
96 return;
97}
98
100{
101 //inefficient but simple to code...
102 EvtVector4C v0 = getVector( 0 );
103 EvtVector4C v1 = getVector( 1 );
104 EvtVector4C v2 = getVector( 2 );
105 EvtVector4C v3 = getVector( 3 );
106 v0.applyBoostTo( boost );
107 v1.applyBoostTo( boost );
108 v2.applyBoostTo( boost );
109 v3.applyBoostTo( boost );
110 setVector( 0, v0 );
111 setVector( 1, v1 );
112 setVector( 2, v2 );
113 setVector( 3, v3 );
114 EvtDiracSpinor sp0 = getSpinor( 0 );
115 EvtDiracSpinor sp1 = getSpinor( 1 );
116 EvtDiracSpinor sp2 = getSpinor( 2 );
117 EvtDiracSpinor sp3 = getSpinor( 3 );
118 sp0.applyBoostTo( boost );
119 sp1.applyBoostTo( boost );
120 sp2.applyBoostTo( boost );
121 sp3.applyBoostTo( boost );
122 setSpinor( 0, sp0 );
123 setSpinor( 1, sp1 );
124 setSpinor( 2, sp2 );
125 setSpinor( 3, sp3 );
126}
127
128ostream& operator<<( ostream& s, const EvtRaritaSchwinger& rs )
129{
130 int i, j;
131 s << endl;
132 for ( i = 0; i < 4; i++ ) {
133 for ( j = 0; j < 4; j++ ) {
134 s << rs.m_rs[i][j];
135 }
136 s << endl;
137 }
138 return s;
139}
140
142{
143 EvtVector4C tmp( m_rs[i][0], m_rs[i][1], m_rs[i][2], m_rs[i][3] );
144 return tmp;
145}
146
148{
149 EvtDiracSpinor tmp;
150 tmp.set( m_rs[0][i], m_rs[1][i], m_rs[2][i], m_rs[3][i] );
151 return tmp;
152}
153
155{
156 m_rs[i][0] = v.get( 0 );
157 m_rs[i][1] = v.get( 1 );
158 m_rs[i][2] = v.get( 2 );
159 m_rs[i][3] = v.get( 3 );
160}
161
163{
164 m_rs[0][i] = sp.get_spinor( 0 );
165 m_rs[1][i] = sp.get_spinor( 1 );
166 m_rs[2][i] = sp.get_spinor( 2 );
167 m_rs[3][i] = sp.get_spinor( 3 );
168}
169
171{
172 int i, j;
173
175
176 for ( i = 0; i < 4; i++ ) {
177 for ( j = 0; j < 4; j++ ) {
178 tmp.m_rs[i][j] = u.get_spinor( i ) * v.get( j );
179 }
180 }
181
182 return tmp;
183}
184
186{
187 int i, j;
188
190
191 for ( i = 0; i < 4; i++ ) {
192 for ( j = 0; j < 4; j++ ) {
193 tmp.m_rs[i][j] = u.get_spinor( i ) * v.get( j );
194 }
195 }
196
197 return tmp;
198}
199
201{
202 int i, j;
203 EvtComplex tmp = 0.0;
204
205 for ( i = 0; i < 4; i++ ) {
206 for ( j = 0; j < 4; j++ ) {
207 tmp += conj( u1.m_rs[i][j] ) * u2.m_rs[i][j];
208 }
209 }
210
211 return tmp;
212}
213
215{
216 int i, j;
217
218 for ( i = 0; i < 4; i++ ) {
219 for ( j = 0; j < 4; j++ ) {
220 m_rs[i][j] += u2.m_rs[i][j];
221 }
222 }
223
224 return *this;
225}
226
228 const EvtRaritaSchwinger& u2 )
229{
230 return EvtRaritaSchwinger( u1 ) += u2;
231}
232
234{
235 int i, j;
236
237 for ( i = 0; i < 4; i++ ) {
238 for ( j = 0; j < 4; j++ ) {
239 m_rs[i][j] += u2.m_rs[i][j];
240 }
241 }
242
243 return *this;
244}
245
247 const EvtRaritaSchwinger& u2 )
248{
249 return EvtRaritaSchwinger( u1 ) -= u2;
250}
EvtComplex conj(const EvtComplex &c)
EvtRaritaSchwinger operator+(const EvtRaritaSchwinger &u1, const EvtRaritaSchwinger &u2)
EvtRaritaSchwinger boostTo(const EvtRaritaSchwinger &rs, const EvtVector4R p4)
EvtRaritaSchwinger rotateEuler(const EvtRaritaSchwinger &rs, double alpha, double beta, double gamma)
EvtRaritaSchwinger operator-(const EvtRaritaSchwinger &u1, const EvtRaritaSchwinger &u2)
EvtComplex operator*(const EvtRaritaSchwinger &u1, const EvtRaritaSchwinger &u2)
ostream & operator<<(ostream &s, const EvtRaritaSchwinger &rs)
EvtRaritaSchwinger dirProd(EvtVector4R v, EvtDiracSpinor u)
const EvtComplex & get_spinor(int i) const
void set(const EvtComplex &sp0, const EvtComplex &sp1, const EvtComplex &sp2, const EvtComplex &sp3)
void applyRotateEuler(double alpha, double beta, double gamma)
void applyBoostTo(const EvtVector4R &p4)
EvtDiracSpinor getSpinor(int i) const
void applyRotateEuler(double alpha, double beta, double gamma)
void setSpinor(int i, const EvtDiracSpinor &sp)
void set(int i, int j, const EvtComplex &sp)
EvtComplex get(int i, int j) const
EvtRaritaSchwinger & operator+=(const EvtRaritaSchwinger &u2)
EvtRaritaSchwinger & operator-=(const EvtRaritaSchwinger &u2)
void setVector(int i, const EvtVector4C &v)
EvtComplex m_rs[4][4]
void applyBoostTo(const EvtVector4R p4)
EvtVector4C getVector(int i) const
void applyRotateEuler(double alpha, double beta, double gamma)
const EvtComplex & get(int) const
void applyBoostTo(const EvtVector4R &p4)
double get(int i) const