CMS 3D CMS Logo

AHCalDetId.cc
Go to the documentation of this file.
2 #include <ostream>
4 
5 const AHCalDetId AHCalDetId::Undefined(0, 0, 0);
6 
8 
9 AHCalDetId::AHCalDetId(uint32_t rawid) : DetId(rawid) {}
10 
11 AHCalDetId::AHCalDetId(int row, int col, int depth) : DetId(Hcal, HcalOther) {
12  int icol = (col > 0) ? col : kMaxRowCol - col;
13  int irow = (row > 0) ? row : kMaxRowCol - row;
16 }
17 
19  if (!gen.null()) {
20  HcalSubdetector subdet = (HcalSubdetector(gen.subdetId()));
21  if (gen.det() != Hcal || subdet != HcalOther) {
22  throw cms::Exception("Invalid DetId")
23  << "Cannot initialize AHCalDetId from " << std::hex << gen.rawId() << std::dec;
24  }
25  }
26  id_ = gen.rawId();
27 }
28 
29 int AHCalDetId::irow() const {
31  if (value >= kMaxRowCol)
32  value = (kMaxRowCol - value);
33  return value;
34 }
35 
36 int AHCalDetId::icol() const {
38  if (value >= kMaxRowCol)
39  value = (kMaxRowCol - value);
40  return value;
41 }
42 
44 
45 std::ostream& operator<<(std::ostream& s, const AHCalDetId& id) {
46  return s << "(AHCal " << id.irow() << ',' << id.icol() << ',' << id.depth() << ')';
47 }
static constexpr uint32_t kHcalDepthMask
Definition: AHCalDetId.h:46
static constexpr uint32_t kHcalZsideMask1
Definition: HcalDetId.h:20
int icol() const
get the column number
Definition: AHCalDetId.cc:36
static constexpr uint32_t kHcalPhiMask1
Definition: HcalDetId.h:14
HcalSubdetector
Definition: HcalAssistant.h:31
Definition: value.py:1
HcalSubdetector subdet() const
get the subdetector
Definition: AHCalDetId.h:30
std::ostream & operator<<(std::ostream &s, const AHCalDetId &id)
Definition: AHCalDetId.cc:45
Definition: DetId.h:17
static const AHCalDetId Undefined
Definition: AHCalDetId.h:42
uint32_t id_
Definition: DetId.h:69
int irow() const
get the row number
Definition: AHCalDetId.cc:29
static constexpr uint32_t kHcalEtaOffset1
Definition: HcalDetId.h:16
static constexpr int kMaxRowCol
Definition: AHCalDetId.h:45
col
Definition: cuy.py:1009
static constexpr uint32_t kHcalEtaMask1
Definition: HcalDetId.h:18
int depth() const
get the layer number
Definition: AHCalDetId.cc:43
static constexpr uint32_t kHcalDepthOffset1
Definition: HcalDetId.h:22