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
EvtTensor4C.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 EvtTensor4C_HH
22
#define EvtTensor4C_HH
23
24
#include "
EvtGenBase/EvtComplex.hh
"
25
26
//Class to handle 4D complex valued tensors.
27
class
EvtTensor4C
;
28
class
EvtVector4C
;
29
class
EvtVector4R
;
30
class
EvtVector3R
;
31
32
namespace
EvtGenFunctions
{
33
EvtTensor4C
directProd
(
const
EvtVector4R& c1,
const
EvtVector4R& c2 );
34
EvtTensor4C
directProd
(
const
EvtVector4C& c1,
const
EvtVector4C& c2 );
35
EvtTensor4C
directProd
(
const
EvtVector4C& c1,
const
EvtVector4R& c2 );
36
}
// namespace EvtGenFunctions
37
38
class
EvtTensor4C
final {
39
friend
EvtTensor4C
EvtGenFunctions::directProd
(
const
EvtVector4R
& c1,
40
const
EvtVector4R
& c2 );
41
friend
EvtTensor4C
EvtGenFunctions::directProd
(
const
EvtVector4C
& c1,
42
const
EvtVector4C
& c2 );
43
friend
EvtTensor4C
EvtGenFunctions::directProd
(
const
EvtVector4C
& c1,
44
const
EvtVector4R
& c2 );
45
46
friend
EvtTensor4C
rotateEuler
(
const
EvtTensor4C
& e,
double
alpha,
47
double
beta,
double
gamma );
48
friend
EvtTensor4C
boostTo
(
const
EvtTensor4C
& e,
const
EvtVector4R
p4 );
49
friend
EvtTensor4C
boostTo
(
const
EvtTensor4C
& e,
const
EvtVector3R
boost );
50
friend
EvtTensor4C
dual
(
const
EvtTensor4C
& t2 );
51
friend
EvtTensor4C
conj
(
const
EvtTensor4C
& t2 );
52
friend
EvtTensor4C
cont22
(
const
EvtTensor4C
& t1,
const
EvtTensor4C
& t2 );
53
friend
EvtTensor4C
cont11
(
const
EvtTensor4C
& t1,
const
EvtTensor4C
& t2 );
54
friend
EvtTensor4C
operator*
(
const
EvtTensor4C
& t1,
const
EvtComplex
& c );
55
friend
EvtTensor4C
operator*
(
const
EvtComplex
& c,
const
EvtTensor4C
& t1 );
56
friend
EvtTensor4C
operator*
(
const
EvtTensor4C
& t1,
double
d );
57
friend
EvtTensor4C
operator*
(
double
d,
const
EvtTensor4C
& t1 );
58
friend
EvtComplex
cont
(
const
EvtTensor4C
& t1,
const
EvtTensor4C
& t2 );
59
friend
EvtTensor4C
operator+
(
const
EvtTensor4C
& t1,
const
EvtTensor4C
& t2 );
60
friend
EvtTensor4C
operator-
(
const
EvtTensor4C
& t1,
const
EvtTensor4C
& t2 );
61
62
public
:
63
EvtTensor4C
() { ; }
64
65
EvtTensor4C
(
double
t00,
double
t11,
double
t22,
double
t33 )
66
{
67
setdiag
( t00, t11, t22, t33 );
68
}
69
70
EvtTensor4C
(
const
EvtTensor4C
& t1 );
71
EvtTensor4C
&
operator=
(
const
EvtTensor4C
& t1 );
72
EvtTensor4C
&
operator*=
(
const
EvtComplex
& c );
73
EvtTensor4C
&
operator*=
(
double
d );
74
EvtTensor4C
&
addDirProd
(
const
EvtVector4R
& p1,
const
EvtVector4R
& p2 );
75
static
const
EvtTensor4C
&
g
();
76
inline
void
set
(
int
i,
int
j,
const
EvtComplex
& c );
77
void
setdiag
(
double
t00,
double
t11,
double
t22,
double
t33 );
78
inline
const
EvtComplex
&
get
(
int
i,
int
j )
const
;
79
inline
EvtComplex
trace
()
const
;
80
void
zero
();
81
void
applyRotateEuler
(
double
alpha,
double
beta,
double
gamma );
82
void
applyBoostTo
(
const
EvtVector4R
& p4 );
83
void
applyBoostTo
(
const
EvtVector3R
& boost );
84
friend
std::ostream&
operator<<
( std::ostream& s,
const
EvtTensor4C
& t );
85
EvtTensor4C
&
operator+=
(
const
EvtTensor4C
& t2 );
86
EvtTensor4C
&
operator-=
(
const
EvtTensor4C
& t2 );
87
EvtTensor4C
conj
()
const
;
88
EvtVector4C
cont1
(
const
EvtVector4C
& v4 )
const
;
89
EvtVector4C
cont2
(
const
EvtVector4C
& v4 )
const
;
90
EvtVector4C
cont1
(
const
EvtVector4R
& v4 )
const
;
91
EvtVector4C
cont2
(
const
EvtVector4R
& v4 )
const
;
92
93
private
:
94
EvtComplex
m_t
[4][4];
95
};
96
97
inline
EvtTensor4C
operator+
(
const
EvtTensor4C
& t1,
const
EvtTensor4C
& t2 )
98
{
99
return
EvtTensor4C
( t1 ) += t2;
100
}
101
102
inline
EvtTensor4C
operator-
(
const
EvtTensor4C
& t1,
const
EvtTensor4C
& t2 )
103
{
104
return
EvtTensor4C
( t1 ) -= t2;
105
}
106
107
inline
void
EvtTensor4C::set
(
int
i,
int
j,
const
EvtComplex
& c )
108
{
109
m_t
[i][j] = c;
110
}
111
112
inline
const
EvtComplex
&
EvtTensor4C::get
(
int
i,
int
j )
const
113
{
114
return
m_t
[i][j];
115
}
116
117
inline
EvtComplex
EvtTensor4C::trace
()
const
118
{
119
return
m_t
[0][0] -
m_t
[1][1] -
m_t
[2][2] -
m_t
[3][3];
120
}
121
122
#endif
EvtComplex.hh
operator-
EvtTensor4C operator-(const EvtTensor4C &t1, const EvtTensor4C &t2)
Definition
EvtTensor4C.hh:102
operator+
EvtTensor4C operator+(const EvtTensor4C &t1, const EvtTensor4C &t2)
Definition
EvtTensor4C.hh:97
EvtComplex
Definition
EvtComplex.hh:29
EvtTensor4C
Definition
EvtTensor4C.hh:38
EvtTensor4C::operator-
friend EvtTensor4C operator-(const EvtTensor4C &t1, const EvtTensor4C &t2)
Definition
EvtTensor4C.hh:102
EvtTensor4C::dual
friend EvtTensor4C dual(const EvtTensor4C &t2)
Definition
EvtTensor4C.cpp:363
EvtTensor4C::setdiag
void setdiag(double t00, double t11, double t22, double t33)
Definition
EvtTensor4C.cpp:202
EvtTensor4C::rotateEuler
friend EvtTensor4C rotateEuler(const EvtTensor4C &e, double alpha, double beta, double gamma)
Definition
EvtTensor4C.cpp:76
EvtTensor4C::cont
friend EvtComplex cont(const EvtTensor4C &t1, const EvtTensor4C &t2)
Definition
EvtTensor4C.cpp:290
EvtTensor4C::zero
void zero()
Definition
EvtTensor4C.cpp:179
EvtTensor4C::trace
EvtComplex trace() const
Definition
EvtTensor4C.hh:117
EvtTensor4C::set
void set(int i, int j, const EvtComplex &c)
Definition
EvtTensor4C.hh:107
EvtTensor4C::get
const EvtComplex & get(int i, int j) const
Definition
EvtTensor4C.hh:112
EvtTensor4C::operator=
EvtTensor4C & operator=(const EvtTensor4C &t1)
Definition
EvtTensor4C.cpp:50
EvtTensor4C::operator-=
EvtTensor4C & operator-=(const EvtTensor4C &t2)
Definition
EvtTensor4C.cpp:234
EvtTensor4C::cont1
EvtVector4C cont1(const EvtVector4C &v4) const
Definition
EvtTensor4C.cpp:446
EvtTensor4C::g
static const EvtTensor4C & g()
Definition
EvtTensor4C.cpp:43
EvtTensor4C::applyBoostTo
void applyBoostTo(const EvtVector4R &p4)
Definition
EvtTensor4C.cpp:98
EvtTensor4C::conj
EvtTensor4C conj() const
Definition
EvtTensor4C.cpp:62
EvtTensor4C::operator+
friend EvtTensor4C operator+(const EvtTensor4C &t1, const EvtTensor4C &t2)
Definition
EvtTensor4C.hh:97
EvtTensor4C::operator<<
friend std::ostream & operator<<(std::ostream &s, const EvtTensor4C &t)
EvtTensor4C::addDirProd
EvtTensor4C & addDirProd(const EvtVector4R &p1, const EvtVector4R &p2)
Definition
EvtTensor4C.cpp:350
EvtTensor4C::cont22
friend EvtTensor4C cont22(const EvtTensor4C &t1, const EvtTensor4C &t2)
Definition
EvtTensor4C.cpp:408
EvtTensor4C::operator*=
EvtTensor4C & operator*=(const EvtComplex &c)
Definition
EvtTensor4C.cpp:246
EvtTensor4C::cont11
friend EvtTensor4C cont11(const EvtTensor4C &t1, const EvtTensor4C &t2)
Definition
EvtTensor4C.cpp:427
EvtTensor4C::cont2
EvtVector4C cont2(const EvtVector4C &v4) const
Definition
EvtTensor4C.cpp:460
EvtTensor4C::m_t
EvtComplex m_t[4][4]
Definition
EvtTensor4C.hh:94
EvtTensor4C::operator+=
EvtTensor4C & operator+=(const EvtTensor4C &t2)
Definition
EvtTensor4C.cpp:222
EvtTensor4C::operator*
friend EvtTensor4C operator*(const EvtTensor4C &t1, const EvtComplex &c)
Definition
EvtTensor4C.cpp:258
EvtTensor4C::applyRotateEuler
void applyRotateEuler(double alpha, double beta, double gamma)
Definition
EvtTensor4C.cpp:502
EvtTensor4C::boostTo
friend EvtTensor4C boostTo(const EvtTensor4C &e, const EvtVector4R p4)
Definition
EvtTensor4C.cpp:84
EvtTensor4C::EvtTensor4C
EvtTensor4C(double t00, double t11, double t22, double t33)
Definition
EvtTensor4C.hh:65
EvtTensor4C::EvtTensor4C
EvtTensor4C()
Definition
EvtTensor4C.hh:63
EvtVector3R
Definition
EvtVector3R.hh:26
EvtVector4C
Definition
EvtVector4C.hh:30
EvtVector4R
Definition
EvtVector4R.hh:29
EvtGenFunctions
Definition
EvtGammaMatrix.hh:31
EvtGenFunctions::directProd
EvtTensor3C directProd(const EvtVector3C &c1, const EvtVector3C &c2)
Definition
EvtTensor3C.cpp:153
Generated by
1.17.0