ATLAS Offline Software
MSVertexRecoAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "MSVertexRecoAlg.h"
6 
9 
10 //** ----------------------------------------------------------------------------------------------------------------- **//
11 
12 MSVertexRecoAlg::MSVertexRecoAlg(const std::string& name, ISvcLocator* pSvcLocator) : AthReentrantAlgorithm(name, pSvcLocator) {}
13 
14 //** ----------------------------------------------------------------------------------------------------------------- **//
15 
17  //* Retrieve MSVertexRecoTool *//
18  ATH_CHECK(m_vertexRecoTool.retrieve());
19  ATH_MSG_DEBUG("Retrieved tool " << m_vertexRecoTool);
20 
21  //* Retrieve MSVertexTrackletTool *//
22  ATH_CHECK(m_vertexTrackletTool.retrieve());
23  ATH_MSG_DEBUG("Retrieved tool " << m_vertexTrackletTool);
24 
25  return StatusCode::SUCCESS;
26 }
27 
28 //** ----------------------------------------------------------------------------------------------------------------- **//
29 
30 StatusCode MSVertexRecoAlg::execute(const EventContext& ctx) const {
31  std::vector<Tracklet> tracklets;
32  std::vector<MSVertex*> vertices;
33 
34  StatusCode sc = m_vertexTrackletTool->findTracklets(tracklets, ctx);
35  if (sc.isFailure()) {
36  ATH_MSG_FATAL("Failed vertex tracklet ");
37  return StatusCode::FAILURE;
38  } else
39  ATH_MSG_DEBUG("Tracklet reconstruction tool called");
40 
41  sc = m_vertexRecoTool->findMSvertices(tracklets, vertices, ctx);
42  if (sc.isFailure()) {
43  ATH_MSG_FATAL("Failed vertex reco ");
44  return StatusCode::FAILURE;
45  } else
46  ATH_MSG_DEBUG("Vertex reconstruction tool called");
47 
48  ATH_MSG_DEBUG("Found " << tracklets.size() << " tracklets and " << vertices.size() << " vertices in the MS");
49 
50  return StatusCode::SUCCESS;
51 }
MSVertexRecoAlg::m_vertexRecoTool
ToolHandle< Muon::IMSVertexRecoTool > m_vertexRecoTool
Definition: MSVertexRecoAlg.h:24
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
MSVertex.h
MSVertexRecoAlg::execute
StatusCode execute(const EventContext &ctx) const override
Definition: MSVertexRecoAlg.cxx:30
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
MSVertexRecoAlg::initialize
StatusCode initialize() override
Definition: MSVertexRecoAlg.cxx:16
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MSVertexRecoAlg::MSVertexRecoAlg
MSVertexRecoAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MSVertexRecoAlg.cxx:12
MSVertexRecoAlg::m_vertexTrackletTool
ToolHandle< Muon::IMSVertexTrackletTool > m_vertexTrackletTool
Definition: MSVertexRecoAlg.h:22
MSVertexRecoAlg.h
Tracklet.h