10 const std::string &
name,
25 ATH_MSG_ERROR(
"No track reconstruction tools set, check settings in AFP_LocReco/AFP_LocReco.py. Aborting.");
26 return StatusCode::FAILURE;
36 ATH_MSG_ERROR(
"No output track containers provided, check settings in AFP_LocReco/AFP_LocReco.py. Aborting.");
37 return StatusCode::FAILURE;
48 std::vector<std::string> listOfWHKeys;
52 listOfWHKeys.push_back(whk.key());
54 unsigned int all_WHkeys=listOfWHKeys.size();
56 std::sort(listOfWHKeys.begin(), listOfWHKeys.end());
57 listOfWHKeys.erase(
std::unique(listOfWHKeys.begin(),listOfWHKeys.end()), listOfWHKeys.end());
58 if(listOfWHKeys.size() != all_WHkeys)
60 ATH_MSG_ERROR(
"It seems write handle keys do not have unique values, check settings in AFP_LocReco/AFP_LocReco.py. Aborting.");
61 return StatusCode::FAILURE;
64 std::vector<std::string> listOfOutputContainers;
67 ATH_MSG_DEBUG(
"have ouput container "<<recoTool->outputContainerName());
68 listOfOutputContainers.push_back(recoTool->outputContainerName());
71 std::sort(listOfOutputContainers.begin(), listOfOutputContainers.end());
72 listOfOutputContainers.erase(
std::unique(listOfOutputContainers.begin(),listOfOutputContainers.end()), listOfOutputContainers.end());
74 if(listOfWHKeys.size() != listOfOutputContainers.size())
76 ATH_MSG_ERROR(
"There is different number of unique write handle keys ("<<listOfWHKeys.size()<<
") and unique output containers ("<<listOfOutputContainers.size()<<
"). Aborting");
77 return StatusCode::FAILURE;
81 for(
const auto &trkOutCont : listOfOutputContainers)
83 if(
std::find(listOfWHKeys.begin(),listOfWHKeys.end(),trkOutCont) == listOfWHKeys.end())
85 ATH_MSG_ERROR(
"Cannot find track reconstruction output container "<<trkOutCont<<
" in write handle keys. Aborting");
89 for(
const auto &whk : listOfWHKeys)
91 if(
std::find(listOfOutputContainers.begin(),listOfOutputContainers.end(),whk) == listOfOutputContainers.end())
93 ATH_MSG_ERROR(
"Cannot find write handle key "<<whk<<
" in track reconstruction output containers. Aborting");
97 if(doAbort)
return StatusCode::FAILURE;
107 return StatusCode::SUCCESS;
120 auto afpTrk=std::make_unique<xAOD::AFPTrackContainer>();
121 auto afpTrkAux=std::make_unique<xAOD::AFPTrackAuxContainer>();
122 afpTrk->setStore(afpTrkAux.get());
126 if(recoTool->outputContainerName() != whk.key())
continue;
128 if( recoTool->reconstructTracks(afpTrk, ctx).isFailure() )
130 ATH_MSG_WARNING (
"Failed to reconstruct tracks with algorithm = "<<recoTool->name());
134 trkSize += afpTrk->size();
138 ATH_CHECK( trackContainer.
record(std::move(afpTrk), std::move(afpTrkAux)) );
143 return StatusCode::SUCCESS;
148 return StatusCode::SUCCESS;