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

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