CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ZdcTopology Class Reference

#include <ZdcTopology.h>

Inheritance diagram for ZdcTopology:
CaloSubdetectorTopology

Public Member Functions

std::vector< DetIddown (const DetId &id) const override
 
std::vector< DetIdeast (const DetId &id) const override
 
void exclude (const HcalZDCDetId &id)
 
void exclude (int zside)
 
void exclude (int zside, HcalZDCDetId::Section section)
 
int exclude (int zside, HcalZDCDetId::Section section, int ich1, int ich2)
 
int firstCell (HcalZDCDetId::Section section) const
 
int lastCell (HcalZDCDetId::Section section) const
 
virtual std::vector< DetIdlongitudinal (const DetId &id) const
 
virtual unsigned int ncells () const
 return a count of valid cells (for dense indexing use) More...
 
int ncells (HcalZDCDetId::Section section) const
 
std::vector< DetIdnorth (const DetId &id) const override
 
std::vector< DetIdsouth (const DetId &id) const override
 
virtual std::vector< DetIdtransverse (const DetId &id) const
 
std::vector< DetIdup (const DetId &id) const override
 
virtual bool valid (const DetId &) const
 
virtual bool valid (const HcalZDCDetId &id) const
 
std::vector< DetIdwest (const DetId &id) const override
 
 ZdcTopology ()
 
- Public Member Functions inherited from CaloSubdetectorTopology
 CaloSubdetectorTopology ()
 standard constructor More...
 
virtual DetId denseId2detId (unsigned int) const
 return a linear packed id More...
 
virtual bool denseIdConsistent (int topoVer) const
 return whether this topology is consistent with the numbering in the given topology More...
 
virtual unsigned int detId2denseId (const DetId &) const
 return a linear packed id More...
 
virtual std::vector< DetIdgetAllNeighbours (const DetId &id) const
 
virtual std::vector< DetIdgetNeighbours (const DetId &id, const CaloDirection &dir) const
 
virtual std::vector< DetIdgetWindow (const DetId &id, const int &northSouthSize, const int &eastWestSize) const
 
virtual DetId goDown (const DetId &id) const
 
virtual DetId goEast (const DetId &id) const
 
virtual DetId goNorth (const DetId &id) const
 
virtual DetId goSouth (const DetId &id) const
 
virtual DetId goUp (const DetId &id) const
 
virtual DetId goWest (const DetId &id) const
 
virtual unsigned int ncells () const
 return a count of valid cells (for dense indexing use) More...
 
virtual int topoVersion () const
 return a version which identifies the given topology More...
 
virtual bool valid (const DetId &) const
 is this detid present in the Topology? More...
 
virtual ~CaloSubdetectorTopology ()
 virtual destructor More...
 

Private Member Functions

int firstEMModule () const
 
int firstHADModule () const
 
int firstLUMModule () const
 
int firstRPDModule () const
 
bool isExcluded (const HcalZDCDetId &id) const
 
int lastEMModule () const
 
int lastHADModule () const
 
int lastLUMModule () const
 
int lastRPDModule () const
 
bool validRaw (const HcalZDCDetId &id) const
 

Private Attributes

bool excludeEM_
 
bool excludeHAD_
 
bool excludeLUM_
 
bool excludeRPD_
 
bool excludeZN_
 
bool excludeZP_
 
std::vector< HcalZDCDetIdexclusionList_
 
int firstEMModule_
 
int firstHADModule_
 
int firstLUMModule_
 
int firstRPDModule_
 
int lastEMModule_
 
int lastHADModule_
 
int lastLUMModule_
 
int lastRPDModule_
 

Additional Inherited Members

- Protected Types inherited from CaloSubdetectorTopology
typedef std::pair< int, int > Coordinate
 
- Protected Member Functions inherited from CaloSubdetectorTopology
Coordinate getNeighbourIndex (const Coordinate &coord, const CaloDirection &dir) const
 

Detailed Description

Definition at line 14 of file ZdcTopology.h.

Constructor & Destructor Documentation

◆ ZdcTopology()

ZdcTopology::ZdcTopology ( )

Definition at line 12 of file ZdcTopology.cc.

13  : excludeEM_(false),
14  excludeHAD_(false),
15  excludeLUM_(false),
16  excludeRPD_(false),
17  excludeZP_(false),
18  excludeZN_(false),
19  firstEMModule_(1),
20  lastEMModule_(5),
21  firstHADModule_(1),
22  lastHADModule_(4),
23  firstLUMModule_(1),
24  lastLUMModule_(2),
25  firstRPDModule_(1),
26  lastRPDModule_(16) {}
int firstEMModule_
Definition: ZdcTopology.h:59
bool excludeEM_
Definition: ZdcTopology.h:57
int lastLUMModule_
Definition: ZdcTopology.h:59
bool excludeRPD_
Definition: ZdcTopology.h:57
bool excludeHAD_
Definition: ZdcTopology.h:57
int firstRPDModule_
Definition: ZdcTopology.h:59
bool excludeZN_
Definition: ZdcTopology.h:57
int firstHADModule_
Definition: ZdcTopology.h:59
bool excludeLUM_
Definition: ZdcTopology.h:57
int lastRPDModule_
Definition: ZdcTopology.h:59
bool excludeZP_
Definition: ZdcTopology.h:57
int lastEMModule_
Definition: ZdcTopology.h:59
int firstLUMModule_
Definition: ZdcTopology.h:59
int lastHADModule_
Definition: ZdcTopology.h:59

Member Function Documentation

◆ down()

std::vector< DetId > ZdcTopology::down ( const DetId id) const
overridevirtual

Get the neighbors of the given cell in down direction (inward)

Implements CaloSubdetectorTopology.

Definition at line 293 of file ZdcTopology.cc.

293  {
294  edm::LogVerbatim("ForwardGeom") << "ZdcTopology::down() not yet implemented";
295  std::vector<DetId> vNeighborsDetId;
296  return vNeighborsDetId;
297 }
Log< level::Info, true > LogVerbatim

◆ east()

std::vector< DetId > ZdcTopology::east ( const DetId id) const
overridevirtual

Get the neighbors of the given cell in east direction

Implements CaloSubdetectorTopology.

Definition at line 266 of file ZdcTopology.cc.

266  {
267  edm::LogVerbatim("ForwardGeom") << "ZdcTopology::east() not yet implemented";
268  std::vector<DetId> vNeighborsDetId;
269  return vNeighborsDetId;
270 }
Log< level::Info, true > LogVerbatim

◆ exclude() [1/4]

void ZdcTopology::exclude ( const HcalZDCDetId id)

Exlucde a cell

Definition at line 65 of file ZdcTopology.cc.

References exclusionList_, mps_fire::i, l1ctLayer2EG_cff::id, and pfDeepBoostedJetPreprocessParams_cfi::lower_bound.

Referenced by exclude().

65  {
66  std::vector<HcalZDCDetId>::iterator i = std::lower_bound(exclusionList_.begin(), exclusionList_.end(), id);
67  if (i == exclusionList_.end() || *i != id) {
68  exclusionList_.insert(i, id);
69  }
70 }
std::vector< HcalZDCDetId > exclusionList_
Definition: ZdcTopology.h:55

◆ exclude() [2/4]

void ZdcTopology::exclude ( int  zside)

Exclude a side

Definition at line 72 of file ZdcTopology.cc.

References excludeZN_, excludeZP_, and ecaldqm::zside().

72  {
73  switch (zside) {
74  case (1):
75  excludeZP_ = true;
76  break;
77  case (-1):
78  excludeZN_ = true;
79  break;
80  default:
81  break;
82  }
83 }
int zside(DetId const &)
bool excludeZN_
Definition: ZdcTopology.h:57
bool excludeZP_
Definition: ZdcTopology.h:57

◆ exclude() [3/4]

void ZdcTopology::exclude ( int  zside,
HcalZDCDetId::Section  section 
)

Exclude a section, in either side (+1 positive, -1 negative)

Definition at line 85 of file ZdcTopology.cc.

References HcalZDCDetId::EM, excludeEM_, excludeHAD_, excludeLUM_, excludeRPD_, excludeZN_, excludeZP_, HcalZDCDetId::HAD, HcalZDCDetId::LUM, HcalZDCDetId::RPD, hgcalPlots::section, and ecaldqm::zside().

85  {
86  switch (zside) {
87  case (1):
88  excludeZP_ = true;
89  break;
90  case (-1):
91  excludeZN_ = true;
92  break;
93  default:
94  break;
95  }
96  switch (section) {
97  case (HcalZDCDetId::EM):
98  excludeEM_ = true;
99  break;
100  case (HcalZDCDetId::HAD):
101  excludeHAD_ = true;
102  break;
103  case (HcalZDCDetId::LUM):
104  excludeLUM_ = true;
105  break;
106  case (HcalZDCDetId::RPD):
107  excludeRPD_ = true;
108  break;
109  default:
110  break;
111  }
112 }
bool excludeEM_
Definition: ZdcTopology.h:57
bool excludeRPD_
Definition: ZdcTopology.h:57
bool excludeHAD_
Definition: ZdcTopology.h:57
int zside(DetId const &)
bool excludeZN_
Definition: ZdcTopology.h:57
bool excludeLUM_
Definition: ZdcTopology.h:57
bool excludeZP_
Definition: ZdcTopology.h:57

◆ exclude() [4/4]

int ZdcTopology::exclude ( int  zside,
HcalZDCDetId::Section  section,
int  ich1,
int  ich2 
)

Exclude a range of channels (deph) for a given subdetector

Definition at line 114 of file ZdcTopology.cc.

References HcalZDCDetId::EM, exclude(), excludeEM_, excludeHAD_, excludeLUM_, excludeRPD_, excludeZN_, excludeZP_, HcalZDCDetId::HAD, l1ctLayer2EG_cff::id, HcalZDCDetId::LUM, dqmiodumpmetadata::n, HcalZDCDetId::RPD, hgcalPlots::section, validRaw(), and ecaldqm::zside().

114  {
115  bool exed = false;
116  switch (zside) {
117  case (1):
118  exed = excludeZP_;
119  break;
120  case (-1):
121  exed = excludeZN_;
122  break;
123  default:
124  exed = false;
125  }
126  if (exed)
127  return 0;
128 
129  switch (section) {
130  case (HcalZDCDetId::EM):
131  exed = excludeEM_;
132  break;
133  case (HcalZDCDetId::HAD):
134  exed = excludeHAD_;
135  break;
136  case (HcalZDCDetId::LUM):
137  exed = excludeLUM_;
138  break;
139  case (HcalZDCDetId::RPD):
140  exed = excludeRPD_;
141  break;
142  default:
143  exed = false;
144  }
145  if (exed)
146  return 0;
147 
148  bool isPositive = false;
149  if (zside == 1)
150  isPositive = true;
151 
152  int n = 0;
153  for (int ich = ich1; ich < ich2; ich++) {
154  HcalZDCDetId id(section, isPositive, ich);
155  if (validRaw(id))
156  exclude(id);
157  n++;
158  }
159  return n;
160 }
bool excludeEM_
Definition: ZdcTopology.h:57
void exclude(const HcalZDCDetId &id)
Definition: ZdcTopology.cc:65
bool excludeRPD_
Definition: ZdcTopology.h:57
bool excludeHAD_
Definition: ZdcTopology.h:57
int zside(DetId const &)
bool excludeZN_
Definition: ZdcTopology.h:57
bool excludeLUM_
Definition: ZdcTopology.h:57
bool validRaw(const HcalZDCDetId &id) const
Definition: ZdcTopology.cc:162
bool excludeZP_
Definition: ZdcTopology.h:57

◆ firstCell()

int ZdcTopology::firstCell ( HcalZDCDetId::Section  section) const

Definition at line 321 of file ZdcTopology.cc.

References HcalZDCDetId::EM, firstEMModule_, firstHADModule_, firstLUMModule_, firstRPDModule_, HcalZDCDetId::HAD, HcalZDCDetId::LUM, HcalZDCDetId::RPD, hgcalPlots::section, and HcalZDCDetId::Unknown.

Referenced by ZdcHardcodeGeometryLoader::fill().

321  {
322  int firstCell = 0;
323  switch (section) {
324  case (HcalZDCDetId::EM):
326  break;
327  case (HcalZDCDetId::HAD):
329  break;
330  case (HcalZDCDetId::LUM):
332  break;
333  case (HcalZDCDetId::RPD):
335  break;
336  case (HcalZDCDetId::Unknown):
337  firstCell = 0;
338  break;
339  }
340  return firstCell;
341 }
int firstEMModule_
Definition: ZdcTopology.h:59
int firstRPDModule_
Definition: ZdcTopology.h:59
int firstHADModule_
Definition: ZdcTopology.h:59
int firstCell(HcalZDCDetId::Section section) const
Definition: ZdcTopology.cc:321
int firstLUMModule_
Definition: ZdcTopology.h:59

◆ firstEMModule()

int ZdcTopology::firstEMModule ( ) const
inlineprivate

Definition at line 64 of file ZdcTopology.h.

References firstEMModule_.

64 { return firstEMModule_; }
int firstEMModule_
Definition: ZdcTopology.h:59

◆ firstHADModule()

int ZdcTopology::firstHADModule ( ) const
inlineprivate

Definition at line 65 of file ZdcTopology.h.

References firstHADModule_.

65 { return firstHADModule_; }
int firstHADModule_
Definition: ZdcTopology.h:59

◆ firstLUMModule()

int ZdcTopology::firstLUMModule ( ) const
inlineprivate

Definition at line 66 of file ZdcTopology.h.

References firstLUMModule_.

66 { return firstLUMModule_; }
int firstLUMModule_
Definition: ZdcTopology.h:59

◆ firstRPDModule()

int ZdcTopology::firstRPDModule ( ) const
inlineprivate

Definition at line 67 of file ZdcTopology.h.

References firstRPDModule_.

67 { return firstRPDModule_; }
int firstRPDModule_
Definition: ZdcTopology.h:59

◆ isExcluded()

bool ZdcTopology::isExcluded ( const HcalZDCDetId id) const
private

Definition at line 35 of file ZdcTopology.cc.

References HcalZDCDetId::EM, excludeEM_, excludeHAD_, excludeLUM_, excludeRPD_, exclusionList_, HcalZDCDetId::HAD, mps_fire::i, l1ctLayer2EG_cff::id, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, HcalZDCDetId::LUM, HcalZDCDetId::RPD, and hgcalPlots::section.

Referenced by valid().

35  {
36  bool exed = false;
37 
38  // check for section exclutions
39  switch (id.section()) {
40  case (HcalZDCDetId::EM):
41  exed = excludeEM_;
42  break;
43  case (HcalZDCDetId::HAD):
44  exed = excludeHAD_;
45  break;
46  case (HcalZDCDetId::LUM):
47  exed = excludeLUM_;
48  break;
49  case (HcalZDCDetId::RPD):
50  exed = excludeRPD_;
51  break;
52  default:
53  exed = false;
54  }
55 
56  // check the entire list
57  if (!exed && !exclusionList_.empty()) {
58  std::vector<HcalZDCDetId>::const_iterator i = std::lower_bound(exclusionList_.begin(), exclusionList_.end(), id);
59  if (i != exclusionList_.end() && *i == id)
60  exed = true;
61  }
62  return exed;
63 }
bool excludeEM_
Definition: ZdcTopology.h:57
bool excludeRPD_
Definition: ZdcTopology.h:57
bool excludeHAD_
Definition: ZdcTopology.h:57
std::vector< HcalZDCDetId > exclusionList_
Definition: ZdcTopology.h:55
bool excludeLUM_
Definition: ZdcTopology.h:57

◆ lastCell()

int ZdcTopology::lastCell ( HcalZDCDetId::Section  section) const

Definition at line 343 of file ZdcTopology.cc.

References HcalZDCDetId::EM, HcalZDCDetId::HAD, lastEMModule_, lastHADModule_, lastLUMModule_, lastRPDModule_, HcalZDCDetId::LUM, HcalZDCDetId::RPD, hgcalPlots::section, and HcalZDCDetId::Unknown.

Referenced by ZdcHardcodeGeometryLoader::fill().

343  {
344  int lastCell = 0;
345  switch (section) {
346  case (HcalZDCDetId::EM):
348  break;
349  case (HcalZDCDetId::HAD):
351  break;
352  case (HcalZDCDetId::LUM):
354  break;
355  case (HcalZDCDetId::RPD):
357  break;
358  case (HcalZDCDetId::Unknown):
359  lastCell = 0;
360  break;
361  }
362  return lastCell;
363 }
int lastLUMModule_
Definition: ZdcTopology.h:59
int lastRPDModule_
Definition: ZdcTopology.h:59
int lastCell(HcalZDCDetId::Section section) const
Definition: ZdcTopology.cc:343
int lastEMModule_
Definition: ZdcTopology.h:59
int lastHADModule_
Definition: ZdcTopology.h:59

◆ lastEMModule()

int ZdcTopology::lastEMModule ( ) const
inlineprivate

Definition at line 68 of file ZdcTopology.h.

References lastEMModule_.

68 { return lastEMModule_; }
int lastEMModule_
Definition: ZdcTopology.h:59

◆ lastHADModule()

int ZdcTopology::lastHADModule ( ) const
inlineprivate

Definition at line 69 of file ZdcTopology.h.

References lastHADModule_.

69 { return lastHADModule_; }
int lastHADModule_
Definition: ZdcTopology.h:59

◆ lastLUMModule()

int ZdcTopology::lastLUMModule ( ) const
inlineprivate

Definition at line 70 of file ZdcTopology.h.

References lastLUMModule_.

70 { return lastLUMModule_; }
int lastLUMModule_
Definition: ZdcTopology.h:59

◆ lastRPDModule()

int ZdcTopology::lastRPDModule ( ) const
inlineprivate

Definition at line 71 of file ZdcTopology.h.

References lastRPDModule_.

71 { return lastRPDModule_; }
int lastRPDModule_
Definition: ZdcTopology.h:59

◆ longitudinal()

std::vector< DetId > ZdcTopology::longitudinal ( const DetId id) const
virtual

Get the longitudinal neighbors (Z) of the given cell

Definition at line 210 of file ZdcTopology.cc.

References HcalZDCDetId::channel(), HcalZDCDetId::HAD, ICH_HAD_MAX, ICH_LUM_MAX, ICH_RPD_MAX, HcalZDCDetId::LUM, DetId::rawId(), HcalZDCDetId::RPD, HcalZDCDetId::section(), validRaw(), and HcalZDCDetId::zside().

210  {
211  std::vector<DetId> vNeighborsDetId;
212  HcalZDCDetId zdcId = HcalZDCDetId(id);
213  HcalZDCDetId zdcDetId;
214  if (validRaw(zdcId) && zdcId.section() == HcalZDCDetId::HAD) {
215  bool isPositive = false;
216  if (zdcId.zside() == 1)
217  isPositive = true;
218  if (zdcId.channel() == 1) {
219  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() + 1);
220  vNeighborsDetId.emplace_back(zdcDetId.rawId());
221  return vNeighborsDetId;
222  }
223  if (zdcId.channel() == ICH_HAD_MAX) {
224  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() - 1);
225  vNeighborsDetId.emplace_back(zdcDetId.rawId());
226  return vNeighborsDetId;
227  }
228  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() - 1);
229  vNeighborsDetId.emplace_back(zdcDetId.rawId());
230  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() + 1);
231  vNeighborsDetId.emplace_back(zdcDetId.rawId());
232  }
233  if (validRaw(zdcId) && zdcId.section() == HcalZDCDetId::LUM) {
234  bool isPositive = false;
235  if (zdcId.zside() == 1)
236  isPositive = true;
237  if (zdcId.channel() == 1) {
238  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() + 1);
239  vNeighborsDetId.emplace_back(zdcDetId.rawId());
240  return vNeighborsDetId;
241  }
242  if (zdcId.channel() == ICH_LUM_MAX) {
243  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() - 1);
244  vNeighborsDetId.emplace_back(zdcDetId.rawId());
245  return vNeighborsDetId;
246  }
247  }
248  if (validRaw(zdcId) && zdcId.section() == HcalZDCDetId::RPD) {
249  bool isPositive = false;
250  if (zdcId.zside() == 1)
251  isPositive = true;
252  if (zdcId.channel() == 1) {
253  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() + 1);
254  vNeighborsDetId.emplace_back(zdcDetId.rawId());
255  return vNeighborsDetId;
256  }
257  if (zdcId.channel() == ICH_RPD_MAX) {
258  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() - 1);
259  vNeighborsDetId.emplace_back(zdcDetId.rawId());
260  return vNeighborsDetId;
261  }
262  }
263  return vNeighborsDetId;
264 }
static const int ICH_LUM_MAX
Definition: ZdcTopology.cc:9
Section section() const
get the section
Definition: HcalZDCDetId.cc:44
static const int ICH_RPD_MAX
Definition: ZdcTopology.cc:10
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
bool validRaw(const HcalZDCDetId &id) const
Definition: ZdcTopology.cc:162
static const int ICH_HAD_MAX
Definition: ZdcTopology.cc:8
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalZDCDetId.h:39
int channel() const
get the channel
Definition: HcalZDCDetId.cc:63

◆ ncells() [1/2]

virtual unsigned int CaloSubdetectorTopology::ncells
inline

return a count of valid cells (for dense indexing use)

Definition at line 30 of file CaloSubdetectorTopology.h.

30 { return 1; }

◆ ncells() [2/2]

int ZdcTopology::ncells ( HcalZDCDetId::Section  section) const

Definition at line 299 of file ZdcTopology.cc.

References HcalZDCDetId::EM, HcalZDCDetId::HAD, ICH_EM_MAX, ICH_HAD_MAX, ICH_LUM_MAX, ICH_RPD_MAX, HcalZDCDetId::LUM, CaloSubdetectorTopology::ncells(), HcalZDCDetId::RPD, hgcalPlots::section, and HcalZDCDetId::Unknown.

299  {
300  int ncells = 0;
301  switch (section) {
302  case (HcalZDCDetId::EM):
303  ncells = ICH_EM_MAX;
304  break;
305  case (HcalZDCDetId::HAD):
307  break;
308  case (HcalZDCDetId::LUM):
310  break;
311  case (HcalZDCDetId::RPD):
313  break;
314  case (HcalZDCDetId::Unknown):
315  ncells = 0;
316  break;
317  }
318  return ncells;
319 }
static const int ICH_LUM_MAX
Definition: ZdcTopology.cc:9
static const int ICH_EM_MAX
Definition: ZdcTopology.cc:7
static const int ICH_RPD_MAX
Definition: ZdcTopology.cc:10
virtual unsigned int ncells() const
return a count of valid cells (for dense indexing use)
static const int ICH_HAD_MAX
Definition: ZdcTopology.cc:8

◆ north()

std::vector< DetId > ZdcTopology::north ( const DetId id) const
overridevirtual

Get the neighbors of the given cell in north direction

Implements CaloSubdetectorTopology.

Definition at line 278 of file ZdcTopology.cc.

278  {
279  edm::LogVerbatim("ForwardGeom") << "ZdcTopology::north() not yet implemented";
280  std::vector<DetId> vNeighborsDetId;
281  return vNeighborsDetId;
282 }
Log< level::Info, true > LogVerbatim

◆ south()

std::vector< DetId > ZdcTopology::south ( const DetId id) const
overridevirtual

Get the neighbors of the given cell in south direction

Implements CaloSubdetectorTopology.

Definition at line 283 of file ZdcTopology.cc.

283  {
284  edm::LogVerbatim("ForwardGeom") << "ZdcTopology::south() not yet implemented";
285  std::vector<DetId> vNeighborsDetId;
286  return vNeighborsDetId;
287 }
Log< level::Info, true > LogVerbatim

◆ transverse()

std::vector< DetId > ZdcTopology::transverse ( const DetId id) const
virtual

Get the transverse (X) neighbors of the given cell

Definition at line 184 of file ZdcTopology.cc.

References HcalZDCDetId::channel(), HcalZDCDetId::EM, ICH_EM_MAX, DetId::rawId(), HcalZDCDetId::section(), validRaw(), and HcalZDCDetId::zside().

184  {
185  std::vector<DetId> vNeighborsDetId;
186  HcalZDCDetId zdcId = HcalZDCDetId(id);
187  HcalZDCDetId zdcDetId;
188  if (validRaw(zdcId) && zdcId.section() == HcalZDCDetId::EM) {
189  bool isPositive = false;
190  if (zdcId.zside() == 1)
191  isPositive = true;
192  if (zdcId.channel() == 1) {
193  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() + 1);
194  vNeighborsDetId.emplace_back(zdcDetId.rawId());
195  return vNeighborsDetId;
196  }
197  if (zdcId.channel() == ICH_EM_MAX) {
198  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() - 1);
199  vNeighborsDetId.emplace_back(zdcDetId.rawId());
200  return vNeighborsDetId;
201  }
202  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() - 1);
203  vNeighborsDetId.emplace_back(zdcDetId.rawId());
204  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() + 1);
205  vNeighborsDetId.emplace_back(zdcDetId.rawId());
206  }
207  return vNeighborsDetId;
208 }
static const int ICH_EM_MAX
Definition: ZdcTopology.cc:7
Section section() const
get the section
Definition: HcalZDCDetId.cc:44
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
bool validRaw(const HcalZDCDetId &id) const
Definition: ZdcTopology.cc:162
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalZDCDetId.h:39
int channel() const
get the channel
Definition: HcalZDCDetId.cc:63

◆ up()

std::vector< DetId > ZdcTopology::up ( const DetId id) const
overridevirtual

Get the neighbors of the given cell in up direction (outward)

Implements CaloSubdetectorTopology.

Definition at line 288 of file ZdcTopology.cc.

288  {
289  edm::LogVerbatim("ForwardGeom") << "ZdcTopology::up() not yet implemented";
290  std::vector<DetId> vNeighborsDetId;
291  return vNeighborsDetId;
292 }
Log< level::Info, true > LogVerbatim

◆ valid() [1/2]

virtual bool CaloSubdetectorTopology::valid
inline

Is this a valid cell id?

Definition at line 24 of file CaloSubdetectorTopology.h.

24 { return false; };

◆ valid() [2/2]

bool ZdcTopology::valid ( const HcalZDCDetId id) const
virtual

Definition at line 28 of file ZdcTopology.cc.

References isExcluded(), convertSQLiteXML::ok, and validRaw().

Referenced by ZdcHardcodeGeometryLoader::fill().

28  {
29  // check the raw rules
30  bool ok = validRaw(id);
31  ok = ok && !isExcluded(id);
32  return ok;
33 }
bool validRaw(const HcalZDCDetId &id) const
Definition: ZdcTopology.cc:162
bool isExcluded(const HcalZDCDetId &id) const
Definition: ZdcTopology.cc:35

◆ validRaw()

bool ZdcTopology::validRaw ( const HcalZDCDetId id) const
private

Definition at line 162 of file ZdcTopology.cc.

References funct::abs(), HcalZDCDetId::EM, HcalZDCDetId::HAD, ICH_EM_MAX, ICH_HAD_MAX, ICH_LUM_MAX, ICH_RPD_MAX, HcalZDCDetId::LUM, convertSQLiteXML::ok, HcalZDCDetId::RPD, hgcalPlots::section, and ecaldqm::zside().

Referenced by exclude(), longitudinal(), transverse(), and valid().

162  {
163  bool ok = true;
164  if (abs(id.zside()) != 1)
165  ok = false;
166  else if (id.channel() <= 0)
167  ok = false;
168  else if (!(id.section() == HcalZDCDetId::EM || id.section() == HcalZDCDetId::HAD ||
169  id.section() == HcalZDCDetId::LUM))
170  // id.section()== HcalZDCDetId::LUM ||
171  // id.section()== HcalZDCDetId::RPD))
172  ok = false;
173  else if (id.section() == HcalZDCDetId::EM && id.channel() > ICH_EM_MAX)
174  ok = false;
175  else if (id.section() == HcalZDCDetId::HAD && id.channel() > ICH_HAD_MAX)
176  ok = false;
177  else if (id.section() == HcalZDCDetId::LUM && id.channel() > ICH_LUM_MAX)
178  ok = false;
179  else if (id.section() == HcalZDCDetId::RPD && id.channel() > ICH_RPD_MAX)
180  ok = false;
181  return ok;
182 }
static const int ICH_LUM_MAX
Definition: ZdcTopology.cc:9
static const int ICH_EM_MAX
Definition: ZdcTopology.cc:7
int zside(DetId const &)
static const int ICH_RPD_MAX
Definition: ZdcTopology.cc:10
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int ICH_HAD_MAX
Definition: ZdcTopology.cc:8

◆ west()

std::vector< DetId > ZdcTopology::west ( const DetId id) const
overridevirtual

Get the neighbors of the given cell in west direction

Implements CaloSubdetectorTopology.

Definition at line 272 of file ZdcTopology.cc.

272  {
273  edm::LogVerbatim("ForwardGeom") << "ZdcTopology::west() not yet implemented";
274  std::vector<DetId> vNeighborsDetId;
275  return vNeighborsDetId;
276 }
Log< level::Info, true > LogVerbatim

Member Data Documentation

◆ excludeEM_

bool ZdcTopology::excludeEM_
private

Definition at line 57 of file ZdcTopology.h.

Referenced by exclude(), and isExcluded().

◆ excludeHAD_

bool ZdcTopology::excludeHAD_
private

Definition at line 57 of file ZdcTopology.h.

Referenced by exclude(), and isExcluded().

◆ excludeLUM_

bool ZdcTopology::excludeLUM_
private

Definition at line 57 of file ZdcTopology.h.

Referenced by exclude(), and isExcluded().

◆ excludeRPD_

bool ZdcTopology::excludeRPD_
private

Definition at line 57 of file ZdcTopology.h.

Referenced by exclude(), and isExcluded().

◆ excludeZN_

bool ZdcTopology::excludeZN_
private

Definition at line 57 of file ZdcTopology.h.

Referenced by exclude().

◆ excludeZP_

bool ZdcTopology::excludeZP_
private

Definition at line 57 of file ZdcTopology.h.

Referenced by exclude().

◆ exclusionList_

std::vector<HcalZDCDetId> ZdcTopology::exclusionList_
private

Definition at line 55 of file ZdcTopology.h.

Referenced by exclude(), and isExcluded().

◆ firstEMModule_

int ZdcTopology::firstEMModule_
private

Definition at line 59 of file ZdcTopology.h.

Referenced by firstCell(), and firstEMModule().

◆ firstHADModule_

int ZdcTopology::firstHADModule_
private

Definition at line 59 of file ZdcTopology.h.

Referenced by firstCell(), and firstHADModule().

◆ firstLUMModule_

int ZdcTopology::firstLUMModule_
private

Definition at line 59 of file ZdcTopology.h.

Referenced by firstCell(), and firstLUMModule().

◆ firstRPDModule_

int ZdcTopology::firstRPDModule_
private

Definition at line 59 of file ZdcTopology.h.

Referenced by firstCell(), and firstRPDModule().

◆ lastEMModule_

int ZdcTopology::lastEMModule_
private

Definition at line 59 of file ZdcTopology.h.

Referenced by lastCell(), and lastEMModule().

◆ lastHADModule_

int ZdcTopology::lastHADModule_
private

Definition at line 59 of file ZdcTopology.h.

Referenced by lastCell(), and lastHADModule().

◆ lastLUMModule_

int ZdcTopology::lastLUMModule_
private

Definition at line 59 of file ZdcTopology.h.

Referenced by lastCell(), and lastLUMModule().

◆ lastRPDModule_

int ZdcTopology::lastRPDModule_
private

Definition at line 59 of file ZdcTopology.h.

Referenced by lastCell(), and lastRPDModule().