ATLAS Offline Software
Loading...
Searching...
No Matches
AthAsgExUnittestAlg.cxx
Go to the documentation of this file.
1
2//
3// Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
4//
5
6// AthAsgExUnittest includes
8
10 ISvcLocator* pSvcLocator ) :
11 AthAnalysisAlgorithm( name, pSvcLocator ),
12 m_property( 1 ),
13 m_tool( "AthAsgExUnittestTool/MyTool", this ) {
14 addRef(); // workaround until fix in Gaudi
15 // example property declarations
16 declareProperty( "MyProperty", m_property );
17 declareProperty( "MyTool", m_tool );
18}
19
20
22
23
25 ATH_MSG_INFO( "Initializing " << name() << "..." );
26 ATH_MSG_INFO( "MyProperty = " << m_property );
27 CHECK(m_tool.retrieve());
28 return StatusCode::SUCCESS;
29}
30
32 ATH_MSG_INFO( "Finalizing " << name() << "..." );
33 return StatusCode::SUCCESS;
34}
35
37 ATH_MSG_DEBUG( "Executing " << name() << "..." );
38 setFilterPassed(false); //optional: start with algorithm not passed
39
40 // Real algorithm here
41
42 setFilterPassed(true); //if got here, assume that means algorithm passed
43 return StatusCode::SUCCESS;
44}
45
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
AthAnalysisAlgorithm(const std::string &name)
Constructor taking just a name.
virtual StatusCode execute() override
ToolHandle< IAthAsgExUnittestTool > m_tool
AthAsgExUnittestAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize() override
virtual StatusCode finalize() override
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)