ATLAS Offline Software
IPRD_AssociationTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRKAMBIGUITYPROCESSOR_IPRD_ASSOCIATIONTOOL_H
6 #define TRKAMBIGUITYPROCESSOR_IPRD_ASSOCIATIONTOOL_H
7 
8 #include "GaudiKernel/IAlgTool.h"
10 #include <map>
11 #include <set>
12 
13 class AtlasDetectorID;
14 class Identifier;
15 
16 namespace Trk {
17 
18 class Track;
19 class PrepRawData;
20 
36 class IPRD_AssociationTool : virtual public IAlgTool
37 {
38 public:
40 
41  // typedef std::pair<const PrepRawData*, const Track*>
42  // PrepRawDataTrackMapPair;
45  using ConstPRD_MapIt = PrepRawDataTrackMap::const_iterator;
48  using PrepRawDataTrackMapRange = std::pair<ConstPRD_MapIt, ConstPRD_MapIt>;
50 
52  typedef std::set<const Track*> TrackSet;
53 
55  struct Maps
56  {
57  // holds the tracks associated with each PRD (i.e. the PRD* is the key)
59  // holds the PRDs associated with each Track (i.e. the Track* is the key)
61  };
62 
64  virtual StatusCode addPRDs(Maps& maps, const Track& track) const = 0;
65 
67  virtual StatusCode addPRDs(const Track& track) = 0;
68 
71  virtual StatusCode removePRDs(Maps& maps, const Track& track) const = 0;
72 
76  virtual StatusCode removePRDs(const Track& track) = 0;
77 
83  virtual bool isUsed(const Maps& maps, const PrepRawData& prd) const = 0;
84 
90  virtual bool isUsed(const PrepRawData& prd) const = 0;
91 
97  virtual bool isShared(const Maps& maps, const PrepRawData& prd) const = 0;
98 
104  virtual bool isShared(const PrepRawData& prd) const = 0;
105 
114  virtual std::vector<const PrepRawData*> getPrdsOnTrack(
115  const Track& track) const = 0;
116 
117  // getPrdsOnTrack with state passed explicitly.
118  virtual std::vector<const PrepRawData*> getPrdsOnTrack(
119  const Maps& maps,
120  const Track& track) const = 0;
121 
131  virtual TrackSet findConnectedTracks(const Track& track) const = 0;
132 
133  // findConnectedTracks with state passed explicitly.
134  virtual TrackSet findConnectedTracks(const Maps& maps,
135  const Track& track) const = 0;
136 
142  virtual PrepRawDataTrackMapRange onTracks(const PrepRawData& prd) const = 0;
143 
144  // onTracks with explicit state
146  const PrepRawData& prd) const = 0;
147 
149  virtual void reset() = 0;
150 };
151 
152 } // end of ns
153 
154 #endif
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
PRDtoTrackMap.h
Trk::IPRD_AssociationTool
Interface for handling the mapping between Trk::Track and Trk::PrepRawData.
Definition: IPRD_AssociationTool.h:37
Trk::IPRD_AssociationTool::onTracks
virtual PrepRawDataTrackMapRange onTracks(const Maps &maps, const PrepRawData &prd) const =0
Trk::IPRD_AssociationTool::addPRDs
virtual StatusCode addPRDs(Maps &maps, const Track &track) const =0
add the PRDs from this track to maps
Trk::IPRD_AssociationTool::addPRDs
virtual StatusCode addPRDs(const Track &track)=0
add the PRDs from this track to the store
Trk::IPRD_AssociationTool::isUsed
virtual bool isUsed(const Maps &maps, const PrepRawData &prd) const =0
does this PRD belong to at least one track in maps?
Trk::IPRD_AssociationTool::DeclareInterfaceID
DeclareInterfaceID(IPRD_AssociationTool, 1, 0)
Trk::IPRD_AssociationTool::removePRDs
virtual StatusCode removePRDs(Maps &maps, const Track &track) const =0
remove the PRDs from this track from the maps
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::IPRD_AssociationTool::Maps::m_prepRawDataTrackMap
IPRD_AssociationTool::PrepRawDataTrackMap m_prepRawDataTrackMap
Definition: IPRD_AssociationTool.h:58
Trk::IPRD_AssociationTool::isUsed
virtual bool isUsed(const PrepRawData &prd) const =0
does this PRD belong to at least one track?
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Trk::IPRD_AssociationTool::reset
virtual void reset()=0
this may well go, but at the moment it resets the tool
Trk::IPRD_AssociationTool::isShared
virtual bool isShared(const PrepRawData &prd) const =0
does this PRD belong to more than one track?
Trk::IPRD_AssociationTool::PrepRawDataTrackMapRange
std::pair< ConstPRD_MapIt, ConstPRD_MapIt > PrepRawDataTrackMapRange
the first element is the beginning iterator of the range, the second is the end
Definition: IPRD_AssociationTool.h:48
Trk::IPRD_AssociationTool::findConnectedTracks
virtual TrackSet findConnectedTracks(const Maps &maps, const Track &track) const =0
Trk::IPRD_AssociationTool::onTracks
virtual PrepRawDataTrackMapRange onTracks(const PrepRawData &prd) const =0
get the Tracks associated with this PrepRawData.
Trk::IPRD_AssociationTool::PrepRawDataTrackMap
PRDtoTrackMap::PrepRawDataTrackMap PrepRawDataTrackMap
Definition: IPRD_AssociationTool.h:43
Trk::PrepRawData
Definition: PrepRawData.h:62
Trk::IPRD_AssociationTool::ConstPRD_MapIt
PrepRawDataTrackMap::const_iterator ConstPRD_MapIt
Definition: IPRD_AssociationTool.h:45
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::IPRD_AssociationTool::getPrdsOnTrack
virtual std::vector< const PrepRawData * > getPrdsOnTrack(const Maps &maps, const Track &track) const =0
Trk::IPRD_AssociationTool::findConnectedTracks
virtual TrackSet findConnectedTracks(const Track &track) const =0
Return transient sets of connected and disconnected tracks, AND remove disconnected tracks from this ...
Trk::IPRD_AssociationTool::PRD_MapIt
PrepRawDataTrackMap::iterator PRD_MapIt
Definition: IPRD_AssociationTool.h:44
Trk::IPRD_AssociationTool::TrackSet
std::set< const Track * > TrackSet
Definition: IPRD_AssociationTool.h:52
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
Trk::IPRD_AssociationTool::TrackPrepRawDataMap
PRDtoTrackMap::TrackPrepRawDataMap TrackPrepRawDataMap
Definition: IPRD_AssociationTool.h:49
Trk::IPRD_AssociationTool::removePRDs
virtual StatusCode removePRDs(const Track &track)=0
remove the PRDs from this track from the store
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
Trk::IPRD_AssociationTool::isShared
virtual bool isShared(const Maps &maps, const PrepRawData &prd) const =0
does this PRD belong to more than one track in maps?
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
Trk::IPRD_AssociationTool::getPrdsOnTrack
virtual std::vector< const PrepRawData * > getPrdsOnTrack(const Track &track) const =0
returns a vector of PRDs belonging to the passed track.
Trk::IPRD_AssociationTool::Maps
The mutable state of the tool.
Definition: IPRD_AssociationTool.h:56
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
Trk::IPRD_AssociationTool::Maps::m_trackPrepRawDataMap
IPRD_AssociationTool::TrackPrepRawDataMap m_trackPrepRawDataMap
Definition: IPRD_AssociationTool.h:60
Identifier
Definition: IdentifierFieldParser.cxx:14