ATLAS Offline Software
PhysicsAnalysis
D3PDTools
EventLoop
Root
PostClosedOutputsModule.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
8
#include <
EventLoop/PostClosedOutputsModule.h
>
9
10
#include <
EventLoop/Job.h
>
11
#include <
EventLoop/ModuleData.h
>
12
#include <
EventLoop/Worker.h
>
13
#include <
RootCoreUtils/ShellExec.h
>
14
15
16
//
17
// method implementations
18
//
19
20
namespace
EL
21
{
22
namespace
Detail
23
{
24
StatusCode
PostClosedOutputsModule ::
25
postFileClose
(
ModuleData
&
data
)
26
{
27
// get executable if user provided one
28
std::string postCloseExec =
data
.m_worker->metaData()->castString (
Job::optWorkerPostClosedOutputsExecutable
,
""
);
29
30
if
(!postCloseExec.size()){
31
// user did not provide an excutable to be called after all outputs are closed
32
ANA_MSG_DEBUG
(
"PostClosedOutputsModule: no additionnal checks/actions performed after all outputs are closed"
);
33
return
StatusCode::SUCCESS;
34
}
35
36
// user provided an executable to be used
37
// loop over all outputs
38
for
(
auto
& [
outputLabel
, outputPtr] :
data
.m_outputs){
39
if
(
outputLabel
!= outputPtr->mainStreamName())
continue
;
40
41
const
std::string&
outputFileName
= outputPtr->finalFileName();
42
43
if
(!
outputFileName
.size()){
44
ANA_MSG_WARNING
(
"PostClosedOutputsModule: empty outputFileName skipping outputLabel = "
+
outputLabel
);
45
continue
;
46
}
47
48
// for instance execute a script checking that root files are not corrupted
49
std::string cmdLineToExecute = postCloseExec+
" "
+
outputLabel
+
" "
+
outputFileName
;
50
51
ANA_MSG_INFO
(
"PostClosedOutputsModule: execute command line = '"
<< cmdLineToExecute <<
"'"
);
52
RCU::Shell::exec
(cmdLineToExecute.c_str());
53
}
54
return
StatusCode::SUCCESS;
55
}
56
}
57
}
data
char data[hepevt_bytes_allocation_ATLAS]
Definition:
HepEvt.cxx:11
EL::Detail::ModuleData
the data the EventLoop core classes are sharing with the Module implementation
Definition:
ModuleData.h:64
Job.h
PostClosedOutputsModule.h
outputLabel
const std::string outputLabel
Definition:
OverlapRemovalTester.cxx:69
ShellExec.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition:
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
EL::Job::optWorkerPostClosedOutputsExecutable
static const std::string optWorkerPostClosedOutputsExecutable
Optionnal executable to be provided by the user that will be called, by the worker,...
Definition:
Job.h:286
ANA_MSG_INFO
#define ANA_MSG_INFO(xmsg)
Macro printing info messages.
Definition:
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:290
ANA_MSG_WARNING
#define ANA_MSG_WARNING(xmsg)
Macro printing warning messages.
Definition:
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:292
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition:
AsgComponentFactories.h:16
xAOD::DiTauJetParameters::Detail
Detail
Definition:
DiTauDefs.h:38
Worker.h
RCU::Shell::exec
void exec(const std::string &cmd)
effects: execute the given command guarantee: strong failures: out of memory II failures: system fail...
Definition:
ShellExec.cxx:29
ModuleData.h
EL::Detail::PostClosedOutputsModule::postFileClose
virtual StatusCode postFileClose(ModuleData &data) override
action at end of the worker job
Definition:
PostClosedOutputsModule.cxx:25
AthenaPoolExample_Copy.outputFileName
string outputFileName
Definition:
AthenaPoolExample_Copy.py:40
ANA_MSG_DEBUG
#define ANA_MSG_DEBUG(xmsg)
Macro printing debug messages.
Definition:
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:288
Generated on Mon Sep 29 2025 21:17:01 for ATLAS Offline Software by
1.8.18