Skip to content

Commit

Permalink
CalorimeterHitsMerger: use for instead of std::for_each
Browse files Browse the repository at this point in the history
  • Loading branch information
veprbl committed Jul 18, 2023
1 parent 5df061b commit 9490348
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/algorithms/calorimetry/CalorimeterHitsMerger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ std::unique_ptr<edm4eic::CalorimeterHitCollection> CalorimeterHitsMerger::execut
}

// sort hits by energy from large to small
std::for_each(merge_map.begin(), merge_map.end(), [&](auto &it) {
for (auto &it : merge_map) {
std::sort(it.second.begin(), it.second.end(), [&](std::size_t ix1, std::size_t ix2) {
return input[ix1].getEnergy() > input[ix2].getEnergy();
});
});
}

// reconstruct info for merged hits
// dd4hep decoders
Expand Down

0 comments on commit 9490348

Please sign in to comment.