Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
BookkeeperTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef EVENT_BOOKKEEPER_TOOLS__BOOKKEEPER_TOOL_H
6 #define EVENT_BOOKKEEPER_TOOLS__BOOKKEEPER_TOOL_H
7 
19 #include <AsgTools/SourceID.h>
20 
21 #ifndef XAOD_STANDALONE
24 #include <GaudiKernel/ServiceHandle.h>
25 #endif // XAOD_STANDALONE
26 
29 
31 #include <memory>
32 #include <string>
33 #include <unordered_map>
34 
35 #ifndef XAOD_STANDALONE
36 
37 class CutFlowSvc;
38 
39 #endif // XAOD_STANDALONE
40 
41 
43 #ifndef XAOD_STANDALONE
44  , public virtual ::IMetaDataTool
45 #endif // XAOD_STANDALONE
46 {
47 #ifndef XAOD_STANDALONE
50 #endif
51 
52 public: // Constructor and Destructor
54  BookkeeperTool(const std::string& name = "BookkeeperTool");
56  virtual ~BookkeeperTool() = default;
57 
59 public:
60  virtual StatusCode initialize() override;
61  virtual StatusCode metaDataStop() override;
62 #ifdef XAOD_STANDALONE
63  virtual StatusCode beginInputFile() override;
64  virtual StatusCode endInputFile() override;
65 #else
66  virtual StatusCode beginInputFile() override {return StatusCode::SUCCESS;}
67  virtual StatusCode endInputFile() override {return StatusCode::SUCCESS;}
68  virtual StatusCode beginInputFile(const SG::SourceID &source) override;
69  virtual StatusCode endInputFile(const SG::SourceID &source) override;
70 #endif
71 
72 private:
75  const SG::SourceID &source = "");
76 
79 
83 
84 #ifndef XAOD_STANDALONE
85  ServiceHandle<ICutFlowSvc> m_cutFlowSvc{ this, "CutFlowSvc", "CutFlowSvc/CutFlowSvc", "Pointer to the CutFlowSvc"};
89 #endif // XAOD_STANDALONE
90 
92  Gaudi::Property<std::string> m_inputCollName{this, "InputCollName", "CutBookkeepers",
93  "The default name of the xAOD::CutBookkeeperContainer for input files"};
94 
96  Gaudi::Property<std::string> m_outputCollName{this, "OutputCollName", "CutBookkeepers",
97  "The default name of the xAOD::CutBookkeeperContainer for output files"};
98 
101 
103  std::unordered_map<SG::SourceID, CutBookkeepersLocalCache> m_inputContainers;
104 
108 };
109 
110 #endif // EVENT_BOOKKEEPER_TOOLS__BOOKKEEPER_TOOL_H
PropertyWrapper.h
BookkeeperTool::~BookkeeperTool
virtual ~BookkeeperTool()=default
Destructor.
BookkeeperTool::m_incompleteContainers
CutBookkeepersLocalCache m_incompleteContainers
Definition: BookkeeperTool.h:107
SourceID.h
IMetaDataTool.h
This file contains the class definition for the IMetaDataTool class.
BookkeeperTool::beginInputFile
virtual StatusCode beginInputFile() override
Function called when a new input file is opened.
Definition: BookkeeperTool.h:66
BookkeeperTool::loadXAODMetaData
StatusCode loadXAODMetaData()
Initialisation helpers.
Definition: BookkeeperTool.cxx:296
CutBookkeeperAuxContainer.h
BookkeeperTool::copyCutflowFromService
StatusCode copyCutflowFromService()
Fill Cutflow information from the service.
Definition: BookkeeperTool.cxx:269
BookkeeperTool::copyInputContainersToOutput
StatusCode copyInputContainersToOutput(CutBookkeepersLocalCache &target, const SG::SourceID &source="")
Copy input containers to the output.
Definition: BookkeeperTool.cxx:232
BookkeeperTool::loadPOOLMetaData
StatusCode loadPOOLMetaData()
Definition: BookkeeperTool.cxx:363
BookkeeperTool::m_cutFlowSvc
ServiceHandle< ICutFlowSvc > m_cutFlowSvc
Pointer to the public CutFlowSvc interface.
Definition: BookkeeperTool.h:86
CutBookkeepersLocalCache
Helper in-memory structure.
Definition: CutBookkeepersLocalCache.h:15
CutFlowSvc
This implements the methods for ICutFlowSvc.
Definition: CutFlowSvc.h:47
BookkeeperTool::BookkeeperTool
BookkeeperTool(const std::string &name="BookkeeperTool")
Declare the correct constructor for Athena.
Definition: BookkeeperTool.cxx:25
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
BookkeeperTool::m_cutFlowSvcPrivate
CutFlowSvc * m_cutFlowSvcPrivate
Direct pointer to the CutFlowSvc for "private" methods access.
Definition: BookkeeperTool.h:88
CutBookkeeperContainer.h
BookkeeperTool::metaDataStop
virtual StatusCode metaDataStop() override
Function called when the tool should prepare to write its metadata.
Definition: BookkeeperTool.cxx:171
CutBookkeepersLocalCache.h
BookkeeperTool::m_inputContainers
std::unordered_map< SG::SourceID, CutBookkeepersLocalCache > m_inputContainers
Input CutBookkeeperContainers.
Definition: BookkeeperTool.h:103
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
BookkeeperTool::endInputFile
virtual StatusCode endInputFile() override
Function called when the currently open input file got completely processed.
Definition: BookkeeperTool.h:67
ICutFlowSvc.h
BookkeeperTool::m_inputCollName
Gaudi::Property< std::string > m_inputCollName
The name of the input CutBookkeeperContainer.
Definition: BookkeeperTool.h:92
BookkeeperTool::initialize
virtual StatusCode initialize() override
Standard reimplemented functions.
Definition: BookkeeperTool.cxx:34
asg::AsgMetadataTool
Base class for dual-use tools that provide file metadata access.
Definition: AsgMetadataTool.h:48
copySelective.target
string target
Definition: copySelective.py:37
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
SG::SourceID
std::string SourceID
Definition: AthenaKernel/AthenaKernel/SourceID.h:25
BookkeeperTool::m_outputCollName
Gaudi::Property< std::string > m_outputCollName
The name of the output CutBookkeeperContainer.
Definition: BookkeeperTool.h:96
AsgMetadataTool.h
BookkeeperTool
Definition: BookkeeperTool.h:46
IMetaDataTool
This class provides the interface for MetaDataTools.
Definition: IMetaDataTool.h:20
copySelective.source
string source
Definition: copySelective.py:32
BookkeeperTool::m_completeContainers
CutBookkeepersLocalCache m_completeContainers
Local CutBookkeeperContainers.
Definition: BookkeeperTool.h:106
BookkeeperTool::m_numberOfWeightVariations
size_t m_numberOfWeightVariations
Number of event weight variations.
Definition: BookkeeperTool.h:100
ServiceHandle< ICutFlowSvc >