CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Private Attributes
reco::JetTrackMatch< JetC > Class Template Reference

Association between Jets from jet collection and tracks from track collection. More...

#include <JetTrackMatch.h>

Public Types

typedef edm::Ref< JetC > JetRef
 
typedef edm::AssociationMap
< edm::OneToMany< JetC,
reco::TrackCollection > > 
Map
 
typedef edm::Ref
< reco::TrackCollection
TrackRef
 

Public Member Functions

std::vector< JetRefallJets () const
 get list of all jats in the map More...
 
std::vector< TrackRefgetTracks (const JetRef &mJet) const
 get all tracks associated with jet More...
 
void insert (const JetRef &fJet)
 insert orphan jet More...
 
void insert (const JetRef &fJet, const TrackRef &fTrack)
 assign track to jet. More...
 
 JetTrackMatch ()
 
 ~JetTrackMatch ()
 

Private Attributes

Map mMap
 

Detailed Description

template<typename JetC>
class reco::JetTrackMatch< JetC >

Association between Jets from jet collection and tracks from track collection.

Every jet may have several tracks associated with it

class definition:

template <typename jetc>=""> class JetTrackMatch { public: typedef edm::Ref<JetC> JetRef; typedef edm::Ref<reco::TrackCollection> TrackRef; JetTrackMatch (); ~JetTrackMatch (); // insert orphan jet void insert (const JetRef& fJet); // assign track to jet. void insert (const JetRef& fJet, const TrackRef& fTrack); // get list of all tracks in the map std::vector <JetRef> allJets () const; // get all tracks associated with jet std::vector <TrackRef> getTracks (const JetRef& mJet) const; };

Author
Fedor Ratnikov, UMd

Definition at line 39 of file JetTrackMatch.h.

Member Typedef Documentation

template<typename JetC >
typedef edm::Ref<JetC> reco::JetTrackMatch< JetC >::JetRef

Definition at line 41 of file JetTrackMatch.h.

template<typename JetC >
typedef edm::AssociationMap<edm::OneToMany<JetC, reco::TrackCollection> > reco::JetTrackMatch< JetC >::Map

Definition at line 43 of file JetTrackMatch.h.

template<typename JetC >
typedef edm::Ref<reco::TrackCollection> reco::JetTrackMatch< JetC >::TrackRef

Definition at line 42 of file JetTrackMatch.h.

Constructor & Destructor Documentation

template<typename JetC >
reco::JetTrackMatch< JetC >::JetTrackMatch ( )
inline

Definition at line 49 of file JetTrackMatch.h.

49 {}
template<typename JetC >
reco::JetTrackMatch< JetC >::~JetTrackMatch ( )
inline

Definition at line 50 of file JetTrackMatch.h.

50 {}

Member Function Documentation

template<typename JetC >
std::vector<JetRef> reco::JetTrackMatch< JetC >::allJets ( ) const
inline

get list of all jats in the map

Definition at line 59 of file JetTrackMatch.h.

References edm::AssociationMap< Tag >::begin(), edm::AssociationMap< edm::OneToMany< JetC, reco::TrackCollection > >::const_iterator, edm::AssociationMap< Tag >::end(), reco::JetTrackMatch< JetC >::mMap, and mps_fire::result.

59  {
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  }
const_iterator end() const
last iterator over the map (read only)
tuple result
Definition: mps_fire.py:311
const_iterator begin() const
first iterator over the map (read only)
template<typename JetC >
std::vector<TrackRef> reco::JetTrackMatch< JetC >::getTracks ( const JetRef mJet) const
inline

get all tracks associated with jet

Definition at line 68 of file JetTrackMatch.h.

References mps_fire::i, reco::JetTrackMatch< JetC >::mMap, mps_fire::result, edm::RefVector< C, T, F >::size(), and tracks.

68  {
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  }
auto const & tracks
cannot be loose
tuple result
Definition: mps_fire.py:311
size_type size() const
Size of the RefVector.
Definition: RefVector.h:102
template<typename JetC >
void reco::JetTrackMatch< JetC >::insert ( const JetRef fJet)
inline

insert orphan jet

Definition at line 53 of file JetTrackMatch.h.

References edm::AssociationMap< Tag >::insert(), and reco::JetTrackMatch< JetC >::mMap.

Referenced by BeautifulSoup.PageElement::_invert(), and SequenceTypes.Schedule::_replaceIfHeldDirectly().

53 { mMap.insert(fJet, TrackRef()); }
edm::Ref< reco::TrackCollection > TrackRef
Definition: JetTrackMatch.h:42
void insert(const key_type &k, const data_type &v)
insert an association
template<typename JetC >
void reco::JetTrackMatch< JetC >::insert ( const JetRef fJet,
const TrackRef fTrack 
)
inline

assign track to jet.

Definition at line 56 of file JetTrackMatch.h.

References edm::AssociationMap< Tag >::insert(), and reco::JetTrackMatch< JetC >::mMap.

Referenced by BeautifulSoup.PageElement::_invert(), and SequenceTypes.Schedule::_replaceIfHeldDirectly().

56 { mMap.insert(fJet, fTrack); }
void insert(const key_type &k, const data_type &v)
insert an association

Member Data Documentation

template<typename JetC >
Map reco::JetTrackMatch< JetC >::mMap
private