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 
14 
17 
23 
24 #include <unordered_map>
25 
27 public:
28  typedef std::unordered_map<unsigned, unsigned> DetIdToHitIdx;
29 
30  PFRecHitNavigatorBase() = default;
32 
33  virtual ~PFRecHitNavigatorBase() = default;
34 
35  virtual void init(const edm::EventSetup&) = 0;
36  virtual void associateNeighbours(reco::PFRecHit&,
37  std::unique_ptr<reco::PFRecHitCollection>&,
39 
40 protected:
41  void associateNeighbour(const DetId& id,
43  std::unique_ptr<reco::PFRecHitCollection>& hits,
45  short eta,
46  short phi,
47  short depth) {
48  auto found_hit = std::lower_bound(
49  hits->begin(), hits->end(), id, [](const reco::PFRecHit& a, const DetId& id) { return a.detId() < id; });
50  if (found_hit != hits->end() && found_hit->detId() == id.rawId()) {
51  hit.addNeighbour(eta, phi, depth, found_hit - hits->begin());
52  }
53  }
54 };
55 
58 
59 #endif
edm::RefProd
Definition: EDProductfwd.h:25
PluginFactory.h
PFRecHitFwd.h
MessageLogger.h
PFRecHitNavigatorBase::associateNeighbour
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)
Definition: PFRecHitNavigatorBase.h:41
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
ESHandle.h
PFRecHitNavigatorBase::~PFRecHitNavigatorBase
virtual ~PFRecHitNavigatorBase()=default
PFRecHitNavigatorBase::init
virtual void init(const edm::EventSetup &)=0
PFRecHit.h
PFRecHitNavigatorBase::associateNeighbours
virtual void associateNeighbours(reco::PFRecHit &, std::unique_ptr< reco::PFRecHitCollection > &, edm::RefProd< reco::PFRecHitCollection > &)=0
PFRecHitNavigatorBase::DetIdToHitIdx
std::unordered_map< unsigned, unsigned > DetIdToHitIdx
Definition: PFRecHitNavigatorBase.h:28
DetId
Definition: DetId.h:17
PVValHelper::eta
Definition: PVValidationHelpers.h:69
TruncatedPyramid.h
PFRecHitNavigatorBase::PFRecHitNavigatorBase
PFRecHitNavigatorBase(const edm::ParameterSet &iConfig)
Definition: PFRecHitNavigatorBase.h:31
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
CaloGeometryRecord.h
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
CaloSubdetectorGeometry.h
edm::ParameterSet
Definition: ParameterSet.h:47
a
double a
Definition: hdecay.h:119
Event.h
edmplugin::PluginFactory
Definition: PluginFactory.h:34
PFRecHitNavigatorBase
Definition: PFRecHitNavigatorBase.h:26
edm::EventSetup
Definition: EventSetup.h:57
DDAxes::phi
CaloCellGeometry.h
Frameworkfwd.h
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
PFRecHitNavigatorBase::PFRecHitNavigatorBase
PFRecHitNavigatorBase()=default
CaloGeometry.h
EventSetup.h
reco::PFRecHit
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
ParameterSet.h
hit
Definition: SiStripHitEffFromCalibTree.cc:88