1 #ifndef RecoParticleFlow_PFProducer_PFBlockAlgo_h
2 #define RecoParticleFlow_PFProducer_PFBlockAlgo_h
64 #include <unordered_map>
68 struct hash<std::pair<size_t,size_t> > {
72 return arg.first ^ (arg.second << 1);
76 struct equal_to<std::pair<size_t,size_t> > {
79 return (arg1.first == arg2.first && arg1.second == arg2.second);
94 typedef std::vector<std::unique_ptr<reco::PFBlockElement> >
ElementList;
95 typedef std::unique_ptr<BlockElementImporterBase>
ImporterPtr;
97 typedef std::unique_ptr<KDTreeLinkerBase>
KDTreePtr;
99 typedef ElementList::iterator
IE;
100 typedef ElementList::const_iterator
IEC;
101 typedef reco::PFBlockCollection::const_iterator
IBC;
107 void setLinkers(
const std::vector<edm::ParameterSet>&);
109 void setImporters(
const std::vector<edm::ParameterSet>&,
126 const std::auto_ptr< reco::PFBlockCollection >&
blocks()
const
144 const std::unordered_map<std::pair<size_t,size_t>,
PFBlockLink>&
links)
const;
157 std::auto_ptr< reco::PFBlockCollection >
blocks_;
170 const std::unordered_map<std::string,reco::PFBlockElement::Type>
const std::auto_ptr< reco::PFBlockCollection > & blocks() const
value_type operator()(const arg_type &arg) const
std::unique_ptr< BlockElementLinkerBase > LinkTestPtr
Abstract base class for a PFBlock element (track, cluster...)
std::vector< LinkTestPtr > _linkTests
const std::unordered_map< std::string, reco::PFBlockElement::Type > _elementTypes
ElementList::const_iterator IEC
friend std::ostream & operator<<(std::ostream &, const PFBlockAlgo &)
IE associate(ElementList &elems, std::unordered_map< std::pair< size_t, size_t >, PFBlockLink > &links, reco::PFBlock &)
std::auto_ptr< reco::PFBlockCollection > blocks_
ElementList::iterator IE
define these in *Fwd files in DataFormats/ParticleFlowReco?
std::vector< std::unique_ptr< reco::PFBlockElement > > ElementList
bool operator()(const arg_type &arg1, const arg_type &arg2) const
std::unique_ptr< KDTreeLinkerBase > KDTreePtr
void setDebug(bool debug)
sets debug printout flag
void link(const reco::PFBlockElement *el1, const reco::PFBlockElement *el2, PFBlockLink::Type &linktype, reco::PFBlock::LinkTest &linktest, double &dist) const
check whether 2 elements are linked. Returns distance and linktype
void packLinks(reco::PFBlock &block, const std::unordered_map< std::pair< size_t, size_t >, PFBlockLink > &links) const
std::vector< KDTreePtr > _kdtrees
void updateEventSetup(const edm::EventSetup &)
std::pair< size_t, size_t > arg_type
void setImporters(const std::vector< edm::ParameterSet > &, edm::ConsumesCollector &)
reco::PFBlockCollection::const_iterator IBC
std::pair< size_t, size_t > arg_type
std::auto_ptr< reco::PFBlockCollection > transferBlocks()
bool linkPrefilter(const reco::PFBlockElement *last, const reco::PFBlockElement *next) const
Avoid to check links when not useful.
void findBlocks()
build blocks
Type
possible types. WARNING: have a look at PFBlockElement
void buildElements(const edm::Event &)
bool debug_
if true, debug printouts activated
void setLinkers(const std::vector< edm::ParameterSet > &)
std::vector< ImporterPtr > _importers
std::unique_ptr< BlockElementImporterBase > ImporterPtr