From 4e9f9010907557c80d9cf8e5ea0892cfb977330c Mon Sep 17 00:00:00 2001 From: ruse-traveler Date: Wed, 6 Nov 2024 11:47:05 -0500 Subject: [PATCH] Fix compile time errors --- src/algorithms/calorimetry/CalorimeterHitsMerger.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/algorithms/calorimetry/CalorimeterHitsMerger.cc b/src/algorithms/calorimetry/CalorimeterHitsMerger.cc index ef9ab873a..6cd5c759e 100644 --- a/src/algorithms/calorimetry/CalorimeterHitsMerger.cc +++ b/src/algorithms/calorimetry/CalorimeterHitsMerger.cc @@ -195,12 +195,17 @@ void CalorimeterHitsMerger::build_map_via_funcs( for (std::size_t iHit = 0; const auto& hit : *in_hits) { // make sure vector is clear - ref_indices.clear(); + ref_fields.clear(); for (std::size_t iField = 0; const auto& name_field : id_desc.fields()) { + // check if field has associated mapping + const bool foundMapping = ( + std::find(m_cfg.fields.begin(), m_cfg.fields.end(), name_field.first) != m_cfg.fields.end() + ); + // if mapping provided for field, apply it // otherwise just copy index - if (std::find(m_cfg.fields, name_field.first)){ + if (foundMapping) { ref_fields.push_back( {name_field.first, ref_maps[iField](hit)} ); @@ -215,7 +220,7 @@ void CalorimeterHitsMerger::build_map_via_funcs( // add hit to appropriate group merge_map[ref_id].push_back(iHit); - ++iHit + ++iHit; } // end hit loop