ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDTools
AnaAlgorithm
Root
AnaReentrantAlgorithmWrapper.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 <
AnaAlgorithm/AnaReentrantAlgorithmWrapper.h
>
14
15
#include <
AnaAlgorithm/MessageCheck.h
>
16
#include "
RootCoreUtils/Assert.h
"
17
18
19
20
//
21
// method implementations
22
//
23
24
namespace
EL
25
{
26
void
AnaReentrantAlgorithmWrapper ::
27
testInvariant ()
const
28
{
29
RCU_INVARIANT
(!
m_config
.name().empty());
30
}
31
32
33
34
AnaReentrantAlgorithmWrapper ::
35
AnaReentrantAlgorithmWrapper (
AnaReentrantAlgorithmConfig
val_config)
36
:
m_config
(
std
::move (val_config))
37
{
38
RCU_NEW_INVARIANT
(
this
);
39
}
40
41
42
43
std::string_view AnaReentrantAlgorithmWrapper ::
44
getName ()
const
45
{
46
RCU_READ_INVARIANT
(
this
);
47
return
m_config
.name();
48
}
49
50
51
52
bool
AnaReentrantAlgorithmWrapper ::
53
hasName (
const
std::string& name)
const
54
{
55
RCU_READ_INVARIANT
(
this
);
56
return
m_config
.name() == name;
57
}
58
59
60
61
std::unique_ptr<IAlgorithmWrapper> AnaReentrantAlgorithmWrapper ::
62
makeClone()
const
63
{
64
RCU_READ_INVARIANT
(
this
);
65
return
std::make_unique<AnaReentrantAlgorithmWrapper> (
m_config
);
66
}
67
68
69
70
StatusCode
AnaReentrantAlgorithmWrapper ::
71
initialize (
const
AlgorithmWorkerData
& workerData)
72
{
73
using namespace
msgAlgorithmConfig;
74
RCU_CHANGE_INVARIANT
(
this
);
75
if
(
m_config
.makeAlgorithm (
m_algorithm
, workerData).isFailure())
76
{
77
ANA_MSG_ERROR
(
"failed to create AnaReentrantAlgorithm: "
<<
m_config
.name());
78
return
StatusCode::FAILURE;
79
}
80
return
StatusCode::SUCCESS;
81
}
82
83
84
85
StatusCode
AnaReentrantAlgorithmWrapper ::
86
execute (
const
EventContext& ctx)
87
{
88
using namespace
msgAlgorithmConfig;
89
RCU_READ_INVARIANT
(
this
);
90
if
(
m_algorithm
->sysExecute(ctx).isFailure())
91
{
92
ANA_MSG_ERROR
(
"failed to call execute() on algorithm: "
<<
m_config
.name());
93
return
StatusCode::FAILURE;
94
}
95
return
StatusCode::SUCCESS;
96
}
97
98
99
100
StatusCode
AnaReentrantAlgorithmWrapper ::
101
finalize ()
102
{
103
using namespace
msgAlgorithmConfig;
104
RCU_READ_INVARIANT
(
this
);
105
if
(
m_algorithm
->sysFinalize().isFailure())
106
{
107
ANA_MSG_ERROR
(
"failed to call finalize() on algorithm: "
<<
m_config
.name());
108
return
StatusCode::FAILURE;
109
}
110
return
StatusCode::SUCCESS;
111
}
112
113
114
115
StatusCode
AnaReentrantAlgorithmWrapper ::
116
fileExecute ()
117
{
118
// no-op
119
return
StatusCode::SUCCESS;
120
}
121
122
123
124
StatusCode
AnaReentrantAlgorithmWrapper ::
125
beginInputFile ()
126
{
127
// no-op
128
return
StatusCode::SUCCESS;
129
}
130
131
132
133
::StatusCode
AnaReentrantAlgorithmWrapper ::
134
endInputFile ()
135
{
136
// no-op
137
return
StatusCode::SUCCESS;
138
}
139
}
AnaReentrantAlgorithmWrapper.h
Assert.h
RCU_INVARIANT
#define RCU_INVARIANT(x)
Definition
Assert.h:187
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::AnaReentrantAlgorithmConfig
an object that can create a AnaReentrantAlgorithm
Definition
AnaReentrantAlgorithmConfig.h:29
EL::AnaReentrantAlgorithmWrapper::m_algorithm
std::unique_ptr< AnaReentrantAlgorithm > m_algorithm
the actual algorithm (once instantiated)
Definition
AnaReentrantAlgorithmWrapper.h:76
EL::AnaReentrantAlgorithmWrapper::m_config
AnaReentrantAlgorithmConfig m_config
the algorithm configuration
Definition
AnaReentrantAlgorithmWrapper.h:69
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