CMS 3D CMS Logo

HGCalTriggerBackendDetId.h
Go to the documentation of this file.
1 #ifndef DataFormats_ForwardDetId_HGCalTriggerBackendDetId_H
2 #define DataFormats_ForwardDetId_HGCalTriggerBackendDetId_H 1
3 
7 
8 /* \brief description of the bit assigment
9  [0:10] ID of the lpGBT or Stage 1 FPGA in sector 0
10  [11:12] sector (0,1,2 counter-clockwise from u-axis)
11  [13:15] Type (0 lpGBT
12  1 Stage 1 FPGA
13  2 Stage 1 link
14  3 Stage 2 FPGA)
15  [16:16] z-side (0 for +z; 1 for -z)
16  [19:23] reserved for future use
17  [24:24] Class identifier (0 for HGCalTriggerModuleDetID, 1 for HGCalTriggerBackendDetID)
18  [25:27] Subdetector Type (HGCTrigger)
19  [28:31] Detector type (Forward)
20 */
21 
23 public:
27  HGCalTriggerBackendDetId(uint32_t rawid);
29  HGCalTriggerBackendDetId(int zp, int type, int sector, int label);
34 
37 
39  int type() const { return (id_ >> kHGCalTypeOffset) & kHGCalTypeMask; }
40 
42  int zside() const { return ((id_ >> kHGCalZsideOffset) & kHGCalZsideMask ? -1 : 1); }
43 
45  int sector() const { return (id_ >> kHGCalSectorOffset) & kHGCalSectorMask; }
46 
48  int label() const { return (id_ >> kHGCalLabelOffset) & kHGCalLabelMask; }
49 
50  bool isLpGBT() const { return (type() == BackendType::LpGBT); }
51  bool isStage1FPGA() const { return (type() == BackendType::Stage1FPGA); }
52  bool isStage1Link() const { return (type() == BackendType::Stage1Link); }
53  bool isStage2FPGA() const { return (type() == BackendType::Stage2FPGA); }
54  bool isForward() const { return true; }
57 
59 
60  static const int kHGCalLabelOffset = 0;
61  static const int kHGCalLabelMask = 0x7FF;
62  static const int kHGCalSectorOffset = 11;
63  static const int kHGCalSectorMask = 0x3;
64  static const int kHGCalTypeOffset = 13;
65  static const int kHGCalTypeMask = 0x7;
66  static const int kHGCalZsideOffset = 16;
67  static const int kHGCalZsideMask = 0x1;
68  static const int kHGCalTriggerClassIdentifierOffset = 24;
69  static const int kHGCalTriggerClassIdentifierMask = 0x1;
70 
72 };
73 
74 std::ostream& operator<<(std::ostream&, const HGCalTriggerBackendDetId& id);
75 
76 #endif
static const int kHGCalTriggerClassIdentifierMask
int type() const
get the type
int zside() const
get the z-side of the backend object (1/-1)
HGCalTriggerBackendDetId & operator=(const DetId &id)
int classId() const
get the class
int sector() const
get the sector #
int label() const
get the value
Definition: DetId.h:17
uint32_t id_
Definition: DetId.h:69
static const HGCalTriggerBackendDetId Undefined
std::ostream & operator<<(std::ostream &, const HGCalTriggerBackendDetId &id)
static const int kHGCalTriggerClassIdentifierOffset