CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HGCalTriggerModuleDetId.cc
Go to the documentation of this file.
3 #include <iostream>
4 
6 
8 
10  HGCalTriggerSubdetector subdet, int zp, int type, int layer, int sector, int moduleU, int moduleV)
11  : DetId(Forward, HGCTrigger) {
13  int zside = (zp < 0) ? 1 : 0;
14 
15  id_ |=
16  (((moduleU & kHGCalModuleUMask) << kHGCalModuleUOffset) | ((moduleV & kHGCalModuleVMask) << kHGCalModuleVOffset) |
17  ((sector & kHGCalSectorMask) << kHGCalSectorOffset) | ((layer & kHGCalLayerMask) << kHGCalLayerOffset) |
18  ((zside & kHGCalZsideMask) << kHGCalZsideOffset) | ((type & kHGCalTypeMask) << kHGCalTypeOffset) |
21 }
22 
24  if (!gen.null()) {
25  if (gen.det() != Forward) {
26  throw cms::Exception("Invalid DetId")
27  << "Cannot initialize HGCalTriggerModuleDetId from " << std::hex << gen.rawId() << std::dec;
28  }
29  }
30  id_ = gen.rawId();
31 }
32 
34  if (!gen.null()) {
35  if (gen.det() != Forward) {
36  throw cms::Exception("Invalid DetId")
37  << "Cannot assign HGCalTriggerModuleDetId from " << std::hex << gen.rawId() << std::dec;
38  }
39  }
40  id_ = gen.rawId();
41  return (*this);
42 }
43 
44 std::ostream& operator<<(std::ostream& s, const HGCalTriggerModuleDetId& id) {
45  return s << "HGCalTriggerModuleDetId::HFNose:EE:HSil:HScin= " << id.isHFNose() << ":" << id.isEE() << ":"
46  << id.isHSilicon() << ":" << id.isHScintillator() << " type= " << id.type() << " z= " << id.zside()
47  << " layer= " << id.layer() << " sector= " << id.sector() << " module(u,v)= (" << id.moduleU() << ","
48  << id.moduleV() << ")";
49 }
HGCalTriggerSubdetector
int zside() const
get the z-side of the module (1/-1)
static const int kHGCalTriggerSubdetMask
static const int kHGCalTriggerClassIdentifierOffset
HGCalTriggerModuleDetId & operator=(const DetId &id)
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
static const int kHGCalModuleVOffset
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
static const int kHGCalModuleUOffset
constexpr std::array< uint8_t, layerIndexSize > layer
static const int kHGCalTriggerClassIdentifierMask
Definition: DetId.h:17
uint32_t id_
Definition: DetId.h:69
static const int kHGCalTriggerSubdetOffset
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46