ATLAS Offline Software
Loading...
Searching...
No Matches
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
14
16#include <TString.h>
17#include <TTree.h>
18
19//
20// method implementations
21//
22
23namespace 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}
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
std::unique_ptr< TTree > m_fileExecutedTree
the tree containing the list of files for which fileExecute has been called
TString * m_fileExecutedName
the name of the file being executed, to be stored inside m_fileExecutedTree
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177
This module defines the arguments passed from the BATCH driver to the BATCH worker.
::StatusCode StatusCode
StatusCode definition for legacy code.
the data the EventLoop core classes are sharing with the Module implementation
Definition ModuleData.h:64