Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Geometry/HGCalMapping/interface/HGCalMappingTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ namespace hgcal {
uint32_t getElectronicsId(
bool zside, uint16_t fedid, uint16_t captureblock, uint16_t econdidx, int cellchip, int cellhalf, int cellseq);
uint32_t getSiDetId(bool zside, int moduleplane, int moduleu, int modulev, int celltype, int celliu, int celliv);
uint32_t getSiPMDetId(bool zside, int moduleplane, int modulev, int celltype, int celliu, int celliv);
uint32_t getSiPMDetId(
bool zside, int moduleplane, int modulev, int celltype, int celliu, int celliv, bool isHD = false);

/**
* @short matches the module and cell info by detId and returns their indices (-1 is used in case index was not found)
Expand Down
11 changes: 9 additions & 2 deletions Geometry/HGCalMapping/plugins/HGCalMappingESProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,15 @@ void HGCalMappingESProducer::prepareModuleMapperIndexer() {
if (matched) {
wtypecode = typecode_match[1].str(); // wafer type following MM-T pattern, e.g. "MH-F"
} else {
edm::LogWarning("HGCalMappingIndexESSource")
<< "Could not match module type code to expected pattern: " << typecode;
const std::regex sipm_typecode_regex(R"(T[LH]-L\d{2}S\d)");
std::smatch sipm_typecode_match; // match object for string objects
matched = std::regex_match(typecode, sipm_typecode_match, sipm_typecode_regex);
if (matched) {
wtypecode = sipm_typecode_match[0].str(); // assign sipm typecode as wafer type
} else {
throw cms::Exception("HGCalMappingIndexESSource")
<< "Could not match module type code to expected pattern: " << typecode;
}
}

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
//identify special cases (Si vs SiPM, calib vs normal)
std::string typecode = pmap.getAttr("Typecode", row);
auto typeidx = cellIndexer.getEnumFromTypecode(typecode);
bool isSiPM = typecode.find("TM") != std::string::npos;
bool isSiPM = (typecode[0] == 'T');
int rocpin = pmap.getIntAttr("ROCpin", row);
int celltype = pmap.getIntAttr("t", row);
int i1(0), i2(0), sensorcell(0);
Expand All @@ -119,6 +119,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
if (isSiPM) {
i1 = pmap.getIntAttr("iring", row);
i2 = pmap.getIntAttr("iphi", row);
isHD = {typecode.find("TH") != std::string::npos ? true : false};
} else {
i1 = pmap.getIntAttr("iu", row);
i2 = pmap.getIntAttr("iv", row);
Expand Down
Loading