]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TEvtGen/EvtGenBase/Evt3Rank3C.hh
AliDecayer realisation for the EvtGen code and EvtGen itself.
[u/mrichter/AliRoot.git] / TEvtGen / EvtGenBase / Evt3Rank3C.hh
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/Evt3Rank3C.hh
12 //
13 // Description:Class to handle complex 3rd rank 3D tensors
14 //
15 // Modification history:
16 //
17 //    RYD     September 14, 1997         Module created
18 //
19 //------------------------------------------------------------------------
20
21 #ifndef EVT3RANK3C_HH
22 #define EVT3RANK3C_HH
23
24 #include <iostream>
25 #include "EvtGenBase/EvtComplex.hh"
26
27 class EvtTensor3C;
28 class EvtVector3C;
29 class EvtVector3R;
30
31
32 class  Evt3Rank3C ;
33 inline Evt3Rank3C operator*(const EvtComplex& c,const Evt3Rank3C& t2);
34 inline Evt3Rank3C operator*(const double d,const Evt3Rank3C& t2);
35 inline Evt3Rank3C operator*(const Evt3Rank3C& t2,const EvtComplex& c);
36 inline Evt3Rank3C operator*(const Evt3Rank3C& t2,const double d);
37 inline Evt3Rank3C operator+(const Evt3Rank3C& t1,const Evt3Rank3C& t2);
38 inline Evt3Rank3C operator-(const Evt3Rank3C& t1,const Evt3Rank3C& t2);
39 Evt3Rank3C directProd(const EvtVector3C& c1,const EvtVector3C& c2,
40                       const EvtVector3C& c3); 
41 Evt3Rank3C conj(const Evt3Rank3C& t2);
42
43 Evt3Rank3C directProd(const EvtVector3C& c1,const EvtVector3C& c2,
44                               const EvtVector3C& c3);
45
46
47 class Evt3Rank3C {
48
49   friend Evt3Rank3C operator*(const EvtComplex& c,const Evt3Rank3C& t2);
50   friend Evt3Rank3C operator*(const double d,const Evt3Rank3C& t2);
51   friend Evt3Rank3C operator*(const Evt3Rank3C& t2,const EvtComplex& c);
52   friend Evt3Rank3C operator*(const Evt3Rank3C& t2,const double d);
53   friend Evt3Rank3C operator+(const Evt3Rank3C& t1,const Evt3Rank3C& t2);
54   friend Evt3Rank3C operator-(const Evt3Rank3C& t1,const Evt3Rank3C& t2);
55   friend Evt3Rank3C directProd(const EvtVector3C& c1,const EvtVector3C& c2,
56                               const EvtVector3C& c3); 
57   friend Evt3Rank3C conj(const Evt3Rank3C& t2);
58
59   friend std::ostream& operator<<(std::ostream& s, const Evt3Rank3C& t2);
60   
61 public:
62   Evt3Rank3C();
63   Evt3Rank3C(const Evt3Rank3C& t1 );
64   virtual ~Evt3Rank3C();
65   Evt3Rank3C& operator=(const Evt3Rank3C& t1);
66   inline void set(int i,int j,int k,const EvtComplex& c);
67   inline const EvtComplex& get(int i, int j, int k) const;
68   void zero();
69   
70
71   Evt3Rank3C& operator+=(const Evt3Rank3C& t2);
72   Evt3Rank3C& operator-=(const Evt3Rank3C& t2);
73   Evt3Rank3C& operator*=(const double d);
74   Evt3Rank3C& operator*=(const EvtComplex& c);
75   Evt3Rank3C conj() const;
76   EvtTensor3C cont1(const EvtVector3C& v) const; 
77   EvtTensor3C cont2(const EvtVector3C& v) const; 
78   EvtTensor3C cont3(const EvtVector3C& v) const; 
79   EvtTensor3C cont1(const EvtVector3R& v) const; 
80   EvtTensor3C cont2(const EvtVector3R& v) const; 
81   EvtTensor3C cont3(const EvtVector3R& v) const; 
82   
83   
84 private:
85
86   EvtComplex t[3][3][3];
87
88 };
89
90
91 inline Evt3Rank3C operator*(const EvtComplex& c,const Evt3Rank3C& t2){
92    return Evt3Rank3C(t2)*=c;
93 }
94
95 inline Evt3Rank3C operator*(const double d,const Evt3Rank3C& t2){
96    return Evt3Rank3C(t2)*=d;
97 }
98
99 inline Evt3Rank3C operator*(const Evt3Rank3C& t2,const EvtComplex& c){
100    return Evt3Rank3C(t2)*=c;
101 }
102
103 inline Evt3Rank3C operator*(const Evt3Rank3C& t2,const double d){
104    return Evt3Rank3C(t2)*=d;
105 }
106
107 inline Evt3Rank3C operator+(const Evt3Rank3C& t1,const Evt3Rank3C& t2){
108    return Evt3Rank3C(t1)+=t2;
109 }
110
111 inline Evt3Rank3C operator-(const Evt3Rank3C& t1,const Evt3Rank3C& t2){
112    return Evt3Rank3C(t1)-=t2;
113 }
114
115 inline void Evt3Rank3C::set(int i,int j,int k,const EvtComplex& c){
116    t[i][j][k]=c;
117 }
118
119 inline const EvtComplex& Evt3Rank3C::get(int i,int j,int k) const{
120    return t[i][j][k];
121 }
122
123
124 #endif
125
126