ATLAS Offline Software
BookkeeperTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 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 
15 #include <memory>
16 
19 #include <AsgTools/SourceID.h>
20 
21 #ifndef XAOD_STANDALONE
24 #include <GaudiKernel/ServiceHandle.h>
25 #endif // XAOD_STANDALONE
26 
29 
31 
32 
33 #ifndef XAOD_STANDALONE
34 
35 class CutFlowSvc;
36 
37 #endif // XAOD_STANDALONE
38 
39 
41 #ifndef XAOD_STANDALONE
42  , public virtual ::IMetaDataTool
43 #endif // XAOD_STANDALONE
44 {
45 #ifndef XAOD_STANDALONE
48 #endif
49 
50 public: // Constructor and Destructor
52  BookkeeperTool(const std::string& name = "BookkeeperTool");
54  virtual ~BookkeeperTool() = default;
55 
57 public:
58  virtual StatusCode initialize() override;
59  virtual StatusCode metaDataStop() override;
60 #ifdef XAOD_STANDALONE
61  virtual StatusCode beginInputFile() override;
62  virtual StatusCode endInputFile() override;
63 #else
64  virtual StatusCode beginInputFile() override {return StatusCode::SUCCESS;}
65  virtual StatusCode endInputFile() override {return StatusCode::SUCCESS;}
66  virtual StatusCode beginInputFile(const SG::SourceID &source) override;
67  virtual StatusCode endInputFile(const SG::SourceID &source) override;
68 #endif
69 
70 private:
73  const SG::SourceID &source = "");
74 
77 
81 
82 #ifndef XAOD_STANDALONE
83  ServiceHandle<ICutFlowSvc> m_cutFlowSvc{ this, "CutFlowSvc", "CutFlowSvc/CutFlowSvc", "Pointer to the CutFlowSvc"};
87 #endif // XAOD_STANDALONE
88 
90  Gaudi::Property<std::string> m_inputCollName{this, "InputCollName", "CutBookkeepers",
91  "The default name of the xAOD::CutBookkeeperContainer for input files"};
92 
94  Gaudi::Property<std::string> m_outputCollName{this, "OutputCollName", "CutBookkeepers",
95  "The default name of the xAOD::CutBookkeeperContainer for output files"};
96 
99 
101  std::unordered_map<SG::SourceID, CutBookkeepersLocalCache> m_inputContainers;
102 
106 };
107 
108 #endif // EVENT_BOOKKEEPER_TOOLS__BOOKKEEPER_TOOL_H
PropertyWrapper.h
BookkeeperTool::~BookkeeperTool
virtual ~BookkeeperTool()=default
Destructor.
BookkeeperTool::m_incompleteContainers
CutBookkeepersLocalCache m_incompleteContainers
Definition: BookkeeperTool.h:105
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:64
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:84
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:86
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:101
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
BookkeeperTool::endInputFile
virtual StatusCode endInputFile() override
Function called when the currently open input file got completely processed.
Definition: BookkeeperTool.h:65
ICutFlowSvc.h
BookkeeperTool::m_inputCollName
Gaudi::Property< std::string > m_inputCollName
The name of the input CutBookkeeperContainer.
Definition: BookkeeperTool.h:90
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
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
SG::SourceID
std::string SourceID
Definition: AthenaKernel/AthenaKernel/SourceID.h:23
BookkeeperTool::m_outputCollName
Gaudi::Property< std::string > m_outputCollName
The name of the output CutBookkeeperContainer.
Definition: BookkeeperTool.h:94
AsgMetadataTool.h
BookkeeperTool
Definition: BookkeeperTool.h:44
IMetaDataTool
This class provides the interface for MetaDataTools.
Definition: IMetaDataTool.h:21
COOLRates.target
target
Definition: COOLRates.py:1106
BookkeeperTool::m_completeContainers
CutBookkeepersLocalCache m_completeContainers
Local CutBookkeeperContainers.
Definition: BookkeeperTool.h:104
BookkeeperTool::m_numberOfWeightVariations
size_t m_numberOfWeightVariations
Number of event weight variations.
Definition: BookkeeperTool.h:98
ServiceHandle< ICutFlowSvc >