|
12 | 12 | [9:16] |ring| index (starting from a minimum radius depending on type) |
13 | 13 | [17:21] Layer # |
14 | 14 | [22] Trigger(1)/Detector(0) cell |
15 | | - [23] SiPM type (0 for 2mm: 1 for 4mm) |
16 | | - [24] Free |
| 15 | + [23] SiPM type (0 for Small: 1 for Large) |
| 16 | + [24] Granularity of the tile (0 normal; 1 fine) |
17 | 17 | [25:25] z-side (0 for +z; 1 for -z) |
18 | | - [26:27] Tile granularity and type (0 fine divisions of scintillators; |
19 | | - 1 coarse divisions of type "c"; |
20 | | - 2 coarse divisions of type "m") |
| 18 | + [26:27] Tile make (1 of type "c"; 2 of type "m") |
21 | 19 | [28:31] Detector type (HGCalHSc) |
22 | 20 | */ |
23 | 21 |
|
24 | 22 | class HGCScintillatorDetId : public DetId { |
25 | 23 | public: |
| 24 | + enum tileGranularity { HGCalTileNormal = 0, HGCalTileFine = 1 }; |
| 25 | + enum sipmType { HGCalSiPMSmall = 0, HGCalSiPMLarge = 1 }; |
| 26 | + enum tileType { HGCalTileTypeUnknown = 0, HGCalTileTypeCaste = 1, HGCalTileTypeMould = 2 }; |
26 | 27 | /** Create a null cellid*/ |
27 | 28 | constexpr HGCScintillatorDetId() : DetId() {} |
28 | 29 | /** Create cellid from raw id (0=invalid tower id) */ |
29 | 30 | constexpr HGCScintillatorDetId(uint32_t rawid) : DetId(rawid) {} |
30 | 31 | /** Constructor from subdetector, zplus, layer, module, cell numbers */ |
31 | | - constexpr HGCScintillatorDetId(int type, int layer, int ring, int phi, bool trigger = false, int sipm = 0) |
| 32 | + constexpr HGCScintillatorDetId( |
| 33 | + int type, int layer, int ring, int phi, bool trigger = false, int sipm = 0, int granularity = 0) |
32 | 34 | : DetId(HGCalHSc, ForwardEmpty) { |
33 | 35 | int zside = (ring < 0) ? 1 : 0; |
34 | 36 | int itrig = trigger ? 1 : 0; |
35 | 37 | int ringAbs = std::abs(ring); |
36 | 38 | id_ |= (((type & kHGCalTypeMask) << kHGCalTypeOffset) | ((zside & kHGCalZsideMask) << kHGCalZsideOffset) | |
37 | 39 | ((sipm & kHGCalSiPMMask) << kHGCalSiPMOffset) | ((itrig & kHGCalTriggerMask) << kHGCalTriggerOffset) | |
38 | 40 | ((layer & kHGCalLayerMask) << kHGCalLayerOffset) | ((ringAbs & kHGCalRadiusMask) << kHGCalRadiusOffset) | |
39 | | - ((phi & kHGCalPhiMask) << kHGCalPhiOffset)); |
| 41 | + ((phi & kHGCalPhiMask) << kHGCalPhiOffset) | |
| 42 | + ((granularity & kHGCalGranularityMask) << kHGCalGranularityOffset)); |
40 | 43 | } |
41 | 44 |
|
42 | 45 | /** Constructor from a generic cell id */ |
@@ -80,6 +83,11 @@ class HGCScintillatorDetId : public DetId { |
80 | 83 | id_ &= kHGCalTypeMask0; |
81 | 84 | id_ |= ((type & kHGCalTypeMask) << kHGCalTypeOffset); |
82 | 85 | } |
| 86 | + constexpr int granularity() const { return (id_ >> kHGCalGranularityOffset) & kHGCalGranularityMask; } |
| 87 | + constexpr void setGranularity(int granularity) { |
| 88 | + id_ &= kHGCalGranularityMask0; |
| 89 | + id_ |= ((granularity & kHGCalGranularityMask) << kHGCalGranularityOffset); |
| 90 | + } |
83 | 91 |
|
84 | 92 | /// get the z-side of the cell (1/-1) |
85 | 93 | constexpr int zside() const { return (((id_ >> kHGCalZsideOffset) & kHGCalZsideMask) ? -1 : 1); } |
@@ -145,6 +153,9 @@ class HGCScintillatorDetId : public DetId { |
145 | 153 | static constexpr int kHGCalTriggerMask = 0x1; |
146 | 154 | static constexpr int kHGCalSiPMOffset = 23; |
147 | 155 | static constexpr int kHGCalSiPMMask = 0x1; |
| 156 | + static constexpr int kHGCalGranularityOffset = 24; |
| 157 | + static constexpr int kHGCalGranularityMask = 0x1; |
| 158 | + static constexpr int kHGCalGranularityMask0 = 0xFFDFFFFF; |
148 | 159 | static constexpr int kHGCalSiPMMask0 = 0xFF7FFFFF; |
149 | 160 | static constexpr int kHGCalZsideOffset = 25; |
150 | 161 | static constexpr int kHGCalZsideMask = 0x1; |
|
0 commit comments