1 #ifndef RecoParticleFlow_PFProducer_PFBlockAlgo_h
2 #define RecoParticleFlow_PFProducer_PFBlockAlgo_h
64 #include <unordered_map>
65 #include <unordered_set>
69 struct hash<std::pair<unsigned int,unsigned int> > {
70 typedef std::pair<unsigned int,unsigned int>
arg_type;
73 return arg.first ^ (arg.second << 1);
77 struct equal_to<std::pair<unsigned int,unsigned int> > {
78 typedef std::pair<unsigned int,unsigned int>
arg_type;
80 return ( (arg1.first == arg2.first) & (arg1.second == arg2.second) );
95 typedef std::vector<std::unique_ptr<reco::PFBlockElement> >
ElementList;
96 typedef std::unique_ptr<BlockElementImporterBase>
ImporterPtr;
98 typedef std::unique_ptr<KDTreeLinkerBase>
KDTreePtr;
100 typedef ElementList::iterator
IE;
101 typedef ElementList::const_iterator
IEC;
102 typedef reco::PFBlockCollection::const_iterator
IBC;
110 void setLinkers(
const std::vector<edm::ParameterSet>&);
112 void setImporters(
const std::vector<edm::ParameterSet>&,
129 const std::auto_ptr< reco::PFBlockCollection >&
blocks()
const
142 const std::unordered_map<std::pair<unsigned int,unsigned int>,
PFBlockLink>&
links)
const;
156 std::auto_ptr< reco::PFBlockCollection >
blocks_;
171 const std::unordered_map<std::string,reco::PFBlockElement::Type>
const std::auto_ptr< reco::PFBlockCollection > & blocks() 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
std::auto_ptr< reco::PFBlockCollection > blocksNew_
ElementList::const_iterator IEC
friend std::ostream & operator<<(std::ostream &, const PFBlockAlgo &)
std::pair< unsigned int, unsigned int > arg_type
std::auto_ptr< reco::PFBlockCollection > blocks_
ElementList::iterator IE
define these in *Fwd files in DataFormats/ParticleFlowReco?
bool operator()(const arg_type &arg1, const arg_type &arg2) const
std::vector< std::unique_ptr< reco::PFBlockElement > > ElementList
std::pair< unsigned int, unsigned int > arg_type
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
std::vector< KDTreePtr > _kdtrees
void updateEventSetup(const edm::EventSetup &)
void setImporters(const std::vector< edm::ParameterSet > &, edm::ConsumesCollector &)
void packLinks(reco::PFBlock &block, const std::unordered_map< std::pair< unsigned int, unsigned int >, PFBlockLink > &links) const
reco::PFBlockCollection::const_iterator IBC
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
std::array< std::pair< unsigned int, unsigned int >, reco::PFBlockElement::kNBETypes > ElementRanges
Type
possible types. WARNING: have a look at PFBlockElement
value_type operator()(const arg_type &arg) const
std::vector< ElementList::value_type::pointer > bare_elements_
void buildElements(const edm::Event &)
unsigned int _linkTestSquare[reco::PFBlockElement::kNBETypes][reco::PFBlockElement::kNBETypes]
bool debug_
if true, debug printouts activated
void setLinkers(const std::vector< edm::ParameterSet > &)
std::vector< ImporterPtr > _importers
std::unique_ptr< BlockElementImporterBase > ImporterPtr