ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthViews
src_dflow
ConditionTestAlg.cxx
Go to the documentation of this file.
1
2
3
/*
4
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
5
*/
6
7
// ConditionTestAlg.cxx
8
// Implementation file for class ConditionTestAlg
9
// Author: B. Wynne <bwynne@cern.ch>
11
12
#include "
ConditionTestAlg.h
"
13
14
// STL includes
15
16
// FrameWork includes
17
#include "
AthenaKernel/ExtendedEventContext.h
"
18
19
namespace
AthViews
{
20
22
// Public methods:
24
25
// Constructors
27
ConditionTestAlg::ConditionTestAlg
(
const
std::string& name,
28
ISvcLocator* pSvcLocator ) :
29
::
AthCondAlgorithm
( name, pSvcLocator )
30
{
31
//
32
// Property declaration
33
//
34
//declareProperty( "Property", m_nProperty );
35
}
36
37
// Destructor
39
ConditionTestAlg::~ConditionTestAlg
()
40
{}
41
42
// Athena Algorithm's Hooks
44
StatusCode
ConditionTestAlg::initialize
()
45
{
46
ATH_MSG_INFO
(
"Initializing "
<< name() <<
"..."
);
47
48
CHECK
(
m_condKeyTest
.initialize() );
49
50
return
StatusCode::SUCCESS;
51
}
52
53
StatusCode
ConditionTestAlg::finalize
()
54
{
55
ATH_MSG_INFO
(
"Finalizing "
<< name() <<
"..."
);
56
57
return
StatusCode::SUCCESS;
58
}
59
60
StatusCode
ConditionTestAlg::execute
(
const
EventContext& ctx)
const
61
{
62
SG::WriteCondHandle< CondDataObj >
condHandleTest(
m_condKeyTest
, ctx );
63
64
if
( condHandleTest.
isValid
() ) {
65
ATH_MSG_DEBUG
(
"CondHandle "
<< condHandleTest.
fullKey
() <<
" is already valid."
);
66
return
StatusCode::SUCCESS;
67
}
68
69
ATH_MSG_INFO
(
"Creating "
<<
m_condKeyTest
);
70
71
ATH_MSG_DEBUG
( name() <<
" running with store "
<<
Atlas::getExtendedEventContext
(ctx).proxy()->name() );
72
73
// Make a (large) validity range
74
EventIDBase begin (0,
75
EventIDBase::UNDEFEVT,
// event
76
EventIDBase::UNDEFNUM,
// timestamp
77
EventIDBase::UNDEFNUM,
// timestamp ns
78
0);
79
EventIDBase end (10000,
80
EventIDBase::UNDEFEVT,
// event
81
EventIDBase::UNDEFNUM,
// timestamp
82
EventIDBase::UNDEFNUM,
// timestamp ns
83
10000);
84
EventIDRange range( begin, end );
85
86
// Write a dummy object with this validity range
87
ATH_CHECK
( condHandleTest.
record
( range, std::make_unique< CondDataObj >( 987 ) ) );
88
89
return
StatusCode::SUCCESS;
90
}
91
92
}
//> end namespace AthViews
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
ConditionTestAlg.h
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
ExtendedEventContext.h
AthCondAlgorithm
Base class for conditions algorithms.
Definition
AthCondAlgorithm.h:22
AthViews::ConditionTestAlg::ConditionTestAlg
ConditionTestAlg()
Default constructor:
AthViews::ConditionTestAlg::~ConditionTestAlg
virtual ~ConditionTestAlg()
Destructor:
Definition
ConditionTestAlg.cxx:39
AthViews::ConditionTestAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
ConditionTestAlg.cxx:60
AthViews::ConditionTestAlg::finalize
virtual StatusCode finalize() override
Definition
ConditionTestAlg.cxx:53
AthViews::ConditionTestAlg::initialize
virtual StatusCode initialize() override
Definition
ConditionTestAlg.cxx:44
AthViews::ConditionTestAlg::m_condKeyTest
SG::WriteCondHandleKey< CondDataObj > m_condKeyTest
Containers.
Definition
ConditionTestAlg.h:57
SG::WriteCondHandle
Definition
WriteCondHandle.h:26
SG::WriteCondHandle::record
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
Definition
WriteCondHandle.h:161
SG::WriteCondHandle::isValid
bool isValid() const
Definition
WriteCondHandle.h:252
SG::WriteCondHandle::fullKey
const DataObjID & fullKey() const
Definition
WriteCondHandle.h:45
AthViews
Definition
ViewDataVerifier.cxx:18
Atlas::getExtendedEventContext
const ExtendedEventContext & getExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.
Definition
ExtendedEventContext.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0