Algorithm reconstructing vertices from protons.
More...
#include <AFP_VertexRecoTool.h>
Algorithm reconstructing vertices from protons.
Definition at line 30 of file AFP_VertexRecoTool.h.
◆ AFP_VertexRecoTool()
AFP_VertexRecoTool::AFP_VertexRecoTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~AFP_VertexRecoTool()
virtual AFP_VertexRecoTool::~AFP_VertexRecoTool |
( |
| ) |
|
|
virtualdefault |
◆ execute()
StatusCode AFP_VertexRecoTool::execute |
( |
const EventContext & |
ctx | ) |
const |
|
overridevirtual |
Run vertex reco tool.
Definition at line 113 of file AFP_VertexRecoTool.cxx.
121 auto afpVertex=std::make_unique<xAOD::AFPVertexContainer>();
122 auto afpVertexAux=std::make_unique<xAOD::AFPVertexAuxContainer>();
123 afpVertex->setStore(afpVertexAux.get());
127 if(recoTool->outputContainerName() != whk.key())
continue;
129 if( recoTool->doVertexReco(afpVertex, ctx).isFailure() )
131 ATH_MSG_WARNING (
"Failed to reconstruct vertices with algorithm = "<<recoTool->name());
135 ATH_MSG_DEBUG(
"write handle key "<<whk<<
", have "<<afpVertex->size()<<
" reconstructed vertices");
139 ATH_CHECK( vertexContainer.record(std::move(afpVertex), std::move(afpVertexAux)) );
142 return StatusCode::SUCCESS;
◆ initialize()
StatusCode AFP_VertexRecoTool::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 18 of file AFP_VertexRecoTool.cxx.
25 ATH_MSG_ERROR(
"No vertex reconstruction tools set, check settings in AFP_VertexReco/AFP_VertexReco.py. Aborting.");
26 return StatusCode::FAILURE;
37 ATH_MSG_ERROR(
"No output vertex containers provided, check settings in AFP_VertexReco/AFP_VertexReco.py. Aborting.");
38 return StatusCode::FAILURE;
50 std::vector<std::string> listOfWHKeys;
54 listOfWHKeys.push_back(whk.key());
56 unsigned int all_WHkeys=listOfWHKeys.size();
58 std::sort(listOfWHKeys.begin(), listOfWHKeys.end());
59 listOfWHKeys.erase(std::unique(listOfWHKeys.begin(),listOfWHKeys.end()), listOfWHKeys.end());
60 if(listOfWHKeys.size() != all_WHkeys)
62 ATH_MSG_ERROR(
"It seems write handle keys do not have unique values, check settings in AFP_VertexReco/AFP_VertexReco.py. Aborting.");
63 return StatusCode::FAILURE;
66 std::vector<std::string> listOfOutputContainers;
69 ATH_MSG_DEBUG(
"have ouput container "<<recoTool->outputContainerName());
70 listOfOutputContainers.push_back(recoTool->outputContainerName());
73 std::sort(listOfOutputContainers.begin(), listOfOutputContainers.end());
74 listOfOutputContainers.erase(std::unique(listOfOutputContainers.begin(),listOfOutputContainers.end()), listOfOutputContainers.end());
76 if(listOfWHKeys.size() != listOfOutputContainers.size())
78 ATH_MSG_ERROR(
"There is different number of unique write handle keys ("<<listOfWHKeys.size()<<
") and unique output containers ("<<listOfOutputContainers.size()<<
"). Aborting");
79 return StatusCode::FAILURE;
83 for(
const auto &trkOutCont : listOfOutputContainers)
85 if(
std::find(listOfWHKeys.begin(),listOfWHKeys.end(),trkOutCont) == listOfWHKeys.end())
87 ATH_MSG_ERROR(
"Cannot find vertex reconstruction output container "<<trkOutCont<<
" in write handle keys. Aborting");
91 for(
const auto &whk : listOfWHKeys)
93 if(
std::find(listOfOutputContainers.begin(),listOfOutputContainers.end(),whk) == listOfOutputContainers.end())
95 ATH_MSG_ERROR(
"Cannot find write handle key "<<whk<<
" in vertex reconstruction output containers. Aborting");
99 if(doAbort)
return StatusCode::FAILURE;
110 return StatusCode::SUCCESS;
◆ m_arrayOfWriteHandleKeys
Array of unique write handle keys for vertex output container.
Each write handle key has to be unique and in sync with m_recoToolsList. It's possible for several time reco algorithms contributing to the common container. Ideally, one should setup vertex reco containers (in AFP_VertexReco/AFP_VertexReco.py) and let the python script pick unique names.
Definition at line 53 of file AFP_VertexRecoTool.h.
◆ m_recoToolsList
ToolHandleArray<IAFP_TimeRecoTool> AFP_VertexRecoTool::m_recoToolsList {this,"RecoToolsList",{},"List of AFP vertex reconstruction tools"} |
|
private |
Vector of tool handles to be used for vertex reconstruction.
Several time reco algorithms will be implemented. This array contains all of them
Definition at line 48 of file AFP_VertexRecoTool.h.
The documentation for this class was generated from the following files:
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.