CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/TrackingTools/TrajectoryParametrization/interface/LocalTrajectoryError.h

Go to the documentation of this file.
00001 #ifndef _TRACKER_LOCALTRAJECTORYERROR_H_
00002 #define _TRACKER_LOCALTRAJECTORYERROR_H_
00003 
00004 #include "DataFormats/GeometrySurface/interface/LocalError.h"
00005 #include "DataFormats/Math/interface/AlgebraicROOTObjects.h"
00006 
00007 #include <boost/shared_ptr.hpp>
00008 
00021 class LocalTrajectoryError {
00022 public:
00023   // construct
00024   LocalTrajectoryError(){}
00025   LocalTrajectoryError(InvalidError) {theCovarianceMatrix(0,0)=-99999.e10;}
00026   // destruct
00027   ~LocalTrajectoryError(){}
00028 
00029   bool invalid() const { return theCovarianceMatrix(0,0)<-1.e10;}
00030   bool valid() const { return !invalid();}
00031 
00032   // not really full check of posdef
00033   bool posDef() const { 
00034     return (theCovarianceMatrix(0,0)>=0) && (theCovarianceMatrix(1,1)>=0) && 
00035       (theCovarianceMatrix(2,2)>=0) && (theCovarianceMatrix(3,3)>=0) && (theCovarianceMatrix(4,4)>=0);
00036   }
00037 
00038 
00043   LocalTrajectoryError(const AlgebraicSymMatrix55& aCovarianceMatrix):
00044     theCovarianceMatrix(aCovarianceMatrix), theWeightMatrixPtr() { }
00045 
00052   LocalTrajectoryError( float dx, float dy, float dxdir, float dydir,
00053                         float dpinv);
00054 
00055 // access
00056 
00060   const AlgebraicSymMatrix55 &matrix() const {
00061     return theCovarianceMatrix;
00062   }
00063 
00066  const AlgebraicSymMatrix55 &weightMatrix() const;
00067 
00068 
00072   LocalTrajectoryError & operator *= (double factor) {
00073     theCovarianceMatrix *= factor;
00074     if ((theWeightMatrixPtr.get() != 0) && (factor != 0.0)) { (*theWeightMatrixPtr) /= factor; } 
00075     return *this;
00076   }
00077 
00082   LocalError positionError() const {
00083     return LocalError( theCovarianceMatrix(3,3),theCovarianceMatrix(3,4),
00084                        theCovarianceMatrix(4,4));
00085   }
00086 
00087 private:
00088   AlgebraicSymMatrix55 theCovarianceMatrix;
00089   mutable boost::shared_ptr<AlgebraicSymMatrix55> theWeightMatrixPtr;
00090 };
00091 
00092 #endif