CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackExtraBase.h
Go to the documentation of this file.
1 #ifndef TrackReco_TrackExtraBase_h
2 #define TrackReco_TrackExtraBase_h
3 
17 
18 namespace reco
19 {
20 
22 {
23 
24 public:
27 
28  void setHits(TrackingRecHitRefProd const & prod, unsigned firstH, unsigned int nH) {
30  m_firstHit =firstH; m_nHits=nH;
31  }
32 
34  void add(const TrackingRecHitRef &ref) {
36  if (m_nHits==0) {
37  m_firstHit = ref.key();
38  }
39  assert(m_nHits== ref.key()-m_firstHit);
40  ++m_nHits;
41  }
42 
43 
44  unsigned int firstRecHit() const {
45  return m_firstHit;
46  }
47 
49  unsigned int recHitsSize() const {
50  return m_nHits;
51  }
52 
53 
56  return recHitsProduct().data().begin()+firstRecHit();
57  }
58 
61  return recHitsBegin()+recHitsSize();
62  }
63 
65  TrackingRecHitRef recHitRef(unsigned int i) const {
67  }
68 
70  TrackingRecHitRef recHit(unsigned int i) const {
71  return recHitRef(i);
72  }
73 
75  return *edm::getProduct<TrackingRecHitCollection>(m_hitCollection);
76 
77  }
78 
79 private:
80 
82  unsigned int m_firstHit;
83  unsigned int m_nHits;
84 
85 };
86 
87 }// namespace reco
88 
89 #endif
90 
void pushBackItem(RefCore const &productToBeInserted, bool checkPointer)
Definition: RefCore.cc:176
int i
Definition: DBlmapReader.cc:9
TrackingRecHitCollection const & recHitsProduct() const
void setHits(TrackingRecHitRefProd const &prod, unsigned firstH, unsigned int nH)
RefCore const & refCore() const
Definition: Ref.h:281
key_type key() const
Accessor for product key.
Definition: Ref.h:266
trackingRecHit_iterator recHitsEnd() const
last iterator over RecHits
TrackingRecHitRef recHitRef(unsigned int i) const
get a ref to i-th recHit
TrackingRecHitRef recHit(unsigned int i) const
get i-th recHit
void add(const TrackingRecHitRef &ref)
add a reference to a RecHit
edm::Ref< TrackingRecHitCollection > TrackingRecHitRef
persistent reference to a TrackingRecHit
unsigned int recHitsSize() const
number of RecHits
TrackExtraBase()
default constructor
trackingRecHit_iterator recHitsBegin() const
first iterator over RecHits
unsigned int m_nHits
RefCore const & refCore() const
Definition: RefProd.h:126
base const & data() const
Definition: OwnVector.h:372
unsigned int m_firstHit
unsigned int firstRecHit() const
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
edm::RefCore m_hitCollection