12 #include "GaudiKernel/MsgStream.h"
20 ISvcLocator* pSvcLocator)
32 ATH_CHECK(m_pileupTRT.initialize(m_doTrackOverlay));
33 ATH_CHECK(m_pileupPixel.initialize(m_doTrackOverlay));
34 ATH_CHECK(m_pileupSCT.initialize(m_doTrackOverlay));
35 ATH_CHECK(m_outtracklocation.initialize());
36 ATH_CHECK(m_assoTool.retrieve(DisableTool{m_assoTool.name().empty()}));
37 ATH_CHECK(m_assoMapName.initialize(!m_assoMapName.key().empty()));
38 return StatusCode::SUCCESS;
47 auto outputCol = std::make_unique<ConstDataVector<TrackCollection>>(
SG::VIEW_ELEMENTS);
48 ATH_MSG_DEBUG(
"Number of Track collections " << m_tracklocation.size());
51 std::vector<const TrackCollection*> trackCollections;
52 trackCollections.reserve(m_tracklocation.size());
54 for (
const auto& tcname : m_tracklocation){
57 trackCollections.push_back(trackCol.
cptr());
58 ttNumber += trackCol->size();
60 std::unique_ptr<Trk::PRDtoTrackMap> pPrdToTrackMap(m_assoTool ? m_assoTool->createPRDtoTrackMap() :
nullptr);
62 outputCol->reserve(ttNumber);
64 for (
auto& tciter : trackCollections) {
66 if (mergeTrack(tciter, pPrdToTrackMap.get(), outputCol.get()).isFailure()) {
70 ATH_MSG_DEBUG(
"Size of combined tracks " << outputCol->size());
73 ATH_CHECK(h_write.record(std::move(outputCol)));
75 if (!m_assoMapName.key().empty()) {
77 if (write_handle.
record( m_assoTool->reduceToStorableMap(std::move(pPrdToTrackMap))).isFailure()) {
83 return StatusCode::SUCCESS;
92 return StatusCode::SUCCESS;
104 if (trackCol && !trackCol->
empty()) {
106 if (not pPrdToTrackMap)
107 ATH_MSG_WARNING(
"No valid PRD to Track Map; was the association tool name missing?");
109 for (
const auto*
const rf : *trackCol) {
112 if (m_assoTool and m_assoTool->addPRDs(*pPrdToTrackMap, *rf).isFailure())
117 return StatusCode::SUCCESS;