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

void add (const TrackingRecHitRef &ref)
 add a reference to a RecHit More...
 
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

void reco::TrackExtraBase::add ( const TrackingRecHitRef ref)
inline

add a reference to a RecHit

Definition at line 34 of file TrackExtraBase.h.

References edm::Ref< C, T, F >::key(), m_firstHit, m_hitCollection, m_nHits, edm::RefCore::pushBackItem(), and edm::Ref< C, T, F >::refCore().

Referenced by MuonErrorMatrixAdjuster::attachRecHits(), helper::GsfElectronCollectionStoreManager::cloneAndStore(), helper::MuonCollectionStoreManager::processMuon(), helper::TrackCollectionStoreManager::processTrack(), MuonTrackProducer::produce(), PixelTracksProducer::produce(), FastTrackMerger::produce(), SimpleTrackListMerger::produce(), CosmicTrackSelector::produce(), FakeTrackProducer< T >::produce(), DuplicateListMerger::produce(), TrackMultiSelector::produce(), reco::modules::TrackFullCloneSelectorBase< Selector >::produce(), reco::modules::HICaloCompatibleTrackSelector::produce(), GsfTrackProducerBase::putInEvt(), TrackProducerWithSCAssociation::putInEvt(), counter.Counter::register(), AnalyticalTrackSelector::run(), and PixelTrackProducer::store().

34  {
36  if (m_nHits==0) {
37  m_firstHit = ref.key();
38  }
39  assert(m_nHits== ref.key()-m_firstHit);
40  ++m_nHits;
41  }
void pushBackItem(RefCore const &productToBeInserted, bool checkPointer)
Definition: RefCore.cc:176
RefCore const & refCore() const
Definition: Ref.h:281
key_type key() const
Accessor for product key.
Definition: Ref.h:266
unsigned int m_nHits
unsigned int m_firstHit
edm::RefCore m_hitCollection
unsigned int reco::TrackExtraBase::firstRecHit ( ) const
inline

Definition at line 44 of file TrackExtraBase.h.

References m_firstHit.

Referenced by recHitsBegin().

44  {
45  return m_firstHit;
46  }
unsigned int m_firstHit
TrackingRecHitRef reco::TrackExtraBase::recHit ( unsigned int  i) const
inline

get i-th recHit

Definition at line 70 of file TrackExtraBase.h.

References recHitRef().

70  {
71  return recHitRef(i);
72  }
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 65 of file TrackExtraBase.h.

References m_firstHit, and m_hitCollection.

Referenced by recHit().

65  {
67  }
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 55 of file TrackExtraBase.h.

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

Referenced by recHitsEnd().

55  {
56  return recHitsProduct().data().begin()+firstRecHit();
57  }
TrackingRecHitCollection const & recHitsProduct() const
base const & data() const
Definition: OwnVector.h:372
unsigned int firstRecHit() const
trackingRecHit_iterator reco::TrackExtraBase::recHitsEnd ( ) const
inline

last iterator over RecHits

Definition at line 60 of file TrackExtraBase.h.

References recHitsBegin(), and recHitsSize().

60  {
61  return recHitsBegin()+recHitsSize();
62  }
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 74 of file TrackExtraBase.h.

References m_hitCollection.

Referenced by recHitsBegin().

74  {
75  return *edm::getProduct<TrackingRecHitCollection>(m_hitCollection);
76 
77  }
edm::RefCore m_hitCollection
unsigned int reco::TrackExtraBase::recHitsSize ( ) const
inline

number of RecHits

Definition at line 49 of file TrackExtraBase.h.

References m_nHits.

Referenced by recHitsEnd().

49  {
50  return m_nHits;
51  }
unsigned int m_nHits
void reco::TrackExtraBase::setHits ( TrackingRecHitRefProd const &  prod,
unsigned  firstH,
unsigned int  nH 
)
inline

Definition at line 28 of file TrackExtraBase.h.

References m_firstHit, m_hitCollection, m_nHits, edm::RefCore::pushBackItem(), and edm::RefProd< T >::refCore().

Referenced by TrackListMerger::produce(), DuplicateListMerger::produce(), and KfTrackProducerBase::putInEvt().

28  {
29  m_hitCollection.pushBackItem(prod.refCore(),true);
30  m_firstHit =firstH; m_nHits=nH;
31  }
void pushBackItem(RefCore const &productToBeInserted, bool checkPointer)
Definition: RefCore.cc:176
unsigned int m_nHits
unsigned int m_firstHit
edm::RefCore m_hitCollection

Member Data Documentation

unsigned int reco::TrackExtraBase::m_firstHit
private

Definition at line 82 of file TrackExtraBase.h.

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

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

Definition at line 81 of file TrackExtraBase.h.

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

unsigned int reco::TrackExtraBase::m_nHits
private

Definition at line 83 of file TrackExtraBase.h.

Referenced by add(), recHitsSize(), and setHits().