Skip to content

Commit 4e9f901

Browse files
committed
Fix compile time errors
1 parent 54aa6b0 commit 4e9f901

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/algorithms/calorimetry/CalorimeterHitsMerger.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,17 @@ void CalorimeterHitsMerger::build_map_via_funcs(
195195
for (std::size_t iHit = 0; const auto& hit : *in_hits) {
196196

197197
// make sure vector is clear
198-
ref_indices.clear();
198+
ref_fields.clear();
199199
for (std::size_t iField = 0; const auto& name_field : id_desc.fields()) {
200200

201+
// check if field has associated mapping
202+
const bool foundMapping = (
203+
std::find(m_cfg.fields.begin(), m_cfg.fields.end(), name_field.first) != m_cfg.fields.end()
204+
);
205+
201206
// if mapping provided for field, apply it
202207
// otherwise just copy index
203-
if (std::find(m_cfg.fields, name_field.first)){
208+
if (foundMapping) {
204209
ref_fields.push_back(
205210
{name_field.first, ref_maps[iField](hit)}
206211
);
@@ -215,7 +220,7 @@ void CalorimeterHitsMerger::build_map_via_funcs(
215220

216221
// add hit to appropriate group
217222
merge_map[ref_id].push_back(iHit);
218-
++iHit
223+
++iHit;
219224

220225
} // end hit loop
221226

0 commit comments

Comments
 (0)