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)
uint32_t cc[maxCellsPerHit]
void associateNeighbours(reco::PFRecHit &hit, std::unique_ptr< reco::PFRecHitCollection > &hits, edm::RefProd< reco::PFRecHitCollection > &refProd) override
std::unique_ptr< const TOPO > topology_
edm::ESWatcher< HcalRecNumberingRecord > theRecNumberWatcher_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geomToken_
T const * product() const
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
unsigned int denseIdHcalMax_
std::vector< std::vector< DetId > > neighboursHcal_
bool validNeighbours(const unsigned int denseid) const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > hcalToken_
PFHCALDenseIdNavigator(const edm::ParameterSet &iConfig, edm::ConsumesCollector &cc)
~PFHCALDenseIdNavigator() override
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
bool check(const edm::EventSetup &iSetup)
void init(const edm::EventSetup &iSetup) override
std::vector< int > vhcalEnum_
unsigned int denseIdHcalMin_
Log< level::Warning, false > LogWarning
unsigned int getIdx(const unsigned int denseid) const