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
#include "Gaudi/PropertyFmt.h"
9
10
AthAsgExUnittestAlg::AthAsgExUnittestAlg
(
const
std::string& name,
11
ISvcLocator* pSvcLocator ) :
12
AthAnalysisAlgorithm
( name, pSvcLocator ) {
13
addRef();
// workaround until fix in Gaudi
14
}
15
16
17
AthAsgExUnittestAlg::~AthAsgExUnittestAlg
() {}
18
19
20
StatusCode
AthAsgExUnittestAlg::initialize
() {
21
ATH_MSG_INFO
(
"Initializing {}..."
, name() );
22
ATH_MSG_INFO
(
"MyProperty = {}"
,
m_property
);
23
CHECK
(
m_tool
.retrieve());
24
return
StatusCode::SUCCESS;
25
}
26
27
StatusCode
AthAsgExUnittestAlg::finalize
() {
28
ATH_MSG_INFO
(
"Finalizing {}..."
, name() );
29
return
StatusCode::SUCCESS;
30
}
31
32
StatusCode
AthAsgExUnittestAlg::execute
(
const
EventContext& ctx) {
33
ATH_MSG_DEBUG
(
"Executing {}..."
, name() );
34
setFilterPassed
(
false
, ctx);
//optional: start with algorithm not passed
35
36
// Real algorithm here
37
38
setFilterPassed
(
true
, ctx);
//if got here, assume that means algorithm passed
39
return
StatusCode::SUCCESS;
40
}
41
AthAsgExUnittestAlg.h
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
ATH_MSG_INFO
#define ATH_MSG_INFO(x,...)
Definition
AthMsgStreamMacros.h:45
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:10
AthAsgExUnittestAlg::m_property
Gaudi::Property< int > m_property
Definition
AthAsgExUnittestAlg.h:30
AthAsgExUnittestAlg::initialize
virtual StatusCode initialize() override
Definition
AthAsgExUnittestAlg.cxx:20
AthAsgExUnittestAlg::~AthAsgExUnittestAlg
virtual ~AthAsgExUnittestAlg()
Definition
AthAsgExUnittestAlg.cxx:17
AthAsgExUnittestAlg::execute
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
Definition
AthAsgExUnittestAlg.cxx:32
AthAsgExUnittestAlg::finalize
virtual StatusCode finalize() override
Definition
AthAsgExUnittestAlg.cxx:27
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