CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackingRecHit.h
Go to the documentation of this file.
1 #ifndef TrackingRecHit_h
2 #define TrackingRecHit_h
3 
10 
12 public:
13 
15 
16  typedef unsigned int id_type;
17 
25  enum Type { valid = 0, missing = 1, inactive = 2, bad = 3 };
26  static const int typeMask = 0xf; // mask for the above
27  static const int rttiShift = 24; // shift amount to get the rtti
28 
31 
32  explicit TrackingRecHit(DetId id, Type type=valid ) : m_id(id), m_status(type) {}
33  explicit TrackingRecHit(id_type id=0, Type type=valid ) : m_id(id), m_status(type) {}
34 
35  TrackingRecHit(DetId id, unsigned int rt, Type type=valid ) : m_id(id), m_status((rt<< rttiShift)|int(type)) {}
36 
37 
38  virtual ~TrackingRecHit() {}
39 
40  virtual TrackingRecHit * clone() const = 0;
41 
42  virtual AlgebraicVector parameters() const = 0;
43 
44  virtual AlgebraicSymMatrix parametersError() const = 0;
45 
46  virtual AlgebraicMatrix projectionMatrix() const = 0;
47 
48  virtual void getKfComponents( KfComponentsHolder & holder ) const ;
49 
50  virtual int dimension() const = 0;
51 
53  virtual std::vector<const TrackingRecHit*> recHits() const = 0;
54  virtual void recHitsV(std::vector<const TrackingRecHit*> & ) const;
55 
57  virtual std::vector<TrackingRecHit*> recHits() = 0;
58  virtual void recHitsV(std::vector<TrackingRecHit*> & );
59 
60 
61  id_type rawId() const { return m_id;}
62  DetId geographicalId() const {return m_id;}
63 
64  virtual LocalPoint localPosition() const = 0;
65 
66  virtual LocalError localPositionError() const = 0;
67 
69  virtual bool hasPositionAndError() const {return true;};
70 
71  virtual float weight() const {return 1.;}
72 
73  Type type() const { return Type(typeMask&m_status); }
74  Type getType() const { return Type(typeMask&m_status); }
75  bool isValid() const {return getType()==valid;}
76 
77  unsigned int getRTTI() const { return m_status >> rttiShift;}
78 
84  virtual bool sharesInput( const TrackingRecHit* other, SharedInputType what) const;
85 
86 protected:
87  // used by muon...
88  void setId(id_type iid) { m_id=iid;}
89  void setType(Type ttype) { m_status=ttype;}
90 
91  void setRTTI (unsigned int rt) { m_status &= (rt<< rttiShift);} // can be done only once...
92 
93 private:
94 
96 
97  unsigned int m_status; // bit assigned (type 0-8) (rtti 24-31)
98 
99 };
100 
101 #endif
SharedInputType
definition of equality via shared input
type
Definition: HCALResponse.h:21
virtual int dimension() const =0
virtual void getKfComponents(KfComponentsHolder &holder) const
virtual float weight() const
unsigned int id_type
void setId(id_type iid)
virtual bool sharesInput(const TrackingRecHit *other, SharedInputType what) const
Type type() const
virtual AlgebraicVector parameters() const =0
CLHEP::HepMatrix AlgebraicMatrix
void setType(Type ttype)
virtual ~TrackingRecHit()
virtual std::vector< const TrackingRecHit * > recHits() const =0
Access to component RecHits (if any)
static const int rttiShift
virtual bool hasPositionAndError() const
to be redefined by daughter class
unsigned int getRTTI() const
virtual TrackingRecHit * clone() const =0
TrackingRecHit(DetId id, Type type=valid)
Definition: DetId.h:18
CLHEP::HepVector AlgebraicVector
Type getType() const
virtual LocalError localPositionError() const =0
unsigned int m_status
void setRTTI(unsigned int rt)
TrackingRecHit(DetId id, unsigned int rt, Type type=valid)
bool isValid() const
TrackingRecHit(id_type id=0, Type type=valid)
virtual AlgebraicMatrix projectionMatrix() const =0
static const int typeMask
CLHEP::HepSymMatrix AlgebraicSymMatrix
DetId geographicalId() const
virtual void recHitsV(std::vector< const TrackingRecHit * > &) const
virtual LocalPoint localPosition() const =0
id_type rawId() const
virtual AlgebraicSymMatrix parametersError() const =0