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 
2 #ifndef DataFormats_ForwardDetId_HGCHEDetId_H
3 #define DataFormats_ForwardDetId_HGCHEDetId_H 1
4 
5 #include <iosfwd>
8 
9 
10 class HGCHEDetId : public DetId {
11 public:
12  static const int kHGCHECellOffset = 0;
13  static const int kHGCHECellMask = 0xFFF;
14  static const int kHGCHESectorOffset = 12;
15  static const int kHGCHESectorMask = 0x3F;
16  static const int kHGCHESubSectorOffset = 18;
17  static const int kHGCHESubSectorMask = 0x1;
18  static const int kHGCHELayerOffset = 19;
19  static const int kHGCHELayerMask = 0x1F;
20  static const int kHGCHEZsideOffset = 24;
21  static const int kHGCHEZsideMask = 0x1;
23  HGCHEDetId();
25  HGCHEDetId(uint32_t rawid);
27  HGCHEDetId(ForwardSubdetector subdet, int zp, int lay, int mod, int subsec, int cell);
29  HGCHEDetId(const DetId& id);
31  HGCHEDetId& operator=(const DetId& id);
32 
36  HGCHEDetId geometryCell () const;
37 
40 
42  int cell() const { return id_&kHGCHECellMask; }
43 
45  int sector() const { return (id_>>kHGCHESectorOffset)&kHGCHESectorMask; }
46 
48  int subsector() const { return ( (id_>>kHGCHESubSectorOffset)&kHGCHESubSectorMask ? 1 : -1); }
49 
51  int layer() const { return (id_>>kHGCHELayerOffset)&kHGCHELayerMask; }
52 
54  int zside() const { return ((id_>>kHGCHEZsideOffset) & kHGCHEZsideMask ? 1 : -1); }
55 
57  bool isHE() const { return true; }
58  bool isForward() const { return true; }
59 
60  static const HGCHEDetId Undefined;
61 
62 };
63 
64 std::ostream& operator<<(std::ostream&,const HGCHEDetId& id);
65 
66 #endif
67 
static const int kHGCHESubSectorOffset
Definition: HGCHEDetId.h:16
static const int kHGCHELayerOffset
Definition: HGCHEDetId.h:18
bool isForward() const
Definition: HGCHEDetId.h:58
static const int kHGCHESubSectorMask
Definition: HGCHEDetId.h:17
int cell() const
get the absolute value of the cell #&#39;s in x and y
Definition: HGCHEDetId.h:42
static const int kHGCHESectorOffset
Definition: HGCHEDetId.h:14
int layer() const
get the layer #
Definition: HGCHEDetId.h:51
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
static const int kHGCHECellOffset
Definition: HGCHEDetId.h:12
ForwardSubdetector
bool isHE() const
consistency check
Definition: HGCHEDetId.h:57
HGCHEDetId geometryCell() const
Definition: HGCHEDetId.cc:46
int subsector() const
get the degree subsector
Definition: HGCHEDetId.h:48
static const int kHGCHELayerMask
Definition: HGCHEDetId.h:19
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:20
static const int kHGCHEZsideMask
Definition: HGCHEDetId.h:21
Definition: DetId.h:18
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCHEDetId.h:54
uint32_t id_
Definition: DetId.h:55
static const int kHGCHECellMask
Definition: HGCHEDetId.h:13
static const int kHGCHESectorMask
Definition: HGCHEDetId.h:15
int sector() const
get the sector #
Definition: HGCHEDetId.h:45
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCHEDetId.h:39
static const HGCHEDetId Undefined
Definition: HGCHEDetId.h:60
HGCHEDetId & operator=(const DetId &id)
Definition: HGCHEDetId.cc:34