/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Generator/BesEvtGen/BesEvtGen-00-03-58/src/EvtGen/EvtGenBase/EvtVector3C.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: EvtVector3C.cc
00012 //
00013 // Description: Complex 3 vectors.
00014 //
00015 // Modification history:
00016 //
00017 //    RYD       September 5, 1997       Module created
00018 //
00019 //------------------------------------------------------------------------
00020 // 
00021 #include "EvtGenBase/EvtPatches.hh"
00022 #include <iostream>
00023 #include <math.h>
00024 #include "EvtGenBase/EvtComplex.hh"
00025 #include "EvtGenBase/EvtVector3C.hh"
00026 using std::ostream;
00027 
00028 
00029 
00030 
00031 EvtVector3C::EvtVector3C(){
00032 
00033   v[0]=EvtComplex(0.0); v[1]=EvtComplex(0.0); v[2]=EvtComplex(0.0); 
00034 }
00035 
00036 EvtVector3C::~EvtVector3C(){
00037 
00038   return;
00039 }
00040 
00041 
00042 EvtVector3C::EvtVector3C(const EvtComplex& e1,const EvtComplex& e2,const EvtComplex& e3){
00043 
00044   v[0]=e1; v[1]=e2; v[2]=e3;
00045 }
00046 
00047 
00048 EvtVector3C EvtVector3C::cross( const EvtVector3C& p2 ){
00049 
00050   //Calcs the cross product.  Added by djl on July 27, 1995.
00051 
00052   EvtVector3C temp;
00053   
00054   temp.v[0] = v[1]*p2.v[2] - v[2]*p2.v[1];
00055   temp.v[1] = v[2]*p2.v[0] - v[0]*p2.v[2];
00056   temp.v[2] = v[0]*p2.v[1] - v[1]*p2.v[0];
00057 
00058   return temp;
00059 }
00060 
00061 EvtVector3C rotateEuler(const EvtVector3C& v,
00062                         double alpha,double beta,double gamma){
00063 
00064   EvtVector3C tmp(v);
00065   tmp.applyRotateEuler(alpha,beta,gamma);
00066   return tmp;
00067 
00068 }
00069 
00070 
00071 void EvtVector3C::applyRotateEuler(double phi,double theta,double ksi){
00072 
00073   EvtComplex temp[3];
00074   double sp,st,sk,cp,ct,ck;
00075 
00076   sp=sin(phi);
00077   st=sin(theta);
00078   sk=sin(ksi);
00079   cp=cos(phi);
00080   ct=cos(theta);
00081   ck=cos(ksi);
00082 
00083   temp[0]=( ck*ct*cp-sk*sp)*v[0]+( -sk*ct*cp-ck*sp)*v[1]+st*cp*v[2];
00084   temp[1]=( ck*ct*sp+sk*cp)*v[0]+(-sk*ct*sp+ck*cp)*v[1]+st*sp*v[2];
00085   temp[2]=-ck*st*v[0]+sk*st*v[1]+ct*v[2];
00086 
00087 
00088   v[0]=temp[0];
00089   v[1]=temp[1];
00090   v[2]=temp[2];
00091 }
00092 
00093 
00094 
00095 ostream& operator<<(ostream& s,const EvtVector3C& v){
00096 
00097   s<<"("<<v.v[0]<<","<<v.v[1]<<","<<v.v[2]<<")";
00098   
00099   return s;
00100 }
00101 
00102 

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