Skip to content

Commit 760b5a9

Browse files
authored
Merge pull request #48571 from CMS-HGCAL/hgcalmapping_SiPMupdatePR
Updates for new HGCal SiPM channel mapping
2 parents 7afbaa6 + b1d2732 commit 760b5a9

File tree

6 files changed

+610
-7
lines changed

6 files changed

+610
-7
lines changed

Geometry/HGCalMapping/interface/HGCalMappingTools.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ namespace hgcal {
6464
uint32_t getElectronicsId(
6565
bool zside, uint16_t fedid, uint16_t captureblock, uint16_t econdidx, int cellchip, int cellhalf, int cellseq);
6666
uint32_t getSiDetId(bool zside, int moduleplane, int moduleu, int modulev, int celltype, int celliu, int celliv);
67-
uint32_t getSiPMDetId(bool zside, int moduleplane, int modulev, int celltype, int celliu, int celliv);
67+
uint32_t getSiPMDetId(
68+
bool zside, int moduleplane, int modulev, int celltype, int celliu, int celliv, bool isHD = false);
6869

6970
/**
7071
* @short matches the module and cell info by detId and returns their indices (-1 is used in case index was not found)

Geometry/HGCalMapping/plugins/HGCalMappingESProducer.cc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,15 @@ void HGCalMappingESProducer::prepareModuleMapperIndexer() {
115115
if (matched) {
116116
wtypecode = typecode_match[1].str(); // wafer type following MM-T pattern, e.g. "MH-F"
117117
} else {
118-
edm::LogWarning("HGCalMappingIndexESSource")
119-
<< "Could not match module type code to expected pattern: " << typecode;
118+
const std::regex sipm_typecode_regex(R"(T[LH]-L\d{2}S\d)");
119+
std::smatch sipm_typecode_match; // match object for string objects
120+
matched = std::regex_match(typecode, sipm_typecode_match, sipm_typecode_regex);
121+
if (matched) {
122+
wtypecode = sipm_typecode_match[0].str(); // assign sipm typecode as wafer type
123+
} else {
124+
throw cms::Exception("HGCalMappingIndexESSource")
125+
<< "Could not match module type code to expected pattern: " << typecode;
126+
}
120127
}
121128

122129
try {

Geometry/HGCalMapping/plugins/alpaka/HGCalMappingCellESProducer.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
119119
if (isSiPM) {
120120
i1 = pmap.getIntAttr("iring", row);
121121
i2 = pmap.getIntAttr("iphi", row);
122+
isHD = {typecode.find("TH") != std::string::npos ? true : false};
122123
} else {
123124
i1 = pmap.getIntAttr("iu", row);
124125
i2 = pmap.getIntAttr("iv", row);

0 commit comments

Comments
 (0)