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

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: EvtGen/EvtTensor3C.hh
00012 //
00013 // Description: Class to handle complex 3 tensors
00014 //
00015 // Modification history:
00016 //
00017 //    RYD     September 14, 1997         Module created
00018 //
00019 //------------------------------------------------------------------------
00020 
00021 #ifndef EVTTENSOR3C_HH
00022 #define EVTTENSOR3C_HH
00023 
00024 #include <iostream>
00025 #include "EvtGenBase/EvtComplex.hh"
00026 
00027 class EvtVector3C;
00028 class EvtVector3R;
00029 
00030 class EvtTensor3C;
00031 
00032 EvtTensor3C rotateEuler(const EvtTensor3C& v,
00033                         double phi,double theta,double ksi);
00034 inline EvtTensor3C operator*(const EvtComplex& c,const EvtTensor3C& t2);
00035 inline EvtTensor3C operator*(const double d,const EvtTensor3C& t2);
00036 inline EvtTensor3C operator*(const EvtTensor3C& t2,const EvtComplex& c);
00037 inline EvtTensor3C operator*(const EvtTensor3C& t2,const double d);
00038 inline EvtTensor3C operator+(const EvtTensor3C& t1,const EvtTensor3C& t2);
00039 inline EvtTensor3C operator-(const EvtTensor3C& t1,const EvtTensor3C& t2);
00040 EvtTensor3C directProd(const EvtVector3C& c1,const EvtVector3C& c2); 
00041 EvtTensor3C directProd(const EvtVector3C& c1,const EvtVector3R& c2); 
00042 EvtTensor3C directProd(const EvtVector3R& c1,const EvtVector3R& c2); 
00043 EvtTensor3C conj(const EvtTensor3C& t2);
00044 //Contract the second index of two tensors result(i,j) = t1(i,k)t2(j,k)
00045 EvtTensor3C cont22(const EvtTensor3C& t1,const EvtTensor3C& t2); 
00046 //Contract the first index of two tensors result(i,j) = t1(k,i)t2(k,j)
00047 EvtTensor3C cont11(const EvtTensor3C& t1,const EvtTensor3C& t2);
00048 //Contract the last index of eps_{ijk} with w
00049 EvtTensor3C eps(const EvtVector3R& v);
00050 std::ostream& operator<<(std::ostream& c,const EvtTensor3C& v); 
00051 
00052 //==================
00053 class EvtTensor3C {
00054 
00055   friend EvtTensor3C rotateEuler(const EvtTensor3C& v,
00056                                  double phi,double theta,double ksi);
00057   friend EvtTensor3C operator*(
00058                   const EvtComplex& c,const EvtTensor3C& t2);
00059   friend EvtTensor3C operator*(const double d,const EvtTensor3C& t2);
00060   friend EvtTensor3C operator*(
00061                   const EvtTensor3C& t2,const EvtComplex& c);
00062   friend EvtTensor3C operator*(const EvtTensor3C& t2,const double d);
00063   friend EvtTensor3C operator+(
00064                   const EvtTensor3C& t1,const EvtTensor3C& t2);
00065   friend EvtTensor3C operator-(
00066                   const EvtTensor3C& t1,const EvtTensor3C& t2);
00067   friend EvtTensor3C directProd(const EvtVector3C& c1,const EvtVector3C& c2); 
00068   friend EvtTensor3C directProd(const EvtVector3C& c1,const EvtVector3R& c2); 
00069   friend EvtTensor3C directProd(const EvtVector3R& c1,const EvtVector3R& c2); 
00070   friend EvtTensor3C conj(const EvtTensor3C& t2);
00071 //Contract the second index of two tensors result(i,j) = t1(i,k)t2(j,k)
00072   friend EvtTensor3C cont22(const EvtTensor3C& t1,const EvtTensor3C& t2); 
00073 //Contract the first index of two tensors result(i,j) = t1(k,i)t2(k,j)
00074   friend EvtTensor3C cont11(const EvtTensor3C& t1,const EvtTensor3C& t2);
00075 //Contract the last index of eps_{ijk} with w
00076   friend EvtTensor3C eps(const EvtVector3R& v);
00077   friend std::ostream& operator<<(std::ostream& c,const EvtTensor3C& v); 
00078 
00079 public:
00080   EvtTensor3C();
00081   EvtTensor3C(const EvtTensor3C& t1 );
00082   EvtTensor3C(double d11, double d22, double d33);
00083   virtual ~EvtTensor3C();
00084   EvtTensor3C& operator=(const EvtTensor3C& t1);
00085   inline void set(int i,int j,const EvtComplex& c);
00086   inline const EvtComplex& get(int i, int j) const;
00087   inline EvtComplex trace() const;
00088   static const EvtTensor3C& id();
00089   void zero();
00090   void applyRotateEuler(double phi,double theta,double ksi);
00091 
00092   EvtTensor3C operator+=(const EvtTensor3C& t2);
00093   EvtTensor3C operator-=(const EvtTensor3C& t2);
00094   EvtTensor3C operator*=(const double d);
00095   EvtTensor3C operator*=(const EvtComplex& c);
00096   EvtTensor3C conj() const;
00097   EvtVector3C cont1(const EvtVector3C& v) const; 
00098   EvtVector3C cont2(const EvtVector3C& v) const; 
00099   EvtVector3C cont1(const EvtVector3R& v) const; 
00100   EvtVector3C cont2(const EvtVector3R& v) const; 
00101   
00102 private:
00103 
00104     EvtComplex t[3][3];
00105 };
00106 
00107 inline EvtTensor3C operator*(const EvtComplex& c,const EvtTensor3C& t2){
00108   return EvtTensor3C(t2)*=c;
00109 }
00110 
00111 inline EvtTensor3C operator*(const double d,const EvtTensor3C& t2){
00112   return EvtTensor3C(t2)*=d;
00113 }
00114 
00115 inline EvtTensor3C operator*(const EvtTensor3C& t2,const EvtComplex& c){
00116   return EvtTensor3C(t2)*=c;
00117 }
00118 
00119 inline EvtTensor3C operator*(const EvtTensor3C& t2,const double d){
00120   return EvtTensor3C(t2)*=d;
00121 }
00122 
00123 inline EvtTensor3C operator+(const EvtTensor3C& t1,const EvtTensor3C& t2){
00124   return EvtTensor3C(t1)+=t2;
00125 }
00126 
00127 inline EvtTensor3C operator-(const EvtTensor3C& t1,const EvtTensor3C& t2){
00128   return EvtTensor3C(t1)-=t2;
00129 }
00130 
00131 inline void EvtTensor3C::set(int i,int j,const EvtComplex& c){
00132    t[i][j]=c;
00133 }
00134 
00135 inline const EvtComplex& EvtTensor3C::get(int i,int j) const{
00136    return t[i][j];
00137 }
00138 
00139 inline EvtComplex EvtTensor3C::trace() const{
00140    return t[0][0]+t[1][1]+t[2][2];
00141 }
00142 
00143 #endif
00144 

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