CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HGCTriggerDetId.cc
Go to the documentation of this file.
3 #include <ostream>
4 #include <iostream>
5 
6 const uint32_t HGCTriggerDetId::cell_shift;
7 const uint32_t HGCTriggerDetId::cell_mask;
8 const uint32_t HGCTriggerDetId::module_mask;
9 const uint32_t HGCTriggerDetId::module_shift;
10 const uint32_t HGCTriggerDetId::sector_shift;
11 const uint32_t HGCTriggerDetId::sector_mask;
12 const uint32_t HGCTriggerDetId::layer_shift;
13 const uint32_t HGCTriggerDetId::layer_mask;
14 const uint32_t HGCTriggerDetId::zside_shift;
15 const uint32_t HGCTriggerDetId::zside_mask;
16 
18 
20 
21 HGCTriggerDetId::HGCTriggerDetId(uint32_t rawid) : DetId(rawid) {}
22 
23 HGCTriggerDetId::HGCTriggerDetId(ForwardSubdetector subdet, int zp, int lay, int sec, int mod, int cell)
24  : DetId(Forward, subdet) {
25  if (zp < 0)
26  zp = 0;
27 
33 }
34 
36  if (!gen.null()) {
38  if (gen.det() != Forward || (subdet != HGCTrigger)) {
39  throw cms::Exception("Invalid DetId")
40  << "Cannot initialize HGCTriggerDetId from " << std::hex << gen.rawId() << std::dec;
41  }
42  }
43  id_ = gen.rawId();
44 }
45 
47  if (!gen.null()) {
49  if (gen.det() != Forward || (subdet != HGCTrigger)) {
50  throw cms::Exception("Invalid DetId")
51  << "Cannot assign HGCTriggerDetId from " << std::hex << gen.rawId() << std::dec;
52  }
53  }
54  id_ = gen.rawId();
55  return (*this);
56 }
57 
58 std::ostream& operator<<(std::ostream& s, const HGCTriggerDetId& id) {
59  switch (id.subdet()) {
60  case (HGCTrigger):
61  return s << "isEE=" << id.isEE() << " zpos=" << id.zside() << " layer=" << id.layer() << " module=" << id.module()
62  << " sector=" << id.sector() << " cell=" << id.cell();
63  default:
64  return s << id.rawId();
65  }
66 }
constexpr bool null() const
is this a null id ?
Definition: DetId.h:59
static const uint32_t cell_shift
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
static const uint32_t cell_mask
ForwardSubdetector
static const uint32_t layer_shift
static const uint32_t zside_mask
static const uint32_t sector_mask
static const uint32_t layer_mask
static const uint32_t zside_shift
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
ForwardSubdetector subdet() const
get the subdetector
void setMaskedId(const uint32_t value, const uint32_t &shift, const uint32_t &mask)
static const uint32_t sector_shift
Definition: DetId.h:17
static const uint32_t module_shift
uint32_t id_
Definition: DetId.h:69
HGCTriggerDetId & operator=(const DetId &id)
static const HGCTriggerDetId Undefined
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
static const uint32_t module_mask
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46