ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDTools
EventLoop
Root
FileExecutedModule.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
8
9
//
10
// includes
11
//
12
13
#include <
EventLoop/FileExecutedModule.h
>
14
15
#include <
EventLoop/ModuleData.h
>
16
#include <TString.h>
17
#include <TTree.h>
18
19
//
20
// method implementations
21
//
22
23
namespace
EL
24
{
25
namespace
Detail
26
{
27
FileExecutedModule ::
28
~FileExecutedModule () noexcept
29
{
30
m_fileExecutedTree
.release ();
31
delete
m_fileExecutedName
;
32
}
33
34
35
36
StatusCode
FileExecutedModule ::
37
onInitialize (
ModuleData
&
/*data*/
)
38
{
39
m_fileExecutedTree
= std::make_unique<TTree>
40
(
"EventLoop_FileExecuted"
,
"executed files"
);
41
m_fileExecutedTree
->SetDirectory (
nullptr
);
42
m_fileExecutedName
=
new
TString;
43
m_fileExecutedTree
->Branch (
"file"
, &
m_fileExecutedName
);
44
return
StatusCode::SUCCESS;
45
}
46
47
48
49
StatusCode
FileExecutedModule ::
50
onFileExecute (
ModuleData
& data)
51
{
52
auto
split
= data.m_inputFileUrl.rfind (
'/'
);
53
if
(
split
!= std::string::npos)
54
*
m_fileExecutedName
= data.m_inputFileUrl.substr (
split
+ 1);
55
else
56
*
m_fileExecutedName
= data.m_inputFileUrl;
57
m_fileExecutedTree
->Fill ();
58
return
StatusCode::SUCCESS;
59
}
60
61
62
63
StatusCode
FileExecutedModule ::
64
postFinalize (
ModuleData
& data)
65
{
66
data.addOutput (std::move (
m_fileExecutedTree
));
67
return
StatusCode::SUCCESS;
68
}
69
}
70
}
FileExecutedModule.h
ModuleData.h
EL::Detail::FileExecutedModule::m_fileExecutedTree
std::unique_ptr< TTree > m_fileExecutedTree
the tree containing the list of files for which fileExecute has been called
Definition
FileExecutedModule.h:52
EL::Detail::FileExecutedModule::m_fileExecutedName
TString * m_fileExecutedName
the name of the file being executed, to be stored inside m_fileExecutedTree
Definition
FileExecutedModule.h:57
split
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition
hcg.cxx:179
EL::Detail
Definition
AsgComponentFactories.h:20
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
EL::Detail::ModuleData
the data the EventLoop core classes are sharing with the Module implementation
Definition
ModuleData.h:65
Generated on
for ATLAS Offline Software by
1.17.0