14 #include "ext/functional"
27 if (
sc.isFailure())
return sc;
28 ATH_CHECK( m_prdToTrackMap.initialize( !m_prdToTrackMap.key().empty() ) );
30 return StatusCode::SUCCESS;
35 if (!m_prdToTrackMap.key().empty())
throw std::runtime_error(
"Cannot modify(addPRDs) the PRDtoTrackMap that was read from storegate!");
36 return addPRDs (m_maps,
track);
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;
49 std::vector< const Trk::PrepRawData* > prds = getPrdsOnTrack( maps,
track );
51 maps.m_prepRawDataTrackMap.emplace(prd, &
track);
55 maps.m_trackPrepRawDataMap.emplace(&
track, prds);
58 maps.m_prepRawDataTrackMap.size());
59 return StatusCode::SUCCESS;
64 if (!m_prdToTrackMap.key().empty())
throw std::runtime_error(
"Cannot modify(removePRDs) the PRDtoTrackMap that was read from storegate!");
65 return removePRDs (m_maps,
track);
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;
122 if (!m_prdToTrackMap.key().empty())
throw std::runtime_error(
"findConnectedTracks not supported when using a PRDtoTrackMap from storegate.");
123 return findConnectedTracks (m_maps,
track);
132 std::vector< const Trk::PrepRawData* > prds = getPrdsOnTrack(maps,
track);
142 if (conTrack!=&
track) {
144 connectedTracks.insert(conTrack);
149 "\tsize of list now:"<<connectedTracks.size());
152 return connectedTracks;
156 std::vector< const Trk::PrepRawData* >
159 if (!m_prdToTrackMap.key().empty())
throw std::runtime_error(
"getPrdsOnTrack not supported when using a PRDtoTrackMap from storegate.");
160 return getPrdsOnTrack (m_maps,
track);
164 std::vector< const Trk::PrepRawData* >
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());
189 if(m_idHelperSvc->isMuon(rot->
identify())){
191 if(!m_idHelperSvc->isMdt(rot->
identify()) && (!m_idHelperSvc->isCsc(rot->
identify()) || m_idHelperSvc->measuresPhi(rot->
identify())))
continue;
199 for(
unsigned int i=0;
i<numROTs;++
i ){
203 if(!m_idHelperSvc->isMdt(rot->
identify()) && (!m_idHelperSvc->isCsc(rot->
identify()) || m_idHelperSvc->measuresPhi(rot->
identify())))
continue;
218 return onTracks (m_maps, prd);
225 return maps.m_prepRawDataTrackMap.equal_range(&prd);
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();