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 #ifndef BESVECTORERR_H
00030 #define BESVECTORERR_H
00031
00032 #include <iosfwd>
00033 #include "MdcRecoUtil/BesError.h"
00034 #include "CLHEP/Vector/Rotation.h"
00035
00036 using namespace CLHEP;
00037
00038
00039 class BesVectorErr : public Hep3Vector {
00040
00041 public:
00042
00043 enum PolarCoordinateIndex {
00044 Rho = 0,
00045 Theta = 1,
00046 Phi = 2,
00047 NUM_PCOORDINATES = 3
00048 };
00049
00050 enum CylindricalCoordinateIndex {
00051 C_Rho = 0,
00052 C_Zeta = 1,
00053 C_Phi = 2,
00054 NUM_CCOORDINATES = 3
00055 };
00056
00057 BesVectorErr() : Hep3Vector(), _covMatrix(NUM_COORDINATES) {}
00058
00059
00060 BesVectorErr(const Hep3Vector &p) : Hep3Vector(p), _covMatrix(NUM_COORDINATES) {}
00061 BesVectorErr(const Hep3Vector &p, const BesError& covMat) : Hep3Vector(p),
00062 _covMatrix(NUM_COORDINATES) { _covMatrix=covMat; }
00063
00064
00065 BesVectorErr(const BesVectorErr& v) : Hep3Vector(v),
00066 _covMatrix(v.covMatrix()) {}
00067
00068
00069
00070
00071
00072 BesVectorErr& operator=(const BesVectorErr& v)
00073 {
00074 if (this != &v) {
00075 Hep3Vector::operator=(v);
00076 _covMatrix = v.covMatrix();
00077 }
00078 return *this;
00079 }
00080
00081 BesVectorErr operator - () {
00082 Hep3Vector t = *this;
00083 return BesVectorErr( -t, _covMatrix);
00084 }
00085
00086 BesVectorErr& operator += (const BesVectorErr& v){
00087 Hep3Vector::operator+=(v);
00088 _covMatrix += v.covMatrix();
00089 return *this;
00090 }
00091
00092 BesVectorErr& operator -= (const BesVectorErr& v){
00093 Hep3Vector::operator-=(v);
00094 _covMatrix += v.covMatrix();
00095 return *this;
00096 }
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115 double determineChisq(const Hep3Vector& refVector) const;
00116
00117
00118
00119
00120
00121 inline const BesError & covMatrix() const { return _covMatrix; }
00122
00123 BesError covRTPMatrix() const;
00124
00125
00126
00127 BesError covRZPMatrix() const;
00128
00129
00130
00131 inline void setCovMatrix(const BesError& v) { _covMatrix = v; }
00132
00133
00134
00135 private:
00136
00137 BesError _covMatrix;
00138 };
00139
00140
00141 BesVectorErr operator + (const BesVectorErr&, const BesVectorErr&);
00142
00143 BesVectorErr operator - (const BesVectorErr&, const BesVectorErr&);
00144
00145
00146 BesVectorErr operator * (const BesVectorErr &, double a);
00147 BesVectorErr operator * (double a, const BesVectorErr &);
00148
00149 std::ostream & operator<<(std::ostream & stream, const BesVectorErr & verr);
00150 std::istream & operator>>(std::istream & stream, BesVectorErr & verr);
00151
00152 #endif
00153
00154
00155
00156
00157
00158