ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthViews
src
ViewTestAlg.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
// ViewTestAlg.cxx
8
// Implementation file for class ViewTestAlg
9
// Author: B. Wynne <bwynne@cern.ch>
11
12
#include "
ViewTestAlg.h
"
13
#include "
AthenaKernel/ExtendedEventContext.h
"
14
#include "
AthViews/View.h
"
15
16
namespace
AthViews
{
17
18
StatusCode
ViewTestAlg::initialize
()
19
{
20
ATH_MSG_DEBUG
(
"Initializing "
<< name() <<
"..."
);
21
22
if
(
m_output
.key() ==
""
)
23
{
24
renounce
(
m_output
);
25
}
26
else
27
{
28
CHECK
(
m_output
.initialize() );
29
}
30
31
return
StatusCode::SUCCESS;
32
}
33
34
StatusCode
ViewTestAlg::finalize
()
35
{
36
ATH_MSG_DEBUG
(
"Finalizing "
<< name() <<
"..."
);
37
38
return
StatusCode::SUCCESS;
39
}
40
41
StatusCode
ViewTestAlg::execute
(
const
EventContext& ctx)
const
42
{
43
ATH_MSG_DEBUG
(
"Executing "
<< name() <<
"..."
);
44
45
auto
theStore =
Atlas::getExtendedEventContext
( ctx ).proxy();
46
ATH_MSG_INFO
( name() <<
" running with store "
<< theStore->name() );
47
48
// Make (optional) output
49
if
(
m_output
.key() !=
""
)
50
{
51
auto
output =
SG::makeHandle
(
m_output
, ctx );
52
output = std::make_unique<int>( 1 );
53
}
54
55
// Identify if this is a view
56
SG::View
* theView =
dynamic_cast<
SG::View
*
>
( theStore );
57
if
( theView )
58
{
59
ATH_MSG_INFO
( theView->
dump
() );
60
}
61
else
62
{
63
ATH_MSG_INFO
(
"This is not an EventView"
);
64
}
65
66
return
StatusCode::SUCCESS;
67
}
68
69
}
//> end namespace AthViews
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
ExtendedEventContext.h
ViewTestAlg.h
View.h
AthCommonAlgorithm< Gaudi::Algorithm >::renounce
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
Definition
AthCommonDataStore.h:380
AthViews::ViewTestAlg::initialize
virtual StatusCode initialize() override
Definition
ViewTestAlg.cxx:18
AthViews::ViewTestAlg::m_output
SG::WriteHandleKey< int > m_output
Definition
ViewTestAlg.h:32
AthViews::ViewTestAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
ViewTestAlg.cxx:41
AthViews::ViewTestAlg::finalize
virtual StatusCode finalize() override
Definition
ViewTestAlg.cxx:34
SG::View
A "view" of the event store (IProxyDict).
Definition
View.h:46
SG::View::dump
std::string dump(const std::string &indent="") const
Print content of the view.
Definition
View.cxx:164
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
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition
ReadCondHandle.h:269
Generated on
for ATLAS Offline Software by
1.17.0