CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
9 class HGCHEDetId : public DetId {
10 public:
11  static const int kHGCHECellOffset = 0;
12  static const int kHGCHECellMask = 0xFFF;
13  static const int kHGCHESectorOffset = 12;
14  static const int kHGCHESectorMask = 0x3F;
15  static const int kHGCHESubSectorOffset = 18;
16  static const int kHGCHESubSectorMask = 0x1;
17  static const int kHGCHELayerOffset = 19;
18  static const int kHGCHELayerMask = 0x1F;
19  static const int kHGCHEZsideOffset = 24;
20  static const int kHGCHEZsideMask = 0x1;
22  HGCHEDetId();
24  HGCHEDetId(uint32_t rawid);
26  HGCHEDetId(ForwardSubdetector subdet, int zp, int lay, int mod, int subsec, int cell);
28  HGCHEDetId(const DetId& id);
30  HGCHEDetId& operator=(const DetId& id);
31 
35  HGCHEDetId geometryCell () const;
36 
39 
41  int cell() const { return id_&kHGCHECellMask; }
42 
44  int sector() const { return (id_>>kHGCHESectorOffset)&kHGCHESectorMask; }
45 
47  int subsector() const { return ( (id_>>kHGCHESubSectorOffset)&kHGCHESubSectorMask ? 1 : -1); }
48 
50  int layer() const { return (id_>>kHGCHELayerOffset)&kHGCHELayerMask; }
51 
53  int zside() const { return ((id_>>kHGCHEZsideOffset) & kHGCHEZsideMask ? 1 : -1); }
54 
56  bool isHE() const { return true; }
57  bool isForward() const { return true; }
58 
59  static const HGCHEDetId Undefined;
60 
61 };
62 
63 std::ostream& operator<<(std::ostream&,const HGCHEDetId& id);
64 
65 #endif
66 
static const int kHGCHESubSectorOffset
Definition: HGCHEDetId.h:15
static const int kHGCHELayerOffset
Definition: HGCHEDetId.h:17
bool isForward() const
Definition: HGCHEDetId.h:57
static const int kHGCHESubSectorMask
Definition: HGCHEDetId.h:16
int cell() const
get the absolute value of the cell #&#39;s in x and y
Definition: HGCHEDetId.h:41
static const int kHGCHESectorOffset
Definition: HGCHEDetId.h:13
int layer() const
get the layer #
Definition: HGCHEDetId.h:50
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
static const int kHGCHECellOffset
Definition: HGCHEDetId.h:11
ForwardSubdetector
bool isHE() const
consistency check
Definition: HGCHEDetId.h:56
HGCHEDetId geometryCell() const
Definition: HGCHEDetId.cc:46
int subsector() const
get the degree subsector
Definition: HGCHEDetId.h:47
static const int kHGCHELayerMask
Definition: HGCHEDetId.h:18
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
static const int kHGCHEZsideOffset
Definition: HGCHEDetId.h:19
static const int kHGCHEZsideMask
Definition: HGCHEDetId.h:20
Definition: DetId.h:18
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCHEDetId.h:53
uint32_t id_
Definition: DetId.h:55
static const int kHGCHECellMask
Definition: HGCHEDetId.h:12
static const int kHGCHESectorMask
Definition: HGCHEDetId.h:14
int sector() const
get the sector #
Definition: HGCHEDetId.h:44
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCHEDetId.h:38
static const HGCHEDetId Undefined
Definition: HGCHEDetId.h:59
HGCHEDetId & operator=(const DetId &id)
Definition: HGCHEDetId.cc:34