/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Generator/BesEvtGen/BesEvtGen-00-03-58/src/EvtGen/EvtGenBase/Evt3Rank3C.cc

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 //
00003 // Environment:
00004 //      This software is part of the EvtGen package developed jointly
00005 //      for the BaBar and CLEO collaborations.  If you use all or part
00006 //      of it, please give an appropriate acknowledgement.
00007 //
00008 // Copyright Information: See EvtGen/COPYRIGHT
00009 //      Copyright (C) 1998      Caltech, UCSB
00010 //
00011 // Module: Evt3Rank3C.cc
00012 //
00013 // Description: Implementation of 3 Rank tensors.
00014 //
00015 // Modification history:
00016 //
00017 //    RYD     September 14, 1996         Module created
00018 //
00019 //------------------------------------------------------------------------
00020 #include "EvtGenBase/EvtPatches.hh"
00021 
00022 #include <iostream>
00023 #include <math.h>
00024 #include "EvtGenBase/Evt3Rank3C.hh"
00025 #include "EvtGenBase/EvtComplex.hh"
00026 #include "EvtGenBase/EvtVector3C.hh"
00027 #include "EvtGenBase/EvtTensor3C.hh"
00028 #include "EvtGenBase/EvtReport.hh"
00029 
00030 
00031 
00032 Evt3Rank3C::Evt3Rank3C( const Evt3Rank3C& t1 ) {
00033 
00034   int i,j,k;
00035   
00036   for(i=0;i<3;i++) {
00037     for(j=0;j<3;j++) {
00038       for(k=0;k<3;j++) {
00039         t[i][j][k] = t1.t[i][j][k];
00040       }
00041     }
00042   }
00043 }
00044 
00045 Evt3Rank3C::~Evt3Rank3C() { }
00046 
00047 
00048 Evt3Rank3C& Evt3Rank3C::operator=(const Evt3Rank3C& t1) {
00049   int i,j,k;
00050   
00051   for(i=0;i<3;i++) {
00052     for(j=0;j<3;j++) {
00053       for(k=0;k<3;k++) {
00054         t[i][j][k] = t1.t[i][j][k];
00055       }
00056     }
00057   }
00058   return *this;
00059 }
00060 
00061 
00062 Evt3Rank3C Evt3Rank3C::conj() const {
00063   Evt3Rank3C temp;
00064   
00065   int i,j,k;
00066   
00067   for(i=0;i<3;i++) {
00068     for(j=0;j<3;j++) {
00069       for(k=0;k<3;k++) {
00070         temp.set(j,i,k,::conj(t[i][j][k]));
00071       }
00072     }
00073   }
00074   return temp;
00075 }
00076 
00077 void Evt3Rank3C::zero(){
00078   int i,j,k;
00079   for(i=0;i<3;i++){
00080     for(j=0;j<3;j++){
00081       for(k=0;k<3;k++){
00082         t[i][j][k]=EvtComplex(0.0,0.0);
00083       }
00084     }
00085   }
00086 }
00087 
00088 
00089 Evt3Rank3C::Evt3Rank3C(){
00090   
00091   int i,j,k;
00092   
00093   for(i=0;i<3;i++){
00094     for(j=0;j<3;j++){
00095       for(k=0;k<3;k++){
00096         t[i][j][k]=EvtComplex(0.0,0.0);
00097       }
00098     }
00099   }
00100 
00101 }
00102 
00103 void Evt3Rank3C::dump() const {
00104   int i,j,k;
00105   for(k=0;k<3;k++){
00106     for(i=0;i<3;i++){
00107       for(j=0;j<3;j++){
00108         report(INFO,"EvtGen") <<t[k][i][j];
00109       }
00110       report(INFO,"EvtGen") << "\n";
00111     }
00112   }
00113 }
00114 
00115 Evt3Rank3C& Evt3Rank3C::operator+=(const Evt3Rank3C& t2){
00116   
00117   int i,j,k;
00118   
00119   for (i=0;i<3;i++) {
00120     for (j=0;j<3;j++) {
00121       for (k=0;k<3;k++) {
00122         t[i][j][k]+=t2.get(i,j,k);
00123       }
00124     }
00125   }
00126   return *this;
00127 }
00128 
00129 Evt3Rank3C& Evt3Rank3C::operator-=(const Evt3Rank3C& t2) {
00130 
00131   int i,j,k;
00132   
00133   for (i=0;i<3;i++) {
00134     for (j=0;j<3;j++) {
00135       for (k=0;k<3;k++) {
00136         t[i][j][k]-=t2.get(i,j,k);
00137       }
00138     }
00139   }
00140 
00141   return *this;
00142 
00143 }
00144 
00145 
00146 Evt3Rank3C& Evt3Rank3C::operator*=(const EvtComplex& c){
00147 
00148   int i,j,k;
00149   
00150   for (i=0;i<3;i++) {
00151     for (j=0;j<3;j++) {
00152       for (k=0;k<3;k++) {
00153         t[i][j][k]*=c;
00154       }
00155     }
00156   }
00157   return *this;
00158 }
00159 
00160 Evt3Rank3C& Evt3Rank3C::operator*=(const double c){
00161   int i,j,k;
00162   
00163   for (i=0;i<3;i++) {
00164     for (j=0;j<3;j++) {
00165       for (k=0;k<3;k++) {
00166         t[i][j][k]*=EvtComplex(c);
00167       }
00168     }
00169   }
00170 
00171   return *this;
00172 
00173 }
00174 
00175 Evt3Rank3C conj(const Evt3Rank3C& t2) { 
00176   Evt3Rank3C temp;
00177   
00178   int i,j,k;
00179 
00180   for(i=0;i<3;i++){ 
00181     for(j=0;j<3;j++){ 
00182       for(k=0;k<3;k++){ 
00183         temp.set(i,j,k,::conj((t2.get(i,j,k))));
00184       }
00185     }
00186   }
00187   return temp;
00188 }
00189 
00190 EvtTensor3C Evt3Rank3C::cont1(const EvtVector3C& v) const {
00191   EvtTensor3C temp;
00192   
00193   int i,k;
00194   
00195   for(i=0;i<3;i++){
00196     for(k=0;k<3;k++){
00197       temp.set(i,k,t[0][i][k]*v.get(0)+t[1][i][k]*v.get(1)
00198              +t[2][i][k]*v.get(2));
00199     }
00200   }
00201   return temp;
00202 } 
00203 
00204 
00205 EvtTensor3C Evt3Rank3C::cont2(const EvtVector3C& v) const {
00206   EvtTensor3C temp;
00207   
00208   int i,k;
00209   
00210   for(i=0;i<3;i++){
00211     for(k=0;k<3;k++){
00212       temp.set(i,k,t[i][0][k]*v.get(0)+t[i][1][k]*v.get(1)
00213              +t[i][2][k]*v.get(2));
00214     }
00215   }
00216   return temp;
00217 } 
00218 
00219 
00220 EvtTensor3C Evt3Rank3C::cont3(const EvtVector3C& v) const {
00221   EvtTensor3C temp;
00222   
00223   int i,k;
00224   
00225   for(i=0;i<3;i++){
00226     for(k=0;k<3;k++){
00227       temp.set(i,k,t[i][k][0]*v.get(0)+t[i][k][1]*v.get(1)
00228              +t[i][k][2]*v.get(2));
00229     }
00230   }
00231   return temp;
00232 } 
00233 
00234 EvtTensor3C Evt3Rank3C::cont1(const EvtVector3R& v) const {
00235   EvtTensor3C temp;
00236   
00237   int i,k;
00238   
00239   for(i=0;i<3;i++){
00240     for(k=0;k<3;k++){
00241       temp.set(i,k,t[0][i][k]*v.get(0)+t[1][i][k]*v.get(1)
00242              +t[2][i][k]*v.get(2));
00243     }
00244   }
00245   return temp;
00246 } 
00247 
00248 
00249 EvtTensor3C Evt3Rank3C::cont2(const EvtVector3R& v) const {
00250   EvtTensor3C temp;
00251   
00252   int i,k;
00253   
00254   for(i=0;i<3;i++){
00255     for(k=0;k<3;k++){
00256       temp.set(i,k,t[i][0][k]*v.get(0)+t[i][1][k]*v.get(1)
00257              +t[i][2][k]*v.get(2));
00258     }
00259   }
00260   return temp;
00261 } 
00262 
00263 
00264 EvtTensor3C Evt3Rank3C::cont3(const EvtVector3R& v) const {
00265   EvtTensor3C temp;
00266   
00267   int i,k;
00268   
00269   for(i=0;i<3;i++){
00270     for(k=0;k<3;k++){
00271       temp.set(i,k,t[i][k][0]*v.get(0)+t[i][k][1]*v.get(1)
00272              +t[i][k][2]*v.get(2));
00273     }
00274   }
00275   return temp;
00276 } 
00277 

Generated on Tue Nov 29 23:12:12 2016 for BOSS_7.0.2 by  doxygen 1.4.7