2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
6 template <class HandleArrayKeyType, class ContainerType>
7 StatusCode TrackFindingAlg::getContainersFromKeys(
8 const EventContext &ctx,
9 HandleArrayKeyType &handleKeyArray,
10 std::vector<const ContainerType *> &outputContainers,
11 std::size_t &sum) const {
12 outputContainers.reserve(handleKeyArray.size());
13 for (const auto &handleKey : handleKeyArray) {
14 ATH_MSG_DEBUG("Reading input collection with key " << handleKey.key());
15 auto handle = SG::makeHandle(handleKey, ctx);
16 ATH_CHECK(handle.isValid());
17 outputContainers.push_back(handle.cptr());
18 ATH_MSG_DEBUG("Retrieved " << outputContainers.back()->size()
19 << " input elements from key " << handle.key());
20 sum += outputContainers.back()->size();
23 return StatusCode::SUCCESS;
25 } // namespace ActsTrk