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];
192 const int ietaAbs(ebDetId.
ietaAbs());
200 cell = *(ol.begin());
212 if (!neighbours.empty() && !neighbours[0].null()) {
213 cell = neighbours[0];
227 cell = *(ol.begin());
251 }
else if (dir ==
SOUTH) {
254 }
else if (dir ==
EAST) {
255 result =
stdsimplemove(cell,
EAST, barrelTopo, endcapTopo, barrelGeom, endcapGeom);
257 }
else if (dir ==
WEST) {
258 result =
stdsimplemove(cell,
WEST, barrelTopo, endcapTopo, barrelGeom, endcapGeom);
266 return stdsimplemove(cell,
EAST, barrelTopo, endcapTopo, barrelGeom, endcapGeom);
268 result =
stdsimplemove(cell,
EAST, barrelTopo, endcapTopo, barrelGeom, endcapGeom);
277 return stdsimplemove(cell,
WEST, barrelTopo, endcapTopo, barrelGeom, endcapGeom);
279 result =
stdsimplemove(cell,
WEST, barrelTopo, endcapTopo, barrelGeom, endcapGeom);
288 return stdsimplemove(cell,
EAST, barrelTopo, endcapTopo, barrelGeom, endcapGeom);
290 result =
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)
T getParameter(std::string const &) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
std::vector< std::vector< DetId > > neighboursEB_
for each ecal barrel rechit, keep track of the neighbours
PFECALHashNavigator(const edm::ParameterSet &iConfig)
const OrderedListOfEEDetId * getClosestEndcapCells(EBDetId id) const
int hashedIndex() const
get a compact index for arrays
virtual std::vector< DetId > getNeighbours(const DetId &id, const CaloDirection &dir) const
std::unique_ptr< EcalEndcapTopology > endcapTopology_
bool stdmove(DetId &cell, const CaloDirection &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom) const
unsigned detId() const
rechit detId
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
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)
std::unique_ptr< EcalBarrelTopology > barrelTopology_
static const CaloDirection orderedDir[8]
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
int iPhiOuterRing() const
const OrderedListOfEBDetId * getClosestBarrelCells(EEDetId id) const
void beginEvent(const edm::EventSetup &iSetup) override
DetId move(DetId cell, const CaloDirection &dir) const
const EcalEndcapGeometry * endcapGeometry_
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
void associateNeighbours(reco::PFRecHit &rh, std::unique_ptr< reco::PFRecHitCollection > &hits, edm::RefProd< reco::PFRecHitCollection > &refprod) override
bool stdsimplemove(DetId &cell, const CaloDirection &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom) const
const EcalBarrelGeometry * barrelGeometry_
static const int MAX_IETA
CaloDirection
Codes the local directions in the cell lattice.
int ietaAbs() const
get the absolute value of the crystal ieta
bool neighbourmapcalculated_
set to true in ecalNeighbArray