1 #ifndef RecoParticleFlow_PFClusterProducer_PFECALHashNavigator_h 2 #define RecoParticleFlow_PFClusterProducer_PFECALHashNavigator_h 114 const unsigned nbarrel = 62000;
122 unsigned size=vec.size();
123 for(
unsigned ic=0; ic<
size; ++ic)
126 std::vector<DetId> neighbours(barrelTopo.
getWindow(vec[ic],3,3));
128 unsigned nneighbours=neighbours.size();
131 if(hashedindex>=nbarrel)
133 LogDebug(
"CaloGeometryTools") <<
" Array overflow " << std::endl;
145 for(
unsigned in=0;
in<nneighbours;++
in)
148 if(neighbours[
in]!=vec[ic])
159 for(
unsigned idir=0;idir<8;++idir)
163 barrelTopo, endcapTopo,
164 barrelGeom, endcapGeom);
181 const unsigned nendcap=19960;
184 for(
unsigned ic=0; ic<
size; ++ic)
187 std::vector<DetId> neighbours(endcapTopo.
getWindow(vecee[ic],3,3));
188 unsigned nneighbours=neighbours.size();
192 if(hashedindex>=nendcap)
194 LogDebug(
"CaloGeometryTools") <<
" Array overflow " << std::endl;
200 for(
unsigned in=0;
in<nneighbours;++
in)
203 if(neighbours[
in]!=vecee[ic])
213 for(
unsigned idir=0;idir<8;++idir)
217 barrelTopo, endcapTopo,
218 barrelGeom, endcapGeom);
239 std::vector<DetId> neighbours;
248 if(!neighbours.empty() && !neighbours[0].null()) {
249 cell = neighbours[0];
257 const int ietaAbs ( ebDetId.
ietaAbs() ) ;
266 cell = *(ol.begin() );
279 if(!neighbours.empty() && !neighbours[0].null()) {
280 cell = neighbours[0];
295 cell = *(ol.begin() );
324 else if(dir==
SOUTH) {
329 result =
stdsimplemove(cell,
EAST, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
333 result =
stdsimplemove(cell,
WEST, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
343 return stdsimplemove(cell,
EAST, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
346 result =
stdsimplemove(cell,
EAST, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
357 return stdsimplemove(cell,
WEST, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
360 result =
stdsimplemove(cell,
WEST, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
371 return stdsimplemove(cell,
EAST, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
374 result =
stdsimplemove(cell,
EAST, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
385 return stdsimplemove(cell,
WEST, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
390 return stdsimplemove(cell,
WEST, barrelTopo, endcapTopo, barrelGeom, endcapGeom );
404 DetId originalcell = cell;
405 if(dir==
NONE || cell==
DetId(0))
return false;
410 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
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
EcalBarrelTopology * barrelTopology_
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)
static const CaloDirection orderedDir[8]
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
int iPhiOuterRing() const
const OrderedListOfEBDetId * getClosestBarrelCells(EEDetId id) const
void beginEvent(const edm::EventSetup &iSetup) override
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
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
EcalEndcapTopology * endcapTopology_
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