ATLAS Offline Software
Loading...
Searching...
No Matches
Tracking
TrkEvent
TrkEventUtils
TrkEventUtils
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>
15
#include "
AthAllocators/ArenaPoolSTLAllocator.h
"
16
17
namespace
Trk
{
39
40
template
<
class
OrigMap,
class
CmpT = std::less<
typename
OrigMap::mapped_type>>
41
class
InverseMultiMap
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
49
template
<
class
OrigMap,
class
CmpT>
50
void
addToInverseMultiMap
(
InverseMultiMap<OrigMap, CmpT>
*
result
,
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*/
ArenaPoolSTLAllocator.h
STL-style allocator wrapper for ArenaPoolAllocator.
Trk::InverseMultiMap
An InverseMultiMap object built from a generic map or multimap allows for quick lookup of original (m...
Definition
InverseMultiMap.h:45
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition
FakeTrackBuilder.h:9
Trk::addToInverseMultiMap
void addToInverseMultiMap(InverseMultiMap< OrigMap, CmpT > *result, const OrigMap &rec2truth)
Definition
InverseMultiMap.h:50
result
Generated on
for ATLAS Offline Software by
1.14.0