00001 #ifndef TrackingRecHit_h 00002 #define TrackingRecHit_h 00003 00004 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h" 00005 #include "DataFormats/DetId/interface/DetId.h" 00006 #include "DataFormats/GeometrySurface/interface/LocalError.h" 00007 #include "DataFormats/GeometryVector/interface/LocalPoint.h" 00008 #include "DataFormats/TrackingRecHit/interface/KfComponentsHolder.h" 00009 00010 class TrackingRecHit { 00011 public: 00012 00013 typedef unsigned int id_type; 00014 00021 enum Type { valid = 0, missing = 1, inactive = 2, bad = 3 }; 00023 enum SharedInputType {all, some}; 00024 00025 explicit TrackingRecHit(DetId id, Type type=valid ) : m_id(id), m_status(type) {} 00026 explicit TrackingRecHit(id_type id=0, Type type=valid ) : m_id(id), m_status(type) {} 00027 00028 virtual ~TrackingRecHit() {} 00029 00030 virtual TrackingRecHit * clone() const = 0; 00031 00032 virtual AlgebraicVector parameters() const = 0; 00033 00034 virtual AlgebraicSymMatrix parametersError() const = 0; 00035 00036 virtual AlgebraicMatrix projectionMatrix() const = 0; 00037 00038 virtual void getKfComponents( KfComponentsHolder & holder ) const ; 00039 00040 virtual int dimension() const = 0; 00041 00043 virtual std::vector<const TrackingRecHit*> recHits() const = 0; 00044 virtual void recHitsV(std::vector<const TrackingRecHit*> & ) const; 00045 00047 virtual std::vector<TrackingRecHit*> recHits() = 0; 00048 virtual void recHitsV(std::vector<TrackingRecHit*> & ); 00049 00050 DetId geographicalId() const {return m_id;} 00051 00052 virtual LocalPoint localPosition() const = 0; 00053 00054 virtual LocalError localPositionError() const = 0; 00055 00056 virtual float weight() const {return 1.;} 00057 00058 Type type() const { return Type(m_status); } 00059 Type getType() const { return Type(m_status); } 00060 bool isValid() const {return getType()==valid;} 00061 00067 virtual bool sharesInput( const TrackingRecHit* other, SharedInputType what) const; 00068 00069 protected: 00070 // used by muon... 00071 void setId(id_type iid) { m_id=iid;} 00072 00073 private: 00074 00075 id_type m_id; 00076 int m_status; 00077 00078 }; 00079 00080 #endif