CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
reco::TrackExtraBase Class Reference

#include <DataFormats/TrackReco/interface/TrackExtraBase.h>

Inheritance diagram for reco::TrackExtraBase:
reco::TrackExtra

Public Member Functions

unsigned int firstRecHit () const
 
TrackingRecHitRef recHit (unsigned int i) const
 get i-th recHit More...
 
TrackingRecHitRef recHitRef (unsigned int i) const
 get a ref to i-th recHit More...
 
trackingRecHit_iterator recHitsBegin () const
 first iterator over RecHits More...
 
trackingRecHit_iterator recHitsEnd () const
 last iterator over RecHits More...
 
TrackingRecHitCollection const & recHitsProduct () const
 
unsigned int recHitsSize () const
 number of RecHits More...
 
void setHits (TrackingRecHitRefProd const &prod, unsigned firstH, unsigned int nH)
 
 TrackExtraBase ()
 default constructor More...
 

Private Attributes

unsigned int m_firstHit
 
edm::RefCore m_hitCollection
 
unsigned int m_nHits
 

Detailed Description

Basic extension of a reconstructed Track. Contains references to the hits assigned to the track.

If you access the hits, check if they are valid or not. (Invalid hits are dummy hits created in layers crossed by the track, where no physical hit was found).

Author
Luca Lista, INFN

Definition at line 21 of file TrackExtraBase.h.

Constructor & Destructor Documentation

reco::TrackExtraBase::TrackExtraBase ( )
inline

default constructor

Definition at line 26 of file TrackExtraBase.h.

26 : m_firstHit(-1), m_nHits(0) { }
unsigned int m_nHits
unsigned int m_firstHit

Member Function Documentation

unsigned int reco::TrackExtraBase::firstRecHit ( ) const
inline

Definition at line 33 of file TrackExtraBase.h.

References m_firstHit.

Referenced by recHitsBegin().

33  {
34  return m_firstHit;
35  }
unsigned int m_firstHit
TrackingRecHitRef reco::TrackExtraBase::recHit ( unsigned int  i) const
inline

get i-th recHit

Definition at line 67 of file TrackExtraBase.h.

References recHitRef().

67  {
68  return recHitRef(i);
69  }
int i
Definition: DBlmapReader.cc:9
TrackingRecHitRef recHitRef(unsigned int i) const
get a ref to i-th recHit
TrackingRecHitRef reco::TrackExtraBase::recHitRef ( unsigned int  i) const
inline

get a ref to i-th recHit

Definition at line 54 of file TrackExtraBase.h.

References reco_application_2006_simpleTBanalysis_cfg::hitCollection, i, edm::RefCore::id(), m_firstHit, m_hitCollection, and edm::RefCore::productPtr().

Referenced by recHit().

54  {
55  //Another thread might change the RefCore at the same time.
56  // By using a copy we will be safe.
58  if(hitCollection.productPtr()) {
60  TrackingRecHitRef::value_type const* item = finder(*(static_cast<TrackingRecHitRef::product_type const*>(hitCollection.productPtr())), m_firstHit+i);
61  return TrackingRecHitRef(hitCollection.id(), item, m_firstHit+i);
62  }
64  }
int i
Definition: DBlmapReader.cc:9
edm::Ref< TrackingRecHitCollection > TrackingRecHitRef
persistent reference to a TrackingRecHit
unsigned int m_firstHit
edm::RefCore m_hitCollection
trackingRecHit_iterator reco::TrackExtraBase::recHitsBegin ( ) const
inline

first iterator over RecHits

Definition at line 44 of file TrackExtraBase.h.

References edm::OwnVector< T, P >::data(), firstRecHit(), and recHitsProduct().

Referenced by recHitsEnd().

44  {
45  return recHitsProduct().data().begin()+firstRecHit();
46  }
TrackingRecHitCollection const & recHitsProduct() const
base const & data() const
Definition: OwnVector.h:446
unsigned int firstRecHit() const
trackingRecHit_iterator reco::TrackExtraBase::recHitsEnd ( ) const
inline

last iterator over RecHits

Definition at line 49 of file TrackExtraBase.h.

References recHitsBegin(), and recHitsSize().

49  {
50  return recHitsBegin()+recHitsSize();
51  }
unsigned int recHitsSize() const
number of RecHits
trackingRecHit_iterator recHitsBegin() const
first iterator over RecHits
TrackingRecHitCollection const& reco::TrackExtraBase::recHitsProduct ( ) const
inline

Definition at line 71 of file TrackExtraBase.h.

References m_hitCollection.

Referenced by recHitsBegin().

71  {
72  return *edm::getProduct<TrackingRecHitCollection>(m_hitCollection);
73 
74  }
edm::RefCore m_hitCollection
unsigned int reco::TrackExtraBase::recHitsSize ( ) const
inline

number of RecHits

Definition at line 38 of file TrackExtraBase.h.

References m_nHits.

Referenced by recHitsEnd().

38  {
39  return m_nHits;
40  }
unsigned int m_nHits
void reco::TrackExtraBase::setHits ( TrackingRecHitRefProd const &  prod,
unsigned  firstH,
unsigned int  nH 
)
inline

Member Data Documentation

unsigned int reco::TrackExtraBase::m_firstHit
private

Definition at line 79 of file TrackExtraBase.h.

Referenced by firstRecHit(), recHitRef(), and setHits().

edm::RefCore reco::TrackExtraBase::m_hitCollection
private

Definition at line 78 of file TrackExtraBase.h.

Referenced by recHitRef(), recHitsProduct(), and setHits().

unsigned int reco::TrackExtraBase::m_nHits
private

Definition at line 80 of file TrackExtraBase.h.

Referenced by recHitsSize(), and setHits().