CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 #include <functional>
8 
9 namespace pf2pat {
10 
12 
13  public:
16  typedef std::vector<reco::PFCandidate> container;
17 
18  struct Pointer : public std::unary_function<reco::PFCandidate,const reco::PFCandidate *> {
19  const reco::PFCandidate * operator()(const reco::PFCandidate &c) const { return &c; }
20  };
21 
22  typedef boost::transform_iterator<Pointer,container::const_iterator> const_iterator;
23 
25 
26  const_iterator begin() const { return const_iterator(selected_.begin()); }
27 
28  const_iterator end() const { return const_iterator(selected_.end()); }
29 
30  size_t size() const { return selected_.size(); }
31 
32  const container& selected() const {return selected_;}
33 
34  protected:
36  };
37 }
38 
39 #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:33