ATLAS Offline Software
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 
10 InDetVertexTruthMatchAlgorithm::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 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
InDetVertexTruthMatchAlgorithm.h
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
InDetVertexTruthMatchAlgorithm::m_sgKey
std::string m_sgKey
StoreGate key for the muon container to investigate.
Definition: InDetVertexTruthMatchAlgorithm.h:28
InDetVertexTruthMatchAlgorithm::execute
virtual StatusCode execute() override final
Function executing the algorithm.
Definition: InDetVertexTruthMatchAlgorithm.cxx:32
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
InDetVertexTruthMatchAlgorithm::m_matchTool
ToolHandle< IInDetVertexTruthMatchTool > m_matchTool
Definition: InDetVertexTruthMatchAlgorithm.h:30
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
InDetVertexTruthMatchAlgorithm::initialize
virtual StatusCode initialize() override final
Function initialising the algorithm.
Definition: InDetVertexTruthMatchAlgorithm.cxx:19
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
AthAlgorithm
Definition: AthAlgorithm.h:47
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
VertexContainer.h
InDetVertexTruthMatchAlgorithm::InDetVertexTruthMatchAlgorithm
InDetVertexTruthMatchAlgorithm(const std::string &name, ISvcLocator *svcLoc)
Regular Algorithm constructor.
Definition: InDetVertexTruthMatchAlgorithm.cxx:10