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 8 of file ZdcTopology.cc.

9  : excludeEM_(false),
10  excludeHAD_(false),
11  excludeLUM_(false),
12  excludeRPD_(false),
13  excludeZP_(false),
14  excludeZN_(false),
15  firstEMModule_(1),
17  firstHADModule_(1),
19  firstLUMModule_(1),
21  firstRPDModule_(1),
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
static constexpr int32_t kDepHAD
Definition: HcalZDCDetId.h:38
bool excludeZN_
Definition: ZdcTopology.h:57
static constexpr int32_t kDepEM
Definition: HcalZDCDetId.h:37
int firstHADModule_
Definition: ZdcTopology.h:59
bool excludeLUM_
Definition: ZdcTopology.h:57
int lastRPDModule_
Definition: ZdcTopology.h:59
static constexpr int32_t kDepLUM
Definition: HcalZDCDetId.h:39
bool excludeZP_
Definition: ZdcTopology.h:57
static constexpr int32_t kDepRPD
Definition: HcalZDCDetId.h:40
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 288 of file ZdcTopology.cc.

288  {
289  edm::LogVerbatim("ForwardGeom") << "ZdcTopology::down() not yet implemented";
290  std::vector<DetId> vNeighborsDetId;
291  return vNeighborsDetId;
292 }
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 261 of file ZdcTopology.cc.

261  {
262  edm::LogVerbatim("ForwardGeom") << "ZdcTopology::east() not yet implemented";
263  std::vector<DetId> vNeighborsDetId;
264  return vNeighborsDetId;
265 }
Log< level::Info, true > LogVerbatim

◆ exclude() [1/4]

void ZdcTopology::exclude ( const HcalZDCDetId id)

Exlucde a cell

Definition at line 61 of file ZdcTopology.cc.

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

Referenced by exclude().

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

◆ exclude() [2/4]

void ZdcTopology::exclude ( int  zside)

Exclude a side

Definition at line 68 of file ZdcTopology.cc.

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

68  {
69  switch (zside) {
70  case (1):
71  excludeZP_ = true;
72  break;
73  case (-1):
74  excludeZN_ = true;
75  break;
76  default:
77  break;
78  }
79 }
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 81 of file ZdcTopology.cc.

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

81  {
82  switch (zside) {
83  case (1):
84  excludeZP_ = true;
85  break;
86  case (-1):
87  excludeZN_ = true;
88  break;
89  default:
90  break;
91  }
92  switch (section) {
93  case (HcalZDCDetId::EM):
94  excludeEM_ = true;
95  break;
96  case (HcalZDCDetId::HAD):
97  excludeHAD_ = true;
98  break;
99  case (HcalZDCDetId::LUM):
100  excludeLUM_ = true;
101  break;
102  case (HcalZDCDetId::RPD):
103  excludeRPD_ = true;
104  break;
105  default:
106  break;
107  }
108 }
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 110 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().

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

◆ firstCell()

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

Definition at line 316 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().

316  {
317  int firstCell = 0;
318  switch (section) {
319  case (HcalZDCDetId::EM):
321  break;
322  case (HcalZDCDetId::HAD):
324  break;
325  case (HcalZDCDetId::LUM):
327  break;
328  case (HcalZDCDetId::RPD):
330  break;
331  case (HcalZDCDetId::Unknown):
332  firstCell = 0;
333  break;
334  }
335  return firstCell;
336 }
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:316
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 31 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().

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

338  {
339  int lastCell = 0;
340  switch (section) {
341  case (HcalZDCDetId::EM):
343  break;
344  case (HcalZDCDetId::HAD):
346  break;
347  case (HcalZDCDetId::LUM):
349  break;
350  case (HcalZDCDetId::RPD):
352  break;
353  case (HcalZDCDetId::Unknown):
354  lastCell = 0;
355  break;
356  }
357  return lastCell;
358 }
int lastLUMModule_
Definition: ZdcTopology.h:59
int lastRPDModule_
Definition: ZdcTopology.h:59
int lastCell(HcalZDCDetId::Section section) const
Definition: ZdcTopology.cc:338
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 205 of file ZdcTopology.cc.

References HcalZDCDetId::channel(), HcalZDCDetId::HAD, HcalZDCDetId::kDepHAD, HcalZDCDetId::kDepLUM, HcalZDCDetId::kDepRPD, HcalZDCDetId::LUM, DetId::rawId(), HcalZDCDetId::RPD, HcalZDCDetId::section(), validRaw(), and HcalZDCDetId::zside().

205  {
206  std::vector<DetId> vNeighborsDetId;
207  HcalZDCDetId zdcId = HcalZDCDetId(id);
208  HcalZDCDetId zdcDetId;
209  if (validRaw(zdcId) && zdcId.section() == HcalZDCDetId::HAD) {
210  bool isPositive = false;
211  if (zdcId.zside() == 1)
212  isPositive = true;
213  if (zdcId.channel() == 1) {
214  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() + 1);
215  vNeighborsDetId.emplace_back(zdcDetId.rawId());
216  return vNeighborsDetId;
217  }
218  if (zdcId.channel() == HcalZDCDetId::kDepHAD) {
219  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() - 1);
220  vNeighborsDetId.emplace_back(zdcDetId.rawId());
221  return vNeighborsDetId;
222  }
223  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() - 1);
224  vNeighborsDetId.emplace_back(zdcDetId.rawId());
225  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() + 1);
226  vNeighborsDetId.emplace_back(zdcDetId.rawId());
227  }
228  if (validRaw(zdcId) && zdcId.section() == HcalZDCDetId::LUM) {
229  bool isPositive = false;
230  if (zdcId.zside() == 1)
231  isPositive = true;
232  if (zdcId.channel() == 1) {
233  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() + 1);
234  vNeighborsDetId.emplace_back(zdcDetId.rawId());
235  return vNeighborsDetId;
236  }
237  if (zdcId.channel() == HcalZDCDetId::kDepLUM) {
238  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() - 1);
239  vNeighborsDetId.emplace_back(zdcDetId.rawId());
240  return vNeighborsDetId;
241  }
242  }
243  if (validRaw(zdcId) && zdcId.section() == HcalZDCDetId::RPD) {
244  bool isPositive = false;
245  if (zdcId.zside() == 1)
246  isPositive = true;
247  if (zdcId.channel() == 1) {
248  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() + 1);
249  vNeighborsDetId.emplace_back(zdcDetId.rawId());
250  return vNeighborsDetId;
251  }
252  if (zdcId.channel() == HcalZDCDetId::kDepRPD) {
253  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() - 1);
254  vNeighborsDetId.emplace_back(zdcDetId.rawId());
255  return vNeighborsDetId;
256  }
257  }
258  return vNeighborsDetId;
259 }
static constexpr int32_t kDepHAD
Definition: HcalZDCDetId.h:38
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
static constexpr int32_t kDepLUM
Definition: HcalZDCDetId.h:39
constexpr Section section() const
get the section
Definition: HcalZDCDetId.h:92
bool validRaw(const HcalZDCDetId &id) const
Definition: ZdcTopology.cc:158
static constexpr int32_t kDepRPD
Definition: HcalZDCDetId.h:40
constexpr int32_t channel() const
get the channel
Definition: HcalZDCDetId.h:112
constexpr int32_t zside() const
get the z-side of the cell (1/-1)
Definition: HcalZDCDetId.h:90

◆ 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 294 of file ZdcTopology.cc.

References HcalZDCDetId::EM, HcalZDCDetId::HAD, HcalZDCDetId::kDepEM, HcalZDCDetId::kDepHAD, HcalZDCDetId::kDepLUM, HcalZDCDetId::kDepRPD, HcalZDCDetId::LUM, CaloSubdetectorTopology::ncells(), HcalZDCDetId::RPD, hgcalPlots::section, and HcalZDCDetId::Unknown.

294  {
295  int ncells = 0;
296  switch (section) {
297  case (HcalZDCDetId::EM):
299  break;
300  case (HcalZDCDetId::HAD):
302  break;
303  case (HcalZDCDetId::LUM):
305  break;
306  case (HcalZDCDetId::RPD):
308  break;
309  case (HcalZDCDetId::Unknown):
310  ncells = 0;
311  break;
312  }
313  return ncells;
314 }
static constexpr int32_t kDepHAD
Definition: HcalZDCDetId.h:38
static constexpr int32_t kDepEM
Definition: HcalZDCDetId.h:37
virtual unsigned int ncells() const
return a count of valid cells (for dense indexing use)
static constexpr int32_t kDepLUM
Definition: HcalZDCDetId.h:39
static constexpr int32_t kDepRPD
Definition: HcalZDCDetId.h:40

◆ 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 273 of file ZdcTopology.cc.

273  {
274  edm::LogVerbatim("ForwardGeom") << "ZdcTopology::north() not yet implemented";
275  std::vector<DetId> vNeighborsDetId;
276  return vNeighborsDetId;
277 }
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 278 of file ZdcTopology.cc.

278  {
279  edm::LogVerbatim("ForwardGeom") << "ZdcTopology::south() not yet implemented";
280  std::vector<DetId> vNeighborsDetId;
281  return vNeighborsDetId;
282 }
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 179 of file ZdcTopology.cc.

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

179  {
180  std::vector<DetId> vNeighborsDetId;
181  HcalZDCDetId zdcId = HcalZDCDetId(id);
182  HcalZDCDetId zdcDetId;
183  if (validRaw(zdcId) && zdcId.section() == HcalZDCDetId::EM) {
184  bool isPositive = false;
185  if (zdcId.zside() == 1)
186  isPositive = true;
187  if (zdcId.channel() == 1) {
188  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() + 1);
189  vNeighborsDetId.emplace_back(zdcDetId.rawId());
190  return vNeighborsDetId;
191  }
192  if (zdcId.channel() == HcalZDCDetId::kDepEM) {
193  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() - 1);
194  vNeighborsDetId.emplace_back(zdcDetId.rawId());
195  return vNeighborsDetId;
196  }
197  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() - 1);
198  vNeighborsDetId.emplace_back(zdcDetId.rawId());
199  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() + 1);
200  vNeighborsDetId.emplace_back(zdcDetId.rawId());
201  }
202  return vNeighborsDetId;
203 }
static constexpr int32_t kDepEM
Definition: HcalZDCDetId.h:37
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
constexpr Section section() const
get the section
Definition: HcalZDCDetId.h:92
bool validRaw(const HcalZDCDetId &id) const
Definition: ZdcTopology.cc:158
constexpr int32_t channel() const
get the channel
Definition: HcalZDCDetId.h:112
constexpr int32_t zside() const
get the z-side of the cell (1/-1)
Definition: HcalZDCDetId.h:90

◆ 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 283 of file ZdcTopology.cc.

283  {
284  edm::LogVerbatim("ForwardGeom") << "ZdcTopology::up() not yet implemented";
285  std::vector<DetId> vNeighborsDetId;
286  return vNeighborsDetId;
287 }
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 24 of file ZdcTopology.cc.

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

Referenced by ZdcHardcodeGeometryLoader::fill().

24  {
25  // check the raw rules
26  bool ok = validRaw(id);
27  ok = ok && !isExcluded(id);
28  return ok;
29 }
bool validRaw(const HcalZDCDetId &id) const
Definition: ZdcTopology.cc:158
bool isExcluded(const HcalZDCDetId &id) const
Definition: ZdcTopology.cc:31

◆ validRaw()

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

Definition at line 158 of file ZdcTopology.cc.

References funct::abs(), HcalZDCDetId::EM, HcalZDCDetId::HAD, HcalZDCDetId::kDepEM, HcalZDCDetId::kDepHAD, HcalZDCDetId::kDepLUM, HcalZDCDetId::kDepRPD, HcalZDCDetId::LUM, convertSQLiteXML::ok, HcalZDCDetId::RPD, hgcalPlots::section, and ecaldqm::zside().

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

158  {
159  bool ok = true;
160  if (abs(id.zside()) != 1)
161  ok = false;
162  else if (id.channel() <= 0)
163  ok = false;
164  else if (!(id.section() == HcalZDCDetId::EM || id.section() == HcalZDCDetId::HAD ||
165  id.section() == HcalZDCDetId::LUM))
166  //else if (!(id.section() == HcalZDCDetId::EM || id.section() == HcalZDCDetId::HAD || id.section()== HcalZDCDetId::LUM || id.section()== HcalZDCDetId::RPD))
167  ok = false;
168  else if (id.section() == HcalZDCDetId::EM && id.channel() > HcalZDCDetId::kDepEM)
169  ok = false;
170  else if (id.section() == HcalZDCDetId::HAD && id.channel() > HcalZDCDetId::kDepHAD)
171  ok = false;
172  else if (id.section() == HcalZDCDetId::LUM && id.channel() > HcalZDCDetId::kDepLUM)
173  ok = false;
174  else if (id.section() == HcalZDCDetId::RPD && id.channel() > HcalZDCDetId::kDepRPD)
175  ok = false;
176  return ok;
177 }
int zside(DetId const &)
static constexpr int32_t kDepHAD
Definition: HcalZDCDetId.h:38
static constexpr int32_t kDepEM
Definition: HcalZDCDetId.h:37
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static constexpr int32_t kDepLUM
Definition: HcalZDCDetId.h:39
static constexpr int32_t kDepRPD
Definition: HcalZDCDetId.h:40

◆ 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 267 of file ZdcTopology.cc.

267  {
268  edm::LogVerbatim("ForwardGeom") << "ZdcTopology::west() not yet implemented";
269  std::vector<DetId> vNeighborsDetId;
270  return vNeighborsDetId;
271 }
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().