ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDTools
EventLoop
Root
AsgServiceWrapper.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
8
9
//
10
// includes
11
//
12
13
#include <
EventLoop/AsgServiceWrapper.h
>
14
15
#include <
EventLoop/MessageCheck.h
>
16
#include <
RootCoreUtils/Assert.h
>
17
18
//
19
// method implementations
20
//
21
22
namespace
EL
23
{
24
void
AsgServiceWrapper ::
25
testInvariant ()
const
26
{
27
RCU_INVARIANT
(!
m_config
.name().empty());
28
}
29
30
31
32
AsgServiceWrapper ::
33
AsgServiceWrapper (
asg::AsgServiceConfig
val_config)
34
:
m_config
(
std
::move (val_config))
35
{
36
RCU_NEW_INVARIANT
(
this
);
37
}
38
39
40
41
std::string_view AsgServiceWrapper ::
42
getName ()
const
43
{
44
RCU_READ_INVARIANT
(
this
);
45
return
m_config
.name();
46
}
47
48
49
50
bool
AsgServiceWrapper ::
51
hasName (
const
std::string& name)
const
52
{
53
RCU_READ_INVARIANT
(
this
);
54
return
m_config
.name() == name;
55
}
56
57
58
59
std::unique_ptr<IAlgorithmWrapper> AsgServiceWrapper ::
60
makeClone()
const
61
{
62
RCU_READ_INVARIANT
(
this
);
63
return
std::make_unique<AsgServiceWrapper> (
m_config
);
64
}
65
66
67
68
StatusCode
AsgServiceWrapper ::
69
initialize (
const
AlgorithmWorkerData
&
/*workerData*/
)
70
{
71
using namespace
msgEventLoop;
72
RCU_CHANGE_INVARIANT
(
this
);
73
if
(
m_config
.makeService (
m_service
).isFailure())
74
{
75
ANA_MSG_ERROR
(
"failed to create AsgService: "
<<
m_config
.name());
76
return
StatusCode::FAILURE;
77
}
78
return
StatusCode::SUCCESS;
79
}
80
81
82
83
StatusCode
AsgServiceWrapper ::
84
execute (
const
EventContext&
/*ctx*/
)
85
{
86
RCU_READ_INVARIANT
(
this
);
87
return
StatusCode::SUCCESS;
88
}
89
90
91
92
StatusCode
AsgServiceWrapper ::
93
finalize ()
94
{
95
using namespace
msgEventLoop;
96
RCU_READ_INVARIANT
(
this
);
97
if
(
m_service
->finalize().isFailure())
98
{
99
ANA_MSG_ERROR
(
"failed to call finalize() on service: "
<<
m_config
.name());
100
return
StatusCode::FAILURE;
101
}
102
return
StatusCode::SUCCESS;
103
}
104
105
106
107
StatusCode
AsgServiceWrapper ::
108
fileExecute ()
109
{
110
RCU_READ_INVARIANT
(
this
);
111
return
StatusCode::SUCCESS;
112
}
113
114
115
116
StatusCode
AsgServiceWrapper ::
117
beginInputFile ()
118
{
119
RCU_READ_INVARIANT
(
this
);
120
return
StatusCode::SUCCESS;
121
}
122
123
124
125
::StatusCode
AsgServiceWrapper ::
126
endInputFile ()
127
{
128
// no-op
129
return
StatusCode::SUCCESS;
130
}
131
}
AsgServiceWrapper.h
Assert.h
RCU_INVARIANT
#define RCU_INVARIANT(x)
Definition
Assert.h:189
RCU_CHANGE_INVARIANT
#define RCU_CHANGE_INVARIANT(x)
Definition
Assert.h:219
RCU_NEW_INVARIANT
#define RCU_NEW_INVARIANT(x)
Definition
Assert.h:221
RCU_READ_INVARIANT
#define RCU_READ_INVARIANT(x)
Definition
Assert.h:217
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
MessageCheck.h
EL::AsgServiceWrapper::m_config
asg::AsgServiceConfig m_config
the algorithm configuration
Definition
AsgServiceWrapper.h:69
EL::AsgServiceWrapper::m_service
std::shared_ptr< asg::AsgService > m_service
the actual service (once instantiated)
Definition
AsgServiceWrapper.h:76
asg::AsgServiceConfig
an object that can create a AsgService
Definition
AsgServiceConfig.h:25
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition
AsgComponentFactories.h:16
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
std
STL namespace.
EL::AlgorithmWorkerData
all the external components an algorithm needs before initialization (in EventLoop)
Definition
AlgorithmWorkerData.h:34
Generated on
for ATLAS Offline Software by
1.17.0