ATLAS Offline Software
Loading...
Searching...
No Matches
FileMetaDataTool.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2/*
3 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
4*/
5#ifndef XAODMETADATACNV_FILEMETADATATOOL_H
6#define XAODMETADATACNV_FILEMETADATATOOL_H
7
8// System include(s):
9#include <string>
10#include <vector>
11
12// Infrastructure include(s):
14#ifndef XAOD_STANDALONE
15# include "GaudiKernel/ServiceHandle.h"
18#else
19#include <AsgTools/Interfaces.h>
21#endif
22
24
25namespace xAODMaker {
26
38#ifdef XAOD_STANDALONE
39 : public extends<asg::AsgMetadataTool> {
40#else
41 : public extends<asg::AsgMetadataTool, IMetaDataTool> {
42#endif
43 public:
44 using extends::extends;
46
47
48 explicit FileMetaDataTool(const std::string& name = "FileMetaDataTool");
49
51 StatusCode initialize() override;
52
55
57 StatusCode beginInputFile() override;
58
60 StatusCode endInputFile() override {return StatusCode::SUCCESS;};
61
62#ifndef XAOD_STANDALONE
64 StatusCode beginInputFile(const SG::SourceID&) override {return beginInputFile();};
65
67 StatusCode endInputFile(const SG::SourceID&) override {return StatusCode::SUCCESS;};
68#endif
69
71 StatusCode metaDataStop() override {return StatusCode::SUCCESS;};
72
74
75 private:
76 Gaudi::Property<std::vector<std::string> > m_keys{
77 this,
78 "Keys",
79 {},
80 "(optional) List of keys to copy. Copy all keys if empty"};
81
82#ifndef XAOD_STANDALONE
85#endif
86
87 // To lock/unlock the tool
88 std::mutex m_toolMutex;
89
90 // implementation of individual object copy
91 StatusCode copy(const std::string&);
92
93 // merge "var" src FMD attribute into dst FMD (assuming attribute of type vector<int>)
94 void copyValues(const xAOD::FileMetaData *src, xAOD::FileMetaData *dst, const std::string& var);
95}; // class FileMetaDataTool
96
97} // namespace xAODMaker
98
99#endif // XAODMETADATACNV_FILEMETADATATOOL_H
#define ASG_TOOL_CLASS0(CLASSNAME)
This file contains the class definition for the IAthMetaDataSvc class.
This file contains the class definition for the IMetaDataTool class.
StatusCode metaDataStop() override
Does nothing.
StatusCode endInputFile() override
Does nothing.
StatusCode beginInputFile(const SG::SourceID &) override
Collecting file metadata from input and write to output.
void copyValues(const xAOD::FileMetaData *src, xAOD::FileMetaData *dst, const std::string &var)
Gaudi::Property< std::vector< std::string > > m_keys
StatusCode beginInputFile() override
Collecting file metadata from input and write to output.
ServiceHandle< IAthMetaDataSvc > m_metaDataSvc
Get a handle on the metadata store for the job.
StatusCode copy(const std::string &)
StatusCode endInputFile(const SG::SourceID &) override
Does nothing.
FileMetaDataTool(const std::string &name="FileMetaDataTool")
Regular AsgTool constructor.
StatusCode initialize() override
Function initialising the tool.
FileMetaData_v1 FileMetaData
Declare the latest version of the class.