ATLAS Offline Software
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
7 #include "AthAsgExUnittestAlg.h"
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 
AthAnalysisAlgorithm
Definition: AthAnalysisAlgorithm.h:34
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
AthAsgExUnittestAlg::m_tool
ToolHandle< IAthAsgExUnittestTool > m_tool
Definition: AthAsgExUnittestAlg.h:31
AthAsgExUnittestAlg::AthAsgExUnittestAlg
AthAsgExUnittestAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: AthAsgExUnittestAlg.cxx:9
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
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
AthAsgExUnittestAlg::finalize
virtual StatusCode finalize() override
Definition: AthAsgExUnittestAlg.cxx:31
AthAsgExUnittestAlg::initialize
virtual StatusCode initialize() override
Definition: AthAsgExUnittestAlg.cxx:24
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
AthAsgExUnittestAlg::m_property
int m_property
Definition: AthAsgExUnittestAlg.h:30
AthAsgExUnittestAlg::execute
virtual StatusCode execute() override
Definition: AthAsgExUnittestAlg.cxx:36
AthAsgExUnittestAlg.h
AthAsgExUnittestAlg::~AthAsgExUnittestAlg
virtual ~AthAsgExUnittestAlg()
Definition: AthAsgExUnittestAlg.cxx:21