ATLAS Offline Software
Loading...
Searching...
No Matches
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
9AthExUnittestAlg::AthExUnittestAlg( const std::string& name,
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
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
virtual StatusCode finalize()
ToolHandle< IAthExUnittestTool > m_tool
virtual StatusCode initialize()
AthExUnittestAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode beginInputFile()
virtual StatusCode execute()