82 {
83 bool callTool = true;
86 SG::ReadHandle<xAOD::VertexContainer> handle(str,ctx);
88 if(handle->size() == 0) {
89 callTool = false;
90 ATH_MSG_DEBUG(
"Container VertexContainer (" << str <<
") is empty");
91 break;
92 }
93 }
94 }
95
96
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());
100
101 if(callTool) {
102
103
104
105 if( !
m_SearchTool->performSearch(ctx,*vtxContainer).isSuccess() ) {
107 return StatusCode::FAILURE;
108 }
109
110
111
112
114
115
116
117
118 std::unique_ptr<xAOD::VertexContainer> refPvContainer;
119 std::unique_ptr<xAOD::VertexAuxContainer> refPvAuxContainer;
121
122 refPvContainer = std::make_unique<xAOD::VertexContainer>();
123 refPvAuxContainer = std::make_unique<xAOD::VertexAuxContainer>();
124 refPvContainer->setStore(refPvAuxContainer.get());
125 }
126
127
133
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");
138 }
141 ATH_MSG_FATAL(
"refitting failed - check the vertices you passed");
143 }
144 if(refPvContainer->size() > 10000){
145 ATH_MSG_WARNING(
"Number of refitted vertices is very high N=" << refPvContainer->size() <<
" this may crash the sharedwriter");
146 }
147 }
148 }else{
149 if(vtxContainer->size() >0)
CHECK(
helper.FillCandExistingVertices(vtxContainer.get(), pvContainer.cptr(),
m_DoVertexType));
150 }
151
152 using Analysis::JpsiUpsilonCommon;
153
154 std::vector<const xAOD::TrackParticleContainer*> trackCols;
156 SG::ReadHandle<xAOD::TrackParticleContainer> handle(str,ctx);
157 trackCols.push_back(handle.cptr());
158 }
159 if(not trackCols.empty()){
161 try{
163 }catch(std::runtime_error const& e){
165 return StatusCode::FAILURE;
166 }
167 }
168 }
169 std::vector<const xAOD::MuonContainer*> muCols;
171 SG::ReadHandle<xAOD::MuonContainer> handle(str,ctx);
172 muCols.push_back(handle.cptr());
173 }
174 if(not muCols.empty()){
176 try{
178 }catch(std::runtime_error const& e){
180 return StatusCode::FAILURE;
181 }
182 }
183 }
184
185
186
188 ATH_CHECK(handle.record(std::move(vtxContainer), std::move(vtxAuxContainer)));
189
192 ATH_CHECK(handle.record(std::move(refPvContainer), std::move(refPvAuxContainer)));
193 }
194 }
195
196 if (!callTool) {
200 }
201
202 return StatusCode::SUCCESS;
203 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
#define CHECK(...)
Evaluate an expression and check for errors.
static void RelinkVertexMuons(const std::vector< const xAOD::MuonContainer * > &muoncols, xAOD::Vertex *vtx)
static void RelinkVertexTracks(const std::vector< const xAOD::TrackParticleContainer * > &trkcols, xAOD::Vertex *vtx)
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo_key
SG::ReadHandleKeyArray< xAOD::TrackParticleContainer > m_RelinkContainers
SG::ReadHandleKeyArray< xAOD::MuonContainer > m_RelinkMuons
::StatusCode StatusCode
StatusCode definition for legacy code.
const float SC[NC]
Cross sections for Carbon.
VertexAuxContainer_v1 VertexAuxContainer
Definition of the current jet auxiliary container.
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.