23 const IInterface*
p) :
25 m_v0Tools(
"Trk::V0Tools", this),
26 m_SearchTool(
"",this),
27 m_pvRefitter(
"Analysis::PrimaryVertexRefitter", this)
39 declareProperty(
"RefitPV" ,
m_refitPV =
false);
40 declareProperty(
"MaxPVrefit" ,
m_PV_max = 1000);
44 declareProperty(
"Do3d" ,
m_do3d =
false);
75 return StatusCode::SUCCESS;
88 if(handle->
size() == 0) {
97 std::unique_ptr<xAOD::VertexContainer> vtxContainer = std::make_unique<xAOD::VertexContainer>();
98 std::unique_ptr<xAOD::VertexAuxContainer> vtxAuxContainer = std::make_unique<xAOD::VertexAuxContainer>();
99 vtxContainer->setStore(vtxAuxContainer.get());
105 if( !
m_SearchTool->performSearch(ctx,*vtxContainer).isSuccess() ) {
107 return StatusCode::FAILURE;
118 std::unique_ptr<xAOD::VertexContainer> refPvContainer;
119 std::unique_ptr<xAOD::VertexAuxContainer> refPvAuxContainer;
122 refPvContainer = std::make_unique<xAOD::VertexContainer>();
123 refPvAuxContainer = std::make_unique<xAOD::VertexAuxContainer>();
124 refPvContainer->setStore(refPvAuxContainer.get());
135 if(vtxContainer->
size() >0){
136 if(vtxContainer->
size() > 10000){
137 ATH_MSG_WARNING(
"Number of candidates is very high N=" << vtxContainer->
size() <<
" this may crash the sharedwriter");
141 ATH_MSG_FATAL(
"refitting failed - check the vertices you passed");
144 if(refPvContainer->
size() > 10000){
145 ATH_MSG_WARNING(
"Number of refitted vertices is very high N=" << refPvContainer->
size() <<
" this may crash the sharedwriter");
154 std::vector<const xAOD::TrackParticleContainer*> trackCols;
157 trackCols.push_back(handle.
cptr());
159 if(not trackCols.empty()){
163 }
catch(std::runtime_error
const&
e){
165 return StatusCode::FAILURE;
169 std::vector<const xAOD::MuonContainer*> muCols;
172 muCols.push_back(handle.
cptr());
174 if(not muCols.empty()){
178 }
catch(std::runtime_error
const&
e){
180 return StatusCode::FAILURE;
188 ATH_CHECK(handle.
record(std::move(vtxContainer), std::move(vtxAuxContainer)));
192 ATH_CHECK(handle.
record(std::move(refPvContainer), std::move(refPvAuxContainer)));
202 return StatusCode::SUCCESS;