ATLAS Offline Software
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 
25 namespace 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
63  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
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
beamspotnt.var
var
Definition: bin/beamspotnt.py:1393
PropertyWrapper.h
xAODMaker::FileMetaDataTool::m_toolMutex
std::mutex m_toolMutex
Definition: FileMetaDataTool.h:88
WriteCellNoiseToCool.src
src
Definition: WriteCellNoiseToCool.py:513
IAthMetaDataSvc.h
This file contains the class definition for the IAthMetaDataSvc class.
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
IMetaDataTool.h
This file contains the class definition for the IMetaDataTool class.
xAODMaker::FileMetaDataTool::copy
StatusCode copy(const std::string &)
Definition: FileMetaDataTool.cxx:70
xAODMaker
Definition: StoreGateSvc.h:70
xAODMaker::FileMetaDataTool
Tool propagating xAOD::FileMetaData from input to output.
Definition: FileMetaDataTool.h:41
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ASG_TOOL_CLASS0
#define ASG_TOOL_CLASS0(CLASSNAME)
Definition: AsgToolMacros.h:62
xAODMaker::FileMetaDataTool::endInputFile
StatusCode endInputFile() override
Does nothing.
Definition: FileMetaDataTool.h:60
xAOD::FileMetaData_v1
Class holding file-level metadata about an xAOD file.
Definition: FileMetaData_v1.h:34
xAODMaker::FileMetaDataTool::copyValues
void copyValues(const xAOD::FileMetaData *src, xAOD::FileMetaData *dst, const std::string &var)
Definition: FileMetaDataTool.cxx:138
xAODMaker::FileMetaDataTool::metaDataStop
StatusCode metaDataStop() override
Does nothing.
Definition: FileMetaDataTool.h:71
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
xAODMaker::FileMetaDataTool::m_metaDataSvc
ServiceHandle< IAthMetaDataSvc > m_metaDataSvc
Get a handle on the metadata store for the job.
Definition: FileMetaDataTool.h:84
xAODMaker::FileMetaDataTool::beginInputFile
StatusCode beginInputFile() override
Collecting file metadata from input and write to output.
Definition: FileMetaDataTool.cxx:33
xAODMaker::FileMetaDataTool::m_keys
Gaudi::Property< std::vector< std::string > > m_keys
Definition: FileMetaDataTool.h:76
FileMetaData.h
SG::SourceID
std::string SourceID
Definition: AthenaKernel/AthenaKernel/SourceID.h:25
AsgMetadataTool.h
xAODMaker::FileMetaDataTool::endInputFile
StatusCode endInputFile(const SG::SourceID &) override
Does nothing.
Definition: FileMetaDataTool.h:67
Interfaces.h
xAODMaker::FileMetaDataTool::initialize
StatusCode initialize() override
Function initialising the tool.
Definition: FileMetaDataTool.cxx:23
xAODMaker::FileMetaDataTool::FileMetaDataTool
FileMetaDataTool(const std::string &name="FileMetaDataTool")
Regular AsgTool constructor.
Definition: FileMetaDataTool.cxx:19
ServiceHandle< IAthMetaDataSvc >