17 ISvcLocator *pSvcLocator)
46 return StatusCode::SUCCESS;
59 std::unique_ptr< xAOD::PixelClusterContainer > pixel_cluster_xaod_container = std::make_unique< xAOD::PixelClusterContainer >();
60 std::unique_ptr< xAOD::PixelClusterAuxContainer > pixel_cluster_xaod_aux_container = std::make_unique< xAOD::PixelClusterAuxContainer >();
61 pixel_cluster_xaod_container->setStore( pixel_cluster_xaod_aux_container.get() );
63 std::unique_ptr< xAOD::StripClusterContainer > strip_cluster_xaod_container = std::make_unique< xAOD::StripClusterContainer >();
64 std::unique_ptr< xAOD::StripClusterAuxContainer > strip_cluster_xaod_aux_container = std::make_unique< xAOD::StripClusterAuxContainer >();
65 strip_cluster_xaod_container->setStore( strip_cluster_xaod_aux_container.get() );
73 std::unordered_map<Identifier, std::size_t> mapClusters{};
75 strip_cluster_xaod_container.get(),
78 strip_cluster_xaod_container.get(),
86 ATH_CHECK( pixel_cluster_xaod_handle.
record( std::move(pixel_cluster_xaod_container),
87 std::move(pixel_cluster_xaod_aux_container) ) );
92 ATH_CHECK( strip_cluster_xaod_handle.
record( std::move(strip_cluster_xaod_container),
93 std::move(strip_cluster_xaod_aux_container) ) );
97 return StatusCode::SUCCESS;
108 if (not pixelDetEleHandle.
isValid()) {
110 return StatusCode::FAILURE;
112 pixElements = pixelDetEleHandle.
cptr();
121 std::unique_ptr< xAOD::SpacePointContainer > pixel_xaod_container = std::make_unique< xAOD::SpacePointContainer >();
122 std::unique_ptr< xAOD::SpacePointAuxContainer > pixel_xaod_aux_container = std::make_unique< xAOD::SpacePointAuxContainer >();
123 pixel_xaod_container->setStore( pixel_xaod_aux_container.get() );
125 pixel_xaod_container->
reserve(pixel_container->size());
126 pixel_xaod_aux_container->
reserve(pixel_container->size());
129 for (const ::SpacePointCollection *spc : *pixel_container) {
138 const std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>& clusterList = sp->clusterList();
140 if (theCluster ==
nullptr) {
144 auto clusterId = clusterList.first->identify();
146 if ( element ==
nullptr ) {
147 ATH_MSG_FATAL(
"Invalid pixel detector element for cluster identifier " << clusterId );
148 return StatusCode::FAILURE;
152 cluster_xaod_container->
push_back(pixelCl);
154 pixel_xaod_container->
back()->setMeasurements( {cluster_xaod_container->
back()} );
159 linkAcc(*pixel_xaod_container->
back()) = link;
165 ATH_CHECK( pixel_xaod_handle.
record( std::move(pixel_xaod_container), std::move(pixel_xaod_aux_container) ) );
167 return StatusCode::SUCCESS;
173 std::unordered_map<Identifier, std::size_t>& mapClusters)
const
178 if (not stripDetEleHandle.
isValid()) {
180 return StatusCode::FAILURE;
182 stripElements = stripDetEleHandle.
cptr();
193 std::unique_ptr< xAOD::SpacePointContainer > strip_xaod_container = std::make_unique< xAOD::SpacePointContainer >();
194 std::unique_ptr< xAOD::SpacePointAuxContainer > strip_xaod_aux_container = std::make_unique< xAOD::SpacePointAuxContainer >();
195 strip_xaod_container->setStore( strip_xaod_aux_container.get() );
197 strip_xaod_container->
reserve(strip_container->size());
198 strip_xaod_aux_container->
reserve(strip_container->size());
201 for (const ::SpacePointCollection *spc : *strip_container) {
210 const std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>& clusterList = sp->clusterList();
213 if (theCluster1 ==
nullptr or
214 theCluster2 ==
nullptr) {
218 auto clusterId1 = clusterList.first->identify();
219 auto clusterId2 = clusterList.second->identify();
222 if ( element1 ==
nullptr ) {
223 ATH_MSG_FATAL(
"Invalid strip detector element for cluster (1) identifiers " << clusterId1 );
224 return StatusCode::FAILURE;
226 if ( element2 ==
nullptr ) {
227 ATH_MSG_FATAL(
"Invalid strip detector element for cluster (2) identifiers " << clusterId2 );
228 return StatusCode::FAILURE;
231 auto insertEntry = [&mapClusters, cluster_xaod_container](
const auto & clusterId)->
bool{
232 const auto & [
p,inserted] = mapClusters.try_emplace(clusterId, cluster_xaod_container->
size());
236 if (insertEntry(clusterId1)){
238 cluster_xaod_container->
push_back(stripCl1);
241 if (insertEntry(clusterId2)) {
243 cluster_xaod_container->
push_back(stripCl2);
249 strip_xaod_container->
back()->setMeasurements( {stripCl1, stripCl2} );
254 linkAcc(*strip_xaod_container->
back()) = link;
260 ATH_CHECK( strip_xaod_handle.
record( std::move(strip_xaod_container), std::move(strip_xaod_aux_container) ) );
262 return StatusCode::SUCCESS;
269 std::unordered_map<Identifier, std::size_t>& mapClusters)
const
274 if (not stripDetEleHandle.
isValid()) {
276 return StatusCode::FAILURE;
278 stripElements = stripDetEleHandle.
cptr();
284 const ::SpacePointOverlapCollection* strip_overlap_container = strip_overlap_handle.
cptr();
287 std::unique_ptr< xAOD::SpacePointContainer > strip_overlap_xaod_container = std::make_unique< xAOD::SpacePointContainer >();
288 std::unique_ptr< xAOD::SpacePointAuxContainer > strip_overlap_xaod_aux_container = std::make_unique< xAOD::SpacePointAuxContainer >();
289 strip_overlap_xaod_container->setStore( strip_overlap_xaod_aux_container.get() );
291 strip_overlap_xaod_container->
reserve(strip_overlap_container->size());
292 strip_overlap_xaod_aux_container->
reserve(strip_overlap_container->size());
305 const std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>& clusterList = sp->clusterList();
308 if (theCluster1 ==
nullptr or
309 theCluster2 ==
nullptr) {
313 auto clusterId1 = clusterList.first->identify();
314 auto clusterId2 = clusterList.second->identify();
318 if ( element1 ==
nullptr ) {
319 ATH_MSG_FATAL(
"Invalid strip detector element for cluster (1) identifiers " << clusterId1 );
320 return StatusCode::FAILURE;
322 if ( element2 ==
nullptr ) {
323 ATH_MSG_FATAL(
"Invalid strip detector element for cluster (2) identifiers " << clusterId2 );
324 return StatusCode::FAILURE;
327 auto insertEntry = [&mapClusters, cluster_xaod_container](
const auto & clusterId)->
bool{
328 const auto & [
p,inserted] = mapClusters.try_emplace(clusterId, cluster_xaod_container->
size());
331 if (insertEntry(clusterId1)) {
333 cluster_xaod_container->
push_back(stripCl1);
336 if (insertEntry(clusterId2)) {
338 cluster_xaod_container->
push_back(stripCl2);
344 strip_overlap_xaod_container->
back()->setMeasurements( {stripCl1, stripCl2} );
348 stripSpacePointLinkAcc( *strip_overlap_xaod_container->
back() ) = TrkLink;
353 ATH_CHECK( strip_overlap_xaod_handle.
record( std::move(strip_overlap_xaod_container), std::move(strip_overlap_xaod_aux_container) ) );
355 return StatusCode::SUCCESS;