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