CMS 3D CMS Logo

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 class HGCEEDetId : public DetId {
9 public:
10  static const int kHGCEECellOffset = 0;
11  static const int kHGCEECellMask = 0xFFF;
12  static const int kHGCEESectorOffset = 12;
13  static const int kHGCEESectorMask = 0x3F;
14  static const int kHGCEESubSectorOffset = 18;
15  static const int kHGCEESubSectorMask = 0x1;
16  static const int kHGCEELayerOffset = 19;
17  static const int kHGCEELayerMask = 0x1F;
18  static const int kHGCEEZsideOffset = 24;
19  static const int kHGCEEZsideMask = 0x1;
20  enum { Subdet = HGCEE };
22  HGCEEDetId();
24  HGCEEDetId(uint32_t rawid);
26  HGCEEDetId(ForwardSubdetector subdet, int zp, int lay, int mod, int subsec, int cell);
28  HGCEEDetId(const DetId& id);
30  HGCEEDetId& operator=(const DetId& id);
31 
33  HGCEEDetId geometryCell() const { return HGCEEDetId(subdet(), zside(), layer(), sector(), 0, 0); }
34 
36  ForwardSubdetector subdet() const { return HGCEE; }
37 
39  int cell() const { return id_ & kHGCEECellMask; }
40 
42  int sector() const { return (id_ >> kHGCEESectorOffset) & kHGCEESectorMask; }
43 
45  int subsector() const { return ((id_ >> kHGCEESubSectorOffset) & kHGCEESubSectorMask ? 1 : -1); }
46 
48  int layer() const { return (id_ >> kHGCEELayerOffset) & kHGCEELayerMask; }
49 
51  int zside() const { return ((id_ >> kHGCEEZsideOffset) & kHGCEEZsideMask ? 1 : -1); }
52 
54  bool isEE() const { return true; }
55  bool isForward() const { return true; }
56 
57  static const HGCEEDetId Undefined;
58 };
59 
60 std::ostream& operator<<(std::ostream&, const HGCEEDetId& id);
61 
62 #endif
HGCEEDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCEEDetId.h:51
ForwardSubdetector
ForwardSubdetector
Definition: ForwardSubdetector.h:4
HGCEEDetId::kHGCEESubSectorMask
static const int kHGCEESubSectorMask
Definition: HGCEEDetId.h:15
HGCEEDetId::kHGCEEZsideOffset
static const int kHGCEEZsideOffset
Definition: HGCEEDetId.h:18
mod
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
HGCEEDetId::kHGCEESubSectorOffset
static const int kHGCEESubSectorOffset
Definition: HGCEEDetId.h:14
ForwardSubdetector.h
HGCEEDetId::kHGCEECellOffset
static const int kHGCEECellOffset
Definition: HGCEEDetId.h:10
HGCEEDetId::layer
int layer() const
get the layer #
Definition: HGCEEDetId.h:48
HGCEEDetId::operator=
HGCEEDetId & operator=(const DetId &id)
Definition: HGCEEDetId.cc:35
DetId
Definition: DetId.h:17
HGCEEDetId::kHGCEELayerMask
static const int kHGCEELayerMask
Definition: HGCEEDetId.h:17
HGCEEDetId::isEE
bool isEE() const
consistency check : no bits left => no overhead
Definition: HGCEEDetId.h:54
HGCEEDetId::kHGCEESectorOffset
static const int kHGCEESectorOffset
Definition: HGCEEDetId.h:12
HGCEE
Definition: ForwardSubdetector.h:8
HGCEEDetId::subdet
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCEEDetId.h:36
DetId::id_
uint32_t id_
Definition: DetId.h:69
HGCEEDetId::cell
int cell() const
get the absolute value of the cell #'s in x and y
Definition: HGCEEDetId.h:39
HGCEEDetId::geometryCell
HGCEEDetId geometryCell() const
Definition: HGCEEDetId.h:33
HGCEEDetId::kHGCEELayerOffset
static const int kHGCEELayerOffset
Definition: HGCEEDetId.h:16
HGCEEDetId::kHGCEEZsideMask
static const int kHGCEEZsideMask
Definition: HGCEEDetId.h:19
operator<<
std::ostream & operator<<(std::ostream &, const HGCEEDetId &id)
Definition: HGCEEDetId.cc:46
HGCEEDetId::subsector
int subsector() const
get the degree subsector
Definition: HGCEEDetId.h:45
HGCEEDetId::isForward
bool isForward() const
Definition: HGCEEDetId.h:55
HGCEEDetId::kHGCEECellMask
static const int kHGCEECellMask
Definition: HGCEEDetId.h:11
HGCEEDetId::sector
int sector() const
get the sector #
Definition: HGCEEDetId.h:42
DetId.h
HGCEEDetId::Subdet
Definition: HGCEEDetId.h:20
HGCEEDetId
Definition: HGCEEDetId.h:8
HGCEEDetId::HGCEEDetId
HGCEEDetId()
Definition: HGCEEDetId.cc:8
HGCEEDetId::Undefined
static const HGCEEDetId Undefined
Definition: HGCEEDetId.h:57
HGCEEDetId::kHGCEESectorMask
static const int kHGCEESectorMask
Definition: HGCEEDetId.h:13