14 const std::multimap<
int, std::pair<
int, std::vector<int>>>& trackMap) {
17 std::unordered_map<int, std::vector<int>> cluster;
20 std::unordered_map<int, int> hitToTrack;
23 for (
auto track = trackMap.rbegin(); track != trackMap.rend(); ++track) {
24 std::vector<int> hits = track->second.second;
25 auto matchedTrack = hitToTrack.end();
27 for (
auto hit = hits.begin(); hit != hits.end(); hit++) {
29 matchedTrack = hitToTrack.find(*hit);
30 if (matchedTrack != hitToTrack.end()) {
32 cluster.at(matchedTrack->second).push_back(track->second.first);
37 if (matchedTrack == hitToTrack.end()) {
38 cluster.emplace(track->second.first,
39 std::vector<int>(1, track->second.first));
40 for (
const auto& hit : hits) {
42 hitToTrack.emplace(hit, track->second.first);