00001 #ifndef _TRACKER_CURVILINEARTRAJECTORYERROR_H_ 00002 #define _TRACKER_CURVILINEARTRAJECTORYERROR_H_ 00003 00004 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h" 00005 #include "DataFormats/Math/interface/Error.h" 00006 00026 class CurvilinearTrajectoryError { 00027 public: 00028 00030 enum { dimension = 5 }; 00032 typedef math::Error<dimension>::type MathCovarianceMatrix; 00033 00034 // construct 00035 CurvilinearTrajectoryError() {} 00036 00041 CurvilinearTrajectoryError(const AlgebraicSymMatrix& aCovarianceMatrix) : 00042 theCovarianceMatrix(asSMatrix<5>(aCovarianceMatrix)) {} 00043 00048 CurvilinearTrajectoryError(const AlgebraicSymMatrix55& aCovarianceMatrix) : 00049 theCovarianceMatrix(aCovarianceMatrix) { } 00050 00052 //CurvilinearTrajectoryError( const MathCovarianceMatrix & cov) { return theCovarianceMatrix; } 00053 // not needed anymore: MathCovarianceMatrix === AlgebraicSymMatrix55 00054 00055 00056 // access 00057 00061 const AlgebraicSymMatrix matrix_old() const { 00062 return asHepMatrix(theCovarianceMatrix); 00063 } 00064 00068 //const AlgebraicSymMatrix55 &matrix() const { 00069 const AlgebraicSymMatrix55 &matrix() const { 00070 return theCovarianceMatrix; 00071 } 00072 00076 void operator *= (double factor) { 00077 theCovarianceMatrix *= factor; 00078 } 00079 00080 void zeroFieldScaling(double factor){ 00081 double root_of_factor = sqrt(factor); 00082 //scale the 0 indexed covariance by the factor 00083 for (uint i=1;i!=5;++i) theCovarianceMatrix(i,0)*=root_of_factor; 00084 00085 //scale all others by the scared factor 00086 for (uint i=1;i!=5;++i) for (uint j=i;j!=5;++j) theCovarianceMatrix(i,j)*=factor; 00087 //term 0,0 is not scaled at all 00088 } 00089 00090 operator MathCovarianceMatrix() { return theCovarianceMatrix; } 00091 operator const MathCovarianceMatrix &() const { return theCovarianceMatrix; } 00092 00093 private: 00094 AlgebraicSymMatrix55 theCovarianceMatrix; 00095 }; 00096 00097 #endif