/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Reconstruction/MdcPatRec/MdcRecoUtil/MdcRecoUtil-00-01-08/MdcRecoUtil/BesPointErr.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: BesPointErr.h,v 1.4 2010/03/25 09:55:57 zhangy Exp $
00004 //
00005 // Description:
00006 //      Endow a Point class with a covariance matrix
00007 //      
00008 //
00009 // Environment:
00010 //      Software developed for the BaBar Detector at the SLAC B-Factory.
00011 //
00012 // Author List:
00013 //      Forest Rouse
00014 //      Victoria Novotny  
00015 //      Ed Frank             University of Penn., efrank@upenn5.hep.upenn.edu
00016 //
00017 // History
00018 //      14 Oct 96 Ed Frank   Simple mod to make unary - compile under
00019 //                           native SunOS5 compiler.
00020 //
00021 // Copyright Information:
00022 //      Copyright (C) 1996 U.C. Davis
00023 // 
00024 // History:
00025 //      Migration for BESIII MDC
00026 //      Zhang Yao(zhangyao@ihep.ac.cn)  Migrate to BESIII
00027 //      Zhang Yao(zhangyao@ihep.ac.cn)  Upgrade to CLHEP2.0.4.5 2010-03-25 
00028 //
00029 //------------------------------------------------------------------------
00030 #ifndef BESPOINTERR_H
00031 #define BESPOINTERR_H
00032 
00033 #include "MdcRecoUtil/BesVectorErr.h"
00034 #include "MdcRecoUtil/BesError.h"
00035 #include "CLHEP/Vector/Rotation.h"
00036 #include "CLHEP/Geometry/Point3D.h"
00037 #ifndef ENABLE_BACKWARDS_COMPATIBILITY
00038 typedef HepGeom::Point3D<double> HepPoint3D;
00039 #endif
00040 
00041 using namespace CLHEP;
00042 
00043 
00044 class BesPointErr : public HepPoint3D
00045 {
00046   public:
00047     enum PolarCoordinateIndex {   
00048       Rho = 0, 
00049       Theta = 1, 
00050       Phi = 2,
00051       NUM_PCOORDINATES = 3
00052     };
00053     enum CylindricalCoordinateIndex {   
00054       C_Rho = 0, 
00055       C_Zeta = 1, 
00056       C_Phi = 2,
00057       NUM_CCOORDINATES = 3
00058     };
00059     BesPointErr() : HepPoint3D(), _covMatrix(3)         {}
00060     BesPointErr(const HepPoint3D &p) : HepPoint3D(p),
00061                                        _covMatrix(3)                                            {}
00062     BesPointErr(const HepPoint3D &p, const BesError& covMat) : HepPoint3D(p),
00063                                                                _covMatrix(3)                                            { _covMatrix=covMat; }
00064 
00065     // new constructors for this class
00066     BesPointErr(const BesPointErr& v) : HepPoint3D(),_covMatrix(3)      {*this = v;}
00067 
00068     double determineChisq(const HepPoint3D& diffPoint) const
00069     {
00070       HepVector temp(3);
00071       temp[0] = diffPoint.x()-this->x();
00072       temp[1] = diffPoint.y()-this->y();
00073       temp[2] = diffPoint.z()-this->z();
00074       return _covMatrix.determineChisq(temp);
00075     }
00076 
00077     BesError covRTPMatrix() const;
00078     // returns the covariance Matrix in spherical coordinate
00079     // use   PolarCoordinateIndex enum to get the components
00080     BesError covRZPMatrix() const;
00081     // returns the covariance Matrix in cylindrical coordinate
00082     // use   CylindricalCoordinateIndex enum to get the components
00083 
00084     inline const BesError& covMatrix() const            { return _covMatrix; }
00085     inline void setCovMatrix(const BesError& v)         { _covMatrix = v; }
00086 
00087     //  void printOn(ostream& out=cout) const;
00088 
00089   private:
00090 
00091     BesError _covMatrix;
00092 };
00093 
00094 BesPointErr operator + (const BesPointErr&, const BesVectorErr&);
00095 
00096 BesPointErr operator + (const BesVectorErr&, const BesPointErr&);
00097 
00098 BesPointErr operator - (const BesPointErr&, const BesVectorErr&);
00099 
00100 BesVectorErr operator - (const BesPointErr&, const BesPointErr&);
00101 
00102 std::ostream & operator<<(std::ostream & stream, const BesPointErr & verr);
00103 std::istream & operator>>(std::istream & stream, BesPointErr & verr);
00104 
00105 
00106 #endif
00107 
00108 
00109 
00110 
00111 

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