/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Reconstruction/MdcPatRec/MdcRecoUtil/MdcRecoUtil-00-01-08/src/DifVector.cxx

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information: 
00003 //      $Id: DifVector.cxx,v 1.2 2009/12/23 02:59:56 zhangy Exp $
00004 //
00005 // Description:
00006 //      Class Implementation for |DifVector| 
00007 //      What do i do ?
00008 // Environment:
00009 //      Software developed for the BaBar Detector at the SLAC B-Factory.
00010 //
00011 // Author List:
00012 //      A. Snyder
00013 //
00014 // Copyright Information:
00015 //      Copyright (C) 1996      SLAC
00016 // 
00017 // History:
00018 //      Migration for BESIII MDC
00019 //
00020 //------------------------------------------------------------------------
00021 
00022 #include "MdcRecoUtil/DifVector.h"
00023 #include "MdcRecoUtil/DifRotation.h"
00024 #include "CLHEP/Vector/ThreeVector.h"
00025 using std::cout;
00026 
00027 extern const DifVector xhat(1,0,0);
00028 extern const DifVector yhat(0,1,0);
00029 extern const DifVector zhat(0,0,1);
00030 extern const DifVector nullVec(0,0,0);
00031 
00032 DifVector::DifVector()
00033   :x(0.0),y(0.0),z(0.0)  
00034 {} 
00035 
00036 DifVector::DifVector
00037 (const DifNumber& X,const DifNumber& Y,const DifNumber& Z)
00038   :x(X),y(Y),z(Z)
00039 {}
00040 
00041 DifVector::DifVector
00042 (double X, double Y,double Z)
00043   :x(X),y(Y),z(Z)
00044 {}
00045 
00046 DifVector::DifVector(const Hep3Vector& v)
00047   :x(v.x()),y(v.y()),z(v.z())
00048 {}
00049 
00050 DifVector::DifVector(const DifVector& v)
00051   :x(v.x),y(v.y),z(v.z)
00052 {}
00053 
00054 HepSymMatrix DifVector::errorMatrix(const HepSymMatrix& e)const {
00055   HepSymMatrix temp(3);
00056   temp(1,1)=correlation(x,x,e);  
00057   temp(1,2)=correlation(x,y,e);
00058   temp(1,3)=correlation(x,z,e);
00059   temp(2,2)=correlation(y,y,e);
00060   temp(2,3)=correlation(y,z,e);
00061   temp(3,3)=correlation(z,z,e);
00062   return temp;
00063 }
00064 
00065 HepMatrix DifVector::jacobian()const{
00066   int npar=x.nPar();
00067   HepMatrix temp(3,npar);
00068   for(int i=1; i<=npar; i++){
00069     temp(1,i)=x.derivative(i);
00070     temp(2,i)=y.derivative(i);
00071     temp(3,i)=z.derivative(i);
00072   } // (int i=1; i<=npar; i++)
00073   return temp;
00074 }
00075 
00076 DifVector& DifVector::rotate(const DifRotation& r) {
00077   r.rotate(*this); return *this;
00078 }
00079 
00080 DifVector& DifVector::rotate(const DifNumber& a,const DifNumber& b,const DifNumber& g) {
00081   DifRotation(a,b,g).rotate(*this);
00082   return *this;
00083 }
00084 
00085 void DifVector::print()const {
00086   /*SKIP
00087   cout << "x:" << x;
00088   cout << "y:" << y;
00089   cout << "z:" << z;
00090   */
00091   //yzhang TEMP
00092   cout << "Yzhang::DifVector::print x,y,z SKIPED!\n";
00093 }

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