ATLAS Offline Software
Loading...
Searching...
No Matches
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
14
15
16
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
37class 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
52public: // Constructor and Destructor
54 BookkeeperTool(const std::string& name = "BookkeeperTool");
56 virtual ~BookkeeperTool() = default;
57
59public:
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
72private:
75 const SG::SourceID &source = "");
76
78 StatusCode copyCutflowFromService();
79
81 StatusCode loadXAODMetaData();
82 StatusCode loadPOOLMetaData();
83
84#ifndef XAOD_STANDALONE
86 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
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
This file contains the class definition for the IMetaDataTool class.
CutBookkeepersLocalCache m_incompleteContainers
virtual StatusCode metaDataStop() override
Function called when the tool should write out its metadata.
StatusCode copyCutflowFromService()
Fill Cutflow information from the service.
BookkeeperTool(const std::string &name="BookkeeperTool")
Declare the correct constructor for Athena.
Gaudi::Property< std::string > m_inputCollName
The name of the input CutBookkeeperContainer.
CutFlowSvc * m_cutFlowSvcPrivate
Direct pointer to the CutFlowSvc for "private" methods access.
virtual StatusCode endInputFile() override
Function called when the currently open input file got completely processed.
StatusCode loadPOOLMetaData()
virtual StatusCode initialize() override
Standard reimplemented functions.
virtual StatusCode beginInputFile() override
Function called when a new input file is opened.
std::unordered_map< SG::SourceID, CutBookkeepersLocalCache > m_inputContainers
Input CutBookkeeperContainers.
ServiceHandle< ICutFlowSvc > m_cutFlowSvc
Pointer to the public CutFlowSvc interface.
size_t m_numberOfWeightVariations
Number of event weight variations.
CutBookkeepersLocalCache m_completeContainers
Local CutBookkeeperContainers.
StatusCode copyInputContainersToOutput(CutBookkeepersLocalCache &target, const SG::SourceID &source="")
Copy input containers to the output.
StatusCode loadXAODMetaData()
Initialisation helpers.
virtual ~BookkeeperTool()=default
Destructor.
Gaudi::Property< std::string > m_outputCollName
The name of the output CutBookkeeperContainer.
This implements the methods for ICutFlowSvc.
Definition CutFlowSvc.h:47
This class provides the interface for MetaDataTools.
Base class for dual-use tools that provide file metadata access.
Helper in-memory structure.