|
ATLAS Offline Software
|
Concrete Implementation of the IPRD_AssociationTool interface.
More...
#include <InDetPRD_AssociationToolGangedPixels.h>
Concrete Implementation of the IPRD_AssociationTool interface.
Definition at line 20 of file InDetPRD_AssociationToolGangedPixels.h.
◆ Maps
◆ InDetPRD_AssociationToolGangedPixels()
InDet::InDetPRD_AssociationToolGangedPixels::InDetPRD_AssociationToolGangedPixels |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~InDetPRD_AssociationToolGangedPixels()
InDet::InDetPRD_AssociationToolGangedPixels::~InDetPRD_AssociationToolGangedPixels |
( |
| ) |
|
|
virtualdefault |
◆ addPRDs() [1/2]
StatusCode InDet::InDetPRD_AssociationToolGangedPixels::addPRDs |
( |
const Trk::Track & |
track | ) |
|
|
overridevirtual |
◆ addPRDs() [2/2]
StatusCode InDet::InDetPRD_AssociationToolGangedPixels::addPRDs |
( |
Maps & |
maps, |
|
|
const Trk::Track & |
track |
|
) |
| const |
|
overridevirtual |
add the PRDs from this track to maps.
- Parameters
-
track | all PRDs from 'track' will be added to PRD_AssociationTool's internal store. |
Definition at line 39 of file InDetPRD_AssociationToolGangedPixels.cxx.
43 TrackPrepRawDataMap::const_iterator itvec = maps.m_trackPrepRawDataMap.find(&
track);
44 if (itvec!=maps.m_trackPrepRawDataMap.end())
46 ATH_MSG_ERROR(
"track already found in cache, should not happen");
47 return StatusCode::FAILURE;
56 maps.m_prepRawDataTrackMap.emplace(prd, &
track);
60 if (
pixel->gangedPixel()) {
62 std::pair<PixelGangedClusterAmbiguities::const_iterator,
63 PixelGangedClusterAmbiguities::const_iterator> ambi = gangedAmbis->equal_range(pixel);
64 for (; ambi.first != ambi.second ; ++(ambi.first) ) {
66 ATH_MSG_DEBUG(
"Found mirror pixel, add mirror to association map" );
67 maps.m_prepRawDataTrackMap.emplace(ambi.first->second, &
track);
74 maps.m_trackPrepRawDataMap.emplace(&
track, prds);
77 <<maps.m_prepRawDataTrackMap.size());
78 return StatusCode::SUCCESS;
◆ finalize()
StatusCode InDet::InDetPRD_AssociationToolGangedPixels::finalize |
( |
| ) |
|
|
overridevirtual |
◆ findConnectedTracks() [1/2]
Definition at line 170 of file InDetPRD_AssociationToolGangedPixels.cxx.
182 connectedTracks.insert((
range.first)->second);
188 if (
pixel->gangedPixel()) {
189 std::pair<PixelGangedClusterAmbiguities::const_iterator,
190 PixelGangedClusterAmbiguities::const_iterator> ambi = gangedAmbis->equal_range(pixel);
191 for (; ambi.first != ambi.second ; ++(ambi.first) ) {
195 connectedTracks.insert((
range.first)->second);
202 connectedTracks.erase(&
track);
205 <<
"\tsize of list is "<<connectedTracks.size());
207 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 164 of file InDetPRD_AssociationToolGangedPixels.cxx.
◆ getPrdsOnTrack() [1/2]
Definition at line 219 of file InDetPRD_AssociationToolGangedPixels.cxx.
222 using PRDs_t = std::vector<const Trk::PrepRawData *>;
225 TrackPrepRawDataMap::const_iterator itvec = maps.m_trackPrepRawDataMap.find(&
track);
226 if (itvec!=maps.m_trackPrepRawDataMap.end())
228 ATH_MSG_VERBOSE(
"found track in cache, return cached PRD vector for track");
229 return itvec->second;
232 if (
track.measurementsOnTrack()==
nullptr) {
241 vec.reserve(
track.measurementsOnTrack()->size());
246 for (;
it!=itEnd;++
it){
247 const auto *
const pThisMeasurement(*
it);
◆ 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
-
track | this Track will be iterated through and all PrepRawData added to a vector |
- 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 212 of file InDetPRD_AssociationToolGangedPixels.cxx.
◆ initialize()
StatusCode InDet::InDetPRD_AssociationToolGangedPixels::initialize |
( |
| ) |
|
|
overridevirtual |
◆ isShared() [1/2]
|
inlinefinaloverridevirtual |
does this PRD belong to more than one track in maps?
- Parameters
-
prd | the PrepRawData in question |
- 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 131 of file InDetPRD_AssociationToolGangedPixels.h.
134 return (maps.m_prepRawDataTrackMap.count(&prd)>1);
◆ isShared() [2/2]
does this PRD belong to more than one track?
- Parameters
-
prd | the PrepRawData in question |
- 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 138 of file InDetPRD_AssociationToolGangedPixels.h.
◆ isUsed() [1/2]
|
inlinefinaloverridevirtual |
does this PRD belong to at least one track in maps?
- Parameters
-
prd | the PrepRawData in question |
- 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 118 of file InDetPRD_AssociationToolGangedPixels.h.
121 return (maps.m_prepRawDataTrackMap.count(&prd)>0);
◆ isUsed() [2/2]
does this PRD belong to at least one track?
- Parameters
-
prd | the PrepRawData in question |
- 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 125 of file InDetPRD_AssociationToolGangedPixels.h.
◆ onTracks() [1/2]
◆ onTracks() [2/2]
get the Tracks associated with this Trk::PrepRawData.
IMPORTANT: Please use the typedefs IPRD_AssociationTool::PrepRawDataRange and IPRD_AssociationTool::ConstPRD_MapIt (defined in the interface) to access the tracks, as the way the data is stored internally may change.
Definition at line 275 of file InDetPRD_AssociationToolGangedPixels.cxx.
◆ removePRDs() [1/2]
StatusCode InDet::InDetPRD_AssociationToolGangedPixels::removePRDs |
( |
const Trk::Track & |
track | ) |
|
|
overridevirtual |
remove the PRDs from this track from the store
- Parameters
-
track | all PRDs from 'track' will be removed from the PRD_AssociationTool's internal store. |
Definition at line 81 of file InDetPRD_AssociationToolGangedPixels.cxx.
◆ removePRDs() [2/2]
StatusCode InDet::InDetPRD_AssociationToolGangedPixels::removePRDs |
( |
Maps & |
maps, |
|
|
const Trk::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 86 of file InDetPRD_AssociationToolGangedPixels.cxx.
96 int oldSize = maps.m_prepRawDataTrackMap.size();
100 if (itvec==maps.m_trackPrepRawDataMap.end())
102 ATH_MSG_ERROR(
"Track not found in cache, this should not happen");
103 return StatusCode::FAILURE;
109 std::vector< const Trk::PrepRawData* > prds = itvec->second;
114 range = maps.m_prepRawDataTrackMap.equal_range(prd);
116 ConstPRD_MapIt mapIt =
range.first;
117 ConstPRD_MapIt mapItEnd =
range.second;
119 for ( ;mapIt!=mapItEnd; ++mapIt) {
120 if ( mapIt->second==&
track ) {
121 maps.m_prepRawDataTrackMap.erase( mapIt );
130 if (
pixel->gangedPixel()) {
131 std::pair<PixelGangedClusterAmbiguities::const_iterator,
132 PixelGangedClusterAmbiguities::const_iterator> ambi = gangedAmbis->equal_range(pixel);
133 for (; ambi.first != ambi.second ; ++(ambi.first) ) {
135 ATH_MSG_DEBUG(
"Found ganged pixel, remove also mirror from association map");
137 range = maps.m_prepRawDataTrackMap.equal_range(ambi.first->second);
140 mapItEnd =
range.second;
142 for ( ;mapIt!=mapItEnd; ++mapIt) {
143 if ( mapIt->second==&
track ) {
144 maps.m_prepRawDataTrackMap.erase( mapIt );
155 maps.m_trackPrepRawDataMap.erase( itvec );
158 <<&
track<<
") \t- map has changed size from \t"
159 <<oldSize <<
" \tto "<<maps.m_prepRawDataTrackMap.size());
160 return StatusCode::SUCCESS;
◆ reset()
void InDet::InDetPRD_AssociationToolGangedPixels::reset |
( |
| ) |
|
|
overridevirtual |
◆ m_addTRToutliers
BooleanProperty InDet::InDetPRD_AssociationToolGangedPixels::m_addTRToutliers {this, "addTRToutliers", false} |
|
private |
◆ m_maps
Maps InDet::InDetPRD_AssociationToolGangedPixels::m_maps |
|
private |
◆ m_pixelClusterAmbiguitiesMapName
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
std::set< TrackPtr > TrackSet
virtual bool rioType(RIO_OnTrackType::Type type) const =0
Method checking the Rio On Track type.
std::vector< size_t > vec
#define ATH_MSG_VERBOSE(x)
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
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)