00001 #ifndef CommonTools_ParticleFlow_PFJetSelectorDefinition 00002 #define CommonTools_ParticleFlow_PFJetSelectorDefinition 00003 00004 #include "DataFormats/JetReco/interface/PFJet.h" 00005 #include "DataFormats/JetReco/interface/PFJetCollection.h" 00006 #include "boost/iterator/transform_iterator.hpp" 00007 #include <functional> 00008 00009 namespace pf2pat { 00010 00011 class PFJetSelectorDefinition { 00012 00013 public: 00014 typedef reco::PFJetCollection collection; 00015 typedef edm::Handle< collection > HandleToCollection; 00016 typedef std::vector<reco::PFJet> container; 00017 00018 struct Pointer : public std::unary_function<reco::PFJet,const reco::PFJet *> { 00019 const reco::PFJet * operator()(const reco::PFJet &c) const { return &c; } 00020 }; 00021 00022 typedef boost::transform_iterator<Pointer,container::const_iterator> const_iterator; 00023 00024 PFJetSelectorDefinition () {} 00025 00026 const_iterator begin() const { return const_iterator(selected_.begin()); } 00027 00028 const_iterator end() const { return const_iterator(selected_.end()); } 00029 00030 size_t size() const { return selected_.size(); } 00031 00032 const container& selected() const {return selected_;} 00033 00034 protected: 00035 container selected_; 00036 }; 00037 } 00038 00039 #endif