CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Attributes
PFHCALDenseIdNavigator< DET, TOPO, ownsTopo > Class Template Reference

#include <PFHCALDenseIdNavigator.h>

Inheritance diagram for PFHCALDenseIdNavigator< DET, TOPO, ownsTopo >:
PFRecHitNavigatorBase

Public Member Functions

void associateNeighbours (reco::PFRecHit &hit, std::unique_ptr< reco::PFRecHitCollection > &hits, edm::RefProd< reco::PFRecHitCollection > &refProd) override
 
void backwardCompatibilityCheck (const std::vector< unsigned int > vDenseIdHcal)
 
const bool checkSameSubDet (const DetId detId, const DetId detId2)
 
const unsigned int getIdx (const unsigned int denseid) const
 
const uint32_t getNeighbourDetId (const DetId detId, const uint32_t direction)
 
void init (const edm::EventSetup &iSetup) override
 
 PFHCALDenseIdNavigator (const edm::ParameterSet &iConfig, edm::ConsumesCollector &cc)
 
void printNeighbourInfo (const std::vector< unsigned int > vDenseIdHcal)
 
const bool validNeighbours (const unsigned int denseid) const
 
 ~PFHCALDenseIdNavigator () override
 
- Public Member Functions inherited from PFRecHitNavigatorBase
 PFRecHitNavigatorBase ()=default
 
 PFRecHitNavigatorBase (const edm::ParameterSet &iConfig, edm::ConsumesCollector &cc)
 
virtual ~PFRecHitNavigatorBase ()=default
 

Static Public Member Functions

static constexpr int getZside (const DetId detId)
 

Protected Attributes

unsigned int denseIdHcalMax_
 
unsigned int denseIdHcalMin_
 
std::vector< std::vector< DetId > > neighboursHcal_
 
edm::ESWatcher< HcalRecNumberingRecordtheRecNumberWatcher_
 
std::unique_ptr< const TOPO > topology_
 
std::vector< int > vhcalEnum_
 

Private Attributes

const bool debug = false
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeomToken_
 
edm::ESGetToken< HcalTopology, HcalRecNumberingRecordhcalToken_
 

Additional Inherited Members

- Public Types inherited from PFRecHitNavigatorBase
typedef std::unordered_map< unsigned, unsigned > DetIdToHitIdx
 
- Protected Member Functions inherited from PFRecHitNavigatorBase
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)
 

Detailed Description

template<typename DET, typename TOPO, bool ownsTopo = true>
class PFHCALDenseIdNavigator< DET, TOPO, ownsTopo >

Definition at line 26 of file PFHCALDenseIdNavigator.h.

Constructor & Destructor Documentation

◆ ~PFHCALDenseIdNavigator()

template<typename DET, typename TOPO, bool ownsTopo = true>
PFHCALDenseIdNavigator< DET, TOPO, ownsTopo >::~PFHCALDenseIdNavigator ( )
inlineoverride

Definition at line 28 of file PFHCALDenseIdNavigator.h.

28  {
29  if (!ownsTopo) {
30  topology_.release();
31  }
32  }
std::unique_ptr< const TOPO > topology_

◆ PFHCALDenseIdNavigator()

template<typename DET, typename TOPO, bool ownsTopo = true>
PFHCALDenseIdNavigator< DET, TOPO, ownsTopo >::PFHCALDenseIdNavigator ( const edm::ParameterSet iConfig,
edm::ConsumesCollector cc 
)
inline

Definition at line 34 of file PFHCALDenseIdNavigator.h.

35  : vhcalEnum_(iConfig.getParameter<std::vector<int>>("hcalEnums")),
37  geomToken_(cc.esConsumes<edm::Transition::BeginRun>()) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geomToken_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > hcalToken_

Member Function Documentation

◆ associateNeighbours()

template<typename DET, typename TOPO, bool ownsTopo = true>
void PFHCALDenseIdNavigator< DET, TOPO, ownsTopo >::associateNeighbours ( reco::PFRecHit hit,
std::unique_ptr< reco::PFRecHitCollection > &  hits,
edm::RefProd< reco::PFRecHitCollection > &  refProd 
)
inlineoverridevirtual

Implements PFRecHitNavigatorBase.

Definition at line 311 of file PFHCALDenseIdNavigator.h.

313  {
314  DetId detid(hit.detId());
315  HcalDetId hid(detid);
316  unsigned denseid = topology_.get()->detId2denseId(detid);
317 
318  std::vector<DetId> neighbours(9, DetId(0));
319 
320  if (denseid < denseIdHcalMin_ || denseid > denseIdHcalMax_) {
321  edm::LogWarning("PFRecHitHCALCachedNavigator")
322  << " DenseId for this cell is out of the expected range." << std::endl;
323  } else if (!validNeighbours(denseid)) {
324  edm::LogWarning("PFRecHitHCALCachedNavigator")
325  << " DenseId for this cell does not have the neighbour information. " << hid.ieta() << " " << hid.iphi()
326  << " " << hid.depth() << " " << hid.subdetId();
327  } else {
328  unsigned index = getIdx(denseid);
329  neighbours = neighboursHcal_.at(index);
330  }
331 
332  associateNeighbour(neighbours.at(NORTH), hit, hits, refProd, 0, 1, 0); // N
333  associateNeighbour(neighbours.at(NORTHEAST), hit, hits, refProd, 1, 1, 0); // NE
334  associateNeighbour(neighbours.at(SOUTH), hit, hits, refProd, 0, -1, 0); // S
335  associateNeighbour(neighbours.at(SOUTHWEST), hit, hits, refProd, -1, -1, 0); // SW
336  associateNeighbour(neighbours.at(EAST), hit, hits, refProd, 1, 0, 0); // E
337  associateNeighbour(neighbours.at(SOUTHEAST), hit, hits, refProd, 1, -1, 0); // SE
338  associateNeighbour(neighbours.at(WEST), hit, hits, refProd, -1, 0, 0); // W
339  associateNeighbour(neighbours.at(NORTHWEST), hit, hits, refProd, -1, 1, 0); // NW
340  }
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::unique_ptr< const TOPO > topology_
std::vector< std::vector< DetId > > neighboursHcal_
Definition: DetId.h:17
const bool validNeighbours(const unsigned int denseid) const
Log< level::Warning, false > LogWarning
const unsigned int getIdx(const unsigned int denseid) const

◆ backwardCompatibilityCheck()

template<typename DET, typename TOPO, bool ownsTopo = true>
void PFHCALDenseIdNavigator< DET, TOPO, ownsTopo >::backwardCompatibilityCheck ( const std::vector< unsigned int >  vDenseIdHcal)
inline

Definition at line 105 of file PFHCALDenseIdNavigator.h.

Referenced by PFHCALDenseIdNavigator< HcalDetId, HcalTopology, false >::init().

105  {
106  //
107  // Check backward compatibility (does a neighbour of a channel have the channel as a neighbour?)
108  //
109  for (auto denseid : vDenseIdHcal) {
110  DetId detid = topology_.get()->denseId2detId(denseid);
111  HcalDetId hid = HcalDetId(detid);
112  if (detid == DetId(0)) {
113  edm::LogWarning("PFHCALDenseIdNavigator") << "Found an invalid DetId";
114  continue;
115  }
116  if (!validNeighbours(denseid)) {
117  edm::LogWarning("PFHCALDenseIdNavigator") << "The vector for neighbour information has an invalid length";
118  continue;
119  }
120  std::vector<DetId> neighbours(9, DetId(0));
121  unsigned index = getIdx(denseid);
122  if (index >= neighboursHcal_.size()) {
123  edm::LogWarning("PFHCALDenseIdNavigator") << "The vector for neighbour information is not found";
124  continue; // Skip if not found
125  }
126  neighbours = neighboursHcal_.at(index);
127 
128  //
129  // Loop over neighbours
130  int ineighbour = -1;
131  for (auto neighbour : neighbours) {
132  ineighbour++;
133  if (neighbour == DetId(0))
134  continue;
135  HcalDetId hidn = HcalDetId(neighbour);
136  std::vector<DetId> neighboursOfNeighbour(9, DetId(0));
137  std::unordered_set<unsigned int> listOfNeighboursOfNeighbour; // list of neighbours of neighbour
138  unsigned denseidNeighbour = topology_.get()->detId2denseId(neighbour);
139 
140  if (!validNeighbours(denseidNeighbour)) {
141  edm::LogWarning("PFHCALDenseIdNavigator")
142  << "This neighbour does not have a valid neighbour information (another subdetector?). Ignore: "
143  << detid.det() << " " << hid.ieta() << " " << hid.iphi() << " " << hid.depth() << " " << neighbour.det()
144  << " " << hidn.ieta() << " " << hidn.iphi() << " " << hidn.depth();
145  neighboursHcal_[index][ineighbour] = DetId(0); // Not a valid neighbour. Set to DetId(0)
146  continue;
147  }
148  if (getIdx(denseidNeighbour) >= neighboursHcal_.size())
149  continue;
150  neighboursOfNeighbour = neighboursHcal_.at(getIdx(denseidNeighbour));
151 
152  //
153  // Loop over neighbours of neighbours
154  for (auto neighbourOfNeighbour : neighboursOfNeighbour) {
155  if (neighbourOfNeighbour == DetId(0))
156  continue;
157  unsigned denseidNeighbourOfNeighbour = topology_.get()->detId2denseId(neighbourOfNeighbour);
158  if (!validNeighbours(denseidNeighbourOfNeighbour))
159  continue;
160  listOfNeighboursOfNeighbour.insert(denseidNeighbourOfNeighbour);
161  }
162 
163  //
164  if (listOfNeighboursOfNeighbour.find(denseid) == listOfNeighboursOfNeighbour.end()) {
165  // This neighbour is not backward compatible.
166  edm::LogWarning("PFHCALDenseIdNavigator")
167  << "This neighbour does not have the original channel as its neighbour. Ignore: " << detid.det() << " "
168  << hid.ieta() << " " << hid.iphi() << " " << hid.depth() << " " << neighbour.det() << " " << hidn.ieta()
169  << " " << hidn.iphi() << " " << hidn.depth();
170  neighboursHcal_[index][ineighbour] = DetId(0);
171  }
172 
173  } // loop over neighbours
174  } // loop over denseId_
175  }
std::unique_ptr< const TOPO > topology_
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
std::vector< std::vector< DetId > > neighboursHcal_
Definition: DetId.h:17
const bool validNeighbours(const unsigned int denseid) const
Log< level::Warning, false > LogWarning
const unsigned int getIdx(const unsigned int denseid) const
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164

◆ checkSameSubDet()

template<typename DET, typename TOPO, bool ownsTopo = true>
const bool PFHCALDenseIdNavigator< DET, TOPO, ownsTopo >::checkSameSubDet ( const DetId  detId,
const DetId  detId2 
)
inline

Definition at line 221 of file PFHCALDenseIdNavigator.h.

Referenced by PFHCALDenseIdNavigator< HcalDetId, HcalTopology, false >::getNeighbourDetId().

221  {
222  HcalDetId hid = HcalDetId(detId);
223  HcalDetId hid2 = HcalDetId(detId2);
224  return hid.subdetId() == hid2.subdetId();
225  }
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48

◆ getIdx()

template<typename DET, typename TOPO, bool ownsTopo = true>
const unsigned int PFHCALDenseIdNavigator< DET, TOPO, ownsTopo >::getIdx ( const unsigned int  denseid) const
inline

◆ getNeighbourDetId()

template<typename DET, typename TOPO, bool ownsTopo = true>
const uint32_t PFHCALDenseIdNavigator< DET, TOPO, ownsTopo >::getNeighbourDetId ( const DetId  detId,
const uint32_t  direction 
)
inline

Definition at line 231 of file PFHCALDenseIdNavigator.h.

Referenced by PFHCALDenseIdNavigator< HcalDetId, HcalTopology, false >::getNeighbourDetId(), and PFHCALDenseIdNavigator< HcalDetId, HcalTopology, false >::init().

231  {
232  // desired order for PF: NORTH, SOUTH, EAST, WEST, NORTHEAST, SOUTHWEST, SOUTHEAST, NORTHWEST
233  if (detId == DetId(0))
234  return 0;
235 
236  if (direction == 0) // NORTH
237  return topology_.get()->goNorth(detId); // larger iphi values (except phi boundary)
238 
239  if (direction == 1) // SOUTH
240  return topology_.get()->goSouth(detId); // smaller iphi values (except phi boundary)
241 
242  // In the case of East/West, make sure we are not moving to another subdetector
243  if (direction == 2 && checkSameSubDet(detId, topology_.get()->goEast(detId))) // EAST
244  return topology_.get()->goEast(detId); // smaller ieta values
245 
246  if (direction == 3 && checkSameSubDet(detId, topology_.get()->goWest(detId))) // WEST
247  return topology_.get()->goWest(detId); // larger ieta values
248 
249  // In the case of cornor cells, ensure backward compatibility.
250  // Also make sure it's not already defined as E(ast) or W(est)
251  if (direction == 4) { // NORTHEAST
252  if (getZside(detId) > 0) { // positive eta: east -> move to smaller |ieta| (finner phi granularity) first
253  const DetId E = getNeighbourDetId(detId, 2);
254  const DetId NE = getNeighbourDetId(E, 0);
255  if (getNeighbourDetId(NE, 1) == E && NE != E)
256  return NE; //
257  } else { // negative eta: move in phi first then move to east (coarser phi granularity)
258  const DetId N = getNeighbourDetId(detId, 0);
259  const DetId NE = getNeighbourDetId(N, 2);
260  const DetId E = getNeighbourDetId(detId, 2);
261  if (getNeighbourDetId(NE, 3) == N && NE != E)
262  return NE;
263  }
264  }
265  if (direction == 5) { // SOUTHWEST
266  if (getZside(detId) > 0) { // positive eta: move in phi first then move to west (coarser phi granularity)
267  const DetId S = getNeighbourDetId(detId, 1);
268  const DetId SW = getNeighbourDetId(S, 3);
269  const DetId W = getNeighbourDetId(detId, 3);
270  if (getNeighbourDetId(SW, 2) == S && SW != W)
271  return SW;
272  } else { // negative eta: west -> move to smaller |ieta| (finner phi granularity) first
273  const DetId W = getNeighbourDetId(detId, 3);
274  const DetId SW = getNeighbourDetId(W, 1);
275  if (getNeighbourDetId(SW, 0) == W && SW != W)
276  return SW;
277  }
278  }
279  if (direction == 6) { // SOUTHEAST
280  if (getZside(detId) > 0) { // positive eta: east -> move to smaller |ieta| (finner phi granularity) first
281  const DetId E = getNeighbourDetId(detId, 2);
282  const DetId SE = getNeighbourDetId(E, 1);
283  if (getNeighbourDetId(SE, 0) == E && SE != E)
284  return SE;
285  } else { // negative eta: move in phi first then move to east (coarser phi granularity)
286  const DetId S = getNeighbourDetId(detId, 1);
287  const DetId SE = getNeighbourDetId(S, 2);
288  const DetId E = getNeighbourDetId(detId, 2);
289  if (getNeighbourDetId(SE, 3) == S && SE != E)
290  return SE;
291  }
292  }
293  if (direction == 7) { // NORTHWEST
294  if (getZside(detId) > 0) { // positive eta: move in phi first then move to west (coarser phi granularity)
295  const DetId N = getNeighbourDetId(detId, 0);
296  const DetId NW = getNeighbourDetId(N, 3);
297  const DetId W = getNeighbourDetId(detId, 3);
298  if (getNeighbourDetId(NW, 2) == N && NW != W)
299  return NW;
300  } else { // negative eta: west -> move to smaller |ieta| (finner phi granularity) first
301  const DetId W = getNeighbourDetId(detId, 3);
302  const DetId NW = getNeighbourDetId(W, 0);
303  if (getNeighbourDetId(NW, 1) == W && NW != W)
304  return NW;
305  }
306  }
307  return 0;
308  }
const bool checkSameSubDet(const DetId detId, const DetId detId2)
std::unique_ptr< const TOPO > topology_
static constexpr int getZside(const DetId detId)
Definition: DetId.h:17
#define N
Definition: blowfish.cc:9
const uint32_t getNeighbourDetId(const DetId detId, const uint32_t direction)

◆ getZside()

template<typename DET, typename TOPO, bool ownsTopo = true>
static constexpr int PFHCALDenseIdNavigator< DET, TOPO, ownsTopo >::getZside ( const DetId  detId)
inlinestatic

Definition at line 228 of file PFHCALDenseIdNavigator.h.

Referenced by PFHCALDenseIdNavigator< HcalDetId, HcalTopology, false >::getNeighbourDetId().

228 { return ((detId & HcalDetId::kHcalZsideMask2) ? (1) : (-1)); }
static constexpr uint32_t kHcalZsideMask2
Definition: HcalDetId.h:21

◆ init()

template<typename DET, typename TOPO, bool ownsTopo = true>
void PFHCALDenseIdNavigator< DET, TOPO, ownsTopo >::init ( const edm::EventSetup iSetup)
inlineoverridevirtual

Implements PFRecHitNavigatorBase.

Definition at line 40 of file PFHCALDenseIdNavigator.h.

40  {
41  bool check = theRecNumberWatcher_.check(iSetup);
42  if (!check)
43  return;
44 
45  edm::ESHandle<HcalTopology> hcalTopology = iSetup.getHandle(hcalToken_);
46  topology_.release();
47  topology_.reset(hcalTopology.product());
48 
49  // Fill a vector of valid denseid's
51  const CaloGeometry& caloGeom = *hGeom;
52 
53  std::vector<DetId> vecHcal;
54  std::vector<unsigned int> vDenseIdHcal;
55  neighboursHcal_.clear();
56  for (auto hcalSubdet : vhcalEnum_) {
57  std::vector<DetId> vecDetIds(caloGeom.getValidDetIds(DetId::Hcal, hcalSubdet));
58  vecHcal.insert(vecHcal.end(), vecDetIds.begin(), vecDetIds.end());
59  }
60  vDenseIdHcal.reserve(vecHcal.size());
61  for (auto hDetId : vecHcal) {
62  vDenseIdHcal.push_back(topology_.get()->detId2denseId(hDetId));
63  }
64  std::sort(vDenseIdHcal.begin(), vDenseIdHcal.end());
65 
66  // Fill a vector of cell neighbours
67  denseIdHcalMax_ = *max_element(vDenseIdHcal.begin(), vDenseIdHcal.end());
68  denseIdHcalMin_ = *min_element(vDenseIdHcal.begin(), vDenseIdHcal.end());
70 
71  for (auto denseid : vDenseIdHcal) {
72  std::vector<DetId> neighbours(9, DetId(0));
73 
74  // the centre
75  unsigned denseid_c = denseid;
76  DetId detid_c = topology_.get()->denseId2detId(denseid_c);
77  CaloNavigator<DET> navigator(detid_c, topology_.get());
78 
79  // Using enum in Geometry/CaloTopology/interface/CaloDirection.h
80  // Order: CENTER(NONE),SOUTH,SOUTHEAST,SOUTHWEST,EAST,WEST,NORTHEAST,NORTHWEST,NORTH
81  neighbours.at(NONE) = detid_c;
82 
83  neighbours.at(NORTH) = getNeighbourDetId(detid_c, 0);
84  neighbours.at(SOUTH) = getNeighbourDetId(detid_c, 1);
85  neighbours.at(EAST) = getNeighbourDetId(detid_c, 2);
86  neighbours.at(WEST) = getNeighbourDetId(detid_c, 3);
87 
88  neighbours.at(NORTHEAST) = getNeighbourDetId(detid_c, 4);
89  neighbours.at(SOUTHWEST) = getNeighbourDetId(detid_c, 5);
90  neighbours.at(SOUTHEAST) = getNeighbourDetId(detid_c, 6);
91  neighbours.at(NORTHWEST) = getNeighbourDetId(detid_c, 7);
92 
93  unsigned index = getIdx(denseid_c);
94  neighboursHcal_[index] = neighbours;
95 
96  } // loop over vDenseIdHcal
97 
98  if (debug) {
99  backwardCompatibilityCheck(vDenseIdHcal);
100  printNeighbourInfo(vDenseIdHcal);
101  }
102  }
void backwardCompatibilityCheck(const std::vector< unsigned int > vDenseIdHcal)
std::unique_ptr< const TOPO > topology_
edm::ESWatcher< HcalRecNumberingRecord > theRecNumberWatcher_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geomToken_
T const * product() const
Definition: ESHandle.h:86
void printNeighbourInfo(const std::vector< unsigned int > vDenseIdHcal)
std::vector< std::vector< DetId > > neighboursHcal_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > hcalToken_
Definition: DetId.h:17
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
Definition: CaloGeometry.cc:75
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
const uint32_t getNeighbourDetId(const DetId detId, const uint32_t direction)
Definition: TkAlStyle.h:43
const unsigned int getIdx(const unsigned int denseid) const

◆ printNeighbourInfo()

template<typename DET, typename TOPO, bool ownsTopo = true>
void PFHCALDenseIdNavigator< DET, TOPO, ownsTopo >::printNeighbourInfo ( const std::vector< unsigned int >  vDenseIdHcal)
inline

Definition at line 178 of file PFHCALDenseIdNavigator.h.

Referenced by PFHCALDenseIdNavigator< HcalDetId, HcalTopology, false >::init().

178  {
179  // Print neighbour definitions
180  for (auto denseid : vDenseIdHcal) {
181  std::vector<DetId> neighbours(9, DetId(0));
182 
183  // the centre
184  unsigned denseid_c = denseid;
185  DetId detid_c = topology_.get()->denseId2detId(denseid_c);
186  CaloNavigator<DET> navigator(detid_c, topology_.get());
187 
188  unsigned index = getIdx(denseid_c);
189 
190  neighbours = neighboursHcal_[index];
191 
192  const DetId N = neighbours.at(NORTH);
193  const DetId S = neighbours.at(SOUTH);
194  const DetId E = neighbours.at(EAST);
195  const DetId W = neighbours.at(WEST);
196 
197  const DetId NE = neighbours.at(NORTHEAST);
198  const DetId SW = neighbours.at(SOUTHWEST);
199  const DetId SE = neighbours.at(SOUTHEAST);
200  const DetId NW = neighbours.at(NORTHWEST);
201 
202  edm::LogPrint("PFHCALDenseIdNavigator")
203  << "PFHCALDenseIdNavigator: " << HcalDetId(detid_c).ieta() << " " << HcalDetId(detid_c).iphi() << " "
204  << HcalDetId(detid_c).depth() << " " << HcalDetId(detid_c).subdetId() << ": " << HcalDetId(N).ieta() << " "
205  << HcalDetId(N).iphi() << " " << HcalDetId(N).depth() << " " << HcalDetId(N).subdetId() << ", "
206  << HcalDetId(E).ieta() << " " << HcalDetId(E).iphi() << " " << HcalDetId(E).depth() << " "
207  << HcalDetId(E).subdetId() << ", " << HcalDetId(S).ieta() << " " << HcalDetId(S).iphi() << " "
208  << HcalDetId(S).depth() << " " << HcalDetId(S).subdetId() << ", " << HcalDetId(W).ieta() << " "
209  << HcalDetId(W).iphi() << " " << HcalDetId(W).depth() << " " << HcalDetId(W).subdetId() << ", "
210  << HcalDetId(NE).ieta() << " " << HcalDetId(NE).iphi() << " " << HcalDetId(NE).depth() << " "
211  << HcalDetId(NE).subdetId() << ", " << HcalDetId(SW).ieta() << " " << HcalDetId(SW).iphi() << " "
212  << HcalDetId(SW).depth() << " " << HcalDetId(SW).subdetId() << ", " << HcalDetId(SE).ieta() << " "
213  << HcalDetId(SE).iphi() << " " << HcalDetId(SE).depth() << " " << HcalDetId(SE).subdetId() << ", "
214  << HcalDetId(NW).ieta() << " " << HcalDetId(NW).iphi() << " " << HcalDetId(NW).depth() << " "
215  << HcalDetId(NW).subdetId();
216 
217  } // print ends
218  }
std::unique_ptr< const TOPO > topology_
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
std::vector< std::vector< DetId > > neighboursHcal_
Log< level::Warning, true > LogPrint
Definition: DetId.h:17
#define N
Definition: blowfish.cc:9
const unsigned int getIdx(const unsigned int denseid) const
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164

◆ validNeighbours()

template<typename DET, typename TOPO, bool ownsTopo = true>
const bool PFHCALDenseIdNavigator< DET, TOPO, ownsTopo >::validNeighbours ( const unsigned int  denseid) const
inline

Definition at line 343 of file PFHCALDenseIdNavigator.h.

Referenced by PFHCALDenseIdNavigator< HcalDetId, HcalTopology, false >::associateNeighbours(), and PFHCALDenseIdNavigator< HcalDetId, HcalTopology, false >::backwardCompatibilityCheck().

343  {
344  if (denseid < denseIdHcalMin_ || denseid > denseIdHcalMax_)
345  return false; // neighbour denseid is out of the expected range
346  unsigned index = getIdx(denseid);
347  if (neighboursHcal_.at(index).size() != 9)
348  return false; // the neighbour vector size should be 3x3
349  return true;
350  }
std::vector< std::vector< DetId > > neighboursHcal_
const unsigned int getIdx(const unsigned int denseid) const

Member Data Documentation

◆ debug

template<typename DET, typename TOPO, bool ownsTopo = true>
const bool PFHCALDenseIdNavigator< DET, TOPO, ownsTopo >::debug = false
private

◆ denseIdHcalMax_

template<typename DET, typename TOPO, bool ownsTopo = true>
unsigned int PFHCALDenseIdNavigator< DET, TOPO, ownsTopo >::denseIdHcalMax_
protected

◆ denseIdHcalMin_

template<typename DET, typename TOPO, bool ownsTopo = true>
unsigned int PFHCALDenseIdNavigator< DET, TOPO, ownsTopo >::denseIdHcalMin_
protected

◆ geomToken_

template<typename DET, typename TOPO, bool ownsTopo = true>
edm::ESGetToken<CaloGeometry, CaloGeometryRecord> PFHCALDenseIdNavigator< DET, TOPO, ownsTopo >::geomToken_
private

◆ hcalToken_

template<typename DET, typename TOPO, bool ownsTopo = true>
edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> PFHCALDenseIdNavigator< DET, TOPO, ownsTopo >::hcalToken_
private

◆ neighboursHcal_

template<typename DET, typename TOPO, bool ownsTopo = true>
std::vector<std::vector<DetId> > PFHCALDenseIdNavigator< DET, TOPO, ownsTopo >::neighboursHcal_
protected

◆ theRecNumberWatcher_

template<typename DET, typename TOPO, bool ownsTopo = true>
edm::ESWatcher<HcalRecNumberingRecord> PFHCALDenseIdNavigator< DET, TOPO, ownsTopo >::theRecNumberWatcher_
protected

◆ topology_

template<typename DET, typename TOPO, bool ownsTopo = true>
std::unique_ptr<const TOPO> PFHCALDenseIdNavigator< DET, TOPO, ownsTopo >::topology_
protected

◆ vhcalEnum_

template<typename DET, typename TOPO, bool ownsTopo = true>
std::vector<int> PFHCALDenseIdNavigator< DET, TOPO, ownsTopo >::vhcalEnum_
protected