CMS 3D CMS Logo

RecoTrackViewRefSelector.h
Go to the documentation of this file.
1 #ifndef CommonTools_RecoAlgos_RecoTrackViewRefSelector_h
2 #define CommonTools_RecoAlgos_RecoTrackViewRefSelector_h
3 
6 
8  public:
12 
15 
17 
18  const_ref_iterator begin() const { return ref_selected_.begin(); }
19  const_ref_iterator end() const { return ref_selected_.end(); }
20 
21  void select( const edm::Handle<collection>& c, const edm::Event & event, const edm::EventSetup&es) {
22  init(event, es);
24  for (unsigned int i = 0; i < c->size(); i++) {
25  auto trk = c->refAt(i);
26  if ( operator()(*trk) ) {
27  ref_selected_.push_back( trk );
28  }
29  }
30  }
31 
32  size_t size() const { return ref_selected_.size(); }
33 
34  private:
35  ref_container ref_selected_;
36 };
37 
38 #endif
void init(const edm::Event &event, const edm::EventSetup &es)
RecoTrackViewRefSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
void select(const edm::Handle< collection > &c, const edm::Event &event, const edm::EventSetup &es)
const_iterator end() const
size_type size() const
const_ref_iterator end() const
RefToBase< value_type > refAt(size_type i) const
edm::View< reco::Track > collection
const_ref_iterator begin() const
ref_container::const_iterator const_ref_iterator
size_type size() const
const_iterator begin() const
void push_back(const RefToBase< T > &)
edm::RefToBaseVector< reco::Track > ref_container
Definition: event.py:1