CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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()) {
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
constexpr bool null() const
is this a null id ?
Definition: DetId.h:59
static constexpr uint32_t kHcalPhiMask1
Definition: HcalDetId.h:14
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
int irow() const
get the row number
Definition: AHCalDetId.cc:29
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
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
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: DetId.h:17
static const AHCalDetId Undefined
Definition: AHCalDetId.h:42
uint32_t id_
Definition: DetId.h:69
static constexpr uint32_t kHcalEtaOffset1
Definition: HcalDetId.h:16
static constexpr int kMaxRowCol
Definition: AHCalDetId.h:45
static constexpr uint32_t kHcalEtaMask1
Definition: HcalDetId.h:18
int col
Definition: cuy.py:1009
static constexpr uint32_t kHcalDepthOffset1
Definition: HcalDetId.h:22
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46