CMS 3D CMS Logo

PFRecHitNavigatorBase.h
Go to the documentation of this file.
1 #ifndef RecoParticleFlow_PFClusterProducer_PFRecHitNavigatorBase_h
2 #define RecoParticleFlow_PFClusterProducer_PFRecHitNavigatorBase_h
3 
13 
16 
22 
23 #include <unordered_map>
24 
26 public:
27  typedef std::unordered_map<unsigned, unsigned> DetIdToHitIdx;
28 
29  PFRecHitNavigatorBase() = default;
31 
32  virtual ~PFRecHitNavigatorBase() = default;
33 
34  virtual void init(const edm::EventSetup&) = 0;
35  virtual void associateNeighbours(reco::PFRecHit&,
36  std::unique_ptr<reco::PFRecHitCollection>&,
38 
39 protected:
40  void associateNeighbour(const DetId& id,
42  std::unique_ptr<reco::PFRecHitCollection>& hits,
44  short eta,
45  short phi,
46  short depth) {
47  auto found_hit = std::lower_bound(
48  hits->begin(), hits->end(), id, [](const reco::PFRecHit& a, const DetId& id) { return a.detId() < id; });
49  if (found_hit != hits->end() && found_hit->detId() == id.rawId()) {
50  hit.addNeighbour(eta, phi, depth, found_hit - hits->begin());
51  }
52  }
53 };
54 
58 
59 #endif
void associateNeighbour(const DetId &id, reco::PFRecHit &hit, std::unique_ptr< reco::PFRecHitCollection > &hits, edm::RefProd< reco::PFRecHitCollection > &refProd, short eta, short phi, short depth)
virtual void associateNeighbours(reco::PFRecHit &, std::unique_ptr< reco::PFRecHitCollection > &, edm::RefProd< reco::PFRecHitCollection > &)=0
virtual void init(const edm::EventSetup &)=0
PFRecHitNavigatorBase(const edm::ParameterSet &iConfig, edm::ConsumesCollector &cc)
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
PFRecHitNavigatorBase()=default
virtual ~PFRecHitNavigatorBase()=default
std::unordered_map< unsigned, unsigned > DetIdToHitIdx
Definition: DetId.h:17
double a
Definition: hdecay.h:119
edmplugin::PluginFactory< PFRecHitNavigatorBase *(const edm::ParameterSet &, edm::ConsumesCollector &)> PFRecHitNavigationFactory