CMS 3D CMS Logo

PFCandidateSelectorDefinition.h
Go to the documentation of this file.
1 #ifndef CommonTools_ParticleFlow_PFCandidateSelectorDefinition
2 #define CommonTools_ParticleFlow_PFCandidateSelectorDefinition
3 
6 #include "boost/iterator/transform_iterator.hpp"
7 
8 namespace pf2pat {
9 
11 
12  public:
15  typedef std::vector<reco::PFCandidate> container;
16 
17  struct Pointer {
18  const reco::PFCandidate * operator()(const reco::PFCandidate &c) const { return &c; }
19  };
20 
21  typedef boost::transform_iterator<Pointer,container::const_iterator> const_iterator;
22 
24 
25  const_iterator begin() const { return const_iterator(selected_.begin()); }
26 
27  const_iterator end() const { return const_iterator(selected_.end()); }
28 
29  size_t size() const { return selected_.size(); }
30 
31  const container& selected() const {return selected_;}
32 
33  protected:
34  container selected_;
35  };
36 }
37 
38 #endif
const reco::PFCandidate * operator()(const reco::PFCandidate &c) const
boost::transform_iterator< Pointer, container::const_iterator > const_iterator
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:40