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
00031 #ifndef BESERROR_HH
00032 #define BESERROR_HH
00033
00034 #include <iostream>
00035 #include <math.h>
00036
00037 #include "CLHEP/Matrix/Vector.h"
00038 #include "CLHEP/Matrix/Matrix.h"
00039 #include "CLHEP/Matrix/SymMatrix.h"
00040 #include "CLHEP/Vector/Rotation.h"
00041 #include "CLHEP/Vector/LorentzRotation.h"
00042
00043
00044 using namespace CLHEP;
00045
00046 class BesError : public HepSymMatrix {
00047
00048 public:
00049
00050 static const double chisqUndef;
00051 BesError() : HepSymMatrix() {}
00052
00053 BesError(int n) : HepSymMatrix(n, 0) {}
00054
00055
00056
00057
00058 BesError( const HepSymMatrix &p ) : HepSymMatrix(p) {}
00059
00060
00061 BesError(const BesError& v) : HepSymMatrix() {*this = v;}
00062
00063 BesError& operator=(const BesError& v)
00064 {
00065 if (this != &v) {
00066 HepSymMatrix::operator=(v);
00067 }
00068 return *this;
00069 }
00070
00071 BesError& operator=(const HepSymMatrix& v)
00072 {
00073 if (this != &v) {
00074 HepSymMatrix::operator=(v);
00075 }
00076 return *this;
00077 }
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088 double determineChisq(const HepVector& diff) const;
00089
00090
00091
00092
00093
00094
00095
00096
00097 BesError& operator *= (double t)
00098 { return (BesError&) HepSymMatrix::operator*=(t); }
00099
00100 BesError& operator /= (double t)
00101 {return (BesError&) HepSymMatrix::operator/=(t); }
00102
00103 BesError& operator += (const BesError& m2)
00104 {
00105 HepSymMatrix::operator+=(m2);
00106 return *this;
00107 }
00108
00109 BesError& operator -= (const BesError& m2)
00110 {
00111 HepSymMatrix::operator-=(m2);
00112 return *this;
00113 }
00114
00115 BesError operator - ()
00116 { BesError temp(*this);
00117 return temp; }
00118
00119
00120
00121
00122 BesError& operator += (const HepSymMatrix& m2)
00123 {
00124 HepSymMatrix::operator+=(m2);
00125 return *this;
00126 }
00127
00128 BesError& operator -= (const HepSymMatrix& m2)
00129 {
00130 HepSymMatrix::operator-=(m2);
00131 return *this;
00132 }
00133
00134 BesError operator - () const
00135 { BesError temp(*this);
00136 return temp;}
00137
00138 BesError& operator += (const HepDiagMatrix& m2)
00139 {
00140 HepSymMatrix::operator+=(m2);
00141 return *this;
00142 }
00143
00144 BesError& operator -= (const HepDiagMatrix& m2)
00145 {
00146 HepSymMatrix::operator-=(m2);
00147 return *this;
00148 }
00149
00150 BesError similarity(const HepRotation& rot) const;
00151 BesError similarity(const HepLorentzRotation& rot) const;
00152
00153
00154 BesError similarity(const BesError& E);
00155
00156
00157 BesError similarity(const HepMatrix& m1) const
00158 {
00159 BesError mret(m1.num_row());
00160 mret.similarityWith(*this, m1);
00161 return mret;
00162 }
00163
00164 BesError& similarityWith(const BesError& m, const HepMatrix& m1);
00165
00166
00167
00168 double similarity(const HepVector &v) const
00169 { return this->HepSymMatrix::similarity( v ); }
00170 HepSymMatrix similarity(const HepSymMatrix &m1) const
00171 { return this->HepSymMatrix::similarity( m1 ); }
00172
00173 private:
00174
00175 friend BesError operator*(double t, const BesError& m1);
00176
00177 friend BesError operator*(const BesError& m1, double t);
00178
00179 friend BesError operator/(double t, const BesError& m1);
00180
00181 friend BesError operator/(const BesError& m1, double t);
00182
00183 friend BesError operator+(const BesError& m1, const BesError& m2);
00184
00185 friend BesError operator-(const BesError& m1, const BesError& m2);
00186
00187 friend std::ostream& operator<<(std::ostream& out, const BesError& mat);
00188 friend std::istream& operator>>(std::istream& in, BesError& mat);
00189
00190 };
00191
00192 #endif
00193
00194
00195
00196
00197
00198