ATLAS Offline Software
AthExUnittestAlg.cxx
Go to the documentation of this file.
1 
2 //
3 // Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
4 //
5 
6 // MyPackage includes
7 #include "AthExUnittestAlg.h"
8 
10  ISvcLocator* pSvcLocator ) :
11  AthAlgorithm( name, pSvcLocator ),
12  m_property( 1 ),
13  m_tool( "AthExUnittestTool/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 
21 
23  ATH_MSG_INFO( "Initializing " << name() << "..." );
24  ATH_MSG_INFO( "MyProperty = " << m_property );
25  CHECK(m_tool.retrieve());
26  return StatusCode::SUCCESS;
27 }
28 
30  ATH_MSG_INFO( "Finalizing " << name() << "..." );
31  return StatusCode::SUCCESS;
32 }
33 
35  ATH_MSG_DEBUG( "Executing " << name() << "..." );
36  setFilterPassed(false); //optional: start with algorithm not passed
37 
38  // Real algorithm here
39 
40  setFilterPassed(true); //if got here, assume that means algorithm passed
41  return StatusCode::SUCCESS;
42 }
43 
45  //This method is called at the start of each input file, even if
46  //the input file contains no events. Accumulate metadata information here
47  return StatusCode::SUCCESS;
48 }
49 
AthExUnittestAlg::~AthExUnittestAlg
virtual ~AthExUnittestAlg()
Definition: AthExUnittestAlg.cxx:20
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
AthExUnittestAlg::m_tool
ToolHandle< IAthExUnittestTool > m_tool
Definition: AthExUnittestAlg.h:26
AthExUnittestAlg::beginInputFile
virtual StatusCode beginInputFile()
Definition: AthExUnittestAlg.cxx:44
AthExUnittestAlg.h
AthExUnittestAlg::AthExUnittestAlg
AthExUnittestAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: AthExUnittestAlg.cxx:9
AthExUnittestAlg::m_property
int m_property
Definition: AthExUnittestAlg.h:25
AthExUnittestAlg::execute
virtual StatusCode execute()
Definition: AthExUnittestAlg.cxx:34
AthExUnittestAlg::initialize
virtual StatusCode initialize()
Definition: AthExUnittestAlg.cxx:22
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
AthAlgorithm
Definition: AthAlgorithm.h:47
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
AthExUnittestAlg::finalize
virtual StatusCode finalize()
Definition: AthExUnittestAlg.cxx:29