ATLAS Offline Software
Loading...
Searching...
No Matches
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
8#include "Gaudi/PropertyFmt.h"
9
11 ISvcLocator* pSvcLocator ) :
12 AthAnalysisAlgorithm( name, pSvcLocator ) {
13 addRef(); // workaround until fix in Gaudi
14}
15
16
18
19
21 ATH_MSG_INFO( "Initializing {}...", name() );
22 ATH_MSG_INFO( "MyProperty = {}", m_property );
23 CHECK(m_tool.retrieve());
24 return StatusCode::SUCCESS;
25}
26
28 ATH_MSG_INFO( "Finalizing {}...", name() );
29 return StatusCode::SUCCESS;
30}
31
32StatusCode 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
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_INFO(x,...)
#define CHECK(...)
Evaluate an expression and check for errors.
AthAnalysisAlgorithm(const std::string &name)
Constructor taking just a name.
ToolHandle< IAthAsgExUnittestTool > m_tool
AthAsgExUnittestAlg(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< int > m_property
virtual StatusCode initialize() override
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
virtual StatusCode finalize() override
virtual void setFilterPassed(bool state, const EventContext &ctx) const