CMS 3D CMS Logo

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 = 0xFF;
14  static const int kHGCalWaferOffset = 8;
15  static const int kHGCalWaferMask = 0x3FF;
16  static const int kHGCalWaferTypeOffset = 18;
17  static const int kHGCalWaferTypeMask = 0x1;
18  static const int kHGCalLayerOffset = 19;
19  static const int kHGCalLayerMask = 0x1F;
20  static const int kHGCalZsideOffset = 24;
21  static const int kHGCalZsideMask = 0x1;
22  static const int kHGCalMaskCell = 0xFFFBFF00;
23 
25  HGCalDetId();
27  HGCalDetId(uint32_t rawid);
29  HGCalDetId(ForwardSubdetector subdet, int zp, int lay, int wafertype, int wafer, int cell);
31  HGCalDetId(const DetId& id);
33  HGCalDetId& operator=(const DetId& id);
34 
37 
39  int cell() const { return id_&kHGCalCellMask; }
40 
42  int wafer() const { return (id_>>kHGCalWaferOffset)&kHGCalWaferMask; }
43 
45  int waferType() const { return ((id_>>kHGCalWaferTypeOffset)&kHGCalWaferTypeMask ? 1 : -1); }
46 
48  int layer() const { return (id_>>kHGCalLayerOffset)&kHGCalLayerMask; }
49 
51  int zside() const { return ((id_>>kHGCalZsideOffset) & kHGCalZsideMask ? 1 : -1); }
52 
54  bool isHGCal() const { return true; }
55  bool isForward() const { return true; }
56  static bool isValid(ForwardSubdetector subdet, int zp, int lay,
57  int wafertype, int wafer, int cell);
58 
59  static const HGCalDetId Undefined;
60 };
61 
62 
63 std::ostream& operator<<(std::ostream&,const HGCalDetId& id);
64 
65 #endif
static const int kHGCalLayerOffset
Definition: HGCalDetId.h:18
static const int kHGCalLayerMask
Definition: HGCalDetId.h:19
static const HGCalDetId Undefined
Definition: HGCalDetId.h:59
static const int kHGCalWaferTypeOffset
Definition: HGCalDetId.h:16
ForwardSubdetector
std::ostream & operator<<(std::ostream &, const HGCalDetId &id)
Definition: HGCalDetId.cc:68
static const int kHGCalCellOffset
Definition: HGCalDetId.h:12
static const int kHGCalCellMask
Definition: HGCalDetId.h:13
HGCalDetId geometryCell() const
Definition: HGCalDetId.h:36
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCalDetId.h:51
static const int kHGCalWaferTypeMask
Definition: HGCalDetId.h:17
int wafer() const
get the wafer #
Definition: HGCalDetId.h:42
static const int kHGCalMaskCell
Definition: HGCalDetId.h:22
Definition: DetId.h:18
HGCalDetId & operator=(const DetId &id)
Definition: HGCalDetId.cc:40
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:39
uint32_t id_
Definition: DetId.h:59
static const int kHGCalWaferOffset
Definition: HGCalDetId.h:14
bool isHGCal() const
consistency check : no bits left => no overhead
Definition: HGCalDetId.h:54
static bool isValid(ForwardSubdetector subdet, int zp, int lay, int wafertype, int wafer, int cell)
Definition: HGCalDetId.cc:45
int waferType() const
get the wafer type
Definition: HGCalDetId.h:45
static const int kHGCalZsideOffset
Definition: HGCalDetId.h:20
bool isForward() const
Definition: HGCalDetId.h:55
int layer() const
get the layer #
Definition: HGCalDetId.h:48
static const int kHGCalWaferMask
Definition: HGCalDetId.h:15