ATLAS Offline Software
Loading...
Searching...
No Matches
InDetVertexTruthMatchAlgorithm.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6
8
9
10InDetVertexTruthMatchAlgorithm::InDetVertexTruthMatchAlgorithm( const std::string& name, ISvcLocator* svcLoc )
11 : AthAlgorithm( name, svcLoc ),
12 m_matchTool( "InDetVertexTruthMatchTool/InDetVertexTruthMatchTool", this ) {
13
14 declareProperty( "SGKey", m_sgKey = "PrimaryVertices" );
15
16 declareProperty( "VertexTruthMatchTool", m_matchTool );
17}
18
20
21 // Greet the user:
22 ATH_MSG_INFO( "Initialising" );
23 ATH_MSG_DEBUG( "SGKey = " << m_sgKey );
24
25 // Retrieve the tools:
26 ATH_CHECK( m_matchTool.retrieve() );
27
28 // Return gracefully:
29 return StatusCode::SUCCESS;
30}
31
33
34 //Retrieve the vertices:
35 const xAOD::VertexContainer * vxContainer = nullptr;
36 ATH_CHECK( evtStore()->retrieve( vxContainer, m_sgKey ) );
37
38 //pass to the tool for decoration:
39 ATH_CHECK( m_matchTool->matchVertices( *vxContainer ) );
40
41 return StatusCode::SUCCESS;
42
43}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ToolHandle< IInDetVertexTruthMatchTool > m_matchTool
std::string m_sgKey
StoreGate key for the muon container to investigate.
virtual StatusCode execute() override final
Function executing the algorithm.
InDetVertexTruthMatchAlgorithm(const std::string &name, ISvcLocator *svcLoc)
Regular Algorithm constructor.
virtual StatusCode initialize() override final
Function initialising the algorithm.
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".