Skip to content
Snippets Groups Projects
Commit ccf776e5 authored by Ruggero Turra's avatar Ruggero Turra :headphones:
Browse files

simplify code

parent 343a847f
No related branches found
No related tags found
No related merge requests found
......@@ -30,18 +30,13 @@ namespace CP {
const xAOD::Vertex* getVertexFromTrack(const xAOD::TrackParticle* track,
const xAOD::VertexContainer* vertices)
{
const xAOD::Vertex* found_vx = nullptr;
for (const auto& vx : *vertices) {
for (const auto& tpLink : vx->trackParticleLinks()) {
if (*tpLink == track) {
found_vx = vx;
break;
}
if (*tpLink == track) { return vx; }
}
if (found_vx) { break; }
}
return found_vx;
return nullptr;
}
//____________________________________________________________________________
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment