EvtGen
2.2.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
Toggle main menu visibility
Loading...
Searching...
No Matches
EvtGenBase
EvtVector4C.hh
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
21
#ifndef EVTVECTOR4C_HH
22
#define EVTVECTOR4C_HH
23
24
#include "
EvtGenBase/EvtComplex.hh
"
25
#include "
EvtGenBase/EvtVector3C.hh
"
26
#include "
EvtGenBase/EvtVector4R.hh
"
27
28
#include <iosfwd>
29
30
class
EvtVector4C
final {
31
inline
friend
EvtVector4C
operator*
(
double
d,
const
EvtVector4C
& v2 );
32
inline
friend
EvtVector4C
operator*
(
const
EvtComplex
& c,
33
const
EvtVector4C
& v2 );
34
inline
friend
EvtVector4C
operator*
(
const
EvtVector4C
& v2,
35
const
EvtComplex
& c );
36
inline
friend
EvtVector4C
operator*
(
const
EvtComplex
& c,
37
const
EvtVector4R
& v2 );
38
inline
friend
EvtComplex
operator*
(
const
EvtVector4R
& v1,
39
const
EvtVector4C
& v2 );
40
inline
friend
EvtComplex
operator*
(
const
EvtVector4C
& v1,
41
const
EvtVector4R
& v2 );
42
inline
friend
EvtComplex
operator*
(
const
EvtVector4C
& v1,
43
const
EvtVector4C
& v2 );
44
friend
EvtVector4C
operator+
(
const
EvtVector4C
& v1,
const
EvtVector4C
& v2 );
45
friend
EvtVector4C
operator-
(
const
EvtVector4C
& v1,
const
EvtVector4C
& v2 );
46
47
public
:
48
EvtVector4C
();
49
EvtVector4C
(
const
EvtComplex
&,
const
EvtComplex
&,
const
EvtComplex
&,
50
const
EvtComplex
& );
51
inline
void
set
(
int
,
const
EvtComplex
& );
52
inline
void
set
(
const
EvtComplex
&,
const
EvtComplex
&,
const
EvtComplex
&,
53
const
EvtComplex
& );
54
inline
void
set
(
double
,
double
,
double
,
double
);
55
inline
EvtVector4C
(
const
EvtVector4R
& v1 );
56
inline
const
EvtComplex
&
get
(
int
)
const
;
57
inline
EvtComplex
cont
(
const
EvtVector4C
& v4 )
const
;
58
inline
EvtVector4C
conj
()
const
;
59
EvtVector3C
vec
()
const
;
60
inline
EvtVector4C
&
operator-=
(
const
EvtVector4C
& v2 );
61
inline
EvtVector4C
&
operator+=
(
const
EvtVector4C
& v2 );
62
inline
EvtVector4C
&
operator*=
(
const
EvtComplex
& c );
63
void
applyRotateEuler
(
double
alpha,
double
beta,
double
gamma );
64
void
applyBoostTo
(
const
EvtVector4R
& p4 );
65
void
applyBoostTo
(
const
EvtVector3R
& boost );
66
friend
std::ostream&
operator<<
( std::ostream& s,
const
EvtVector4C
& v );
67
double
dot
(
const
EvtVector4C
& p2 );
68
69
private
:
70
EvtComplex
m_v
[4];
71
};
72
73
EvtVector4C
rotateEuler
(
const
EvtVector4C
& e,
double
alpha,
double
beta,
74
double
gamma );
75
EvtVector4C
boostTo
(
const
EvtVector4C
& e,
const
EvtVector4R
p4 );
76
EvtVector4C
boostTo
(
const
EvtVector4C
& e,
const
EvtVector3R
boost );
77
78
inline
EvtVector4C
&
EvtVector4C::operator+=
(
const
EvtVector4C
& v2 )
79
{
80
m_v
[0] += v2.
m_v
[0];
81
m_v
[1] += v2.
m_v
[1];
82
m_v
[2] += v2.
m_v
[2];
83
m_v
[3] += v2.
m_v
[3];
84
85
return
*
this
;
86
}
87
88
inline
EvtVector4C
&
EvtVector4C::operator-=
(
const
EvtVector4C
& v2 )
89
{
90
m_v
[0] -= v2.
m_v
[0];
91
m_v
[1] -= v2.
m_v
[1];
92
m_v
[2] -= v2.
m_v
[2];
93
m_v
[3] -= v2.
m_v
[3];
94
95
return
*
this
;
96
}
97
98
inline
void
EvtVector4C::set
(
int
i,
const
EvtComplex
& c )
99
{
100
m_v
[i] = c;
101
}
102
103
inline
EvtVector3C
EvtVector4C::vec
()
const
104
{
105
return
EvtVector3C
(
m_v
[1],
m_v
[2],
m_v
[3] );
106
}
107
108
inline
void
EvtVector4C::set
(
const
EvtComplex
& e,
const
EvtComplex
& p1,
109
const
EvtComplex
& p2,
const
EvtComplex
& p3 )
110
{
111
m_v
[0] = e;
112
m_v
[1] = p1;
113
m_v
[2] = p2;
114
m_v
[3] = p3;
115
}
116
117
inline
void
EvtVector4C::set
(
double
e,
double
p1,
double
p2,
double
p3 )
118
{
119
m_v
[0] =
EvtComplex
( e );
120
m_v
[1] =
EvtComplex
( p1 );
121
m_v
[2] =
EvtComplex
( p2 );
122
m_v
[3] =
EvtComplex
( p3 );
123
}
124
125
inline
const
EvtComplex
&
EvtVector4C::get
(
int
i )
const
126
{
127
return
m_v
[i];
128
}
129
130
inline
EvtVector4C
operator+
(
const
EvtVector4C
& v1,
const
EvtVector4C
& v2 )
131
{
132
return
EvtVector4C
( v1 ) += v2;
133
}
134
135
inline
EvtVector4C
operator-
(
const
EvtVector4C
& v1,
const
EvtVector4C
& v2 )
136
{
137
return
EvtVector4C
( v1 ) -= v2;
138
}
139
140
inline
EvtComplex
EvtVector4C::cont
(
const
EvtVector4C
& v4 )
const
141
{
142
return
m_v
[0] * v4.
m_v
[0] -
m_v
[1] * v4.
m_v
[1] -
m_v
[2] * v4.
m_v
[2] -
143
m_v
[3] * v4.
m_v
[3];
144
}
145
146
inline
EvtVector4C
&
EvtVector4C::operator*=
(
const
EvtComplex
& c )
147
{
148
m_v
[0] *= c;
149
m_v
[1] *= c;
150
m_v
[2] *= c;
151
m_v
[3] *= c;
152
153
return
*
this
;
154
}
155
156
inline
EvtVector4C
operator*
(
double
d,
const
EvtVector4C
& v2 )
157
{
158
return
EvtVector4C
( v2.
m_v
[0] * d, v2.
m_v
[1] * d, v2.
m_v
[2] * d,
159
v2.
m_v
[3] * d );
160
}
161
162
inline
EvtVector4C
operator*
(
const
EvtComplex
& c,
const
EvtVector4C
& v2 )
163
{
164
return
EvtVector4C
( v2 ) *= c;
165
}
166
167
inline
EvtVector4C
operator*
(
const
EvtVector4C
& v2,
const
EvtComplex
& c )
168
{
169
return
EvtVector4C
( v2 ) *= c;
170
}
171
172
inline
EvtVector4C
operator*
(
const
EvtComplex
& c,
const
EvtVector4R
& v2 )
173
{
174
return
EvtVector4C
( c * v2.
get
( 0 ), c * v2.
get
( 1 ), c * v2.
get
( 2 ),
175
c * v2.
get
( 3 ) );
176
}
177
178
inline
EvtVector4C::EvtVector4C
(
const
EvtVector4R
& v1 )
179
{
180
m_v
[0] =
EvtComplex
( v1.
get
( 0 ) );
181
m_v
[1] =
EvtComplex
( v1.
get
( 1 ) );
182
m_v
[2] =
EvtComplex
( v1.
get
( 2 ) );
183
m_v
[3] =
EvtComplex
( v1.
get
( 3 ) );
184
}
185
186
inline
EvtComplex
operator*
(
const
EvtVector4R
& v1,
const
EvtVector4C
& v2 )
187
{
188
return
v1.
get
( 0 ) * v2.
m_v
[0] - v1.
get
( 1 ) * v2.
m_v
[1] -
189
v1.
get
( 2 ) * v2.
m_v
[2] - v1.
get
( 3 ) * v2.
m_v
[3];
190
}
191
192
inline
EvtComplex
operator*
(
const
EvtVector4C
& v1,
const
EvtVector4R
& v2 )
193
{
194
return
v1.
m_v
[0] * v2.
get
( 0 ) - v1.
m_v
[1] * v2.
get
( 1 ) -
195
v1.
m_v
[2] * v2.
get
( 2 ) - v1.
m_v
[3] * v2.
get
( 3 );
196
}
197
198
inline
EvtComplex
operator*
(
const
EvtVector4C
& v1,
const
EvtVector4C
& v2 )
199
{
200
return
v1.
m_v
[0] * v2.
m_v
[0] - v1.
m_v
[1] * v2.
m_v
[1] -
201
v1.
m_v
[2] * v2.
m_v
[2] - v1.
m_v
[3] * v2.
m_v
[3];
202
}
203
204
inline
EvtVector4C
EvtVector4C::conj
()
const
205
{
206
return
EvtVector4C
(
::conj
(
m_v
[0] ),
::conj
(
m_v
[1] ),
::conj
(
m_v
[2] ),
207
::conj
(
m_v
[3] ) );
208
}
209
210
#endif
EvtComplex.hh
EvtVector3C.hh
boostTo
EvtVector4C boostTo(const EvtVector4C &e, const EvtVector4R p4)
Definition
EvtVector4C.cpp:55
operator-
EvtVector4C operator-(const EvtVector4C &v1, const EvtVector4C &v2)
Definition
EvtVector4C.hh:135
operator+
EvtVector4C operator+(const EvtVector4C &v1, const EvtVector4C &v2)
Definition
EvtVector4C.hh:130
rotateEuler
EvtVector4C rotateEuler(const EvtVector4C &e, double alpha, double beta, double gamma)
Definition
EvtVector4C.cpp:47
operator*
EvtVector4C operator*(double d, const EvtVector4C &v2)
Definition
EvtVector4C.hh:156
EvtVector4R.hh
EvtComplex
Definition
EvtComplex.hh:29
EvtVector3C
Definition
EvtVector3C.hh:29
EvtVector3R
Definition
EvtVector3R.hh:26
EvtVector4C
Definition
EvtVector4C.hh:30
EvtVector4C::dot
double dot(const EvtVector4C &p2)
EvtVector4C::applyRotateEuler
void applyRotateEuler(double alpha, double beta, double gamma)
Definition
EvtVector4C.cpp:128
EvtVector4C::conj
EvtVector4C conj() const
Definition
EvtVector4C.hh:204
EvtVector4C::set
void set(int, const EvtComplex &)
Definition
EvtVector4C.hh:98
EvtVector4C::operator+=
EvtVector4C & operator+=(const EvtVector4C &v2)
Definition
EvtVector4C.hh:78
EvtVector4C::operator<<
friend std::ostream & operator<<(std::ostream &s, const EvtVector4C &v)
EvtVector4C::operator-
friend EvtVector4C operator-(const EvtVector4C &v1, const EvtVector4C &v2)
Definition
EvtVector4C.hh:135
EvtVector4C::m_v
EvtComplex m_v[4]
Definition
EvtVector4C.hh:70
EvtVector4C::operator+
friend EvtVector4C operator+(const EvtVector4C &v1, const EvtVector4C &v2)
Definition
EvtVector4C.hh:130
EvtVector4C::get
const EvtComplex & get(int) const
Definition
EvtVector4C.hh:125
EvtVector4C::operator-=
EvtVector4C & operator-=(const EvtVector4C &v2)
Definition
EvtVector4C.hh:88
EvtVector4C::EvtVector4C
EvtVector4C()
Definition
EvtVector4C.cpp:30
EvtVector4C::operator*
friend EvtVector4C operator*(double d, const EvtVector4C &v2)
Definition
EvtVector4C.hh:156
EvtVector4C::applyBoostTo
void applyBoostTo(const EvtVector4R &p4)
Definition
EvtVector4C.cpp:69
EvtVector4C::operator*=
EvtVector4C & operator*=(const EvtComplex &c)
Definition
EvtVector4C.hh:146
EvtVector4C::cont
EvtComplex cont(const EvtVector4C &v4) const
Definition
EvtVector4C.hh:140
EvtVector4C::vec
EvtVector3C vec() const
Definition
EvtVector4C.hh:103
EvtVector4R
Definition
EvtVector4R.hh:29
EvtVector4R::get
double get(int i) const
Definition
EvtVector4R.hh:163
Generated by
1.17.0