ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDTools
EventLoop
Root
Algorithm.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
//
8
// includes
9
//
10
11
#include <
EventLoop/Algorithm.h
>
12
13
#include <
EventLoop/StatusCode.h
>
14
#include <
EventLoop/Worker.h
>
15
#include <
RootCoreUtils/Assert.h
>
16
#include <TH1.h>
17
18
#include <
AsgMessaging/MsgLevel.h
>
19
#include <
AsgMessaging/MsgStream.h
>
20
21
#include <stdexcept>
22
23
//
24
// method implementations
25
//
26
27
ClassImp
(
EL::Algorithm
)
28
29
namespace
EL
30
{
31
void
Algorithm ::
32
testInvariant ()
const
33
{}
34
35
36
37
IWorker *Algorithm ::
38
wk ()
const
39
{
40
RCU_READ_INVARIANT
(
this
);
41
return
m_wk;
42
}
43
44
45
46
void
Algorithm ::
47
book (
const
TH1& hist)
48
{
49
RCU_CHANGE_INVARIANT
(
this
);
50
wk()->addOutput (hist.Clone());
51
}
52
53
54
55
TH1 *Algorithm ::
56
hist (
const
std::string& name)
const
57
{
58
RCU_READ_INVARIANT
(
this
);
59
return
dynamic_cast<
TH1*
>
(wk()->getOutputHist (name));
60
}
61
62
63
64
Algorithm ::
65
Algorithm ()
66
: m_wk (
nullptr
)
67
{
68
RCU_NEW_INVARIANT
(
this
);
69
}
70
71
72
73
Algorithm ::
74
~Algorithm ()
75
{
76
delete
m_msg;
77
}
78
79
80
81
asg::SgEvent
*Algorithm ::
82
evtStore()
const
83
{
84
RCU_CHANGE_INVARIANT
(
this
);
85
if
(m_evtStorePtr)
86
return
m_evtStorePtr;
87
m_evtStore =
asg::SgEvent
(wk()->xaodEvent(), wk()->xaodStore());
88
m_evtStorePtr = &m_evtStore;
89
return
m_evtStorePtr;
90
}
91
92
93
94
MsgStream& Algorithm ::
95
msg ()
const
96
{
97
RCU_READ_INVARIANT
(
this
);
98
if
(m_msg == 0 || m_msgName != GetName())
99
{
100
delete
m_msg;
101
m_msg =
nullptr
;
102
m_msgName = GetName();
103
std::string name;
104
if
(m_msgName.empty())
105
name =
"UnnamedAlgorithm"
;
106
else
107
name = m_msgName;
108
m_msg =
new
MsgStream (name);
109
m_msg->setLevel (MSG::Level (m_msgLevel));
110
}
111
return
*m_msg;
112
}
113
114
115
116
MsgStream& Algorithm ::
117
msg (
int
level)
const
118
{
119
RCU_READ_INVARIANT
(
this
);
120
MsgStream& result =
msg
();
121
result << MSG::Level (level);
122
return
result;
123
}
124
125
126
127
bool
Algorithm ::
128
msgLvl (
int
lvl)
const
129
{
130
RCU_READ_INVARIANT
(
this
);
131
return
m_msgLevel <= lvl;
132
}
133
134
135
136
void
Algorithm ::
137
setMsgLevel (
int
level)
138
{
139
RCU_CHANGE_INVARIANT
(
this
);
140
if
(m_msg)
141
m_msg->setLevel (MSG::Level (level));
142
m_msgLevel = level;
143
}
144
145
146
147
StatusCode
Algorithm ::
148
setupJob (Job&
/*job*/
)
149
{
150
RCU_CHANGE_INVARIANT
(
this
);
151
return
StatusCode::SUCCESS;
152
}
153
154
155
156
StatusCode
Algorithm ::
157
fileExecute ()
158
{
159
RCU_CHANGE_INVARIANT
(
this
);
160
return
StatusCode::SUCCESS;
161
}
162
163
164
165
StatusCode
Algorithm ::
166
endOfFile ()
167
{
168
RCU_CHANGE_INVARIANT
(
this
);
169
return
StatusCode::SUCCESS;
170
}
171
172
173
174
StatusCode
Algorithm ::
175
changeInput (
bool
/*firstFile*/
)
176
{
177
RCU_CHANGE_INVARIANT
(
this
);
178
return
StatusCode::SUCCESS;
179
}
180
181
182
183
StatusCode
Algorithm ::
184
initialize ()
185
{
186
RCU_CHANGE_INVARIANT
(
this
);
187
return
StatusCode::SUCCESS;
188
}
189
190
191
192
StatusCode
Algorithm ::
193
histInitialize ()
194
{
195
RCU_CHANGE_INVARIANT
(
this
);
196
return
StatusCode::SUCCESS;
197
}
198
199
200
201
StatusCode
Algorithm ::
202
execute ()
203
{
204
RCU_CHANGE_INVARIANT
(
this
);
205
return
StatusCode::SUCCESS;
206
}
207
208
209
210
StatusCode
Algorithm ::
211
postExecute ()
212
{
213
RCU_CHANGE_INVARIANT
(
this
);
214
return
StatusCode::SUCCESS;
215
}
216
217
218
219
StatusCode
Algorithm ::
220
finalize ()
221
{
222
RCU_CHANGE_INVARIANT
(
this
);
223
return
StatusCode::SUCCESS;
224
}
225
226
227
228
StatusCode
Algorithm ::
229
histFinalize ()
230
{
231
RCU_CHANGE_INVARIANT
(
this
);
232
return
StatusCode::SUCCESS;
233
}
234
235
236
237
bool
Algorithm ::
238
hasName (
const
std::string& name)
const
239
{
240
RCU_CHANGE_INVARIANT
(
this
);
241
return
GetName() == name;
242
}
243
244
245
246
void
Algorithm ::
247
sysSetupJob (Job& job)
248
{
249
RCU_CHANGE_INVARIANT
(
this
);
250
if
(setupJob (job) != StatusCode::SUCCESS)
251
throw
std::runtime_error (
"Algorithm::setupJob returned StatusCode::FAILURE"
);
252
}
253
254
255
256
const
std::string& Algorithm ::
257
name()
const
258
{
259
RCU_CHANGE_INVARIANT
(
this
);
260
m_nameCache = GetName();
261
return
m_nameCache;
262
}
263
}
ClassImp
ClassImp(EL::Algorithm) namespace EL
Definition
Algorithm.cxx:27
Algorithm.h
Assert.h
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
MsgStream.h
MsgLevel.h
Definition of message levels and a helper function.
StatusCode.h
Worker.h
EL::Algorithm
Definition
Algorithm.h:22
asg::SgEvent
Wrapper for Event to make it look like StoreGate.
Definition
SgEvent.h:44
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
msg
MsgStream & msg
Definition
testRead.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0