test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  private:
46 
47  public:
50 
52  void insert (const JetRef& fJet) {
53  mMap.insert (fJet, TrackRef());
54  }
55 
57  void insert (const JetRef& fJet, const TrackRef& fTrack) {
58  mMap.insert (fJet, fTrack);
59  }
60 
62  std::vector <JetRef> allJets () const {
63  std::vector <JetRef> result;
64  typename Map::const_iterator it = mMap.begin ();
65  for (; it != mMap.end(); ++it) {
66  result.push_back (it->key);
67  }
68  return result;
69  }
71  std::vector <TrackRef> getTracks (const JetRef& mJet) const {
72  std::vector <TrackRef> result;
74  int i = tracks.size();
75  while (--i >= 0) {
76  if (!tracks [i].isNull ()) result.push_back (tracks [i]);
77  }
78  return result;
79  }
80  };
81 }
82 
83 #endif
int i
Definition: DBlmapReader.cc:9
Association between Jets from jet collection and tracks from track collection.
Definition: JetTrackMatch.h:39
const_iterator end() const
last iterator over the map (read only)
void insert(const JetRef &fJet)
insert orphan jet
Definition: JetTrackMatch.h:52
edm::AssociationMap< edm::OneToMany< JetC, reco::TrackCollection > > Map
Definition: JetTrackMatch.h:43
void insert(const JetRef &fJet, const TrackRef &fTrack)
assign track to jet.
Definition: JetTrackMatch.h:57
edm::Ref< reco::TrackCollection > TrackRef
Definition: JetTrackMatch.h:42
tuple result
Definition: mps_fire.py:84
std::vector< JetRef > allJets() const
get list of all jats in the map
Definition: JetTrackMatch.h:62
void insert(const key_type &k, const data_type &v)
insert an association
tuple tracks
Definition: testEve_cfg.py:39
std::vector< TrackRef > getTracks(const JetRef &mJet) const
get all tracks associated with jet
Definition: JetTrackMatch.h:71
size_type size() const
Size of the RefVector.
Definition: RefVector.h:107
const_iterator begin() const
first iterator over the map (read only)
edm::Ref< JetC > JetRef
Definition: JetTrackMatch.h:41