ATLAS Offline Software
Loading...
Searching...
No Matches
InverseMultiMap.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
10
11#ifndef INVERSEMULTIMAP_H
12#define INVERSEMULTIMAP_H
13
14#include <map>
16
17namespace Trk {
39
40template <class OrigMap, class CmpT = std::less<typename OrigMap::mapped_type>>
42 : public std::multimap<
43 typename OrigMap::mapped_type, typename OrigMap::key_type, CmpT,
44 SG::ArenaPoolSTLAllocator<
45 std::pair<const typename OrigMap::mapped_type, typename OrigMap::key_type>>> {};
46
47//----------------------------------------------------------------
48// And this is the code to fill an inverse map with data
49template <class OrigMap, class CmpT>
51 const OrigMap& rec2truth) {
52 for (const auto& p : rec2truth) {
53 result->insert(std::make_pair(p.second, p.first));
54 }
55}
56} // namespace Trk
57
58#endif /*INVERSEMULTIMAP_H*/
STL-style allocator wrapper for ArenaPoolAllocator.
An InverseMultiMap object built from a generic map or multimap allows for quick lookup of original (m...
Ensure that the ATLAS eigen extensions are properly loaded.
void addToInverseMultiMap(InverseMultiMap< OrigMap, CmpT > *result, const OrigMap &rec2truth)