Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
//--------------------------------------------------------------------------
//
// Environment:
// This software is part of the EvtGen package developed jointly
// for the BaBar and CLEO collaborations. If you use all or part
// of it, please give an appropriate acknowledgement.
//
// Copyright Information: See EvtGen/COPYRIGHT
// Copyright (C) 1998 Caltech, UCSB
//
// Module: EvtGen/EvtTensor4C.hh
//
// Description: Class to handle complex tensor manipulation
//
// Modification history:
//
// DJL/RYD September 25, 1996 Module created
//
//------------------------------------------------------------------------
#ifndef EvtTensor4C_HH
#define EvtTensor4C_HH
#include "PspGen/EvtComplex.hh"
//Class to handle 4D complex valued tensors.
class EvtTensor4C;
class EvtVector4C;
class EvtVector4R;
class EvtVector3R;
class EvtTensor4C {
friend EvtTensor4C rotateEuler(const EvtTensor4C& e,
double alpha,double beta,double gamma);
friend EvtTensor4C boostTo(const EvtTensor4C& e,
const EvtVector4R p4);
friend EvtTensor4C boostTo(const EvtTensor4C& e,
const EvtVector3R boost);
friend EvtTensor4C directProd(const EvtVector4C& c1,const EvtVector4C& c2);
friend EvtTensor4C directProd(const EvtVector4C& c1,const EvtVector4R& c2);
friend EvtTensor4C directProd(const EvtVector4R& c1,const EvtVector4R& c2);
friend EvtTensor4C dual(const EvtTensor4C& t2);
friend EvtTensor4C conj(const EvtTensor4C& t2);
friend EvtTensor4C cont22(const EvtTensor4C& t1,const EvtTensor4C& t2);
friend EvtTensor4C cont11(const EvtTensor4C& t1,const EvtTensor4C& t2);
friend EvtTensor4C operator*(const EvtTensor4C& t1,const EvtComplex& c);
friend EvtTensor4C operator*(const EvtComplex& c,const EvtTensor4C& t1);
friend EvtTensor4C operator*(const EvtTensor4C& t1,double d);
friend EvtTensor4C operator*(double d,const EvtTensor4C& t1);
friend EvtComplex cont(const EvtTensor4C& t1,const EvtTensor4C& t2);
friend EvtTensor4C operator+(const EvtTensor4C& t1,const EvtTensor4C& t2);
friend EvtTensor4C operator-(const EvtTensor4C& t1,const EvtTensor4C& t2);
public:
EvtTensor4C() {;}
EvtTensor4C(double t00,double t11,double t22, double t33) { setdiag(t00,t11,t22,t33);}
EvtTensor4C(const EvtTensor4C& t1 );
virtual ~EvtTensor4C();
EvtTensor4C& operator=(const EvtTensor4C& t1);
EvtTensor4C& operator*=(const EvtComplex& c);
EvtTensor4C& operator*=(double d);
EvtTensor4C& addDirProd(const EvtVector4R& p1,const EvtVector4R& p2);
static const EvtTensor4C& g();
inline void set(int i,int j,const EvtComplex& c);
void setdiag(double t00,double t11,double t22, double t33);
inline const EvtComplex& get(int i, int j) const;
inline EvtComplex trace() const;
void zero();
void applyRotateEuler(double alpha,double beta,double gamma);
void applyBoostTo(const EvtVector4R& p4);
void applyBoostTo(const EvtVector3R& boost);
friend std::ostream& operator<<(std::ostream& s, const EvtTensor4C& t);
EvtTensor4C& operator+=(const EvtTensor4C& t2);
EvtTensor4C& operator-=(const EvtTensor4C& t2);
EvtTensor4C conj() const;
EvtVector4C cont1(const EvtVector4C& v4) const;
EvtVector4C cont2(const EvtVector4C& v4) const;
EvtVector4C cont1(const EvtVector4R& v4) const;
EvtVector4C cont2(const EvtVector4R& v4) const;
private:
EvtComplex t[4][4];
};
inline EvtTensor4C operator+(const EvtTensor4C& t1,const EvtTensor4C& t2){
return EvtTensor4C(t1)+=t2;
}
inline EvtTensor4C operator-(const EvtTensor4C& t1,const EvtTensor4C& t2){
return EvtTensor4C(t1)-=t2;
}
inline void EvtTensor4C::set(int i,int j,const EvtComplex& c){
t[i][j]=c;
}
inline const EvtComplex& EvtTensor4C::get(int i,int j) const{
return t[i][j];
}
inline EvtComplex EvtTensor4C::trace() const{
return t[0][0]-t[1][1]-t[2][2]-t[3][3];
}
#endif