CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFRecHitNavigatorBase.h
Go to the documentation of this file.
1 #ifndef RecoParticleFlow_PFClusterProducer_PFRecHitNavigatorBase_h
2 #define RecoParticleFlow_PFClusterProducer_PFRecHitNavigatorBase_h
3 
14 
17 
23 
24 #include <unordered_map>
25 
27  public:
28  typedef std::unordered_map<unsigned,unsigned> DetIdToHitIdx;
29 
32 
34 
35  virtual void beginEvent(const edm::EventSetup&)=0;
36  virtual void associateNeighbours(reco::PFRecHit&,std::auto_ptr<reco::PFRecHitCollection>&,edm::RefProd<reco::PFRecHitCollection>&)=0;
37 
38 
39  protected:
40 
41  void associateNeighbour(const DetId& id, reco::PFRecHit& hit,std::auto_ptr<reco::PFRecHitCollection>& hits,edm::RefProd<reco::PFRecHitCollection>& refProd,short eta, short phi,short depth) {
42  auto found_hit = std::lower_bound(hits->begin(),hits->end(),
43  id,
44  [](const reco::PFRecHit& a,
45  const DetId& id){
46  return a.detId() < id;
47  });
48  if( found_hit != hits->end() && found_hit->detId() == id.rawId() ) {
49  hit.addNeighbour(eta,phi,depth,found_hit-hits->begin());
50  }
51  }
52 
53 
54 };
55 
56 
57 
60 
61 #endif
virtual void associateNeighbours(reco::PFRecHit &, std::auto_ptr< reco::PFRecHitCollection > &, edm::RefProd< reco::PFRecHitCollection > &)=0
void addNeighbour(short x, short y, short z, unsigned int)
Definition: PFRecHit.cc:5
edmplugin::PluginFactory< PFRecHitNavigatorBase *(const edm::ParameterSet &)> PFRecHitNavigationFactory
void associateNeighbour(const DetId &id, reco::PFRecHit &hit, std::auto_ptr< reco::PFRecHitCollection > &hits, edm::RefProd< reco::PFRecHitCollection > &refProd, short eta, short phi, short depth)
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
std::unordered_map< unsigned, unsigned > DetIdToHitIdx
Definition: DetId.h:18
double a
Definition: hdecay.h:121
PFRecHitNavigatorBase(const edm::ParameterSet &iConfig)
virtual void beginEvent(const edm::EventSetup &)=0