CMS 3D CMS Logo

TrackExtraBase.h
Go to the documentation of this file.
1 #ifndef DataFormats_TrackReco_TrackExtraBase_h
2 #define DataFormats_TrackReco_TrackExtraBase_h
3 
19 
20 namespace reco {
21 
23  public:
24  using TrajParams = std::vector<LocalTrajectoryParameters>;
25  using Chi2sFive = std::vector<unsigned char>;
26 
28  TrackExtraBase() : m_firstHit((unsigned int)-1), m_nHits(0) {}
29 
30  void setHits(TrackingRecHitRefProd const& prod, unsigned firstH, unsigned int nH) {
31  m_hitCollection.pushBackItem(prod.refCore(), true);
32  m_firstHit = firstH;
33  m_nHits = nH;
34  }
35 
36  void setTrajParams(TrajParams tmps, Chi2sFive chi2s) {
37  m_trajParams = std::move(tmps);
38  m_chi2sX5 = std::move(chi2s);
39  }
40 
41  unsigned int firstRecHit() const { return m_firstHit; }
42 
44  unsigned int recHitsSize() const { return m_nHits; }
45 
47  auto recHits() const { return TrackingRecHitRange(recHitsBegin(), recHitsEnd()); }
48 
51 
54 
56  TrackingRecHitRef recHitRef(unsigned int i) const {
57  //Another thread might change the RefCore at the same time.
58  // By using a copy we will be safe.
60  if (hitCollection.productPtr()) {
63  finder(*(static_cast<TrackingRecHitRef::product_type const*>(hitCollection.productPtr())), m_firstHit + i);
65  }
67  }
68 
70  TrackingRecHitRef recHit(unsigned int i) const { return recHitRef(i); }
71 
73  return *edm::getProduct<TrackingRecHitCollection>(m_hitCollection);
74  }
75 
76  TrajParams const& trajParams() const { return m_trajParams; }
77  Chi2sFive const& chi2sX5() const { return m_chi2sX5; }
78 
79  private:
81  unsigned int m_firstHit;
82  unsigned int m_nHits;
84  Chi2sFive m_chi2sX5; // chi2 * 5 chopped at 255 (max chi2 is 51)
85  };
86 
87 } // namespace reco
88 
89 #endif // DataFormats_TrackReco_TrackExtraBase_h
edm::RefProd< TrackingRecHitCollection >
edm::RefCore
Definition: RefCore.h:21
mps_fire.i
i
Definition: mps_fire.py:428
edm::Ref::value_type
T value_type
Definition: Ref.h:160
reco::TrackExtraBase::m_nHits
unsigned int m_nHits
Definition: TrackExtraBase.h:82
HLT_FULL_cff.finder
finder
Definition: HLT_FULL_cff.py:51935
reco::TrackExtraBase::m_trajParams
TrajParams m_trajParams
Definition: TrackExtraBase.h:83
TrackingRecHitFwd.h
reco::TrackExtraBase::TrackExtraBase
TrackExtraBase()
default constructor
Definition: TrackExtraBase.h:28
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Ref::finder_type
F finder_type
Definition: Ref.h:162
reco::TrackExtraBase::chi2sX5
Chi2sFive const & chi2sX5() const
Definition: TrackExtraBase.h:77
reco::TrackExtraBase::recHitsBegin
trackingRecHit_iterator recHitsBegin() const
first iterator over RecHits
Definition: TrackExtraBase.h:50
edm::Ref
Definition: AssociativeIterator.h:58
reco::TrackExtraBase::m_hitCollection
edm::RefCore m_hitCollection
Definition: TrackExtraBase.h:80
TrackingRecHitRange
edm::Range< trackingRecHit_iterator > TrackingRecHitRange
Range class to enable range-based loops for a tracks RecHits.
Definition: TrackingRecHitFwd.h:22
LocalTrajectoryParameters.h
reco::TrackExtraBase::m_firstHit
unsigned int m_firstHit
Definition: TrackExtraBase.h:81
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
egammaRechitFilter_cfi.hitCollection
hitCollection
Definition: egammaRechitFilter_cfi.py:10
edm::OwnVector::const_iterator
Definition: OwnVector.h:41
reco::TrackExtraBase::setTrajParams
void setTrajParams(TrajParams tmps, Chi2sFive chi2s)
Definition: TrackExtraBase.h:36
TrackingRecHitRef
edm::Ref< TrackingRecHitCollection > TrackingRecHitRef
persistent reference to a TrackingRecHit
Definition: TrackingRecHitFwd.h:14
edm::RefCore::pushBackItem
void pushBackItem(RefCore const &productToBeInserted, bool checkPointer)
Definition: RefCore.cc:165
createfilelist.int
int
Definition: createfilelist.py:10
reco::TrackExtraBase::trajParams
TrajParams const & trajParams() const
Definition: TrackExtraBase.h:76
reco::TrackExtraBase::m_chi2sX5
Chi2sFive m_chi2sX5
Definition: TrackExtraBase.h:84
reco::TrackExtraBase::recHit
TrackingRecHitRef recHit(unsigned int i) const
get i-th recHit
Definition: TrackExtraBase.h:70
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
reco::TrackExtraBase::setHits
void setHits(TrackingRecHitRefProd const &prod, unsigned firstH, unsigned int nH)
Definition: TrackExtraBase.h:30
reco::TrackExtraBase::recHitsSize
unsigned int recHitsSize() const
number of RecHits
Definition: TrackExtraBase.h:44
reco::TrackExtraBase::recHitsProduct
TrackingRecHitCollection const & recHitsProduct() const
Definition: TrackExtraBase.h:72
eostools.move
def move(src, dest)
Definition: eostools.py:511
reco::TrackExtraBase::Chi2sFive
std::vector< unsigned char > Chi2sFive
Definition: TrackExtraBase.h:25
edm::OwnVector::data
base const & data() const
Definition: OwnVector.h:476
reco::TrackExtraBase::recHitRef
TrackingRecHitRef recHitRef(unsigned int i) const
get a ref to i-th recHit
Definition: TrackExtraBase.h:56
reco::TrackExtraBase::firstRecHit
unsigned int firstRecHit() const
Definition: TrackExtraBase.h:41
reco::TrackExtraBase
Definition: TrackExtraBase.h:22
reco::TrackExtraBase::recHitsEnd
trackingRecHit_iterator recHitsEnd() const
last iterator over RecHits
Definition: TrackExtraBase.h:53
reco::TrackExtraBase::TrajParams
std::vector< LocalTrajectoryParameters > TrajParams
Definition: TrackExtraBase.h:24
reco::TrackExtraBase::recHits
auto recHits() const
accessor to RecHits
Definition: TrackExtraBase.h:47
edm::OwnVector< TrackingRecHit >