Skip to content

Commit

Permalink
Replace exception with warning for missing wafer in module mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
jbsauvan committed Jul 4, 2020
1 parent 498fe5f commit 561354d
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ class HGCalTriggerGeometryV9Imp2 : public HGCalTriggerGeometryBase {
edm::FileInPath l1tLinksMapping_;

// module related maps
std::unordered_map<unsigned, unsigned> wafer_to_module_;
std::unordered_multimap<unsigned, unsigned> module_to_wafers_;
// declared mutable to be able to cache missing modules
mutable std::unordered_map<unsigned, unsigned> wafer_to_module_;
mutable std::unordered_multimap<unsigned, unsigned> module_to_wafers_;
std::unordered_map<unsigned, unsigned> links_per_module_;

// Disconnected modules and layers
Expand Down Expand Up @@ -270,11 +271,15 @@ unsigned HGCalTriggerGeometryV9Imp2::getModuleFromTriggerCell(const unsigned tri
unsigned layer_with_offset = layerWithOffset(trigger_cell_id);
auto module_itr = wafer_to_module_.find(packLayerWaferId(layer_with_offset, waferu, waferv));
if (module_itr == wafer_to_module_.end()) {
throw cms::Exception("BadGeometry")
<< trigger_cell_trig_id << "HGCalTriggerGeometry: Wafer (" << waferu << "," << waferv
<< ") is not mapped to any trigger module. The module mapping should be modified. \n";
edm::LogWarning("HGCalTriggerGeometry") << "Found missing wafer (layer=" << layer_with_offset << " u=" << waferu
<< " v=" << waferv << ") in trigger modules mapping";
// Fill missing modules as disconnected (id=0) in the mapping
module = 0;
wafer_to_module_.emplace(packLayerWaferId(layer_with_offset, waferu, waferv), module);
module_to_wafers_.emplace(packLayerModuleId(layer_with_offset, module), packWaferId(waferu, waferv));
} else {
module = module_itr->second;
}
module = module_itr->second;
}
module_id =
HGCalDetId((ForwardSubdetector)subdet_old, zside, layer, tc_type, module, HGCalDetId::kHGCalCellMask).rawId();
Expand Down

0 comments on commit 561354d

Please sign in to comment.