CMS 3D CMS Logo

RecoTrackSelector.h
Go to the documentation of this file.
1 #ifndef RecoSelectors_RecoTrackSelector_h
2 #define RecoSelectors_RecoTrackSelector_h
3 /* \class RecoTrackSelector
4  *
5  * \author Giuseppe Cerati, INFN
6  *
7  */
9 
11  public:
14  typedef std::vector<const reco::Track *> container;
15  typedef container::const_iterator const_iterator;
16 
20  RecoTrackSelectorBase( cfg, iC ) {}
21 
22  const_iterator begin() const { return selected_.begin(); }
23  const_iterator end() const { return selected_.end(); }
24 
25  void select( const edm::Handle<collection>& c, const edm::Event & event, const edm::EventSetup&es) {
26  init(event,es);
27  selected_.clear();
28  for( reco::TrackCollection::const_iterator trk = c->begin();
29  trk != c->end(); ++ trk ) {
30  reference_type tkref(c,std::distance(c->begin(),trk));
31  if ( operator()(*tkref) ) {
32  selected_.push_back( & * trk );
33  }
34  }
35  }
36 
37  size_t size() const { return selected_.size(); }
38 
39  private:
40  container selected_;
41 };
42 
43 #endif
void init(const edm::Event &event, const edm::EventSetup &es)
container::const_iterator const_iterator
reco::TrackRef reference_type
const_iterator end() const
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
RecoTrackSelector()
Constructors.
const_iterator begin() const
RecoTrackSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
void select(const edm::Handle< collection > &c, const edm::Event &event, const edm::EventSetup &es)
size_t size() const
std::vector< const reco::Track * > container
Definition: event.py:1
reco::TrackCollection collection