CMS 3D CMS Logo

JetTrackMatch.h
Go to the documentation of this file.
1 #ifndef JetReco_JetTrackMatch_h
2 #define JetReco_JetTrackMatch_h
3 
36 
37 namespace reco {
38  template <typename JetC>
39  class JetTrackMatch {
40  public:
44 
45  private:
47 
48  public:
51 
53  void insert(const JetRef& fJet) { mMap.insert(fJet, TrackRef()); }
54 
56  void insert(const JetRef& fJet, const TrackRef& fTrack) { mMap.insert(fJet, fTrack); }
57 
59  std::vector<JetRef> allJets() const {
60  std::vector<JetRef> result;
61  typename Map::const_iterator it = mMap.begin();
62  for (; it != mMap.end(); ++it) {
63  result.push_back(it->key);
64  }
65  return result;
66  }
68  std::vector<TrackRef> getTracks(const JetRef& mJet) const {
69  std::vector<TrackRef> result;
71  int i = tracks.size();
72  while (--i >= 0) {
73  if (!tracks[i].isNull())
74  result.push_back(tracks[i]);
75  }
76  return result;
77  }
78  };
79 } // namespace reco
80 
81 #endif
reco::JetTrackMatch::JetTrackMatch
JetTrackMatch()
Definition: JetTrackMatch.h:49
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
mps_fire.i
i
Definition: mps_fire.py:355
reco::JetTrackMatch::insert
void insert(const JetRef &fJet)
insert orphan jet
Definition: JetTrackMatch.h:53
reco::JetTrackMatch::~JetTrackMatch
~JetTrackMatch()
Definition: JetTrackMatch.h:50
AssociationMap.h
edm::RefVector< TrackCollection >
reco::JetTrackMatch::insert
void insert(const JetRef &fJet, const TrackRef &fTrack)
assign track to jet.
Definition: JetTrackMatch.h:56
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Ref
Definition: AssociativeIterator.h:58
edm::AssociationMap::end
const_iterator end() const
last iterator over the map (read only)
Definition: AssociationMap.h:171
Track.h
TrackFwd.h
reco::JetTrackMatch::JetRef
edm::Ref< JetC > JetRef
Definition: JetTrackMatch.h:41
reco::JetTrackMatch::TrackRef
edm::Ref< reco::TrackCollection > TrackRef
Definition: JetTrackMatch.h:42
reco::JetTrackMatch::getTracks
std::vector< TrackRef > getTracks(const JetRef &mJet) const
get all tracks associated with jet
Definition: JetTrackMatch.h:68
edm::AssociationMap< edm::OneToMany< JetC, reco::TrackCollection > >::const_iterator
friend struct const_iterator
Definition: AssociationMap.h:274
reco::JetTrackMatch::mMap
Map mMap
Definition: JetTrackMatch.h:46
edm::AssociationMap
Definition: AssociationMap.h:48
edm::AssociationMap::insert
void insert(const key_type &k, const data_type &v)
insert an association
Definition: AssociationMap.h:166
reco::JetTrackMatch::allJets
std::vector< JetRef > allJets() const
get list of all jats in the map
Definition: JetTrackMatch.h:59
edm::AssociationMap::begin
const_iterator begin() const
first iterator over the map (read only)
Definition: AssociationMap.h:169
mps_fire.result
result
Definition: mps_fire.py:303
reco::JetTrackMatch::Map
edm::AssociationMap< edm::OneToMany< JetC, reco::TrackCollection > > Map
Definition: JetTrackMatch.h:43
reco::JetTrackMatch
Association between Jets from jet collection and tracks from track collection.
Definition: JetTrackMatch.h:39