BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtTensor3C.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/EvtTensor3C.hh
12//
13// Description: Class to handle complex 3 tensors
14//
15// Modification history:
16//
17// RYD September 14, 1997 Module created
18//
19//------------------------------------------------------------------------
20
21#ifndef EVTTENSOR3C_HH
22#define EVTTENSOR3C_HH
23
24#include "EvtComplex.hh"
25#include <iostream>
26
27class EvtVector3C;
28class EvtVector3R;
29
30class EvtTensor3C;
31
32EvtTensor3C rotateEuler( const EvtTensor3C& v, double phi, double theta, double ksi );
33inline EvtTensor3C operator*( const EvtComplex& c, const EvtTensor3C& t2 );
34inline EvtTensor3C operator*( const double d, const EvtTensor3C& t2 );
35inline EvtTensor3C operator*( const EvtTensor3C& t2, const EvtComplex& c );
36inline EvtTensor3C operator*( const EvtTensor3C& t2, const double d );
37inline EvtTensor3C operator+( const EvtTensor3C& t1, const EvtTensor3C& t2 );
38inline EvtTensor3C operator-( const EvtTensor3C& t1, const EvtTensor3C& t2 );
39EvtTensor3C directProd( const EvtVector3C& c1, const EvtVector3C& c2 );
40EvtTensor3C directProd( const EvtVector3C& c1, const EvtVector3R& c2 );
41EvtTensor3C directProd( const EvtVector3R& c1, const EvtVector3R& c2 );
42EvtTensor3C conj( const EvtTensor3C& t2 );
43// Contract the second index of two tensors result(i,j) = t1(i,k)t2(j,k)
44EvtTensor3C cont22( const EvtTensor3C& t1, const EvtTensor3C& t2 );
45// Contract the first index of two tensors result(i,j) = t1(k,i)t2(k,j)
46EvtTensor3C cont11( const EvtTensor3C& t1, const EvtTensor3C& t2 );
47// Contract the last index of eps_{ijk} with w
49std::ostream& operator<<( std::ostream& c, const EvtTensor3C& v );
50
51//==================
53
54 friend EvtTensor3C rotateEuler( const EvtTensor3C& v, double phi, double theta, double ksi );
55 friend EvtTensor3C operator*( const EvtComplex& c, const EvtTensor3C& t2 );
56 friend EvtTensor3C operator*( const double d, const EvtTensor3C& t2 );
57 friend EvtTensor3C operator*( const EvtTensor3C& t2, const EvtComplex& c );
58 friend EvtTensor3C operator*( const EvtTensor3C& t2, const double d );
59 friend EvtTensor3C operator+( const EvtTensor3C& t1, const EvtTensor3C& t2 );
60 friend EvtTensor3C operator-( const EvtTensor3C& t1, const EvtTensor3C& t2 );
61 friend EvtTensor3C directProd( const EvtVector3C& c1, const EvtVector3C& c2 );
62 friend EvtTensor3C directProd( const EvtVector3C& c1, const EvtVector3R& c2 );
63 friend EvtTensor3C directProd( const EvtVector3R& c1, const EvtVector3R& c2 );
64 friend EvtTensor3C conj( const EvtTensor3C& t2 );
65 // Contract the second index of two tensors result(i,j) = t1(i,k)t2(j,k)
66 friend EvtTensor3C cont22( const EvtTensor3C& t1, const EvtTensor3C& t2 );
67 // Contract the first index of two tensors result(i,j) = t1(k,i)t2(k,j)
68 friend EvtTensor3C cont11( const EvtTensor3C& t1, const EvtTensor3C& t2 );
69 // Contract the last index of eps_{ijk} with w
70 friend EvtTensor3C eps( const EvtVector3R& v );
71 friend std::ostream& operator<<( std::ostream& c, const EvtTensor3C& v );
72
73public:
75 EvtTensor3C( const EvtTensor3C& t1 );
76 EvtTensor3C( double d11, double d22, double d33 );
77 virtual ~EvtTensor3C();
78 EvtTensor3C& operator=( const EvtTensor3C& t1 );
79 inline void set( int i, int j, const EvtComplex& c );
80 inline const EvtComplex& get( int i, int j ) const;
81 inline EvtComplex trace() const;
82 static const EvtTensor3C& id();
83 void zero();
84 void applyRotateEuler( double phi, double theta, double ksi );
85
88 EvtTensor3C operator*=( const double d );
90 EvtTensor3C conj() const;
91 EvtVector3C cont1( const EvtVector3C& v ) const;
92 EvtVector3C cont2( const EvtVector3C& v ) const;
93 EvtVector3C cont1( const EvtVector3R& v ) const;
94 EvtVector3C cont2( const EvtVector3R& v ) const;
95
96private:
97 EvtComplex t[3][3];
98};
99
100inline EvtTensor3C operator*( const EvtComplex& c, const EvtTensor3C& t2 ) {
101 return EvtTensor3C( t2 ) *= c;
102}
103
104inline EvtTensor3C operator*( const double d, const EvtTensor3C& t2 ) {
105 return EvtTensor3C( t2 ) *= d;
106}
107
108inline EvtTensor3C operator*( const EvtTensor3C& t2, const EvtComplex& c ) {
109 return EvtTensor3C( t2 ) *= c;
110}
111
112inline EvtTensor3C operator*( const EvtTensor3C& t2, const double d ) {
113 return EvtTensor3C( t2 ) *= d;
114}
115
116inline EvtTensor3C operator+( const EvtTensor3C& t1, const EvtTensor3C& t2 ) {
117 return EvtTensor3C( t1 ) += t2;
118}
119
120inline EvtTensor3C operator-( const EvtTensor3C& t1, const EvtTensor3C& t2 ) {
121 return EvtTensor3C( t1 ) -= t2;
122}
123
124inline void EvtTensor3C::set( int i, int j, const EvtComplex& c ) { t[i][j] = c; }
125
126inline const EvtComplex& EvtTensor3C::get( int i, int j ) const { return t[i][j]; }
127
128inline EvtComplex EvtTensor3C::trace() const { return t[0][0] + t[1][1] + t[2][2]; }
129
130#endif
EvtTensor3C conj(const EvtTensor3C &t2)
EvtTensor3C rotateEuler(const EvtTensor3C &v, double phi, double theta, double ksi)
EvtTensor3C directProd(const EvtVector3C &c1, const EvtVector3C &c2)
std::ostream & operator<<(std::ostream &c, const EvtTensor3C &v)
EvtTensor3C cont22(const EvtTensor3C &t1, const EvtTensor3C &t2)
EvtTensor3C operator*(const EvtComplex &c, const EvtTensor3C &t2)
EvtTensor3C operator-(const EvtTensor3C &t1, const EvtTensor3C &t2)
EvtTensor3C operator+(const EvtTensor3C &t1, const EvtTensor3C &t2)
EvtTensor3C eps(const EvtVector3R &v)
EvtTensor3C cont11(const EvtTensor3C &t1, const EvtTensor3C &t2)
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition KarLud.h:35
virtual ~EvtTensor3C()
const EvtComplex & get(int i, int j) const
friend EvtTensor3C rotateEuler(const EvtTensor3C &v, double phi, double theta, double ksi)
friend EvtTensor3C directProd(const EvtVector3C &c1, const EvtVector3C &c2)
EvtVector3C cont1(const EvtVector3C &v) const
void set(int i, int j, const EvtComplex &c)
friend std::ostream & operator<<(std::ostream &c, const EvtTensor3C &v)
void applyRotateEuler(double phi, double theta, double ksi)
friend EvtTensor3C cont22(const EvtTensor3C &t1, const EvtTensor3C &t2)
friend EvtTensor3C operator*(const EvtComplex &c, const EvtTensor3C &t2)
EvtVector3C cont2(const EvtVector3C &v) const
EvtTensor3C operator-=(const EvtTensor3C &t2)
friend EvtTensor3C operator-(const EvtTensor3C &t1, const EvtTensor3C &t2)
friend EvtTensor3C operator+(const EvtTensor3C &t1, const EvtTensor3C &t2)
static const EvtTensor3C & id()
EvtTensor3C conj() const
EvtTensor3C & operator=(const EvtTensor3C &t1)
friend EvtTensor3C eps(const EvtVector3R &v)
EvtComplex trace() const
EvtTensor3C operator*=(const double d)
EvtTensor3C operator+=(const EvtTensor3C &t2)
friend EvtTensor3C cont11(const EvtTensor3C &t1, const EvtTensor3C &t2)