test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HGCalDetId.h
Go to the documentation of this file.
1 #ifndef DataFormats_ForwardDetId_HGCalDetId_H
2 #define DataFormats_ForwardDetId_HGCalDetId_H 1
3 
4 #include <iosfwd>
7 
8 
9 class HGCalDetId : public DetId {
10 
11 public:
12  static const int kHGCalCellOffset = 0;
13  static const int kHGCalCellMask = 0xFFFF;
14  static const int kHGCalSectorOffset = 16;
15  static const int kHGCalSectorMask = 0x7F;
16  static const int kHGCalSubSectorOffset = 23;
17  static const int kHGCalSubSectorMask = 0x1;
18  static const int kHGCalLayerOffset = 24;
19  static const int kHGCalLayerMask = 0x7F;
20  static const int kHGCalZsideOffset = 31;
21  static const int kHGCalZsideMask = 0x1;
22 
24  HGCalDetId();
26  HGCalDetId(uint32_t rawid);
28  HGCalDetId(ForwardSubdetector subdet, int zp, int lay, int mod, int subsec, int cell);
30  HGCalDetId(const DetId& id);
32  HGCalDetId& operator=(const DetId& id);
33 
35  int cell() const { return id_&kHGCalCellMask; }
36 
38  int sector() const { return (id_>>kHGCalSectorOffset)&kHGCalSectorMask; }
39 
41  int subsector() const { return ( (id_>>kHGCalSubSectorOffset)&kHGCalSubSectorMask ? 1 : -1); }
42 
44  int layer() const { return (id_>>kHGCalLayerOffset)&kHGCalLayerMask; }
45 
47  int zside() const { return ((id_>>kHGCalZsideOffset) & kHGCalZsideMask ? 1 : -1); }
48 
50  bool isHGCal() const { return true; }
51  bool isForward() const { return true; }
52  static bool isValid(ForwardSubdetector subdet, int zp, int lay,
53  int mod, int subsec, int cell);
54 
55 };
56 
57 std::ostream& operator<<(std::ostream&,const HGCalDetId& id);
58 
59 #endif
static const int kHGCalLayerOffset
Definition: HGCalDetId.h:18
static const int kHGCalLayerMask
Definition: HGCalDetId.h:19
static const int kHGCalSubSectorMask
Definition: HGCalDetId.h:17
int sector() const
get the sector #
Definition: HGCalDetId.h:38
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
ForwardSubdetector
int subsector() const
get the degree subsector
Definition: HGCalDetId.h:41
static const int kHGCalCellOffset
Definition: HGCalDetId.h:12
static const int kHGCalCellMask
Definition: HGCalDetId.h:13
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCalDetId.h:47
static const int kHGCalSectorOffset
Definition: HGCalDetId.h:14
Definition: DetId.h:18
HGCalDetId & operator=(const DetId &id)
Definition: HGCalDetId.cc:42
static const int kHGCalZsideMask
Definition: HGCalDetId.h:21
int cell() const
get the absolute value of the cell #&#39;s in x and y
Definition: HGCalDetId.h:35
static bool isValid(ForwardSubdetector subdet, int zp, int lay, int mod, int subsec, int cell)
Definition: HGCalDetId.cc:47
uint32_t id_
Definition: DetId.h:55
bool isHGCal() const
consistency check : no bits left =&gt; no overhead
Definition: HGCalDetId.h:50
static const int kHGCalZsideOffset
Definition: HGCalDetId.h:20
static const int kHGCalSubSectorOffset
Definition: HGCalDetId.h:16
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
bool isForward() const
Definition: HGCalDetId.h:51
int layer() const
get the layer #
Definition: HGCalDetId.h:44
static const int kHGCalSectorMask
Definition: HGCalDetId.h:15