00001 #ifndef RECOTRACKER_TRANSIENTRACKINGRECHIT_TRecHit2DPosConstraint_H
00002 #define RECOTRACKER_TRANSIENTRACKINGRECHIT_TRecHit2DPosConstraint_H
00003
00004 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
00005
00006 class GeomDetUnit;
00007
00008 class TRecHit2DPosConstraint : public TransientTrackingRecHit {
00009 public:
00010
00011 virtual ~TRecHit2DPosConstraint() {}
00012
00013 virtual AlgebraicVector parameters() const {
00014 AlgebraicVector result(2);
00015 LocalPoint lp = localPosition();
00016 result[0] = lp.x();
00017 result[1] = lp.y();
00018 return result;
00019 }
00020
00021 virtual AlgebraicSymMatrix parametersError() const {
00022 AlgebraicSymMatrix m(2);
00023 LocalError le( localPositionError());
00024 m[0][0] = le.xx();
00025 m[0][1] = le.xy();
00026 m[1][1] = le.yy();
00027 return m;
00028 }
00029
00030 virtual AlgebraicMatrix projectionMatrix() const {
00031 AlgebraicMatrix theProjectionMatrix;
00032 theProjectionMatrix = AlgebraicMatrix( 2, 5, 0);
00033 theProjectionMatrix[0][3] = 1;
00034 theProjectionMatrix[1][4] = 1;
00035 return theProjectionMatrix;
00036 }
00037 virtual int dimension() const {return 2;}
00038
00039 virtual LocalPoint localPosition() const {return pos_;}
00040 virtual LocalError localPositionError() const {return err_;}
00041
00042 virtual const TrackingRecHit * hit() const {return 0;}
00043
00044 virtual std::vector<const TrackingRecHit*> recHits() const {
00045 return hit()->recHits();
00046 }
00047 virtual std::vector<TrackingRecHit*> recHits() {
00048 return std::vector<TrackingRecHit*>();
00049 }
00050
00051 virtual bool canImproveWithTrack() const {return false;}
00052
00053 virtual RecHitPointer clone (const TrajectoryStateOnSurface& ts) const {return clone();}
00054
00055 virtual const GeomDetUnit* detUnit() const {return 0;}
00056 virtual const GeomDet* det() const {return 0;}
00057
00058 static RecHitPointer build( const LocalPoint& pos, const LocalError& err,
00059 const Surface* surface) {
00060 return RecHitPointer( new TRecHit2DPosConstraint( pos, err, surface));
00061 }
00062
00063 virtual const Surface * surface() const {return surface_;}
00064
00065 private:
00066 const LocalPoint& pos_;
00067 const LocalError& err_;
00068 const Surface* surface_;
00070 TRecHit2DPosConstraint(const LocalPoint& pos,
00071 const LocalError& err,
00072 const Surface* surface):
00073 pos_(pos),err_(err),surface_(surface) {}
00074
00075 TRecHit2DPosConstraint( const TRecHit2DPosConstraint& other ):
00076 pos_( other.localPosition() ),err_( other.localPositionError() ), surface_((other.surface())) {}
00077
00078 virtual TRecHit2DPosConstraint * clone() const {
00079 return new TRecHit2DPosConstraint(*this);
00080 }
00081
00082 };
00083
00084 #endif