/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Generator/BesEvtGen/BesEvtGen-00-03-58/src/EvtGen/EvtGenBase/EvtVector3C.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/EvtVector3C.hh
00012 //
00013 // Description: Class for complex 3 vectors
00014 //
00015 // Modification history:
00016 //
00017 //    RYD     September 6, 1997         Module created
00018 //
00019 //------------------------------------------------------------------------
00020 
00021 #ifndef EVTVECTOR3C_N
00022 #define EVTVECTOR3C_N
00023 
00024 //#include <iostream.h>
00025 #include "EvtGenBase/EvtComplex.hh"
00026 #include "EvtGenBase/EvtVector3R.hh"
00027 #include <iosfwd>
00028 
00029 class EvtVector3C {
00030 
00031   friend EvtVector3C rotateEuler(const EvtVector3C& v,
00032                                  double phi,double theta,double ksi);
00033   
00034   inline friend EvtVector3C operator*(const EvtComplex& c,const EvtVector3C& v2); 
00035   inline friend EvtVector3C operator*(const EvtComplex& c,const EvtVector3R& v2); 
00036   inline friend EvtComplex operator*(const EvtVector3R& v1,const EvtVector3C& v2); 
00037   inline friend EvtComplex operator*(const EvtVector3C& v1,const EvtVector3R& v2); 
00038   inline friend EvtComplex operator*(const EvtVector3C& v1,const EvtVector3C& v2); 
00039   inline friend EvtVector3C operator+(const EvtVector3C& v1,const EvtVector3C& v2);
00040   inline friend EvtVector3C operator-(const EvtVector3C& v1,const EvtVector3C& v2);
00041   inline friend EvtVector3C operator*(const EvtVector3C& v1,const EvtComplex& c);
00042   
00043 
00044 public:
00045 
00046   EvtVector3C();
00047   EvtVector3C(const EvtComplex&,const EvtComplex&,const EvtComplex&);
00048   virtual ~EvtVector3C();
00049   inline void set(const int,const EvtComplex&);
00050   inline void set(const EvtComplex&,const EvtComplex&,const EvtComplex&);
00051   inline void set(double,double,double);
00052   inline EvtVector3C& operator*=(const EvtComplex& c);
00053   inline EvtVector3C& operator/=(const EvtComplex& c);
00054   inline EvtVector3C& operator+=(const EvtVector3C& v2);
00055   inline EvtVector3C& operator-=(const EvtVector3C& v2);
00056   inline EvtVector3C(const EvtVector3R& v1); 
00057   void applyRotateEuler(double phi,double theta,double ksi);
00058   inline const EvtComplex& get(int) const;
00059   inline EvtVector3C conj() const;
00060   EvtVector3C cross(const EvtVector3C& v2);
00061   friend std::ostream& operator<<(std::ostream& c,const EvtVector3C& v); 
00062   double dot( const EvtVector3C& p2 );  
00063 private:
00064 
00065   EvtComplex v[3];
00066 };
00067 
00068 inline EvtVector3C::EvtVector3C(const EvtVector3R& v1){
00069 
00070   v[0]=EvtComplex(v1.get(0),0.0);
00071   v[1]=EvtComplex(v1.get(1),0.0);
00072   v[2]=EvtComplex(v1.get(2),0.0);
00073 
00074 } 
00075 
00076 inline void EvtVector3C::set(const int i,const EvtComplex& c){
00077 
00078   v[i]=c;
00079   
00080 }
00081 
00082 inline void EvtVector3C::set(const EvtComplex& x,const EvtComplex& y, 
00083                              const EvtComplex& z){
00084 
00085    v[0]=x; v[1]=y; v[2]=z; 
00086 }
00087 
00088 inline void EvtVector3C::set(double x,
00089                           double y,double z){
00090 
00091      v[0]=EvtComplex(x); v[1]=EvtComplex(y); v[2]=EvtComplex(z);
00092 }
00093 
00094 inline const EvtComplex& EvtVector3C::get(int i) const {
00095 
00096    return v[i];
00097 }
00098 
00099 inline EvtVector3C& EvtVector3C::operator*=(const EvtComplex& c){
00100 
00101   v[0]*=c;
00102   v[1]*=c;
00103   v[2]*=c;
00104   return *this;
00105 }
00106 
00107 inline EvtVector3C& EvtVector3C::operator/=(const EvtComplex& c){
00108 
00109   v[0]/=c;
00110   v[1]/=c;
00111   v[2]/=c;
00112   return *this;
00113 }
00114 
00115 inline EvtVector3C& EvtVector3C::operator+=(const EvtVector3C& v2){
00116 
00117   v[0]+=v2.v[0];
00118   v[1]+=v2.v[1];
00119   v[2]+=v2.v[2];
00120   return *this;
00121 }
00122 
00123 inline EvtVector3C& EvtVector3C::operator-=(const EvtVector3C& v2){
00124 
00125   v[0]-=v2.v[0];
00126   v[1]-=v2.v[1];
00127   v[2]-=v2.v[2];
00128   return *this;
00129 }
00130 
00131 inline EvtVector3C operator+(const EvtVector3C& v1,const EvtVector3C& v2) {
00132 
00133   return EvtVector3C(v1)+=v2;
00134 }
00135 
00136 inline EvtVector3C operator-(const EvtVector3C& v1,const EvtVector3C& v2) {
00137 
00138   return EvtVector3C(v1)-=v2;
00139 }
00140 
00141 inline EvtVector3C operator*(const EvtVector3C& v1,const EvtComplex& c) {
00142 
00143   return EvtVector3C(v1)*=c;
00144 }
00145 
00146 inline EvtVector3C operator*(const EvtComplex& c,const EvtVector3C& v2){
00147 
00148   return EvtVector3C(v2)*=c;
00149 }
00150 
00151 inline EvtVector3C operator*(const EvtComplex& c,const EvtVector3R& v2){
00152 
00153   return EvtVector3C(v2)*=c;
00154 }
00155 
00156 inline EvtComplex operator*(const EvtVector3R& v1,const EvtVector3C& v2){
00157  
00158   return v1.get(0)*v2.v[0]+v1.get(1)*v2.v[1]+v1.get(2)*v2.v[2];
00159 }
00160 
00161 inline EvtComplex operator*(const EvtVector3C& v1,const EvtVector3R& v2){
00162  
00163   return v1.v[0]*v2.get(0)+v1.v[1]*v2.get(1)+v1.v[2]*v2.get(2);
00164 }
00165 
00166 inline EvtComplex operator*(const EvtVector3C& v1,const EvtVector3C& v2){
00167  
00168   return v1.v[0]*v2.v[0]+v1.v[1]*v2.v[1]+v1.v[2]*v2.v[2];
00169 }
00170 
00171 inline EvtVector3C EvtVector3C::conj() const { 
00172 
00173   return EvtVector3C(::conj(v[0]),::conj(v[1]),
00174                   ::conj(v[2]));
00175 }
00176 
00177 #endif
00178 

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