Skip to content

Commit 58f6467

Browse files
authored
Merge pull request #45383 from bsunanda/Phase2-hgx358E
Phase2-hgx358E Update the DetId for HGCal scintillator in view of changes for the V19 version of HGCal geometry
2 parents 6d5e056 + eb56536 commit 58f6467

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

DataFormats/ForwardDetId/interface/HGCScintillatorDetId.h

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,34 @@
1212
[9:16] |ring| index (starting from a minimum radius depending on type)
1313
[17:21] Layer #
1414
[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)
1717
[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")
2119
[28:31] Detector type (HGCalHSc)
2220
*/
2321

2422
class HGCScintillatorDetId : public DetId {
2523
public:
24+
enum tileGranularity { HGCalTileNormal = 0, HGCalTileFine = 1 };
25+
enum sipmType { HGCalSiPMSmall = 0, HGCalSiPMLarge = 1 };
26+
enum tileType { HGCalTileTypeUnknown = 0, HGCalTileTypeCaste = 1, HGCalTileTypeMould = 2 };
2627
/** Create a null cellid*/
2728
constexpr HGCScintillatorDetId() : DetId() {}
2829
/** Create cellid from raw id (0=invalid tower id) */
2930
constexpr HGCScintillatorDetId(uint32_t rawid) : DetId(rawid) {}
3031
/** 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)
3234
: DetId(HGCalHSc, ForwardEmpty) {
3335
int zside = (ring < 0) ? 1 : 0;
3436
int itrig = trigger ? 1 : 0;
3537
int ringAbs = std::abs(ring);
3638
id_ |= (((type & kHGCalTypeMask) << kHGCalTypeOffset) | ((zside & kHGCalZsideMask) << kHGCalZsideOffset) |
3739
((sipm & kHGCalSiPMMask) << kHGCalSiPMOffset) | ((itrig & kHGCalTriggerMask) << kHGCalTriggerOffset) |
3840
((layer & kHGCalLayerMask) << kHGCalLayerOffset) | ((ringAbs & kHGCalRadiusMask) << kHGCalRadiusOffset) |
39-
((phi & kHGCalPhiMask) << kHGCalPhiOffset));
41+
((phi & kHGCalPhiMask) << kHGCalPhiOffset) |
42+
((granularity & kHGCalGranularityMask) << kHGCalGranularityOffset));
4043
}
4144

4245
/** Constructor from a generic cell id */
@@ -80,6 +83,11 @@ class HGCScintillatorDetId : public DetId {
8083
id_ &= kHGCalTypeMask0;
8184
id_ |= ((type & kHGCalTypeMask) << kHGCalTypeOffset);
8285
}
86+
constexpr int granularity() const { return (id_ >> kHGCalGranularityOffset) & kHGCalGranularityMask; }
87+
constexpr void setGranularity(int granularity) {
88+
id_ &= kHGCalGranularityMask0;
89+
id_ |= ((granularity & kHGCalGranularityMask) << kHGCalGranularityOffset);
90+
}
8391

8492
/// get the z-side of the cell (1/-1)
8593
constexpr int zside() const { return (((id_ >> kHGCalZsideOffset) & kHGCalZsideMask) ? -1 : 1); }
@@ -145,6 +153,9 @@ class HGCScintillatorDetId : public DetId {
145153
static constexpr int kHGCalTriggerMask = 0x1;
146154
static constexpr int kHGCalSiPMOffset = 23;
147155
static constexpr int kHGCalSiPMMask = 0x1;
156+
static constexpr int kHGCalGranularityOffset = 24;
157+
static constexpr int kHGCalGranularityMask = 0x1;
158+
static constexpr int kHGCalGranularityMask0 = 0xFFDFFFFF;
148159
static constexpr int kHGCalSiPMMask0 = 0xFF7FFFFF;
149160
static constexpr int kHGCalZsideOffset = 25;
150161
static constexpr int kHGCalZsideMask = 0x1;

DataFormats/ForwardDetId/src/HGCScintillatorDetId.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ std::vector<HGCScintillatorDetId> HGCScintillatorDetId::detectorCells() const {
2222

2323
std::ostream& operator<<(std::ostream& s, const HGCScintillatorDetId& id) {
2424
return s << " HGCScintillatorDetId::EE:HE= " << id.isEE() << ":" << id.isHE() << " trigger= " << id.trigger()
25-
<< " type= " << id.type() << " SiPM= " << id.sipm() << " layer= " << id.layer() << " ring= " << id.iradius()
26-
<< ":" << id.iradiusTrigger() << " phi= " << id.iphi() << ":" << id.iphiTrigger();
25+
<< " granularity= " << id.granularity() << " type= " << id.type() << " SiPM= " << id.sipm()
26+
<< " layer= " << id.layer() << " ring= " << id.iradius() << ":" << id.iradiusTrigger()
27+
<< " phi= " << id.iphi() << ":" << id.iphiTrigger();
2728
}

0 commit comments

Comments
 (0)