ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaExamples
AthAsgExUnittest
src
AthAsgExUnittestAlg.cxx
Go to the documentation of this file.
1
2
//
3
// Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
4
//
5
6
// AthAsgExUnittest includes
7
#include "
AthAsgExUnittestAlg.h
"
8
9
AthAsgExUnittestAlg::AthAsgExUnittestAlg
(
const
std::string& name,
10
ISvcLocator* pSvcLocator ) :
11
AthAnalysisAlgorithm
( name, pSvcLocator ) {
12
addRef();
// workaround until fix in Gaudi
13
}
14
15
16
AthAsgExUnittestAlg::~AthAsgExUnittestAlg
() {}
17
18
19
StatusCode
AthAsgExUnittestAlg::initialize
() {
20
ATH_MSG_INFO
(
"Initializing "
<< name() <<
"..."
);
21
ATH_MSG_INFO
(
"MyProperty = "
<<
m_property
);
22
CHECK
(
m_tool
.retrieve());
23
return
StatusCode::SUCCESS;
24
}
25
26
StatusCode
AthAsgExUnittestAlg::finalize
() {
27
ATH_MSG_INFO
(
"Finalizing "
<< name() <<
"..."
);
28
return
StatusCode::SUCCESS;
29
}
30
31
StatusCode
AthAsgExUnittestAlg::execute
(
const
EventContext& ctx) {
32
ATH_MSG_DEBUG
(
"Executing "
<< name() <<
"..."
);
33
setFilterPassed
(
false
, ctx);
//optional: start with algorithm not passed
34
35
// Real algorithm here
36
37
setFilterPassed
(
true
, ctx);
//if got here, assume that means algorithm passed
38
return
StatusCode::SUCCESS;
39
}
40
AthAsgExUnittestAlg.h
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
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
AthAnalysisAlgorithm::AthAnalysisAlgorithm
AthAnalysisAlgorithm(const std::string &name)
Constructor taking just a name.
Definition
AthAnalysisAlgorithm.cxx:19
AthAsgExUnittestAlg::m_tool
ToolHandle< IAthAsgExUnittestTool > m_tool
Definition
AthAsgExUnittestAlg.h:31
AthAsgExUnittestAlg::AthAsgExUnittestAlg
AthAsgExUnittestAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
AthAsgExUnittestAlg.cxx:9
AthAsgExUnittestAlg::m_property
Gaudi::Property< int > m_property
Definition
AthAsgExUnittestAlg.h:30
AthAsgExUnittestAlg::initialize
virtual StatusCode initialize() override
Definition
AthAsgExUnittestAlg.cxx:19
AthAsgExUnittestAlg::~AthAsgExUnittestAlg
virtual ~AthAsgExUnittestAlg()
Definition
AthAsgExUnittestAlg.cxx:16
AthAsgExUnittestAlg::execute
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
Definition
AthAsgExUnittestAlg.cxx:31
AthAsgExUnittestAlg::finalize
virtual StatusCode finalize() override
Definition
AthAsgExUnittestAlg.cxx:26
AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Definition
AthCommonAlgorithm.h:99
Generated on
for ATLAS Offline Software by
1.17.0