CMS 3D CMS Logo

HGCHEDetId.h
Go to the documentation of this file.
1 #ifndef DataFormats_ForwardDetId_HGCHEDetId_H
2 #define DataFormats_ForwardDetId_HGCHEDetId_H 1
3 
4 #include <iosfwd>
7 
8 class HGCHEDetId : public DetId {
9 public:
10  static const int kHGCHECellOffset = 0;
11  static const int kHGCHECellMask = 0xFFF;
12  static const int kHGCHESectorOffset = 12;
13  static const int kHGCHESectorMask = 0x3F;
14  static const int kHGCHESubSectorOffset = 18;
15  static const int kHGCHESubSectorMask = 0x1;
16  static const int kHGCHELayerOffset = 19;
17  static const int kHGCHELayerMask = 0x1F;
18  static const int kHGCHEZsideOffset = 24;
19  static const int kHGCHEZsideMask = 0x1;
21  HGCHEDetId();
23  HGCHEDetId(uint32_t rawid);
25  HGCHEDetId(ForwardSubdetector subdet, int zp, int lay, int mod, int subsec, int cell);
27  HGCHEDetId(const DetId& id);
29  HGCHEDetId& operator=(const DetId& id);
30 
34  HGCHEDetId geometryCell() const;
35 
38 
40  int cell() const { return id_ & kHGCHECellMask; }
41 
43  int sector() const { return (id_ >> kHGCHESectorOffset) & kHGCHESectorMask; }
44 
46  int subsector() const { return ((id_ >> kHGCHESubSectorOffset) & kHGCHESubSectorMask ? 1 : -1); }
47 
49  int layer() const { return (id_ >> kHGCHELayerOffset) & kHGCHELayerMask; }
50 
52  int zside() const { return ((id_ >> kHGCHEZsideOffset) & kHGCHEZsideMask ? 1 : -1); }
53 
55  bool isHE() const { return true; }
56  bool isForward() const { return true; }
57 
58  static const HGCHEDetId Undefined;
59 };
60 
61 std::ostream& operator<<(std::ostream&, const HGCHEDetId& id);
62 
63 #endif
static const int kHGCHESubSectorOffset
Definition: HGCHEDetId.h:14
static const int kHGCHELayerOffset
Definition: HGCHEDetId.h:16
bool isForward() const
Definition: HGCHEDetId.h:56
static const int kHGCHESubSectorMask
Definition: HGCHEDetId.h:15
int cell() const
get the absolute value of the cell #&#39;s in x and y
Definition: HGCHEDetId.h:40
static const int kHGCHESectorOffset
Definition: HGCHEDetId.h:12
int layer() const
get the layer #
Definition: HGCHEDetId.h:49
static const int kHGCHECellOffset
Definition: HGCHEDetId.h:10
ForwardSubdetector
bool isHE() const
consistency check
Definition: HGCHEDetId.h:55
HGCHEDetId geometryCell() const
Definition: HGCHEDetId.cc:46
int subsector() const
get the degree subsector
Definition: HGCHEDetId.h:46
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static const int kHGCHELayerMask
Definition: HGCHEDetId.h:17
static const int kHGCHEZsideOffset
Definition: HGCHEDetId.h:18
static const int kHGCHEZsideMask
Definition: HGCHEDetId.h:19
Definition: DetId.h:17
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCHEDetId.h:52
uint32_t id_
Definition: DetId.h:69
static const int kHGCHECellMask
Definition: HGCHEDetId.h:11
static const int kHGCHESectorMask
Definition: HGCHEDetId.h:13
int sector() const
get the sector #
Definition: HGCHEDetId.h:43
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCHEDetId.h:37
static const HGCHEDetId Undefined
Definition: HGCHEDetId.h:58
HGCHEDetId & operator=(const DetId &id)
Definition: HGCHEDetId.cc:34
std::ostream & operator<<(std::ostream &, const HGCHEDetId &id)
Definition: HGCHEDetId.cc:51