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
EvtVector3C.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 EVTVECTOR3C_N
22
#define EVTVECTOR3C_N
23
24
#include "
EvtGenBase/EvtComplex.hh
"
25
#include "
EvtGenBase/EvtVector3R.hh
"
26
27
#include <iosfwd>
28
29
class
EvtVector3C
final {
30
friend
EvtVector3C
rotateEuler
(
const
EvtVector3C
& v,
double
phi,
31
double
theta,
double
ksi );
32
33
inline
friend
EvtVector3C
operator*
(
const
EvtComplex
& c,
34
const
EvtVector3C
& v2 );
35
inline
friend
EvtVector3C
operator*
(
const
EvtComplex
& c,
36
const
EvtVector3R
& v2 );
37
inline
friend
EvtComplex
operator*
(
const
EvtVector3R
& v1,
38
const
EvtVector3C
& v2 );
39
inline
friend
EvtComplex
operator*
(
const
EvtVector3C
& v1,
40
const
EvtVector3R
& v2 );
41
inline
friend
EvtComplex
operator*
(
const
EvtVector3C
& v1,
42
const
EvtVector3C
& v2 );
43
inline
friend
EvtVector3C
operator+
(
const
EvtVector3C
& v1,
44
const
EvtVector3C
& v2 );
45
inline
friend
EvtVector3C
operator-
(
const
EvtVector3C
& v1,
46
const
EvtVector3C
& v2 );
47
inline
friend
EvtVector3C
operator*
(
const
EvtVector3C
& v1,
48
const
EvtComplex
& c );
49
50
public
:
51
EvtVector3C
();
52
EvtVector3C
(
const
EvtComplex
&,
const
EvtComplex
&,
const
EvtComplex
& );
53
inline
void
set
(
const
int
,
const
EvtComplex
& );
54
inline
void
set
(
const
EvtComplex
&,
const
EvtComplex
&,
const
EvtComplex
& );
55
inline
void
set
(
double
,
double
,
double
);
56
inline
EvtVector3C
&
operator*=
(
const
EvtComplex
& c );
57
inline
EvtVector3C
&
operator/=
(
const
EvtComplex
& c );
58
inline
EvtVector3C
&
operator+=
(
const
EvtVector3C
& v2 );
59
inline
EvtVector3C
&
operator-=
(
const
EvtVector3C
& v2 );
60
inline
EvtVector3C
(
const
EvtVector3R
& v1 );
61
void
applyRotateEuler
(
double
phi,
double
theta,
double
ksi );
62
inline
const
EvtComplex
&
get
(
int
)
const
;
63
inline
EvtVector3C
conj
()
const
;
64
EvtVector3C
cross
(
const
EvtVector3C
& v2 );
65
friend
std::ostream&
operator<<
( std::ostream& c,
const
EvtVector3C
& v );
66
double
dot
(
const
EvtVector3C
& p2 );
67
68
private
:
69
EvtComplex
m_v
[3];
70
};
71
72
inline
EvtVector3C::EvtVector3C
(
const
EvtVector3R
& v1 )
73
{
74
m_v
[0] =
EvtComplex
( v1.
get
( 0 ), 0.0 );
75
m_v
[1] =
EvtComplex
( v1.
get
( 1 ), 0.0 );
76
m_v
[2] =
EvtComplex
( v1.
get
( 2 ), 0.0 );
77
}
78
79
inline
void
EvtVector3C::set
(
const
int
i,
const
EvtComplex
& c )
80
{
81
m_v
[i] = c;
82
}
83
84
inline
void
EvtVector3C::set
(
const
EvtComplex
& x,
const
EvtComplex
& y,
85
const
EvtComplex
& z )
86
{
87
m_v
[0] = x;
88
m_v
[1] = y;
89
m_v
[2] = z;
90
}
91
92
inline
void
EvtVector3C::set
(
double
x,
double
y,
double
z )
93
{
94
m_v
[0] =
EvtComplex
( x );
95
m_v
[1] =
EvtComplex
( y );
96
m_v
[2] =
EvtComplex
( z );
97
}
98
99
inline
const
EvtComplex
&
EvtVector3C::get
(
int
i )
const
100
{
101
return
m_v
[i];
102
}
103
104
inline
EvtVector3C
&
EvtVector3C::operator*=
(
const
EvtComplex
& c )
105
{
106
m_v
[0] *= c;
107
m_v
[1] *= c;
108
m_v
[2] *= c;
109
return
*
this
;
110
}
111
112
inline
EvtVector3C
&
EvtVector3C::operator/=
(
const
EvtComplex
& c )
113
{
114
m_v
[0] /= c;
115
m_v
[1] /= c;
116
m_v
[2] /= c;
117
return
*
this
;
118
}
119
120
inline
EvtVector3C
&
EvtVector3C::operator+=
(
const
EvtVector3C
& v2 )
121
{
122
m_v
[0] += v2.
m_v
[0];
123
m_v
[1] += v2.
m_v
[1];
124
m_v
[2] += v2.
m_v
[2];
125
return
*
this
;
126
}
127
128
inline
EvtVector3C
&
EvtVector3C::operator-=
(
const
EvtVector3C
& v2 )
129
{
130
m_v
[0] -= v2.
m_v
[0];
131
m_v
[1] -= v2.
m_v
[1];
132
m_v
[2] -= v2.
m_v
[2];
133
return
*
this
;
134
}
135
136
inline
EvtVector3C
operator+
(
const
EvtVector3C
& v1,
const
EvtVector3C
& v2 )
137
{
138
return
EvtVector3C
( v1 ) += v2;
139
}
140
141
inline
EvtVector3C
operator-
(
const
EvtVector3C
& v1,
const
EvtVector3C
& v2 )
142
{
143
return
EvtVector3C
( v1 ) -= v2;
144
}
145
146
inline
EvtVector3C
operator*
(
const
EvtVector3C
& v1,
const
EvtComplex
& c )
147
{
148
return
EvtVector3C
( v1 ) *= c;
149
}
150
151
inline
EvtVector3C
operator*
(
const
EvtComplex
& c,
const
EvtVector3C
& v2 )
152
{
153
return
EvtVector3C
( v2 ) *= c;
154
}
155
156
inline
EvtVector3C
operator*
(
const
EvtComplex
& c,
const
EvtVector3R
& v2 )
157
{
158
return
EvtVector3C
( v2 ) *= c;
159
}
160
161
inline
EvtComplex
operator*
(
const
EvtVector3R
& v1,
const
EvtVector3C
& v2 )
162
{
163
return
v1.
get
( 0 ) * v2.
m_v
[0] + v1.
get
( 1 ) * v2.
m_v
[1] +
164
v1.
get
( 2 ) * v2.
m_v
[2];
165
}
166
167
inline
EvtComplex
operator*
(
const
EvtVector3C
& v1,
const
EvtVector3R
& v2 )
168
{
169
return
v1.
m_v
[0] * v2.
get
( 0 ) + v1.
m_v
[1] * v2.
get
( 1 ) +
170
v1.
m_v
[2] * v2.
get
( 2 );
171
}
172
173
inline
EvtComplex
operator*
(
const
EvtVector3C
& v1,
const
EvtVector3C
& v2 )
174
{
175
return
v1.
m_v
[0] * v2.
m_v
[0] + v1.
m_v
[1] * v2.
m_v
[1] + v1.
m_v
[2] * v2.
m_v
[2];
176
}
177
178
inline
EvtVector3C
EvtVector3C::conj
()
const
179
{
180
return
EvtVector3C
(
::conj
(
m_v
[0] ),
::conj
(
m_v
[1] ),
::conj
(
m_v
[2] ) );
181
}
182
183
#endif
EvtComplex.hh
operator+
EvtVector3C operator+(const EvtVector3C &v1, const EvtVector3C &v2)
Definition
EvtVector3C.hh:136
operator-
EvtVector3C operator-(const EvtVector3C &v1, const EvtVector3C &v2)
Definition
EvtVector3C.hh:141
operator*
EvtVector3C operator*(const EvtVector3C &v1, const EvtComplex &c)
Definition
EvtVector3C.hh:146
EvtVector3R.hh
EvtComplex
Definition
EvtComplex.hh:29
EvtVector3C::EvtVector3C
EvtVector3C()
Definition
EvtVector3C.cpp:29
EvtVector3C::m_v
EvtComplex m_v[3]
Definition
EvtVector3C.hh:69
EvtVector3C::operator/=
EvtVector3C & operator/=(const EvtComplex &c)
Definition
EvtVector3C.hh:112
EvtVector3C::operator+
friend EvtVector3C operator+(const EvtVector3C &v1, const EvtVector3C &v2)
Definition
EvtVector3C.hh:136
EvtVector3C::operator-=
EvtVector3C & operator-=(const EvtVector3C &v2)
Definition
EvtVector3C.hh:128
EvtVector3C::dot
double dot(const EvtVector3C &p2)
EvtVector3C::cross
EvtVector3C cross(const EvtVector3C &v2)
Definition
EvtVector3C.cpp:44
EvtVector3C::operator<<
friend std::ostream & operator<<(std::ostream &c, const EvtVector3C &v)
EvtVector3C::operator+=
EvtVector3C & operator+=(const EvtVector3C &v2)
Definition
EvtVector3C.hh:120
EvtVector3C::rotateEuler
friend EvtVector3C rotateEuler(const EvtVector3C &v, double phi, double theta, double ksi)
Definition
EvtVector3C.cpp:57
EvtVector3C::operator-
friend EvtVector3C operator-(const EvtVector3C &v1, const EvtVector3C &v2)
Definition
EvtVector3C.hh:141
EvtVector3C::operator*=
EvtVector3C & operator*=(const EvtComplex &c)
Definition
EvtVector3C.hh:104
EvtVector3C::get
const EvtComplex & get(int) const
Definition
EvtVector3C.hh:99
EvtVector3C::set
void set(const int, const EvtComplex &)
Definition
EvtVector3C.hh:79
EvtVector3C::applyRotateEuler
void applyRotateEuler(double phi, double theta, double ksi)
Definition
EvtVector3C.cpp:65
EvtVector3C::operator*
friend EvtVector3C operator*(const EvtComplex &c, const EvtVector3C &v2)
Definition
EvtVector3C.hh:151
EvtVector3C::conj
EvtVector3C conj() const
Definition
EvtVector3C.hh:178
EvtVector3R
Definition
EvtVector3R.hh:26
EvtVector3R::get
double get(int i) const
Definition
EvtVector3R.hh:121
Generated by
1.17.0