File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
src/algorithms/calorimetry Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -195,12 +195,17 @@ void CalorimeterHitsMerger::build_map_via_funcs(
195
195
for (std::size_t iHit = 0 ; const auto & hit : *in_hits) {
196
196
197
197
// make sure vector is clear
198
- ref_indices .clear ();
198
+ ref_fields .clear ();
199
199
for (std::size_t iField = 0 ; const auto & name_field : id_desc.fields ()) {
200
200
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
+
201
206
// if mapping provided for field, apply it
202
207
// otherwise just copy index
203
- if (std::find (m_cfg. fields , name_field. first )) {
208
+ if (foundMapping) {
204
209
ref_fields.push_back (
205
210
{name_field.first , ref_maps[iField](hit)}
206
211
);
@@ -215,7 +220,7 @@ void CalorimeterHitsMerger::build_map_via_funcs(
215
220
216
221
// add hit to appropriate group
217
222
merge_map[ref_id].push_back (iHit);
218
- ++iHit
223
+ ++iHit;
219
224
220
225
} // end hit loop
221
226
You can’t perform that action at this time.
0 commit comments