123 if (elements==
nullptr) {
125 return StatusCode::SUCCESS;
128 properties = sctProperties.
retrieve();
129 if (properties==
nullptr) {
131 return StatusCode::SUCCESS;
138 r_cache.
vertex = beamSpot->beamVtx().position();
145 std::unique_ptr<DataPool<PixelSpacePoint>> dataItemsPixel =
nullptr;
154 ATH_CHECK( spacePointContainerPixel.
record( std::make_unique<SpacePointContainer>(updateH.
ptr()) ) );
157 const bool hasExternalCache = spacePointContainerPixel->hasExternalCache();
158 if (!hasExternalCache) {
159 dataItemsPixel = std::make_unique<DataPool<PixelSpacePoint>>(ctx);
160 dataItemsPixel->reserve(5000);
162 dataItemsPixel = std::make_unique<DataPool<PixelSpacePoint>>(ctx);
168 std::unique_ptr<DataPool<SCT_SpacePoint>> dataItemsSCT =
nullptr;
177 ATH_CHECK( spacePointContainer_SCT.
record( std::make_unique<SpacePointContainer>(updateH.
ptr()) ) );
180 const bool hasExternalCache = spacePointContainer_SCT->hasExternalCache();
181 if (!hasExternalCache) {
182 dataItemsSCT = std::make_unique<DataPool<SCT_SpacePoint>>(ctx);
183 dataItemsSCT->reserve(10000);
185 dataItemsSCT = std::make_unique<DataPool<SCT_SpacePoint>>(ctx);
193 ATH_CHECK( spacepointoverlapCollection.
record( std::make_unique<SpacePointOverlapCollection>() ) );
198 ATH_MSG_DEBUG(
"Container '" << spacepointoverlapCollection.
name() <<
"' initialised" );
201 int sctCacheCount = 0;
202 int pixCacheCount = 0;
207 if (!sct_clcontainer.
isValid()){
208 msg(MSG:: FATAL) <<
"Could not find the data object "<< sct_clcontainer.
name() <<
" !" <<
endmsg;
209 return StatusCode::RECOVERABLE;
214 ATH_MSG_DEBUG(
"SCT Cluster container found: " << sct_clcontainer->size() <<
" collections" );
220 SCT_ClusterContainer::const_iterator it = sct_clcontainer->begin();
221 SCT_ClusterContainer::const_iterator itend = sct_clcontainer->end();
223 for (; it != itend; ++it){
224 const SCT_ClusterCollection *colNext=&(**it);
229 if(
lock.OnlineAndPresentInAnotherView()){
230 ATH_MSG_DEBUG(
"SCT Hash " << idHash <<
" is already in cache");
236 auto spacepointCollection = std::make_unique<SpacePointCollection>(idHash);
237 spacepointCollection->setIdentifier(elementID);
245 colNext, properties, elements, spacepointCollection.
get(),
246 spacepointoverlapCollection.
ptr(), r_cache, dataItemsSCT.get());
251 size_t size = spacepointCollection->size();
253 ATH_MSG_VERBOSE(
"SiTrackerSpacePointFinder algorithm found no space points" );
256 StatusCode
sc=
lock.addOrDelete( std::move(spacepointCollection) );
259 return StatusCode::RECOVERABLE;
262 nReceivedSPsSCT +=
size;
273 if (!pixel_clcontainer.
isValid()){
274 msg(MSG:: FATAL) <<
"Could not find the data object "<< pixel_clcontainer.
name() <<
" !" <<
endmsg;
275 return StatusCode::RECOVERABLE;
281 PixelClusterContainer::const_iterator colNext = pixel_clcontainer->begin();
282 PixelClusterContainer::const_iterator lastCol = pixel_clcontainer->end();
286 for (; colNext != lastCol; ++colNext)
291 if(
lock.OnlineAndPresentInAnotherView()){
292 ATH_MSG_DEBUG(
"pixel Hash " << idHash <<
" is already in cache");
297 Identifier elementID = (*colNext)->identify();
298 auto spacepointCollection = std::make_unique< SpacePointCollection >(idHash);
299 spacepointCollection->setIdentifier(elementID);
305 if (!(*colNext)->empty())
308 *colNext, spacepointCollection.get(), dataItemsPixel.get());
312 size_t size = spacepointCollection->size();
315 ATH_MSG_DEBUG(
"SiTrackerSpacePointFinder algorithm found no space points" );
319 StatusCode
sc =
lock.addOrDelete( std::move(spacepointCollection) );
323 return StatusCode::RECOVERABLE;
326 <<
" SpacePoints successfully added to Container !" );
327 nReceivedSPsPIX +=
size;
337 if (spacepointoverlapCollection->empty())
343 ATH_MSG_DEBUG( spacepointoverlapCollection->size() <<
" overlap space points registered." );
354 return StatusCode::SUCCESS;
420 enum NeighbourIndices{ThisOne, Opposite, PhiMinus, PhiPlus, EtaMinus, EtaPlus, nNeighbours};
422 std::array<const SCT_ClusterCollection*, nNeighbours> neighbourClusters{};
423 std::array<const InDetDD::SiDetectorElement*, nNeighbours> neighbourElements{};
424 std::array<double, 14> overlapExtents{};
432 const std::vector<IdentifierHash>* others(properties->neighbours(triggerIdHash));
433 if (others==
nullptr || others->empty() )
return;
436 neighbourElements[0] = triggerElement;
437 neighbourClusters[0] = sctClusters;
450 float hwidth(properties->halfWidth(triggerIdHash));
461 const std::array<size_t, nNeighbours> neigbourIndices{ThisOne, Opposite, EtaMinus, EtaPlus, PhiMinus, PhiPlus};
463 for (
const auto& otherHash : *others) {
466 const SCT_ClusterCollection* otherClusters = r_cache.
SCTCContainer->indexFindPtr (otherHash);
469 if(!otherElement || !otherClusters)
continue;
471 neighbourElements[neigbourIndices[n]] = otherElement;
472 neighbourClusters[neigbourIndices[n]] = otherClusters;
482 overlapExtents[ 6] =-hwidth;
485 overlapExtents[ 9] = hwidth;
490 overlapExtents[11] = hwidth;
491 overlapExtents[12] =-hwidth;
518 neighbourElements, neighbourClusters, overlapExtents,
m_allClusters,
519 r_cache.
vertex, spacepointCollection, spacepointOverlapCollection,