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 Era_Run3_cff::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 371 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().

371  {
372  if (validDenseIndex(di)) {
373  bool lz(false);
374  uint32_t dp(0);
376  if (di >= 2 * HcalZDCDetId::kDepRun1) {
378  se = HcalZDCDetId::RPD;
379  dp = 1 + ((di - 2 * HcalZDCDetId::kDepRun1) % HcalZDCDetId::kDepRPD);
380  } else {
381  lz = (di >= HcalZDCDetId::kDepRun1);
382  uint32_t in = (di % HcalZDCDetId::kDepRun1);
383  se = (in < HcalZDCDetId::kDepEM
386  dp = (se == HcalZDCDetId::EM ? in + 1
387  : (se == HcalZDCDetId::HAD ? in - HcalZDCDetId::kDepEM + 1
389  }
390  return static_cast<DetId>(HcalZDCDetId(se, lz, dp));
391  }
392  return DetId();
393 }
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 395 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().

395  {
396  HcalZDCDetId detId(id);
397  const int32_t se(detId.section());
398  uint32_t di = (detId.channel() - 1 +
399  (se == HcalZDCDetId::RPD
400  ? 2 * HcalZDCDetId::kDepRun1 + (detId.zside() < 0 ? 0 : HcalZDCDetId::kDepRPD)
401  : ((detId.zside() < 0 ? 0 : HcalZDCDetId::kDepRun1) +
402  (se == HcalZDCDetId::HAD
405  return di;
406 }
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 294 of file ZdcTopology.cc.

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

267  {
268  edm::LogVerbatim("ForwardGeom") << "ZdcTopology::east() not yet implemented";
269  std::vector<DetId> vNeighborsDetId;
270  return vNeighborsDetId;
271 }
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, EcalPhiSymFlatTableProducers_cfi::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, EcalPhiSymFlatTableProducers_cfi::id, HcalZDCDetId::LUM, create_idmaps::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 322 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().

322  {
323  int firstCell = 0;
324  switch (section) {
325  case (HcalZDCDetId::EM):
327  break;
328  case (HcalZDCDetId::HAD):
330  break;
331  case (HcalZDCDetId::LUM):
333  break;
334  case (HcalZDCDetId::RPD):
336  break;
337  case (HcalZDCDetId::Unknown):
338  firstCell = 0;
339  break;
340  }
341  return firstCell;
342 }
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:322
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, EcalPhiSymFlatTableProducers_cfi::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 = false;
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 344 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().

344  {
345  int lastCell = 0;
346  switch (section) {
347  case (HcalZDCDetId::EM):
349  break;
350  case (HcalZDCDetId::HAD):
352  break;
353  case (HcalZDCDetId::LUM):
355  break;
356  case (HcalZDCDetId::RPD):
358  break;
359  case (HcalZDCDetId::Unknown):
360  lastCell = 0;
361  break;
362  }
363  return lastCell;
364 }
int lastLUMModule_
Definition: ZdcTopology.h:83
int lastRPDModule_
Definition: ZdcTopology.h:83
int lastCell(HcalZDCDetId::Section section) const
Definition: ZdcTopology.cc:344
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 211 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().

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

300  {
301  int ncells = 0;
302  switch (section) {
303  case (HcalZDCDetId::EM):
305  break;
306  case (HcalZDCDetId::HAD):
308  break;
309  case (HcalZDCDetId::LUM):
311  break;
312  case (HcalZDCDetId::RPD):
314  break;
315  case (HcalZDCDetId::Unknown):
316  ncells = 0;
317  break;
318  }
319  return ncells;
320 }
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 279 of file ZdcTopology.cc.

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

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

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

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

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

◆ 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, 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 || id.section() == HcalZDCDetId::LUM))
171  else if (!(id.section() == HcalZDCDetId::EM || id.section() == HcalZDCDetId::HAD ||
173  ok = false;
174  else if (id.section() == HcalZDCDetId::EM && id.channel() > HcalZDCDetId::kDepEM)
175  ok = false;
176  else if (id.section() == HcalZDCDetId::HAD && id.channel() > HcalZDCDetId::kDepHAD)
177  ok = false;
178  else if (id.section() == HcalZDCDetId::LUM && id.channel() > HcalZDCDetId::kDepLUM)
179  ok = false;
180  else if (id.section() == HcalZDCDetId::RPD && id.channel() > HcalZDCDetId::kDepRPD)
181  ok = false;
182  return ok;
183 }
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 273 of file ZdcTopology.cc.

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