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 
21  const_iterator begin() const { return selected_.begin(); }
22  const_iterator end() const { return selected_.end(); }
23 
24  void select(const edm::Handle<collection>& c, const edm::Event& event, const edm::EventSetup& es) {
25  init(event, es);
26  selected_.clear();
27  for (reco::TrackCollection::const_iterator trk = c->begin(); trk != c->end(); ++trk) {
28  reference_type tkref(c, std::distance(c->begin(), trk));
29  if (operator()(*tkref)) {
30  selected_.push_back(&*trk);
31  }
32  }
33  }
34 
35  size_t size() const { return selected_.size(); }
36 
37 private:
39 };
40 
41 #endif
RecoTrackSelector::reference_type
reco::TrackRef reference_type
Definition: RecoTrackSelector.h:12
RecoTrackSelector::container
std::vector< const reco::Track * > container
Definition: RecoTrackSelector.h:14
RecoTrackSelector::RecoTrackSelector
RecoTrackSelector()
Constructors.
Definition: RecoTrackSelector.h:18
RecoTrackSelector::const_iterator
container::const_iterator const_iterator
Definition: RecoTrackSelector.h:15
edm::Handle
Definition: AssociativeIterator.h:50
edm::Ref< TrackCollection >
RecoTrackSelectorBase.h
RecoTrackSelector::size
size_t size() const
Definition: RecoTrackSelector.h:35
RecoTrackSelectorBase::init
void init(const edm::Event &event, const edm::EventSetup &es)
Definition: RecoTrackSelectorBase.h:69
edm::ParameterSet
Definition: ParameterSet.h:47
RecoTrackSelector
Definition: RecoTrackSelector.h:10
RecoTrackSelector::select
void select(const edm::Handle< collection > &c, const edm::Event &event, const edm::EventSetup &es)
Definition: RecoTrackSelector.h:24
RecoTrackSelector::RecoTrackSelector
RecoTrackSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition: RecoTrackSelector.h:19
edm::EventSetup
Definition: EventSetup.h:57
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
looper.cfg
cfg
Definition: looper.py:297
RecoTrackSelector::end
const_iterator end() const
Definition: RecoTrackSelector.h:22
RecoTrackSelectorBase
Definition: RecoTrackSelectorBase.h:16
RecoTrackSelector::selected_
container selected_
Definition: RecoTrackSelector.h:38
RecoTrackSelector::begin
const_iterator begin() const
Definition: RecoTrackSelector.h:21
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7796
RecoTrackSelector::collection
reco::TrackCollection collection
Definition: RecoTrackSelector.h:13
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
edm::ConsumesCollector
Definition: ConsumesCollector.h:45