1 #ifndef RecoParticleFlow_PFClusterProducer_PFECALHashNavigator_h 2 #define RecoParticleFlow_PFClusterProducer_PFECALHashNavigator_h 47 std::unique_ptr<reco::PFRecHitCollection>&
hits,
75 const unsigned nbarrel = 62000;
82 unsigned size = vec.size();
83 for (
unsigned ic = 0; ic <
size; ++ic) {
85 std::vector<DetId> neighbours(barrelTopo.
getWindow(vec[ic], 3, 3));
87 unsigned nneighbours = neighbours.size();
90 if (hashedindex >= nbarrel) {
91 LogDebug(
"CaloGeometryTools") <<
" Array overflow " << std::endl;
99 if (nneighbours == 9) {
101 for (
unsigned in = 0;
in < nneighbours; ++
in) {
103 if (neighbours[
in] != vec[ic]) {
111 for (
unsigned idir = 0; idir < 8; ++idir) {
130 const unsigned nendcap = 19960;
133 for (
unsigned ic = 0; ic <
size; ++ic) {
135 std::vector<DetId> neighbours(endcapTopo.
getWindow(vecee[ic], 3, 3));
136 unsigned nneighbours = neighbours.size();
140 if (hashedindex >= nendcap) {
141 LogDebug(
"CaloGeometryTools") <<
" Array overflow " << std::endl;
144 if (nneighbours == 9) {
146 for (
unsigned in = 0;
in < nneighbours; ++
in) {
148 if (neighbours[
in] != vecee[ic]) {
155 for (
unsigned idir = 0; idir < 8; ++idir) {
174 std::vector<DetId> neighbours;
183 if (!neighbours.empty() && !neighbours[0].null()) {
184 cell = neighbours[0];
200 cell = *(ol.begin());
212 if (!neighbours.empty() && !neighbours[0].null()) {
213 cell = neighbours[0];
227 cell = *(ol.begin());
266 return stdsimplemove(cell,
EAST, barrelTopo, endcapTopo, barrelGeom, endcapGeom);
277 return stdsimplemove(cell,
WEST, barrelTopo, endcapTopo, barrelGeom, endcapGeom);
288 return stdsimplemove(cell,
EAST, barrelTopo, endcapTopo, barrelGeom, endcapGeom);
299 return stdsimplemove(cell,
WEST, barrelTopo, endcapTopo, barrelGeom, endcapGeom);
303 return stdsimplemove(cell,
WEST, barrelTopo, endcapTopo, barrelGeom, endcapGeom);
313 DetId originalcell = cell;
320 static const int calodirections[9] = {-1, 1, 2, 0, 4, 3, 7, 5, 6};
void ecalNeighbArray(const EcalBarrelGeometry &barrelGeom, const CaloSubdetectorTopology &barrelTopo, const EcalEndcapGeometry &endcapGeom, const CaloSubdetectorTopology &endcapTopo)
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)
std::vector< std::vector< DetId > > neighboursEB_
for each ecal barrel rechit, keep track of the neighbours
int ietaAbs() const
get the absolute value of the crystal ieta
std::unique_ptr< EcalEndcapTopology > endcapTopology_
uint32_t cc[maxCellsPerHit]
const OrderedListOfEEDetId * getClosestEndcapCells(EBDetId id) const
bool stdmove(DetId &cell, const CaloDirection &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom) const
bool crossBarrelEndcapBorder_
if true, navigation will cross the barrel-endcap border
std::vector< std::vector< DetId > > neighboursEE_
for each ecal endcap rechit, keep track of the neighbours
std::unique_ptr< EcalBarrelTopology > barrelTopology_
unsigned detId() const
rechit detId
static const CaloDirection orderedDir[8]
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ietaAbs(uint32_t id)
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geomToken_
virtual const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const
Get a list of valid detector ids (for the given subdetector)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
virtual std::vector< DetId > getNeighbours(const DetId &id, const CaloDirection &dir) const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const EcalEndcapGeometry * endcapGeometry_
void associateNeighbours(reco::PFRecHit &rh, std::unique_ptr< reco::PFRecHitCollection > &hits, edm::RefProd< reco::PFRecHitCollection > &refprod) override
const EcalBarrelGeometry * barrelGeometry_
static const int MAX_IETA
DetId move(DetId cell, const CaloDirection &dir) const
PFECALHashNavigator(const edm::ParameterSet &iConfig, edm::ConsumesCollector &cc)
int hashedIndex() const
get a compact index for arrays
void init(const edm::EventSetup &iSetup) override
const OrderedListOfEBDetId * getClosestBarrelCells(EEDetId id) const
CaloDirection
Codes the local directions in the cell lattice.
bool stdsimplemove(DetId &cell, const CaloDirection &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
bool neighbourmapcalculated_
set to true in ecalNeighbArray
int iPhiOuterRing() const