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:24] Reserved for future extension
15  [25:25] z-side (0 for +z; 1 for -z)
16  [26:27] Type (0 fine divisions of scintillators;
17  1 coarse divisions of scintillators)
18  [28:31] Detector type (HGCalHSc)
19 */
20 
21 class HGCScintillatorDetId : public DetId {
22 public:
26  HGCScintillatorDetId(uint32_t rawid);
28  HGCScintillatorDetId(int type, int layer, int iradius, int iphi, bool trigger = false);
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 
50  int iradiusAbs() const;
51  int iradius() const { return zside() * iradiusAbs(); }
52  int ietaAbs() const { return iradiusAbs(); }
53  int ieta() const { return zside() * ietaAbs(); }
54 
56  int iphi() const;
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  std::vector<HGCScintillatorDetId> detectorCells() const;
62  bool trigger() const { return (((id_ >> kHGCalTriggerOffset) & kHGCalTriggerMask) == 1); }
64 
66  bool isEE() const { return false; }
67  bool isHE() const { return true; }
68  bool isForward() const { return true; }
69 
71 
72 public:
73  static const int kHGCalPhiOffset = 0;
74  static const int kHGCalPhiMask = 0x1FF;
75  static const int kHGCalRadiusOffset = 9;
76  static const int kHGCalRadiusMask = 0xFF;
77  static const int kHGCalLayerOffset = 17;
78  static const int kHGCalLayerMask = 0x1F;
79  static const int kHGCalTriggerOffset = 22;
80  static const int kHGCalTriggerMask = 0x1;
81  static const int kHGCalZsideOffset = 25;
82  static const int kHGCalZsideMask = 0x1;
83  static const int kHGCalTypeOffset = 26;
84  static const int kHGCalTypeMask = 0x3;
85 
86  int iradiusTriggerAbs() const;
87  int iradiusTrigger() const { return zside() * iradiusTriggerAbs(); }
88  int iphiTrigger() const;
89 };
90 
91 std::ostream& operator<<(std::ostream&, const HGCScintillatorDetId& id);
92 
93 #endif
HGCScintillatorDetId::subdet
DetId::Detector subdet() const
get the subdetector
Definition: HGCScintillatorDetId.h:38
HGCScintillatorDetId::iradiusAbs
int iradiusAbs() const
get the eta index
Definition: HGCScintillatorDetId.cc:43
HGCScintillatorDetId::iphi
int iphi() const
get the phi index
Definition: HGCScintillatorDetId.cc:57
HGCScintillatorDetId::isForward
bool isForward() const
Definition: HGCScintillatorDetId.h:68
operator<<
std::ostream & operator<<(std::ostream &, const HGCScintillatorDetId &id)
Definition: HGCScintillatorDetId.cc:102
HGCScintillatorDetId::ieta
int ieta() const
Definition: HGCScintillatorDetId.h:53
HGCScintillatorDetId::kHGCalTypeOffset
static const int kHGCalTypeOffset
Definition: HGCScintillatorDetId.h:83
HGCScintillatorDetId::kHGCalTriggerOffset
static const int kHGCalTriggerOffset
Definition: HGCScintillatorDetId.h:79
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:80
HGCScintillatorDetId::iphiTrigger
int iphiTrigger() const
Definition: HGCScintillatorDetId.cc:64
HGCScintillatorDetId::kHGCalTypeMask
static const int kHGCalTypeMask
Definition: HGCScintillatorDetId.h:84
HGCScintillatorDetId::iradiusTrigger
int iradiusTrigger() const
Definition: HGCScintillatorDetId.h:87
HGCScintillatorDetId::geometryCell
HGCScintillatorDetId geometryCell() const
Definition: HGCScintillatorDetId.cc:87
HGCScintillatorDetId::isHE
bool isHE() const
Definition: HGCScintillatorDetId.h:67
HGCScintillatorDetId::detectorCells
std::vector< HGCScintillatorDetId > detectorCells() const
trigger or detector cell
Definition: HGCScintillatorDetId.cc:71
ForwardSubdetector.h
HGCScintillatorDetId::layer
int layer() const
get the layer #
Definition: HGCScintillatorDetId.h:47
HGCScintillatorDetId::iradiusTriggerAbs
int iradiusTriggerAbs() const
Definition: HGCScintillatorDetId.cc:50
DetId
Definition: DetId.h:17
HGCScintillatorDetId::ietaphi
std::pair< int, int > ietaphi() const
Definition: HGCScintillatorDetId.h:57
HGCScintillatorDetId::trigger
bool trigger() const
Definition: HGCScintillatorDetId.h:62
HGCScintillatorDetId::ietaAbs
int ietaAbs() const
Definition: HGCScintillatorDetId.h:52
HGCScintillatorDetId::kHGCalLayerMask
static const int kHGCalLayerMask
Definition: HGCScintillatorDetId.h:78
HGCScintillatorDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCScintillatorDetId.h:44
HGCScintillatorDetId::triggerCell
HGCScintillatorDetId triggerCell() const
Definition: HGCScintillatorDetId.cc:95
DetId::id_
uint32_t id_
Definition: DetId.h:69
HGCScintillatorDetId::Undefined
static const HGCScintillatorDetId Undefined
Definition: HGCScintillatorDetId.h:70
HGCScintillatorDetId::kHGCalRadiusOffset
static const int kHGCalRadiusOffset
Definition: HGCScintillatorDetId.h:75
HGCScintillatorDetId::iradius
int iradius() const
Definition: HGCScintillatorDetId.h:51
HGCScintillatorDetId::isEE
bool isEE() const
consistency check : no bits left => no overhead
Definition: HGCScintillatorDetId.h:66
HGCScintillatorDetId::kHGCalPhiOffset
static const int kHGCalPhiOffset
Definition: HGCScintillatorDetId.h:73
HGCScintillatorDetId::operator=
HGCScintillatorDetId & operator=(const DetId &id)
Definition: HGCScintillatorDetId.cc:32
HGCScintillatorDetId::kHGCalRadiusMask
static const int kHGCalRadiusMask
Definition: HGCScintillatorDetId.h:76
HGCScintillatorDetId::type
int type() const
get the type
Definition: HGCScintillatorDetId.h:41
DetId::Detector
Detector
Definition: DetId.h:24
HGCScintillatorDetId::kHGCalPhiMask
static const int kHGCalPhiMask
Definition: HGCScintillatorDetId.h:74
HGCScintillatorDetId::HGCScintillatorDetId
HGCScintillatorDetId()
Definition: HGCScintillatorDetId.cc:8
type
type
Definition: HCALResponse.h:21
HGCScintillatorDetId::kHGCalZsideMask
static const int kHGCalZsideMask
Definition: HGCScintillatorDetId.h:82
DetId.h
HGCScintillatorDetId
Definition: HGCScintillatorDetId.h:21
HGCScintillatorDetId::kHGCalZsideOffset
static const int kHGCalZsideOffset
Definition: HGCScintillatorDetId.h:81
HGCScintillatorDetId::iradiusphi
std::pair< int, int > iradiusphi() const
Definition: HGCScintillatorDetId.h:58
trigger
Definition: HLTPrescaleTableCond.h:8
HGCScintillatorDetId::kHGCalLayerOffset
static const int kHGCalLayerOffset
Definition: HGCScintillatorDetId.h:77