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 
12  int icol = (col > 0) ? col : kMaxRowCol - col;
13  int irow = (row > 0) ? row : kMaxRowCol - row;
16 }
17 
19  if (!gen.null()) {
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 }
constexpr bool null() const
is this a null id ?
Definition: DetId.h:59
static uint32_t kHcalZsideMask1
Definition: HcalDetId.h:20
static uint32_t kHcalEtaOffset1
Definition: HcalDetId.h:16
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
int irow() const
get the row number
Definition: AHCalDetId.cc:29
HcalSubdetector subdet() const
get the subdetector
Definition: AHCalDetId.h:30
int depth() const
get the layer number
Definition: AHCalDetId.cc:43
int icol() const
get the column number
Definition: AHCalDetId.cc:36
static uint32_t kHcalDepthOffset1
Definition: HcalDetId.h:22
static uint32_t kHcalPhiMask1
Definition: HcalDetId.h:14
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
HcalSubdetector
Definition: HcalAssistant.h:31
Definition: value.py:1
std::ostream & operator<<(std::ostream &s, const AHCalDetId &id)
Definition: AHCalDetId.cc:45
static uint32_t kHcalEtaMask1
Definition: HcalDetId.h:18
static uint32_t kHcalDepthMask
Definition: AHCalDetId.h:46
Definition: DetId.h:17
static const AHCalDetId Undefined
Definition: AHCalDetId.h:42
static int kMaxRowCol
Definition: AHCalDetId.h:45
uint32_t id_
Definition: DetId.h:69
col
Definition: cuy.py:1010
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46