ATLAS Offline Software
Control
AthenaExamples
AthExUnittest
Root
AthExUnittestTool.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
#include "
AthExUnittest/AthExUnittestTool.h
"
7
8
AthExUnittestTool::AthExUnittestTool
(
const
std::string&
type
,
9
const
std::string&
name
,
10
const
IInterface*
parent
) :
11
AthAlgTool
(
type
,
name
,
parent
),
12
m_nProperty( 0 ),
13
m_enumProperty(
IAthExUnittestTool
::Val1 ) {
14
//example property declarations with default values
15
declareProperty
(
"Property"
,
m_nProperty
= 3.0,
16
"Please describe the property here"
);
17
declareProperty
(
"ENumProperty"
,
m_enumProperty
=
Val1
,
18
"Please define enums inside your classes, not just in namespaces"
);
19
}
20
21
StatusCode
AthExUnittestTool::initialize
() {
22
ATH_MSG_INFO
(
"Initializing "
<<
name
() <<
"..."
);
23
ATH_MSG_INFO
(
"Property = "
<<
m_nProperty
);
24
ATH_MSG_INFO
(
"ENumProperty = "
<<
m_enumProperty
);
25
26
//Make use of the property values to configure the tool
27
//Tools should be designed so that no method other than setProperty is called before initialize
28
return
StatusCode::SUCCESS;
29
}
30
31
double
AthExUnittestTool::useTheProperty
() {
32
return
m_nProperty
;
33
}
34
AthExUnittestTool::AthExUnittestTool
AthExUnittestTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition:
AthExUnittestTool.cxx:8
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition:
AthMsgStreamMacros.h:31
IAthExUnittestTool::Val1
@ Val1
Definition:
IAthExUnittestTool.h:15
python.CaloAddPedShiftConfig.type
type
Definition:
CaloAddPedShiftConfig.py:42
AthExUnittestTool::initialize
virtual StatusCode initialize() override
Definition:
AthExUnittestTool.cxx:21
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition:
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition:
AthCommonDataStore.h:145
test_pyathena.parent
parent
Definition:
test_pyathena.py:15
AthExUnittestTool::m_enumProperty
unsigned int m_enumProperty
Definition:
AthExUnittestTool.h:27
AthExUnittestTool::useTheProperty
virtual double useTheProperty() override
Definition:
AthExUnittestTool.cxx:31
name
std::string name
Definition:
Control/AthContainers/Root/debug.cxx:240
AthExUnittestTool::m_nProperty
double m_nProperty
Definition:
AthExUnittestTool.h:26
AthExUnittestTool.h
IAthExUnittestTool
Definition:
IAthExUnittestTool.h:10
AthAlgTool
Definition:
AthAlgTool.h:26
Generated on Mon Sep 1 2025 21:06:43 for ATLAS Offline Software by
1.8.18