|
ATLAS Offline Software
|
Concrete Implementation of the IPRD_AssociationTool interface.
More...
#include <PRD_AssociationTool.h>
Concrete Implementation of the IPRD_AssociationTool interface.
Definition at line 24 of file PRD_AssociationTool.h.
◆ PRD_AssociationTool()
Trk::PRD_AssociationTool::PRD_AssociationTool |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~PRD_AssociationTool()
virtual Trk::PRD_AssociationTool::~PRD_AssociationTool |
( |
| ) |
|
|
virtualdefault |
◆ addPRDs() [1/2]
StatusCode Trk::PRD_AssociationTool::addPRDs |
( |
const Track & |
track | ) |
|
|
overridevirtual |
add the PRDs from this track to the store
- Parameters
-
Definition at line 33 of file PRD_AssociationTool.cxx.
35 if (!
m_prdToTrackMap.
key().empty())
throw std::runtime_error(
"Cannot modify(addPRDs) the PRDtoTrackMap that was read from storegate!");
◆ addPRDs() [2/2]
StatusCode Trk::PRD_AssociationTool::addPRDs |
( |
Maps & |
maps, |
|
|
const Track & |
track |
|
) |
| const |
|
overridevirtual |
add the PRDs from this track to maps.
- Parameters
-
Definition at line 39 of file PRD_AssociationTool.cxx.
42 TrackPrepRawDataMap::const_iterator itvec = maps.m_trackPrepRawDataMap.find(&
track);
43 if (itvec!=maps.m_trackPrepRawDataMap.end())
45 ATH_MSG_ERROR (
"track already found in cache, should not happen");
46 return StatusCode::FAILURE;
51 maps.m_prepRawDataTrackMap.emplace(prd, &
track);
55 maps.m_trackPrepRawDataMap.emplace(&
track, prds);
58 maps.m_prepRawDataTrackMap.size());
59 return StatusCode::SUCCESS;
◆ findConnectedTracks() [1/2]
Definition at line 127 of file PRD_AssociationTool.cxx.
142 if (conTrack!=&
track) {
144 connectedTracks.insert(conTrack);
149 "\tsize of list now:"<<connectedTracks.size());
152 return connectedTracks;
◆ findConnectedTracks() [2/2]
returns set of tracks which share PRD with this one
- Parameters
-
track | this Track must be known to this tool. |
- Returns
- a set of tracks which share PRD/hits with the passed 'track'
Definition at line 120 of file PRD_AssociationTool.cxx.
122 if (!
m_prdToTrackMap.
key().empty())
throw std::runtime_error(
"findConnectedTracks not supported when using a PRDtoTrackMap from storegate.");
◆ getPrdsOnTrack() [1/2]
Definition at line 165 of file PRD_AssociationTool.cxx.
168 using PRDs_t = std::vector<const PrepRawData *>;
171 TrackPrepRawDataMap::const_iterator itvec = maps.m_trackPrepRawDataMap.find(&
track);
172 if (itvec!=maps.m_trackPrepRawDataMap.end())
174 ATH_MSG_VERBOSE (
"found track in cache, return cached PRD vector for track");
175 return itvec->second;
178 if (
track.measurementsOnTrack()==
nullptr) {
184 vec.reserve(
track.measurementsOnTrack()->size());
185 for (
const MeasurementBase* meas : *
track.measurementsOnTrack())
193 vec.push_back(rot->prepRawData());
199 for(
unsigned int i=0;
i<numROTs;++
i ){
◆ getPrdsOnTrack() [2/2]
returns a vector of PRDs belonging to the passed track.
It's basically for the convenience of users and is created purely from the passed track.
i.e. there is no caching if you do it multiple times on the same track, you're being inefficient!!
- Parameters
-
- Returns
- vector of PrepRawData* belonging to 'track'. The PrepRawData should NOT be deleted
- they belong to the Track (and thus the event).
Definition at line 157 of file PRD_AssociationTool.cxx.
159 if (!
m_prdToTrackMap.
key().empty())
throw std::runtime_error(
"getPrdsOnTrack not supported when using a PRDtoTrackMap from storegate.");
◆ initialize()
StatusCode Trk::PRD_AssociationTool::initialize |
( |
| ) |
|
|
overridevirtual |
◆ isShared() [1/2]
|
inlinefinaloverridevirtual |
does this PRD belong to more than one track in maps?
- Parameters
-
- Returns
- true if 'prd' exists on more than one track (of course PRD_AssociationTool can only give information about tracks it knows about i.e. that were added to maps with addPRDs()
Definition at line 129 of file PRD_AssociationTool.h.
132 return (maps.m_prepRawDataTrackMap.count(&prd)>1);
◆ isShared() [2/2]
|
inlinefinaloverridevirtual |
does this PRD belong to more than one track?
- Parameters
-
- Returns
- true if 'prd' exists on more than one track (of course PRD_AssociationTool can only give information about tracks it knows about i.e. that were added with addPRDs()
Definition at line 135 of file PRD_AssociationTool.h.
◆ isUsed() [1/2]
|
inlinefinaloverridevirtual |
does this PRD belong to at least one track in maps?
- Parameters
-
- Returns
- true if 'prd' exists in at least one track (of course PRD_AssociationTool can only give information about tracks it knows about i.e. that were added to maps with addPRDs()
Definition at line 117 of file PRD_AssociationTool.h.
120 return (maps.m_prepRawDataTrackMap.count(&prd)>0);
◆ isUsed() [2/2]
|
inlinefinaloverridevirtual |
does this PRD belong to at least one track?
- Parameters
-
- Returns
- true if 'prd' exists in at least one track (of course PRD_AssociationTool can only give information about tracks it knows about i.e. that were added with addPRDs()
Definition at line 123 of file PRD_AssociationTool.h.
◆ onTracks() [1/2]
◆ onTracks() [2/2]
◆ removePRDs() [1/2]
StatusCode Trk::PRD_AssociationTool::removePRDs |
( |
const Track & |
track | ) |
|
|
overridevirtual |
remove the PRDs from this track from the store
- Parameters
-
Definition at line 62 of file PRD_AssociationTool.cxx.
64 if (!
m_prdToTrackMap.
key().empty())
throw std::runtime_error(
"Cannot modify(removePRDs) the PRDtoTrackMap that was read from storegate!");
◆ removePRDs() [2/2]
StatusCode Trk::PRD_AssociationTool::removePRDs |
( |
Maps & |
maps, |
|
|
const Track & |
track |
|
) |
| const |
|
overridevirtual |
remove the PRDs from this track from maps
- Parameters
-
track | all PRDs from 'track' will be removed from maps |
Definition at line 68 of file PRD_AssociationTool.cxx.
78 int oldSize = maps.m_prepRawDataTrackMap.size();
82 if (itvec==maps.m_trackPrepRawDataMap.end())
84 ATH_MSG_ERROR (
"Track not found in cache, this should not happen");
85 return StatusCode::FAILURE;
89 std::vector< const Trk::PrepRawData* > prds = itvec->second;
94 range = maps.m_prepRawDataTrackMap.equal_range(prd);
97 ConstPRD_MapIt mapIt =
range.first;
98 ConstPRD_MapIt mapItEnd =
range.second;
101 for ( ;mapIt!=mapItEnd; ++mapIt)
103 if ( mapIt->second==&
track )
105 maps.m_prepRawDataTrackMap.erase( mapIt );
112 maps.m_trackPrepRawDataMap.erase( itvec );
115 "size from \t"<<oldSize <<
" \tto "<<maps.m_prepRawDataTrackMap.size());
116 return StatusCode::SUCCESS;
◆ reset()
void Trk::PRD_AssociationTool::reset |
( |
| ) |
|
|
overridevirtual |
resets the tool - should be called before using tool (and maybe afterwards to free up memory)
Definition at line 228 of file PRD_AssociationTool.cxx.
230 if (!
m_prdToTrackMap.
key().empty())
throw std::runtime_error(
"cannot reset PRDtoTrack map when it is taken from storegate.");
231 m_maps.m_prepRawDataTrackMap.clear();
232 m_maps.m_trackPrepRawDataMap.clear();
◆ m_idHelperSvc
◆ m_maps
Maps Trk::PRD_AssociationTool::m_maps |
|
private |
◆ m_prdToTrackMap
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
PrepRawDataTrackMapRange onTracks(const PrepRawData &prd)
get the Tracks associated with this PrepRawData.
std::set< TrackPtr > TrackSet
std::vector< size_t > vec
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
virtual const RIO_OnTrack & rioOnTrack(unsigned int) const =0
returns the RIO_OnTrack (also known as ROT) objects depending on the integer.
virtual unsigned int numberOfContainedROTs() const =0
Number of RIO_OnTracks to be contained by this CompetingRIOsOnTrack.
::StatusCode StatusCode
StatusCode definition for legacy code.
Base class for all CompetingRIOsOnTack implementations, extends the common MeasurementBase.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
bool isUsed(const PrepRawData &prd) const
does this PRD belong to at least one track?
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
#define ATH_MSG_WARNING(x)
Identifier identify() const
return the identifier -extends MeasurementBase
bool isShared(const PrepRawData &prd) const
does this PRD belong to more than one track?