23 const IInterface*
p) :
25 m_v0Tools(
"Trk::V0Tools", this),
26 m_SearchTool(
"",this),
27 m_pvRefitter(
"Analysis::PrimaryVertexRefitter", this)
29 declareInterface<DerivationFramework::IAugmentationTool>(
this);
76 return StatusCode::SUCCESS;
85 const EventContext& ctx = Gaudi::Hive::currentContext();
90 if(handle->
size() == 0) {
99 std::unique_ptr<xAOD::VertexContainer> vtxContainer = std::make_unique<xAOD::VertexContainer>();
100 std::unique_ptr<xAOD::VertexAuxContainer> vtxAuxContainer = std::make_unique<xAOD::VertexAuxContainer>();
101 vtxContainer->setStore(vtxAuxContainer.get());
107 if( !
m_SearchTool->performSearch(ctx,*vtxContainer).isSuccess() ) {
109 return StatusCode::FAILURE;
120 std::unique_ptr<xAOD::VertexContainer> refPvContainer;
121 std::unique_ptr<xAOD::VertexAuxContainer> refPvAuxContainer;
124 refPvContainer = std::make_unique<xAOD::VertexContainer>();
125 refPvAuxContainer = std::make_unique<xAOD::VertexAuxContainer>();
126 refPvContainer->setStore(refPvAuxContainer.get());
137 if(vtxContainer->
size() >0){
138 if(vtxContainer->
size() > 10000){
139 ATH_MSG_WARNING(
"Number of candidates is very high N=" << vtxContainer->
size() <<
" this may crash the sharedwriter");
143 ATH_MSG_FATAL(
"refitting failed - check the vertices you passed");
146 if(refPvContainer->
size() > 10000){
147 ATH_MSG_WARNING(
"Number of refitted vertices is very high N=" << refPvContainer->
size() <<
" this may crash the sharedwriter");
156 std::vector<const xAOD::TrackParticleContainer*> trackCols;
159 trackCols.push_back(handle.
cptr());
161 if(not trackCols.empty()){
165 }
catch(std::runtime_error
const&
e){
167 return StatusCode::FAILURE;
171 std::vector<const xAOD::MuonContainer*> muCols;
174 muCols.push_back(handle.
cptr());
176 if(not muCols.empty()){
180 }
catch(std::runtime_error
const&
e){
182 return StatusCode::FAILURE;
190 ATH_CHECK(handle.
record(std::move(vtxContainer), std::move(vtxAuxContainer)));
194 ATH_CHECK(handle.
record(std::move(refPvContainer), std::move(refPvAuxContainer)));
204 return StatusCode::SUCCESS;