ATLAS Offline Software
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 
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  {
28  ~FileExecutedModule () noexcept
29  {
30  m_fileExecutedTree.release ();
31  delete m_fileExecutedName;
32  }
33 
34 
35 
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 
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 
65  {
66  data.addOutput (std::move (m_fileExecutedTree));
67  return StatusCode::SUCCESS;
68  }
69  }
70 }
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
FileExecutedModule.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition: AlgorithmWorkerData.h:24
xAOD::DiTauJetParameters::Detail
Detail
Definition: DiTauDefs.h:38
EL::Detail::FileExecutedModule::onInitialize
virtual StatusCode onInitialize(ModuleData &data) override
action just before algorithms are initialized
Definition: FileExecutedModule.cxx:37
EL::Detail::FileExecutedModule::~FileExecutedModule
virtual ~FileExecutedModule() noexcept
Definition: FileExecutedModule.cxx:28
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:51
EL::Detail::FileExecutedModule::postFinalize
virtual StatusCode postFinalize(ModuleData &data) override
actions after algorithms have been finalized
Definition: FileExecutedModule.cxx:64
ModuleData.h
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
EL::Detail::FileExecutedModule::onFileExecute
virtual StatusCode onFileExecute(ModuleData &data) override
actions just before fileExecute is called on algorithms
Definition: FileExecutedModule.cxx:50
EL::Detail::FileExecutedModule::m_fileExecutedName
TString * m_fileExecutedName
the name of the file being executed, to be stored inside m_fileExecutedTree
Definition: FileExecutedModule.h:56