ATLAS Offline Software
PRDtoTrackMap.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef _Trk_PRDtoTrackMap_H_
6 #define _Trk_PRDtoTrackMap_H_
8 #include <unordered_map>
9 #include <functional>
10 
11 namespace Trk {
12 
13 class PrepRawData;
14 class Track;
15 
17 {
18 public:
20  std::unordered_map<const Track*, // Key
21  std::vector<const PrepRawData*>, // T
22  std::hash<const Track*>, // Hash
23  std::equal_to<const Track*>, // KeyEqual
24  SG::ArenaPoolSTLAllocator<std::pair<
25  const Track* const,
26  std::vector<const PrepRawData*>>> // Allocator
27  >;
28 
29  using PrepRawDataTrackMap = std::unordered_multimap<
30  const PrepRawData*, // Key
31  const Track*, // T
32  std::hash<const PrepRawData*>, // Hash
33  std::equal_to<const PrepRawData*>, // KeyEqual
35  std::pair<const PrepRawData* const, const Track*>> // Allocator
36 
37  >;
38 
40  std::pair<PrepRawDataTrackMap::iterator, PrepRawDataTrackMap::iterator>;
41 
43  std::pair<PrepRawDataTrackMap::const_iterator,
44  PrepRawDataTrackMap::const_iterator>;
45 
46  PRDtoTrackMap() = default;
47  virtual ~PRDtoTrackMap() = default;
48  PRDtoTrackMap(const PRDtoTrackMap& a) = default;
49  PRDtoTrackMap(PRDtoTrackMap&& a) noexcept = default;
50  PRDtoTrackMap& operator=(const PRDtoTrackMap& a) = default;
51  PRDtoTrackMap& operator=(PRDtoTrackMap&& a) noexcept = default;
52 
53  virtual const std::type_info& getType() const;
54 
59  bool isUsed(const PrepRawData& prd) const;
60 
65  bool isShared(const PrepRawData& prd) const;
66 
69 
72 
74  std::vector<const Trk::PrepRawData*> getPrdsOnTrack(const Track& track) const;
75 
76  void clear();
77 
78  void reserve(size_t nTracks, size_t nRawData);
79 
80 protected:
83 
86 };
87 
88 }
89 
90 #include "PRDtoTrackMap.icc"
91 #ifndef CLIDSVC_CLASSDEF_H
92 #include "AthenaKernel/CLASS_DEF.h"
93 CLASS_DEF(Trk::PRDtoTrackMap, 51736277, 1)
94 #endif
95 #endif
Trk::PRDtoTrackMap::PrepRawDataTrackMapRange
std::pair< PrepRawDataTrackMap::iterator, PrepRawDataTrackMap::iterator > PrepRawDataTrackMapRange
Definition: PRDtoTrackMap.h:40
PRDtoTrackMap.icc
Trk::PRDtoTrackMap::onTracks
PrepRawDataTrackMapRange onTracks(const PrepRawData &prd)
get the Tracks associated with this PrepRawData.
Trk::PRDtoTrackMap
Definition: PRDtoTrackMap.h:17
Trk::PRDtoTrackMap::PRDtoTrackMap
PRDtoTrackMap(PRDtoTrackMap &&a) noexcept=default
Trk::PRDtoTrackMap::PRDtoTrackMap
PRDtoTrackMap()=default
Trk::PRDtoTrackMap::onTracks
ConstPrepRawDataTrackMapRange onTracks(const PrepRawData &prd) const
get the Tracks associated with this PrepRawData.
Trk::PRDtoTrackMap::clear
void clear()
ArenaPoolSTLAllocator.h
STL-style allocator wrapper for ArenaPoolAllocator.
Trk::PRDtoTrackMap::PrepRawDataTrackMap
std::unordered_multimap< const PrepRawData *, const Track *, std::hash< const PrepRawData * >, std::equal_to< const PrepRawData * >, SG::ArenaPoolSTLAllocator< std::pair< const PrepRawData *const, const Track * > > > PrepRawDataTrackMap
Definition: PRDtoTrackMap.h:37
Trk::PRDtoTrackMap::m_trackPrepRawDataMap
TrackPrepRawDataMap m_trackPrepRawDataMap
holds the PRDs associated with each Track (i.e.
Definition: PRDtoTrackMap.h:85
Trk::PRDtoTrackMap::getPrdsOnTrack
std::vector< const Trk::PrepRawData * > getPrdsOnTrack(const Track &track) const
returns a vector of PRDs belonging to the passed track.
Trk::PRDtoTrackMap::getType
virtual const std::type_info & getType() const
Trk::PRDtoTrackMap::isUsed
bool isUsed(const PrepRawData &prd) const
does this PRD belong to at least one track?
Trk::PrepRawData
Definition: PrepRawData.h:62
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::PRDtoTrackMap::operator=
PRDtoTrackMap & operator=(const PRDtoTrackMap &a)=default
Trk::PRDtoTrackMap::operator=
PRDtoTrackMap & operator=(PRDtoTrackMap &&a) noexcept=default
Trk::PRDtoTrackMap::m_prepRawDataTrackMap
PrepRawDataTrackMap m_prepRawDataTrackMap
holds the tracks associated with each PRD (i.e.
Definition: PRDtoTrackMap.h:82
Trk::PRDtoTrackMap::TrackPrepRawDataMap
std::unordered_map< const Track *, std::vector< const PrepRawData * >, std::hash< const Track * >, std::equal_to< const Track * >, SG::ArenaPoolSTLAllocator< std::pair< const Track *const, std::vector< const PrepRawData * > >> > TrackPrepRawDataMap
Definition: PRDtoTrackMap.h:27
a
TList * a
Definition: liststreamerinfos.cxx:10
Trk::PRDtoTrackMap::~PRDtoTrackMap
virtual ~PRDtoTrackMap()=default
SG::ArenaPoolSTLAllocator
STL-style allocator wrapper for ArenaPoolAllocator.
Definition: ArenaPoolSTLAllocator.h:106
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
Trk::PRDtoTrackMap::PRDtoTrackMap
PRDtoTrackMap(const PRDtoTrackMap &a)=default
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
Trk::PRDtoTrackMap::reserve
void reserve(size_t nTracks, size_t nRawData)
CLASS_DEF.h
macros to associate a CLID to a type
Trk::PRDtoTrackMap::isShared
bool isShared(const PrepRawData &prd) const
does this PRD belong to more than one track?
Trk::PRDtoTrackMap::ConstPrepRawDataTrackMapRange
std::pair< PrepRawDataTrackMap::const_iterator, PrepRawDataTrackMap::const_iterator > ConstPrepRawDataTrackMapRange
Definition: PRDtoTrackMap.h:44