CMS 3D CMS Logo

HGCEEDetId.h
Go to the documentation of this file.
1 #ifndef DataFormats_ForwardDetId_HGCEEDetId_H
2 #define DataFormats_ForwardDetId_HGCEEDetId_H 1
3 
4 #include <iosfwd>
7 
8 class HGCEEDetId : public DetId {
9 public:
10  static const int kHGCEECellOffset = 0;
11  static const int kHGCEECellMask = 0xFFF;
12  static const int kHGCEESectorOffset = 12;
13  static const int kHGCEESectorMask = 0x3F;
14  static const int kHGCEESubSectorOffset = 18;
15  static const int kHGCEESubSectorMask = 0x1;
16  static const int kHGCEELayerOffset = 19;
17  static const int kHGCEELayerMask = 0x1F;
18  static const int kHGCEEZsideOffset = 24;
19  static const int kHGCEEZsideMask = 0x1;
20  enum { Subdet = HGCEE };
22  HGCEEDetId();
24  HGCEEDetId(uint32_t rawid);
26  HGCEEDetId(ForwardSubdetector subdet, int zp, int lay, int mod, int subsec, int cell);
28  HGCEEDetId(const DetId& id);
30  HGCEEDetId& operator=(const DetId& id);
31 
33  HGCEEDetId geometryCell() const { return HGCEEDetId(subdet(), zside(), layer(), sector(), 0, 0); }
34 
36  ForwardSubdetector subdet() const { return HGCEE; }
37 
39  int cell() const { return id_ & kHGCEECellMask; }
40 
42  int sector() const { return (id_ >> kHGCEESectorOffset) & kHGCEESectorMask; }
43 
45  int subsector() const { return ((id_ >> kHGCEESubSectorOffset) & kHGCEESubSectorMask ? 1 : -1); }
46 
48  int layer() const { return (id_ >> kHGCEELayerOffset) & kHGCEELayerMask; }
49 
51  int zside() const { return ((id_ >> kHGCEEZsideOffset) & kHGCEEZsideMask ? 1 : -1); }
52 
54  bool isEE() const { return true; }
55  bool isForward() const { return true; }
56 
57  static const HGCEEDetId Undefined;
58 };
59 
60 std::ostream& operator<<(std::ostream&, const HGCEEDetId& id);
61 
62 #endif
static const int kHGCEELayerMask
Definition: HGCEEDetId.h:17
static const int kHGCEECellMask
Definition: HGCEEDetId.h:11
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCEEDetId.h:36
int subsector() const
get the degree subsector
Definition: HGCEEDetId.h:45
int cell() const
get the absolute value of the cell #&#39;s in x and y
Definition: HGCEEDetId.h:39
static const int kHGCEELayerOffset
Definition: HGCEEDetId.h:16
static const int kHGCEEZsideMask
Definition: HGCEEDetId.h:19
ForwardSubdetector
static const int kHGCEESectorMask
Definition: HGCEEDetId.h:13
static const HGCEEDetId Undefined
Definition: HGCEEDetId.h:57
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCEEDetId.h:51
static const int kHGCEEZsideOffset
Definition: HGCEEDetId.h:18
std::ostream & operator<<(std::ostream &, const HGCEEDetId &id)
Definition: HGCEEDetId.cc:46
Definition: DetId.h:17
int layer() const
get the layer #
Definition: HGCEEDetId.h:48
HGCEEDetId geometryCell() const
Definition: HGCEEDetId.h:33
uint32_t id_
Definition: DetId.h:69
static const int kHGCEESubSectorOffset
Definition: HGCEEDetId.h:14
bool isEE() const
consistency check : no bits left => no overhead
Definition: HGCEEDetId.h:54
static const int kHGCEESubSectorMask
Definition: HGCEEDetId.h:15
static const int kHGCEESectorOffset
Definition: HGCEEDetId.h:12
static const int kHGCEECellOffset
Definition: HGCEEDetId.h:10
HGCEEDetId & operator=(const DetId &id)
Definition: HGCEEDetId.cc:35
int sector() const
get the sector #
Definition: HGCEEDetId.h:42
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
bool isForward() const
Definition: HGCEEDetId.h:55