ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Event
xAOD
xAODMetaDataCnv
xAODMetaDataCnv
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):
13
#include "
AsgTools/AsgMetadataTool.h
"
14
#ifndef XAOD_STANDALONE
15
# include "GaudiKernel/ServiceHandle.h"
16
# include "
AthenaKernel/IAthMetaDataSvc.h
"
17
# include "
AthenaKernel/IMetaDataTool.h
"
18
#else
19
#include <
AsgTools/Interfaces.h
>
20
#include <
AsgTools/PropertyWrapper.h
>
21
#endif
22
23
#include "
xAODMetaData/FileMetaData.h
"
24
25
namespace
xAODMaker
{
26
37
class
FileMetaDataTool
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;
45
ASG_TOOL_CLASS0
(
FileMetaDataTool
)
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
84
ServiceHandle< IAthMetaDataSvc >
m_metaDataSvc
{
"MetaDataSvc"
, name()};
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
AsgMetadataTool.h
ASG_TOOL_CLASS0
#define ASG_TOOL_CLASS0(CLASSNAME)
Definition
AsgToolMacros.h:62
FileMetaData.h
IAthMetaDataSvc.h
This file contains the class definition for the IAthMetaDataSvc class.
IMetaDataTool.h
This file contains the class definition for the IMetaDataTool class.
Interfaces.h
PropertyWrapper.h
ServiceHandle< IAthMetaDataSvc >
xAODMaker::FileMetaDataTool::metaDataStop
StatusCode metaDataStop() override
Does nothing.
Definition
FileMetaDataTool.h:71
xAODMaker::FileMetaDataTool::endInputFile
StatusCode endInputFile() override
Does nothing.
Definition
FileMetaDataTool.h:60
xAODMaker::FileMetaDataTool::beginInputFile
StatusCode beginInputFile(const SG::SourceID &) override
Collecting file metadata from input and write to output.
Definition
FileMetaDataTool.h:64
xAODMaker::FileMetaDataTool::copyValues
void copyValues(const xAOD::FileMetaData *src, xAOD::FileMetaData *dst, const std::string &var)
Definition
FileMetaDataTool.cxx:138
xAODMaker::FileMetaDataTool::m_keys
Gaudi::Property< std::vector< std::string > > m_keys
Definition
FileMetaDataTool.h:76
xAODMaker::FileMetaDataTool::beginInputFile
StatusCode beginInputFile() override
Collecting file metadata from input and write to output.
Definition
FileMetaDataTool.cxx:33
xAODMaker::FileMetaDataTool::m_toolMutex
std::mutex m_toolMutex
Definition
FileMetaDataTool.h:88
xAODMaker::FileMetaDataTool::m_metaDataSvc
ServiceHandle< IAthMetaDataSvc > m_metaDataSvc
Get a handle on the metadata store for the job.
Definition
FileMetaDataTool.h:84
xAODMaker::FileMetaDataTool::copy
StatusCode copy(const std::string &)
Definition
FileMetaDataTool.cxx:70
xAODMaker::FileMetaDataTool::endInputFile
StatusCode endInputFile(const SG::SourceID &) override
Does nothing.
Definition
FileMetaDataTool.h:67
xAODMaker::FileMetaDataTool::FileMetaDataTool
FileMetaDataTool(const std::string &name="FileMetaDataTool")
Regular AsgTool constructor.
Definition
FileMetaDataTool.cxx:19
xAODMaker::FileMetaDataTool::initialize
StatusCode initialize() override
Function initialising the tool.
Definition
FileMetaDataTool.cxx:23
SG::SourceID
std::string SourceID
Definition
AthenaKernel/AthenaKernel/SourceID.h:25
xAODMaker
Definition
StoreGateSvc.h:70
xAOD::FileMetaData
FileMetaData_v1 FileMetaData
Declare the latest version of the class.
Definition
Event/xAOD/xAODMetaData/xAODMetaData/FileMetaData.h:16
Generated on
for ATLAS Offline Software by
1.17.0