CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
9 class HGCEEDetId : public DetId {
10 public:
11  static const int kHGCEECellOffset = 0;
12  static const int kHGCEECellMask = 0xFFF;
13  static const int kHGCEESectorOffset = 12;
14  static const int kHGCEESectorMask = 0x3F;
15  static const int kHGCEESubSectorOffset = 18;
16  static const int kHGCEESubSectorMask = 0x1;
17  static const int kHGCEELayerOffset = 19;
18  static const int kHGCEELayerMask = 0x1F;
19  static const int kHGCEEZsideOffset = 24;
20  static const int kHGCEEZsideMask = 0x1;
21  enum { Subdet=HGCEE};
23  HGCEEDetId();
25  HGCEEDetId(uint32_t rawid);
27  HGCEEDetId(ForwardSubdetector subdet, int zp, int lay, int mod, int subsec, int cell);
29  HGCEEDetId(const DetId& id);
31  HGCEEDetId& operator=(const DetId& id);
32 
34  HGCEEDetId geometryCell () const {return HGCEEDetId (subdet(), zside(), layer(), sector(), 0, 0);}
35 
37  ForwardSubdetector subdet() const { return HGCEE; }
38 
40  int cell() const { return id_&kHGCEECellMask; }
41 
43  int sector() const { return (id_>>kHGCEESectorOffset)&kHGCEESectorMask; }
44 
46  int subsector() const { return ( (id_>>kHGCEESubSectorOffset)&kHGCEESubSectorMask ? 1 : -1); }
47 
49  int layer() const { return (id_>>kHGCEELayerOffset)&kHGCEELayerMask; }
50 
52  int zside() const { return ((id_>>kHGCEEZsideOffset) & kHGCEEZsideMask ? 1 : -1); }
53 
55  bool isEE() const { return true; }
56  bool isForward() const { return true; }
57 
58  static const HGCEEDetId Undefined;
59 
60 };
61 
62 std::ostream& operator<<(std::ostream&,const HGCEEDetId& id);
63 
64 #endif
static const int kHGCEELayerMask
Definition: HGCEEDetId.h:18
static const int kHGCEECellMask
Definition: HGCEEDetId.h:12
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCEEDetId.h:37
int subsector() const
get the degree subsector
Definition: HGCEEDetId.h:46
int cell() const
get the absolute value of the cell #&#39;s in x and y
Definition: HGCEEDetId.h:40
static const int kHGCEELayerOffset
Definition: HGCEEDetId.h:17
static const int kHGCEEZsideMask
Definition: HGCEEDetId.h:20
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
ForwardSubdetector
static const int kHGCEESectorMask
Definition: HGCEEDetId.h:14
static const HGCEEDetId Undefined
Definition: HGCEEDetId.h:58
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCEEDetId.h:52
static const int kHGCEEZsideOffset
Definition: HGCEEDetId.h:19
Definition: DetId.h:18
int layer() const
get the layer #
Definition: HGCEEDetId.h:49
HGCEEDetId geometryCell() const
Definition: HGCEEDetId.h:34
uint32_t id_
Definition: DetId.h:55
static const int kHGCEESubSectorOffset
Definition: HGCEEDetId.h:15
bool isEE() const
consistency check : no bits left =&gt; no overhead
Definition: HGCEEDetId.h:55
static const int kHGCEESubSectorMask
Definition: HGCEEDetId.h:16
static const int kHGCEESectorOffset
Definition: HGCEEDetId.h:13
static const int kHGCEECellOffset
Definition: HGCEEDetId.h:11
HGCEEDetId & operator=(const DetId &id)
Definition: HGCEEDetId.cc:34
int sector() const
get the sector #
Definition: HGCEEDetId.h:43
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
bool isForward() const
Definition: HGCEEDetId.h:56