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>
5 #include <vector>
8 
9 /* \brief description of the bit assigment
10  [0:8] iphi index wrt x-axis on +z side
11  [9:16] |radius| index (starting from a minimum radius depending on type)
12  [17:21] Layer #
13  [22] Trigger(1)/Detector(0) cell
14  [23] SiPM type (0 for 2mm: 1 for 4mm)
15  [24] Free
16  [25:25] z-side (0 for +z; 1 for -z)
17  [26:27] Tile granularity and type (0 fine divisions of scintillators;
18  1 coarse divisions of type "c";
19  2 coarse divisions of type "m")
20  [28:31] Detector type (HGCalHSc)
21 */
22 
23 class HGCScintillatorDetId : public DetId {
24 public:
28  HGCScintillatorDetId(uint32_t rawid);
30  HGCScintillatorDetId(int type, int layer, int iradius, int iphi, bool trigger = false, int sipm = 0);
32  HGCScintillatorDetId(const DetId& id);
35 
38 
40  DetId::Detector subdet() const { return det(); }
41 
43  int type() const { return (id_ >> kHGCalTypeOffset) & kHGCalTypeMask; }
44  void setType(int type);
45 
47  int zside() const { return (((id_ >> kHGCalZsideOffset) & kHGCalZsideMask) ? -1 : 1); }
48 
50  int layer() const { return (id_ >> kHGCalLayerOffset) & kHGCalLayerMask; }
51 
53  int iradiusAbs() const;
54  int iradius() const { return zside() * iradiusAbs(); }
55  int ietaAbs() const { return iradiusAbs(); }
56  int ieta() const { return zside() * ietaAbs(); }
57 
59  int iphi() const;
60  std::pair<int, int> ietaphi() const { return std::pair<int, int>(ieta(), iphi()); }
61  std::pair<int, int> iradiusphi() const { return std::pair<int, int>(iradius(), iphi()); }
62 
64  int sipm() const { return (id_ >> kHGCalSiPMOffset) & kHGCalSiPMMask; }
65  void setSiPM(int sipm);
66 
68  std::vector<HGCScintillatorDetId> detectorCells() const;
69  bool trigger() const { return (((id_ >> kHGCalTriggerOffset) & kHGCalTriggerMask) == 1); }
71 
73  bool isEE() const { return false; }
74  bool isHE() const { return true; }
75  bool isForward() const { return true; }
76 
78 
79 public:
80  static const int kHGCalPhiOffset = 0;
81  static const int kHGCalPhiMask = 0x1FF;
82  static const int kHGCalRadiusOffset = 9;
83  static const int kHGCalRadiusMask = 0xFF;
84  static const int kHGCalLayerOffset = 17;
85  static const int kHGCalLayerMask = 0x1F;
86  static const int kHGCalTriggerOffset = 22;
87  static const int kHGCalTriggerMask = 0x1;
88  static const int kHGCalSiPMOffset = 23;
89  static const int kHGCalSiPMMask = 0x1;
90  static const int kHGCalSiPMMask0 = 0xFF7FFFFF;
91  static const int kHGCalZsideOffset = 25;
92  static const int kHGCalZsideMask = 0x1;
93  static const int kHGCalTypeOffset = 26;
94  static const int kHGCalTypeMask = 0x3;
95  static const int kHGCalTypeMask0 = 0xF3FFFFFF;
96 
97  int iradiusTriggerAbs() const;
98  int iradiusTrigger() const { return zside() * iradiusTriggerAbs(); }
99  int iphiTrigger() const;
100 };
101 
102 std::ostream& operator<<(std::ostream&, const HGCScintillatorDetId& id);
103 
104 #endif
HGCScintillatorDetId::subdet
DetId::Detector subdet() const
get the subdetector
Definition: HGCScintillatorDetId.h:40
HGCScintillatorDetId::setType
void setType(int type)
Definition: HGCScintillatorDetId.cc:72
HGCScintillatorDetId::iradiusAbs
int iradiusAbs() const
get the eta index
Definition: HGCScintillatorDetId.cc:44
HGCScintillatorDetId::iphi
int iphi() const
get the phi index
Definition: HGCScintillatorDetId.cc:58
HGCScintillatorDetId::isForward
bool isForward() const
Definition: HGCScintillatorDetId.h:75
operator<<
std::ostream & operator<<(std::ostream &, const HGCScintillatorDetId &id)
Definition: HGCScintillatorDetId.cc:113
HGCScintillatorDetId::ieta
int ieta() const
Definition: HGCScintillatorDetId.h:56
HGCScintillatorDetId::kHGCalTypeOffset
static const int kHGCalTypeOffset
Definition: HGCScintillatorDetId.h:93
HGCScintillatorDetId::kHGCalTriggerOffset
static const int kHGCalTriggerOffset
Definition: HGCScintillatorDetId.h:86
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
HGCScintillatorDetId::kHGCalTriggerMask
static const int kHGCalTriggerMask
Definition: HGCScintillatorDetId.h:87
HGCScintillatorDetId::iphiTrigger
int iphiTrigger() const
Definition: HGCScintillatorDetId.cc:65
HGCScintillatorDetId::kHGCalTypeMask
static const int kHGCalTypeMask
Definition: HGCScintillatorDetId.h:94
HGCScintillatorDetId::iradiusTrigger
int iradiusTrigger() const
Definition: HGCScintillatorDetId.h:98
HGCScintillatorDetId::geometryCell
HGCScintillatorDetId geometryCell() const
Definition: HGCScintillatorDetId.cc:98
HGCScintillatorDetId::isHE
bool isHE() const
Definition: HGCScintillatorDetId.h:74
HGCScintillatorDetId::detectorCells
std::vector< HGCScintillatorDetId > detectorCells() const
trigger or detector cell
Definition: HGCScintillatorDetId.cc:82
ForwardSubdetector.h
HGCScintillatorDetId::layer
int layer() const
get the layer #
Definition: HGCScintillatorDetId.h:50
HGCScintillatorDetId::iradiusTriggerAbs
int iradiusTriggerAbs() const
Definition: HGCScintillatorDetId.cc:51
DetId
Definition: DetId.h:17
HGCScintillatorDetId::ietaphi
std::pair< int, int > ietaphi() const
Definition: HGCScintillatorDetId.h:60
HGCScintillatorDetId::trigger
bool trigger() const
Definition: HGCScintillatorDetId.h:69
HGCScintillatorDetId::ietaAbs
int ietaAbs() const
Definition: HGCScintillatorDetId.h:55
HGCScintillatorDetId::kHGCalSiPMMask0
static const int kHGCalSiPMMask0
Definition: HGCScintillatorDetId.h:90
HGCScintillatorDetId::kHGCalLayerMask
static const int kHGCalLayerMask
Definition: HGCScintillatorDetId.h:85
HGCScintillatorDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCScintillatorDetId.h:47
HGCScintillatorDetId::triggerCell
HGCScintillatorDetId triggerCell() const
Definition: HGCScintillatorDetId.cc:106
DetId::id_
uint32_t id_
Definition: DetId.h:69
HGCScintillatorDetId::Undefined
static const HGCScintillatorDetId Undefined
Definition: HGCScintillatorDetId.h:77
HGCScintillatorDetId::kHGCalRadiusOffset
static const int kHGCalRadiusOffset
Definition: HGCScintillatorDetId.h:82
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
HGCScintillatorDetId::iradius
int iradius() const
Definition: HGCScintillatorDetId.h:54
HGCScintillatorDetId::isEE
bool isEE() const
consistency check : no bits left => no overhead
Definition: HGCScintillatorDetId.h:73
HGCScintillatorDetId::kHGCalPhiOffset
static const int kHGCalPhiOffset
Definition: HGCScintillatorDetId.h:80
HGCScintillatorDetId::operator=
HGCScintillatorDetId & operator=(const DetId &id)
Definition: HGCScintillatorDetId.cc:33
HGCScintillatorDetId::kHGCalRadiusMask
static const int kHGCalRadiusMask
Definition: HGCScintillatorDetId.h:83
HGCScintillatorDetId::type
int type() const
get/set the type
Definition: HGCScintillatorDetId.h:43
DetId::Detector
Detector
Definition: DetId.h:24
HGCScintillatorDetId::kHGCalPhiMask
static const int kHGCalPhiMask
Definition: HGCScintillatorDetId.h:81
HGCScintillatorDetId::kHGCalSiPMOffset
static const int kHGCalSiPMOffset
Definition: HGCScintillatorDetId.h:88
HGCScintillatorDetId::HGCScintillatorDetId
HGCScintillatorDetId()
Definition: HGCScintillatorDetId.cc:8
HGCScintillatorDetId::kHGCalZsideMask
static const int kHGCalZsideMask
Definition: HGCScintillatorDetId.h:92
DetId.h
HGCScintillatorDetId
Definition: HGCScintillatorDetId.h:23
HGCScintillatorDetId::kHGCalZsideOffset
static const int kHGCalZsideOffset
Definition: HGCScintillatorDetId.h:91
HGCScintillatorDetId::setSiPM
void setSiPM(int sipm)
Definition: HGCScintillatorDetId.cc:77
HGCScintillatorDetId::iradiusphi
std::pair< int, int > iradiusphi() const
Definition: HGCScintillatorDetId.h:61
trigger
Definition: HLTPrescaleTableCond.h:8
HGCScintillatorDetId::kHGCalLayerOffset
static const int kHGCalLayerOffset
Definition: HGCScintillatorDetId.h:84
HGCScintillatorDetId::kHGCalTypeMask0
static const int kHGCalTypeMask0
Definition: HGCScintillatorDetId.h:95
HGCScintillatorDetId::sipm
int sipm() const
get/set the sipm size
Definition: HGCScintillatorDetId.h:64
HGCScintillatorDetId::kHGCalSiPMMask
static const int kHGCalSiPMMask
Definition: HGCScintillatorDetId.h:89