]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TEvtGen/EvtGenBase/Evt3Rank3C.cpp
Updates EvtGen Code
[u/mrichter/AliRoot.git] / TEvtGen / EvtGenBase / Evt3Rank3C.cpp
CommitLineData
da0e9ce3 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: Evt3Rank3C.cc
12//
13// Description: Implementation of complex 3Rank 3D tensors.
14//
15// Modification history:
16//
17// RYD September 14, 1996 Module created
18//
19//------------------------------------------------------------------------
20#include "EvtGenBase/EvtPatches.hh"
21
22#include <iostream>
23#include <math.h>
24#include "EvtGenBase/Evt3Rank3C.hh"
25#include "EvtGenBase/EvtComplex.hh"
26#include "EvtGenBase/EvtVector3C.hh"
27#include "EvtGenBase/EvtTensor3C.hh"
28#include "EvtGenBase/EvtReport.hh"
29
30
31
32Evt3Rank3C::Evt3Rank3C( const Evt3Rank3C& t1 ) {
33
34 int i,j,k;
35
36 for(i=0;i<3;i++) {
37 for(j=0;j<3;j++) {
38 for(k=0;k<3;j++) {
39 t[i][j][k] = t1.t[i][j][k];
40 }
41 }
42 }
43}
44
45Evt3Rank3C::~Evt3Rank3C() { }
46
47
48Evt3Rank3C& Evt3Rank3C::operator=(const Evt3Rank3C& t1) {
49 int i,j,k;
50
51 for(i=0;i<3;i++) {
52 for(j=0;j<3;j++) {
53 for(k=0;k<3;k++) {
54 t[i][j][k] = t1.t[i][j][k];
55 }
56 }
57 }
58 return *this;
59}
60
61
62Evt3Rank3C Evt3Rank3C::conj() const {
63 Evt3Rank3C temp;
64
65 int i,j,k;
66
67 for(i=0;i<3;i++) {
68 for(j=0;j<3;j++) {
69 for(k=0;k<3;k++) {
70 temp.set(i,j,k,::conj(t[i][j][k]));
71 }
72 }
73 }
74 return temp;
75}
76
77void Evt3Rank3C::zero(){
78 int i,j,k;
79 for(i=0;i<3;i++){
80 for(j=0;j<3;j++){
81 for(k=0;k<3;k++){
82 t[i][j][k]=EvtComplex(0.0,0.0);
83 }
84 }
85 }
86}
87
88
89Evt3Rank3C::Evt3Rank3C(){
90
91 int i,j,k;
92
93 for(i=0;i<3;i++){
94 for(j=0;j<3;j++){
95 for(k=0;k<3;k++){
96 t[i][j][k]=EvtComplex(0.0,0.0);
97 }
98 }
99 }
100
101}
102
103std::ostream& operator<<(std::ostream& s, const Evt3Rank3C& t2){
104 int i,j,k;
105 for(k=0;k<3;k++){
106 for(i=0;i<3;i++){
107 for(j=0;j<3;j++){
108 report(INFO,"EvtGen") <<t2.t[k][i][j];
109 }
110 report(INFO,"EvtGen") << "\n";
111 }
112 }
113 return s;
114}
115
116Evt3Rank3C& Evt3Rank3C::operator+=(const Evt3Rank3C& t2){
117
118 int i,j,k;
119
120 for (i=0;i<3;i++) {
121 for (j=0;j<3;j++) {
122 for (k=0;k<3;k++) {
123 t[i][j][k]+=t2.t[i][j][k];
124 }
125 }
126 }
127 return *this;
128}
129
130Evt3Rank3C& Evt3Rank3C::operator-=(const Evt3Rank3C& t2) {
131
132 int i,j,k;
133
134 for (i=0;i<3;i++) {
135 for (j=0;j<3;j++) {
136 for (k=0;k<3;k++) {
137 t[i][j][k]-=t2.t[i][j][k];
138 }
139 }
140 }
141
142 return *this;
143
144}
145
146
147Evt3Rank3C& Evt3Rank3C::operator*=(const EvtComplex& c){
148
149 int i,j,k;
150
151 for (i=0;i<3;i++) {
152 for (j=0;j<3;j++) {
153 for (k=0;k<3;k++) {
154 t[i][j][k]*=c;
155 }
156 }
157 }
158 return *this;
159}
160
161Evt3Rank3C& Evt3Rank3C::operator*=(const double c){
162 int i,j,k;
163
164 for (i=0;i<3;i++) {
165 for (j=0;j<3;j++) {
166 for (k=0;k<3;k++) {
167 t[i][j][k]*=c;
168 }
169 }
170 }
171
172 return *this;
173
174}
175
176Evt3Rank3C conj(const Evt3Rank3C& t2) {
177 Evt3Rank3C temp;
178
179 int i,j,k;
180
181 for(i=0;i<3;i++){
182 for(j=0;j<3;j++){
183 for(k=0;k<3;k++){
184 temp.t[i][j][k]=::conj(t2.t[i][j][k]);
185 }
186 }
187 }
188 return temp;
189}
190
191EvtTensor3C Evt3Rank3C::cont1(const EvtVector3C& v) const {
192 EvtTensor3C temp;
193
194 int i,k;
195
196 for(i=0;i<3;i++){
197 for(k=0;k<3;k++){
198 temp.set(i,k,t[0][i][k]*v.get(0)+t[1][i][k]*v.get(1)
199 +t[2][i][k]*v.get(2));
200 }
201 }
202 return temp;
203}
204
205
206EvtTensor3C Evt3Rank3C::cont2(const EvtVector3C& v) const {
207 EvtTensor3C temp;
208
209 int i,k;
210
211 for(i=0;i<3;i++){
212 for(k=0;k<3;k++){
213 temp.set(i,k,t[i][0][k]*v.get(0)+t[i][1][k]*v.get(1)
214 +t[i][2][k]*v.get(2));
215 }
216 }
217 return temp;
218}
219
220
221EvtTensor3C Evt3Rank3C::cont3(const EvtVector3C& v) const {
222 EvtTensor3C temp;
223
224 int i,k;
225
226 for(i=0;i<3;i++){
227 for(k=0;k<3;k++){
228 temp.set(i,k,t[i][k][0]*v.get(0)+t[i][k][1]*v.get(1)
229 +t[i][k][2]*v.get(2));
230 }
231 }
232 return temp;
233}
234
235EvtTensor3C Evt3Rank3C::cont1(const EvtVector3R& v) const {
236 EvtTensor3C temp;
237
238 int i,k;
239
240 for(i=0;i<3;i++){
241 for(k=0;k<3;k++){
242 temp.set(i,k,t[0][i][k]*v.get(0)+t[1][i][k]*v.get(1)
243 +t[2][i][k]*v.get(2));
244 }
245 }
246 return temp;
247}
248
249
250EvtTensor3C Evt3Rank3C::cont2(const EvtVector3R& v) const {
251 EvtTensor3C temp;
252
253 int i,k;
254
255 for(i=0;i<3;i++){
256 for(k=0;k<3;k++){
257 temp.set(i,k,t[i][0][k]*v.get(0)+t[i][1][k]*v.get(1)
258 +t[i][2][k]*v.get(2));
259 }
260 }
261 return temp;
262}
263
264
265EvtTensor3C Evt3Rank3C::cont3(const EvtVector3R& v) const {
266 EvtTensor3C temp;
267
268 int i,k;
269
270 for(i=0;i<3;i++){
271 for(k=0;k<3;k++){
272 temp.set(i,k,t[i][k][0]*v.get(0)+t[i][k][1]*v.get(1)
273 +t[i][k][2]*v.get(2));
274 }
275 }
276 return temp;
277}
278