CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HGCalTriggerBackendDetId.cc
Go to the documentation of this file.
3 #include <iostream>
4 
6 
8 
10  : DetId(Forward, HGCTrigger) {
12  int zside = (zp < 0) ? 1 : 0;
13  id_ |= (((label & kHGCalLabelMask) << kHGCalLabelOffset) | ((sector & kHGCalSectorMask) << kHGCalSectorOffset) |
14  ((zside & kHGCalZsideMask) << kHGCalZsideOffset) | ((type & kHGCalTypeMask) << kHGCalTypeOffset) |
16 }
17 
19  if (!gen.null()) {
20  if (gen.det() != Forward) {
21  throw cms::Exception("Invalid DetId")
22  << "Cannot initialize HGCalTriggerBackendDetId from " << std::hex << gen.rawId() << std::dec;
23  }
24  }
25  id_ = gen.rawId();
26 }
27 
29  if (!gen.null()) {
30  if (gen.det() != Forward) {
31  throw cms::Exception("Invalid DetId")
32  << "Cannot assign HGCalTriggerBackendDetId from " << std::hex << gen.rawId() << std::dec;
33  }
34  }
35  id_ = gen.rawId();
36  return (*this);
37 }
38 
39 std::ostream& operator<<(std::ostream& s, const HGCalTriggerBackendDetId& id) {
40  return s << "HGCalTriggerBackendDetId::lpGBT:Stage1 FPGA:Stage2 FPGA= " << id.isLpGBT() << ":" << id.isStage1FPGA()
41  << ":" << id.isStage1Link() << ":" << id.isStage2FPGA() << " z= " << id.zside() << " sector= " << id.sector()
42  << " id= " << id.label();
43 }
static const int kHGCalTriggerClassIdentifierMask
int zside() const
get the z-side of the backend object (1/-1)
constexpr bool null() const
is this a null id ?
Definition: DetId.h:59
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
char const * label
HGCalTriggerBackendDetId & operator=(const DetId &id)
Definition: DetId.h:17
uint32_t id_
Definition: DetId.h:69
static const int kHGCalTriggerClassIdentifierOffset
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46