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;
47 std::vector<std::string> listOfWHKeys;
51 listOfWHKeys.push_back(whk.key());
53 unsigned int all_WHkeys=listOfWHKeys.size();
55 std::sort(listOfWHKeys.begin(), listOfWHKeys.end());
56 listOfWHKeys.erase(
std::unique(listOfWHKeys.begin(),listOfWHKeys.end()), listOfWHKeys.end());
57 if(listOfWHKeys.size() != all_WHkeys)
59 ATH_MSG_ERROR(
"It seems write handle keys do not have unique values, check settings in AFP_LocReco/AFP_LocReco.py. Aborting.");
60 return StatusCode::FAILURE;
63 std::vector<std::string> listOfOutputContainers;
66 ATH_MSG_DEBUG(
"have ouput container "<<recoTool->outputContainerName());
67 listOfOutputContainers.push_back(recoTool->outputContainerName());
70 std::sort(listOfOutputContainers.begin(), listOfOutputContainers.end());
71 listOfOutputContainers.erase(
std::unique(listOfOutputContainers.begin(),listOfOutputContainers.end()), listOfOutputContainers.end());
73 if(listOfWHKeys.size() != listOfOutputContainers.size())
75 ATH_MSG_ERROR(
"There is different number of unique write handle keys ("<<listOfWHKeys.size()<<
") and unique output containers ("<<listOfOutputContainers.size()<<
"). Aborting");
76 return StatusCode::FAILURE;
80 for(
const auto &trkOutCont : listOfOutputContainers)
82 if(
std::find(listOfWHKeys.begin(),listOfWHKeys.end(),trkOutCont) == listOfWHKeys.end())
84 ATH_MSG_ERROR(
"Cannot find track reconstruction output container "<<trkOutCont<<
" in write handle keys. Aborting");
88 for(
const auto &whk : listOfWHKeys)
90 if(
std::find(listOfOutputContainers.begin(),listOfOutputContainers.end(),whk) == listOfOutputContainers.end())
92 ATH_MSG_ERROR(
"Cannot find write handle key "<<whk<<
" in track reconstruction output containers. Aborting");
96 if(doAbort)
return StatusCode::FAILURE;
101 return StatusCode::SUCCESS;
111 auto afpTrk=std::make_unique<xAOD::AFPToFTrackContainer>();
112 auto afpTrkAux=std::make_unique<xAOD::AFPToFTrackAuxContainer>();
113 afpTrk->setStore(afpTrkAux.get());
115 ATH_MSG_DEBUG(
"Number of AFP ToF tracks = " <<afpTrk->size());
119 if(recoTool->outputContainerName() != whk.key())
continue;
121 if( recoTool->reconstructTracks(afpTrk, ctx).isFailure() )
123 ATH_MSG_WARNING (
"Failed to reconstruct tracks with algorithm = "<<recoTool->name());
128 ATH_CHECK( trackContainer.
record(std::move(afpTrk), std::move(afpTrkAux)) );
132 return StatusCode::SUCCESS;
137 return StatusCode::SUCCESS;