CMS 3D CMS Logo

HGCHEDetId.h
Go to the documentation of this file.
1 #ifndef DataFormats_ForwardDetId_HGCHEDetId_H
2 #define DataFormats_ForwardDetId_HGCHEDetId_H 1
3 
4 #include <iosfwd>
7 
8 class HGCHEDetId : public DetId {
9 public:
10  static const int kHGCHECellOffset = 0;
11  static const int kHGCHECellMask = 0xFFF;
12  static const int kHGCHESectorOffset = 12;
13  static const int kHGCHESectorMask = 0x3F;
14  static const int kHGCHESubSectorOffset = 18;
15  static const int kHGCHESubSectorMask = 0x1;
16  static const int kHGCHELayerOffset = 19;
17  static const int kHGCHELayerMask = 0x1F;
18  static const int kHGCHEZsideOffset = 24;
19  static const int kHGCHEZsideMask = 0x1;
21  HGCHEDetId();
23  HGCHEDetId(uint32_t rawid);
25  HGCHEDetId(ForwardSubdetector subdet, int zp, int lay, int mod, int subsec, int cell);
27  HGCHEDetId(const DetId& id);
29  HGCHEDetId& operator=(const DetId& id);
30 
34  HGCHEDetId geometryCell() const;
35 
38 
40  int cell() const { return id_ & kHGCHECellMask; }
41 
43  int sector() const { return (id_ >> kHGCHESectorOffset) & kHGCHESectorMask; }
44 
46  int subsector() const { return ((id_ >> kHGCHESubSectorOffset) & kHGCHESubSectorMask ? 1 : -1); }
47 
49  int layer() const { return (id_ >> kHGCHELayerOffset) & kHGCHELayerMask; }
50 
52  int zside() const { return ((id_ >> kHGCHEZsideOffset) & kHGCHEZsideMask ? 1 : -1); }
53 
55  bool isHE() const { return true; }
56  bool isForward() const { return true; }
57 
58  static const HGCHEDetId Undefined;
59 };
60 
61 std::ostream& operator<<(std::ostream&, const HGCHEDetId& id);
62 
63 #endif
HGCHEDetId::cell
int cell() const
get the absolute value of the cell #'s in x and y
Definition: HGCHEDetId.h:40
HGCHEDetId::layer
int layer() const
get the layer #
Definition: HGCHEDetId.h:49
ForwardSubdetector
ForwardSubdetector
Definition: ForwardSubdetector.h:4
mod
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
HGCHEDetId::isForward
bool isForward() const
Definition: HGCHEDetId.h:56
HGCHEDetId::kHGCHESectorMask
static const int kHGCHESectorMask
Definition: HGCHEDetId.h:13
HGCHEDetId::kHGCHEZsideOffset
static const int kHGCHEZsideOffset
Definition: HGCHEDetId.h:18
HGCHEDetId::HGCHEDetId
HGCHEDetId()
Definition: HGCHEDetId.cc:7
HGCHEDetId::kHGCHEZsideMask
static const int kHGCHEZsideMask
Definition: HGCHEDetId.h:19
ForwardSubdetector.h
HGCHEDetId::isHE
bool isHE() const
consistency check
Definition: HGCHEDetId.h:55
DetId
Definition: DetId.h:17
HGCHEDetId::sector
int sector() const
get the sector #
Definition: HGCHEDetId.h:43
HGCHEDetId::geometryCell
HGCHEDetId geometryCell() const
Definition: HGCHEDetId.cc:46
HGCHEDetId::kHGCHECellMask
static const int kHGCHECellMask
Definition: HGCHEDetId.h:11
HGCHEDetId::kHGCHESubSectorOffset
static const int kHGCHESubSectorOffset
Definition: HGCHEDetId.h:14
HGCHEDetId::operator=
HGCHEDetId & operator=(const DetId &id)
Definition: HGCHEDetId.cc:34
HGCHEDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCHEDetId.h:52
HGCHEDetId::subdet
ForwardSubdetector subdet() const
get the subdetector
Definition: HGCHEDetId.h:37
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
HGCHEDetId::Undefined
static const HGCHEDetId Undefined
Definition: HGCHEDetId.h:58
DetId::id_
uint32_t id_
Definition: DetId.h:69
HGCHEDetId::kHGCHELayerOffset
static const int kHGCHELayerOffset
Definition: HGCHEDetId.h:16
HGCHEDetId::kHGCHECellOffset
static const int kHGCHECellOffset
Definition: HGCHEDetId.h:10
HGCHEDetId
Definition: HGCHEDetId.h:8
DetId.h
HGCHEDetId::kHGCHESubSectorMask
static const int kHGCHESubSectorMask
Definition: HGCHEDetId.h:15
HGCHEDetId::subsector
int subsector() const
get the degree subsector
Definition: HGCHEDetId.h:46
HGCHEDetId::kHGCHESectorOffset
static const int kHGCHESectorOffset
Definition: HGCHEDetId.h:12
operator<<
std::ostream & operator<<(std::ostream &, const HGCHEDetId &id)
Definition: HGCHEDetId.cc:51
HGCHEDetId::kHGCHELayerMask
static const int kHGCHELayerMask
Definition: HGCHEDetId.h:17