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

DetId denseId2detId (uint32_t di) const override
 
uint32_t detId2DenseIndex (const DetId &id) const
 
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
 
uint32_t kSizeForDenseIndexing () const
 
int lastCell (HcalZDCDetId::Section section) const
 
virtual std::vector< DetIdlongitudinal (const DetId &id) const
 
HcalTopologyMode::Mode mode () 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
 
bool validDenseIndex (uint32_t din) const
 
std::vector< DetIdwest (const DetId &id) const override
 
 ZdcTopology (const HcalDDDRecConstants *hcons)
 
- 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_
 
const HcalDDDRecConstantshcons_
 
int lastEMModule_
 
int lastHADModule_
 
int lastLUMModule_
 
int lastRPDModule_
 
HcalTopologyMode::Mode mode_
 

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 16 of file ZdcTopology.h.

Constructor & Destructor Documentation

◆ ZdcTopology()

ZdcTopology::ZdcTopology ( const HcalDDDRecConstants hcons)

Definition at line 8 of file ZdcTopology.cc.

References excludeRPD_, HcalDDDRecConstants::getTopoMode(), hcons_, mode_, and HcalTopologyMode::Run3.

9  : hcons_(hcons),
10  excludeEM_(false),
11  excludeHAD_(false),
12  excludeLUM_(false),
13  excludeRPD_(false),
14  excludeZP_(false),
15  excludeZN_(false),
16  firstEMModule_(1),
18  firstHADModule_(1),
20  firstLUMModule_(1),
22  firstRPDModule_(1),
26  edm::LogVerbatim("ForwardGeom") << "ZdcTopology : Mode " << mode_ << ":" << HcalTopologyMode::Mode::Run3
27  << " ExcludeRPD " << excludeRPD_;
28 }
int firstEMModule_
Definition: ZdcTopology.h:83
Log< level::Info, true > LogVerbatim
bool excludeEM_
Definition: ZdcTopology.h:81
int lastLUMModule_
Definition: ZdcTopology.h:83
bool excludeRPD_
Definition: ZdcTopology.h:81
bool excludeHAD_
Definition: ZdcTopology.h:81
const HcalDDDRecConstants * hcons_
Definition: ZdcTopology.h:76
HcalTopologyMode::Mode mode_
Definition: ZdcTopology.h:77
int firstRPDModule_
Definition: ZdcTopology.h:83
static constexpr int32_t kDepHAD
Definition: HcalZDCDetId.h:38
bool excludeZN_
Definition: ZdcTopology.h:81
static constexpr int32_t kDepEM
Definition: HcalZDCDetId.h:37
int firstHADModule_
Definition: ZdcTopology.h:83
bool excludeLUM_
Definition: ZdcTopology.h:81
int lastRPDModule_
Definition: ZdcTopology.h:83
static constexpr int32_t kDepLUM
Definition: HcalZDCDetId.h:39
bool excludeZP_
Definition: ZdcTopology.h:81
static constexpr int32_t kDepRPD
Definition: HcalZDCDetId.h:40
int lastEMModule_
Definition: ZdcTopology.h:83
int firstLUMModule_
Definition: ZdcTopology.h:83
int lastHADModule_
Definition: ZdcTopology.h:83

Member Function Documentation

◆ denseId2detId()

DetId ZdcTopology::denseId2detId ( uint32_t  di) const
override

Definition at line 372 of file ZdcTopology.cc.

References Calorimetry_cff::dp, HcalZDCDetId::EM, HcalZDCDetId::HAD, recoMuon::in, HcalZDCDetId::kDepEM, HcalZDCDetId::kDepHAD, HcalZDCDetId::kDepRPD, HcalZDCDetId::kDepRun1, HcalZDCDetId::kDepTot, HcalZDCDetId::LUM, HcalZDCDetId::RPD, HcalZDCDetId::Unknown, and validDenseIndex().

372  {
373  if (validDenseIndex(di)) {
374  bool lz(false);
375  uint32_t dp(0);
377  if (di >= 2 * HcalZDCDetId::kDepRun1) {
379  se = HcalZDCDetId::RPD;
380  dp = 1 + ((di - 2 * HcalZDCDetId::kDepRun1) % HcalZDCDetId::kDepRPD);
381  } else {
382  lz = (di >= HcalZDCDetId::kDepRun1);
383  uint32_t in = (di % HcalZDCDetId::kDepRun1);
384  se = (in < HcalZDCDetId::kDepEM
387  dp = (se == HcalZDCDetId::EM ? in + 1
388  : (se == HcalZDCDetId::HAD ? in - HcalZDCDetId::kDepEM + 1
390  }
391  return static_cast<DetId>(HcalZDCDetId(se, lz, dp));
392  }
393  return DetId();
394 }
static constexpr int32_t kDepTot
Definition: HcalZDCDetId.h:42
static constexpr int32_t kDepHAD
Definition: HcalZDCDetId.h:38
static constexpr int32_t kDepEM
Definition: HcalZDCDetId.h:37
Definition: DetId.h:17
static constexpr int32_t kDepRun1
Definition: HcalZDCDetId.h:41
bool validDenseIndex(uint32_t din) const
Definition: ZdcTopology.h:57
static constexpr int32_t kDepRPD
Definition: HcalZDCDetId.h:40

◆ detId2DenseIndex()

uint32_t ZdcTopology::detId2DenseIndex ( const DetId id) const

Definition at line 396 of file ZdcTopology.cc.

References hcalRecHitTable_cff::detId, HcalZDCDetId::HAD, HcalZDCDetId::kDepEM, HcalZDCDetId::kDepHAD, HcalZDCDetId::kDepRPD, HcalZDCDetId::kDepRun1, HcalZDCDetId::LUM, and HcalZDCDetId::RPD.

Referenced by ZdcGeometry::indexFor(), and ZdcGeometry::newCell().

396  {
397  HcalZDCDetId detId(id);
398  const int32_t se(detId.section());
399  uint32_t di = (detId.channel() - 1 +
400  (se == HcalZDCDetId::RPD
401  ? 2 * HcalZDCDetId::kDepRun1 + (detId.zside() < 0 ? 0 : HcalZDCDetId::kDepRPD)
402  : ((detId.zside() < 0 ? 0 : HcalZDCDetId::kDepRun1) +
403  (se == HcalZDCDetId::HAD
406  return di;
407 }
static constexpr int32_t kDepHAD
Definition: HcalZDCDetId.h:38
static constexpr int32_t kDepEM
Definition: HcalZDCDetId.h:37
static constexpr int32_t kDepRun1
Definition: HcalZDCDetId.h:41
static constexpr int32_t kDepRPD
Definition: HcalZDCDetId.h:40

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

295  {
296  edm::LogVerbatim("ForwardGeom") << "ZdcTopology::down() not yet implemented";
297  std::vector<DetId> vNeighborsDetId;
298  return vNeighborsDetId;
299 }
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 268 of file ZdcTopology.cc.

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

◆ exclude() [1/4]

void ZdcTopology::exclude ( const HcalZDCDetId id)

Exlucde a cell

Definition at line 67 of file ZdcTopology.cc.

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

Referenced by exclude().

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

◆ exclude() [2/4]

void ZdcTopology::exclude ( int  zside)

Exclude a side

Definition at line 74 of file ZdcTopology.cc.

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

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

◆ exclude() [3/4]

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

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

Definition at line 87 of file ZdcTopology.cc.

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

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

◆ 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 116 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().

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

◆ firstCell()

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

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

323  {
324  int firstCell = 0;
325  switch (section) {
326  case (HcalZDCDetId::EM):
328  break;
329  case (HcalZDCDetId::HAD):
331  break;
332  case (HcalZDCDetId::LUM):
334  break;
335  case (HcalZDCDetId::RPD):
337  break;
338  case (HcalZDCDetId::Unknown):
339  firstCell = 0;
340  break;
341  }
342  return firstCell;
343 }
int firstEMModule_
Definition: ZdcTopology.h:83
int firstRPDModule_
Definition: ZdcTopology.h:83
int firstHADModule_
Definition: ZdcTopology.h:83
int firstCell(HcalZDCDetId::Section section) const
Definition: ZdcTopology.cc:323
int firstLUMModule_
Definition: ZdcTopology.h:83

◆ firstEMModule()

int ZdcTopology::firstEMModule ( ) const
inlineprivate

Definition at line 67 of file ZdcTopology.h.

References firstEMModule_.

67 { return firstEMModule_; }
int firstEMModule_
Definition: ZdcTopology.h:83

◆ firstHADModule()

int ZdcTopology::firstHADModule ( ) const
inlineprivate

Definition at line 68 of file ZdcTopology.h.

References firstHADModule_.

68 { return firstHADModule_; }
int firstHADModule_
Definition: ZdcTopology.h:83

◆ firstLUMModule()

int ZdcTopology::firstLUMModule ( ) const
inlineprivate

Definition at line 69 of file ZdcTopology.h.

References firstLUMModule_.

69 { return firstLUMModule_; }
int firstLUMModule_
Definition: ZdcTopology.h:83

◆ firstRPDModule()

int ZdcTopology::firstRPDModule ( ) const
inlineprivate

Definition at line 70 of file ZdcTopology.h.

References firstRPDModule_.

70 { return firstRPDModule_; }
int firstRPDModule_
Definition: ZdcTopology.h:83

◆ isExcluded()

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

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

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

◆ kSizeForDenseIndexing()

uint32_t ZdcTopology::kSizeForDenseIndexing ( ) const

◆ lastCell()

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

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

345  {
346  int lastCell = 0;
347  switch (section) {
348  case (HcalZDCDetId::EM):
350  break;
351  case (HcalZDCDetId::HAD):
353  break;
354  case (HcalZDCDetId::LUM):
356  break;
357  case (HcalZDCDetId::RPD):
359  break;
360  case (HcalZDCDetId::Unknown):
361  lastCell = 0;
362  break;
363  }
364  return lastCell;
365 }
int lastLUMModule_
Definition: ZdcTopology.h:83
int lastRPDModule_
Definition: ZdcTopology.h:83
int lastCell(HcalZDCDetId::Section section) const
Definition: ZdcTopology.cc:345
int lastEMModule_
Definition: ZdcTopology.h:83
int lastHADModule_
Definition: ZdcTopology.h:83

◆ lastEMModule()

int ZdcTopology::lastEMModule ( ) const
inlineprivate

Definition at line 71 of file ZdcTopology.h.

References lastEMModule_.

71 { return lastEMModule_; }
int lastEMModule_
Definition: ZdcTopology.h:83

◆ lastHADModule()

int ZdcTopology::lastHADModule ( ) const
inlineprivate

Definition at line 72 of file ZdcTopology.h.

References lastHADModule_.

72 { return lastHADModule_; }
int lastHADModule_
Definition: ZdcTopology.h:83

◆ lastLUMModule()

int ZdcTopology::lastLUMModule ( ) const
inlineprivate

Definition at line 73 of file ZdcTopology.h.

References lastLUMModule_.

73 { return lastLUMModule_; }
int lastLUMModule_
Definition: ZdcTopology.h:83

◆ lastRPDModule()

int ZdcTopology::lastRPDModule ( ) const
inlineprivate

Definition at line 74 of file ZdcTopology.h.

References lastRPDModule_.

74 { return lastRPDModule_; }
int lastRPDModule_
Definition: ZdcTopology.h:83

◆ longitudinal()

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

Get the longitudinal neighbors (Z) of the given cell

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

212  {
213  std::vector<DetId> vNeighborsDetId;
214  HcalZDCDetId zdcId = HcalZDCDetId(id);
215  HcalZDCDetId zdcDetId;
216  if (validRaw(zdcId) && zdcId.section() == HcalZDCDetId::HAD) {
217  bool isPositive = false;
218  if (zdcId.zside() == 1)
219  isPositive = true;
220  if (zdcId.channel() == 1) {
221  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() + 1);
222  vNeighborsDetId.emplace_back(zdcDetId.rawId());
223  return vNeighborsDetId;
224  }
225  if (zdcId.channel() == HcalZDCDetId::kDepHAD) {
226  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() - 1);
227  vNeighborsDetId.emplace_back(zdcDetId.rawId());
228  return vNeighborsDetId;
229  }
230  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() - 1);
231  vNeighborsDetId.emplace_back(zdcDetId.rawId());
232  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() + 1);
233  vNeighborsDetId.emplace_back(zdcDetId.rawId());
234  }
235  if (validRaw(zdcId) && zdcId.section() == HcalZDCDetId::LUM) {
236  bool isPositive = false;
237  if (zdcId.zside() == 1)
238  isPositive = true;
239  if (zdcId.channel() == 1) {
240  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() + 1);
241  vNeighborsDetId.emplace_back(zdcDetId.rawId());
242  return vNeighborsDetId;
243  }
244  if (zdcId.channel() == HcalZDCDetId::kDepLUM) {
245  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() - 1);
246  vNeighborsDetId.emplace_back(zdcDetId.rawId());
247  return vNeighborsDetId;
248  }
249  }
250  if (validRaw(zdcId) && zdcId.section() == HcalZDCDetId::RPD) {
251  bool isPositive = false;
252  if (zdcId.zside() == 1)
253  isPositive = true;
254  if (zdcId.channel() == 1) {
255  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() + 1);
256  vNeighborsDetId.emplace_back(zdcDetId.rawId());
257  return vNeighborsDetId;
258  }
259  if (zdcId.channel() == HcalZDCDetId::kDepRPD) {
260  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() - 1);
261  vNeighborsDetId.emplace_back(zdcDetId.rawId());
262  return vNeighborsDetId;
263  }
264  }
265  return vNeighborsDetId;
266 }
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:164
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

◆ mode()

HcalTopologyMode::Mode ZdcTopology::mode ( void  ) const
inline

Definition at line 20 of file ZdcTopology.h.

References mode_.

20 { return mode_; }
HcalTopologyMode::Mode mode_
Definition: ZdcTopology.h:77

◆ 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 301 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.

301  {
302  int ncells = 0;
303  switch (section) {
304  case (HcalZDCDetId::EM):
306  break;
307  case (HcalZDCDetId::HAD):
309  break;
310  case (HcalZDCDetId::LUM):
312  break;
313  case (HcalZDCDetId::RPD):
315  break;
316  case (HcalZDCDetId::Unknown):
317  ncells = 0;
318  break;
319  }
320  return ncells;
321 }
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 280 of file ZdcTopology.cc.

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

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

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

186  {
187  std::vector<DetId> vNeighborsDetId;
188  HcalZDCDetId zdcId = HcalZDCDetId(id);
189  HcalZDCDetId zdcDetId;
190  if (validRaw(zdcId) && zdcId.section() == HcalZDCDetId::EM) {
191  bool isPositive = false;
192  if (zdcId.zside() == 1)
193  isPositive = true;
194  if (zdcId.channel() == 1) {
195  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() + 1);
196  vNeighborsDetId.emplace_back(zdcDetId.rawId());
197  return vNeighborsDetId;
198  }
199  if (zdcId.channel() == HcalZDCDetId::kDepEM) {
200  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() - 1);
201  vNeighborsDetId.emplace_back(zdcDetId.rawId());
202  return vNeighborsDetId;
203  }
204  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() - 1);
205  vNeighborsDetId.emplace_back(zdcDetId.rawId());
206  zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.channel() + 1);
207  vNeighborsDetId.emplace_back(zdcDetId.rawId());
208  }
209  return vNeighborsDetId;
210 }
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:164
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 290 of file ZdcTopology.cc.

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

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

Referenced by HcalDigitizer::accumulateCaloHits(), and ZdcHardcodeGeometryLoader::fill().

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

◆ validDenseIndex()

bool ZdcTopology::validDenseIndex ( uint32_t  din) const
inline

Definition at line 57 of file ZdcTopology.h.

References cropTnPTrees::din, and kSizeForDenseIndexing().

Referenced by denseId2detId().

57 { return (din < kSizeForDenseIndexing()); }
uint32_t kSizeForDenseIndexing() const
Definition: ZdcTopology.cc:367

◆ validRaw()

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

Definition at line 164 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, HcalZDCDetId::Unknown, and ecaldqm::zside().

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

164  {
165  bool ok = true;
166  if (abs(id.zside()) != 1)
167  ok = false;
168  else if (id.channel() <= 0)
169  ok = false;
170  else if (!(id.section() == HcalZDCDetId::EM || id.section() == HcalZDCDetId::HAD ||
172  ok = false;
173  else if (id.section() == HcalZDCDetId::EM && id.channel() > HcalZDCDetId::kDepEM)
174  ok = false;
175  else if (id.section() == HcalZDCDetId::HAD && id.channel() > HcalZDCDetId::kDepHAD)
176  ok = false;
177  else if (id.section() == HcalZDCDetId::LUM && id.channel() > HcalZDCDetId::kDepLUM)
178  ok = false;
179  else if (id.section() == HcalZDCDetId::RPD && id.channel() > HcalZDCDetId::kDepRPD)
180  ok = false;
181  else if (id.section() == HcalZDCDetId::Unknown)
182  ok = false;
183  return ok;
184 }
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 274 of file ZdcTopology.cc.

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

Member Data Documentation

◆ excludeEM_

bool ZdcTopology::excludeEM_
private

Definition at line 81 of file ZdcTopology.h.

Referenced by exclude(), and isExcluded().

◆ excludeHAD_

bool ZdcTopology::excludeHAD_
private

Definition at line 81 of file ZdcTopology.h.

Referenced by exclude(), and isExcluded().

◆ excludeLUM_

bool ZdcTopology::excludeLUM_
private

Definition at line 81 of file ZdcTopology.h.

Referenced by exclude(), and isExcluded().

◆ excludeRPD_

bool ZdcTopology::excludeRPD_
private

Definition at line 81 of file ZdcTopology.h.

Referenced by exclude(), isExcluded(), and ZdcTopology().

◆ excludeZN_

bool ZdcTopology::excludeZN_
private

Definition at line 81 of file ZdcTopology.h.

Referenced by exclude().

◆ excludeZP_

bool ZdcTopology::excludeZP_
private

Definition at line 81 of file ZdcTopology.h.

Referenced by exclude().

◆ exclusionList_

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

Definition at line 79 of file ZdcTopology.h.

Referenced by exclude(), and isExcluded().

◆ firstEMModule_

int ZdcTopology::firstEMModule_
private

Definition at line 83 of file ZdcTopology.h.

Referenced by firstCell(), and firstEMModule().

◆ firstHADModule_

int ZdcTopology::firstHADModule_
private

Definition at line 83 of file ZdcTopology.h.

Referenced by firstCell(), and firstHADModule().

◆ firstLUMModule_

int ZdcTopology::firstLUMModule_
private

Definition at line 83 of file ZdcTopology.h.

Referenced by firstCell(), and firstLUMModule().

◆ firstRPDModule_

int ZdcTopology::firstRPDModule_
private

Definition at line 83 of file ZdcTopology.h.

Referenced by firstCell(), and firstRPDModule().

◆ hcons_

const HcalDDDRecConstants* ZdcTopology::hcons_
private

Definition at line 76 of file ZdcTopology.h.

Referenced by ZdcTopology().

◆ lastEMModule_

int ZdcTopology::lastEMModule_
private

Definition at line 83 of file ZdcTopology.h.

Referenced by lastCell(), and lastEMModule().

◆ lastHADModule_

int ZdcTopology::lastHADModule_
private

Definition at line 83 of file ZdcTopology.h.

Referenced by lastCell(), and lastHADModule().

◆ lastLUMModule_

int ZdcTopology::lastLUMModule_
private

Definition at line 83 of file ZdcTopology.h.

Referenced by lastCell(), and lastLUMModule().

◆ lastRPDModule_

int ZdcTopology::lastRPDModule_
private

Definition at line 83 of file ZdcTopology.h.

Referenced by lastCell(), and lastRPDModule().

◆ mode_

HcalTopologyMode::Mode ZdcTopology::mode_
private

Definition at line 77 of file ZdcTopology.h.

Referenced by kSizeForDenseIndexing(), mode(), and ZdcTopology().