CMS 3D CMS Logo

HGCScintillatorDetId.h
Go to the documentation of this file.
1 #ifndef DataFormats_ForwardDetId_HGCScintillatorDetId_H
2 #define DataFormats_ForwardDetId_HGCScintillatorDetId_H 1
3 
4 #include <iosfwd>
7 
8 /* \brief description of the bit assigment
9  [0:8] iphi index wrt x-axis on +z side
10  [9:16] |radius| index (starting from a minimum radius depending on type)
11  [17:21] Layer #
12  [22:24] Reserved for future extension
13  [25:25] z-side (0 for +z; 1 for -z)
14  [26:27] Type (0 fine divisions of scintillators;
15  1 coarse divisions of scintillators)
16  [28:31] Detector type (HGCalHSc)
17 */
18 
19 class HGCScintillatorDetId : public DetId {
20 
21 public:
22 
26  HGCScintillatorDetId(uint32_t rawid);
28  HGCScintillatorDetId(int type, int layer, int iradius, int iphi);
30  HGCScintillatorDetId(const DetId& id);
33 
36 
38  DetId::Detector subdet() const { return det(); }
39 
41  int type() const { return (id_>>kHGCalTypeOffset)&kHGCalTypeMask; }
42 
44  int zside() const { return (((id_>>kHGCalZsideOffset) & kHGCalZsideMask) ? -1 : 1); }
45 
47  int layer() const { return (id_>>kHGCalLayerOffset)&kHGCalLayerMask; }
48 
51  int iradius() const { return zside()*iradiusAbs(); }
52  int ietaAbs() const { return (id_>>kHGCalRadiusOffset)&kHGCalRadiusMask; }
53  int ieta() const { return zside()*ietaAbs(); }
54 
56  int iphi() const { return (id_>>kHGCalPhiOffset)&kHGCalPhiMask; }
57  std::pair<int,int> ietaphi() const { return std::pair<int,int>(ieta(),iphi()); }
58  std::pair<int,int> iradiusphi() const { return std::pair<int,int>(iradius(),iphi()); }
59 
61  bool isEE() const { return false; }
62  bool isHE() const { return true; }
63  bool isForward() const { return true; }
64 
66 
67 public:
68 
69  static const int kHGCalPhiOffset = 0;
70  static const int kHGCalPhiMask = 0x1FF;
71  static const int kHGCalRadiusOffset = 9;
72  static const int kHGCalRadiusMask = 0xFF;
73  static const int kHGCalLayerOffset = 17;
74  static const int kHGCalLayerMask = 0x1F;
75  static const int kHGCalZsideOffset = 25;
76  static const int kHGCalZsideMask = 0x1;
77  static const int kHGCalTypeOffset = 26;
78  static const int kHGCalTypeMask = 0x3;
79 };
80 
81 std::ostream& operator<<(std::ostream&,const HGCScintillatorDetId& id);
82 
83 #endif
type
Definition: HCALResponse.h:21
int iradiusAbs() const
get the eta index
static const int kHGCalTypeOffset
int type() const
get the type
DetId::Detector subdet() const
get the subdetector
HGCScintillatorDetId & operator=(const DetId &id)
std::pair< int, int > ietaphi() const
static const int kHGCalLayerMask
static const int kHGCalRadiusOffset
int iphi() const
get the phi index
HGCScintillatorDetId geometryCell() const
static const HGCScintillatorDetId Undefined
Definition: DetId.h:18
static const int kHGCalRadiusMask
std::ostream & operator<<(std::ostream &, const HGCScintillatorDetId &id)
Detector
Definition: DetId.h:26
uint32_t id_
Definition: DetId.h:62
bool isEE() const
consistency check : no bits left => no overhead
static const int kHGCalPhiMask
int layer() const
get the layer #
int zside() const
get the z-side of the cell (1/-1)
static const int kHGCalZsideMask
static const int kHGCalZsideOffset
static const int kHGCalLayerOffset
static const int kHGCalTypeMask
static const int kHGCalPhiOffset
std::pair< int, int > iradiusphi() const
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39