ATLAS Offline Software
FileMetaDataTool.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 /*
3  Copyright (C) 2002-2024 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 #endif
19 
21 
22 namespace xAODMaker {
23 
35 #ifdef XAOD_STANDALONE
36  : public asg::AsgMetadataTool {
37 #else
38  : public asg::AsgMetadataTool, virtual public IMetaDataTool {
39 #endif
40  public:
41  //using extends::extends;
43 
44 
45  explicit FileMetaDataTool(const std::string& name = "FileMetaDataTool");
46 
48  StatusCode initialize() override;
49 
52 
54  StatusCode beginInputFile() override;
55 
57  StatusCode endInputFile() override {return StatusCode::SUCCESS;};
58 
59 #ifndef XAOD_STANDALONE
60  StatusCode beginInputFile(const SG::SourceID&) override {return beginInputFile();};
62 
64  StatusCode endInputFile(const SG::SourceID&) override {return StatusCode::SUCCESS;};
65 #endif
66 
68  StatusCode metaDataStop() override {return StatusCode::SUCCESS;};
69 
71 
72  private:
75  std::vector< std::string > m_keys;
76 
77 #ifndef XAOD_STANDALONE
80 #endif
81 
82  // To lock/unlock the tool
84 
85  // implementation of individual object copy
86  StatusCode copy(const std::string&);
87 
88  // merge "var" src FMD attribute into dst FMD (assuming attribute of type vector<int>)
89  void copyValues(const xAOD::FileMetaData *src, xAOD::FileMetaData *dst, const std::string& var);
90 }; // class FileMetaDataTool
91 
92 } // namespace xAODMaker
93 
94 #endif // XAODMETADATACNV_FILEMETADATATOOL_H
beamspotnt.var
var
Definition: bin/beamspotnt.py:1394
xAODMaker::FileMetaDataTool::m_toolMutex
std::mutex m_toolMutex
Definition: FileMetaDataTool.h:83
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:77
xAODMaker
Definition: StoreGateSvc.h:72
xAODMaker::FileMetaDataTool
Tool propagating xAOD::FileMetaData from input to output.
Definition: FileMetaDataTool.h:38
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:57
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:145
xAODMaker::FileMetaDataTool::metaDataStop
StatusCode metaDataStop() override
Does nothing.
Definition: FileMetaDataTool.h:68
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
xAODMaker::FileMetaDataTool::m_metaDataSvc
ServiceHandle< IAthMetaDataSvc > m_metaDataSvc
Get a handle on the metadata store for the job.
Definition: FileMetaDataTool.h:79
xAODMaker::FileMetaDataTool::beginInputFile
StatusCode beginInputFile() override
Collecting file metadata from input and write to output.
Definition: FileMetaDataTool.cxx:40
FileMetaData.h
asg::AsgMetadataTool
Base class for dual-use tools that provide file metadata access.
Definition: AsgMetadataTool.h:48
SG::SourceID
std::string SourceID
Definition: AthenaKernel/AthenaKernel/SourceID.h:23
AsgMetadataTool.h
xAODMaker::FileMetaDataTool::endInputFile
StatusCode endInputFile(const SG::SourceID &) override
Does nothing.
Definition: FileMetaDataTool.h:64
IMetaDataTool
This class provides the interface for MetaDataTools.
Definition: IMetaDataTool.h:21
xAODMaker::FileMetaDataTool::m_keys
std::vector< std::string > m_keys
(optional) list of keys to propagate from input to output.
Definition: FileMetaDataTool.h:68
xAODMaker::FileMetaDataTool::initialize
StatusCode initialize() override
Function initialising the tool.
Definition: FileMetaDataTool.cxx:30
xAODMaker::FileMetaDataTool::FileMetaDataTool
FileMetaDataTool(const std::string &name="FileMetaDataTool")
Regular AsgTool constructor.
Definition: FileMetaDataTool.cxx:19
ServiceHandle< IAthMetaDataSvc >