Algorithm reconstructing protons from tracks.
More...
#include <AFP_GlobRecoTool.h>
Algorithm reconstructing protons from tracks.
Definition at line 30 of file AFP_GlobRecoTool.h.
◆ AFP_GlobRecoTool()
AFP_GlobRecoTool::AFP_GlobRecoTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~AFP_GlobRecoTool()
AFP_GlobRecoTool::~AFP_GlobRecoTool |
( |
| ) |
|
|
default |
◆ execute()
StatusCode AFP_GlobRecoTool::execute |
( |
const EventContext & |
ctx | ) |
const |
|
override |
Run proton reco tool.
Definition at line 113 of file AFP_GlobRecoTool.cxx.
121 auto afpProton=std::make_unique<xAOD::AFPProtonContainer>();
122 auto afpProtonAux=std::make_unique<xAOD::AFPProtonAuxContainer>();
123 afpProton->setStore(afpProtonAux.get());
127 if(recoTool->outputContainerName() != whk.key())
continue;
129 if( recoTool->doProtonReco(afpProton, ctx).isFailure() )
131 ATH_MSG_WARNING (
"Failed to reconstruct protons with algorithm = "<<recoTool->name());
135 ATH_MSG_DEBUG(
"write handle key "<<whk<<
", have "<<afpProton->size()<<
" reconstructed protons");
139 ATH_CHECK( protonContainer.record(std::move(afpProton), std::move(afpProtonAux)) );
142 return StatusCode::SUCCESS;
◆ initialize()
StatusCode AFP_GlobRecoTool::initialize |
( |
| ) |
|
|
override |
Definition at line 18 of file AFP_GlobRecoTool.cxx.
25 ATH_MSG_ERROR(
"No proton reconstruction tools set, check settings in AFP_GlobReco/AFP_GlobReco.py. Aborting.");
26 return StatusCode::FAILURE;
37 ATH_MSG_ERROR(
"No output proton containers provided, check settings in AFP_GlobReco/AFP_GlobReco.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_GlobReco/AFP_GlobReco.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 proton 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 proton reconstruction output containers. Aborting");
99 if(doAbort)
return StatusCode::FAILURE;
110 return StatusCode::SUCCESS;
◆ m_arrayOfWriteHandleKeys
Array of unique write handle keys for track output containers.
Each write handle key has to be unique and in sync with m_recoToolsList. It's possible for several track reco algorithms contributing to the common container. Ideally, one should setup track reco containers (in AFP_GlobReco/AFP_GlobReco.py) and let the python script pick unique names.
Definition at line 53 of file AFP_GlobRecoTool.h.
◆ m_recoToolsList
ToolHandleArray<IAFP_ProtonRecoTool> AFP_GlobRecoTool::m_recoToolsList {this,"RecoToolsList",{},"List of AFP proton reconstruction tools"} |
|
private |
Vector of tool handles to be used for proton reconstruction.
Each station has its own track reco algorithm. This array contains all of them
Definition at line 48 of file AFP_GlobRecoTool.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.