00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
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
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
00079
00080 BesError covRZPMatrix() const;
00081
00082
00083
00084 inline const BesError& covMatrix() const { return _covMatrix; }
00085 inline void setCovMatrix(const BesError& v) { _covMatrix = v; }
00086
00087
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