1 #ifndef RecoParticleFlow_PFClusterProducer_PFHCALDenseIdNavigator_h
2 #define RecoParticleFlow_PFClusterProducer_PFHCALDenseIdNavigator_h
25 template <
typename DET,
typename TOPO,
bool ownsTopo = true>
52 std::vector<DetId> vecHcal;
53 std::vector<unsigned int> vDenseIdHcal;
57 vecHcal.insert(vecHcal.end(), vecDetIds.begin(), vecDetIds.end());
59 vDenseIdHcal.reserve(vecHcal.size());
60 for (
auto hDetId : vecHcal) {
61 vDenseIdHcal.push_back(
topology_.get()->detId2denseId(hDetId));
63 std::sort(vDenseIdHcal.begin(), vDenseIdHcal.end());
66 denseIdHcalMax_ = *max_element(vDenseIdHcal.begin(), vDenseIdHcal.end());
67 denseIdHcalMin_ = *min_element(vDenseIdHcal.begin(), vDenseIdHcal.end());
70 for (
auto denseid : vDenseIdHcal) {
79 std::vector<DetId> neighbours(9,
DetId(0));
82 unsigned denseid_c = denseid;
88 neighbours.at(
NONE) = detid_c;
116 neighbours.at(
EAST) = E;
128 neighbours.at(
WEST) = W;
144 std::unique_ptr<reco::PFRecHitCollection>& hits,
147 unsigned denseid =
topology_.get()->detId2denseId(detid);
149 std::vector<DetId> neighbours(9,
DetId(0));
152 edm::LogWarning(
"PFRecHitHCALCachedNavigator") <<
" DenseId for this cell is out of the range." << std::endl;
155 <<
" DenseId for this cell does not have the neighbour information." << std::endl;
179 unsigned int getIdx(
const unsigned int denseid)
const {
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)
unsigned detId() const
rechit detId
void associateNeighbours(reco::PFRecHit &hit, std::unique_ptr< reco::PFRecHitCollection > &hits, edm::RefProd< reco::PFRecHitCollection > &refProd) override
unsigned int getIdx(const unsigned int denseid) const
std::unique_ptr< const TOPO > topology_
edm::ESWatcher< HcalRecNumberingRecord > theRecNumberWatcher_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geomToken_
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
unsigned int denseIdHcalMax_
std::vector< std::vector< DetId > > neighboursHcal_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > hcalToken_
PFHCALDenseIdNavigator(const edm::ParameterSet &iConfig, edm::ConsumesCollector &cc)
~PFHCALDenseIdNavigator() override
T const * product() const
double S(const TLorentzVector &, const TLorentzVector &)
bool check(const edm::EventSetup &iSetup)
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
void init(const edm::EventSetup &iSetup) override
std::vector< int > vhcalEnum_
unsigned int denseIdHcalMin_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Log< level::Warning, false > LogWarning
bool validNeighbours(const unsigned int denseid) const