Tool propagating xAOD::FileMetaData from input to output.
More...
#include <FileMetaDataTool.h>
Tool propagating xAOD::FileMetaData from input to output.
This tool propagates the xAOD::FileMetaData object from the input files to the MetaDataStore in Athena. It requires the input to contain the information in an xAOD format. The tool will emit a warning if the file metadata between inputs does not match.
- Author
- Attila Krasznahorkay Attil.nosp@m.a.Kr.nosp@m.aszna.nosp@m.hork.nosp@m.ay@ce.nosp@m.rn.c.nosp@m.h
-
Frank Berghaus fberg.nosp@m.haus.nosp@m.@anl..nosp@m.gov
Definition at line 37 of file FileMetaDataTool.h.
◆ FileMetaDataTool()
xAODMaker::FileMetaDataTool::FileMetaDataTool |
( |
const std::string & |
name = "FileMetaDataTool" | ) |
|
|
explicit |
◆ beginInputFile() [1/2]
StatusCode xAODMaker::FileMetaDataTool::beginInputFile |
( |
| ) |
|
|
override |
Collecting file metadata from input and write to output.
Definition at line 33 of file FileMetaDataTool.cxx.
46 [
this](std::string&
key) {
47 return !inputMetaStore()->contains<xAOD::FileMetaData>(key);
54 if (
keys.empty())
return StatusCode::SUCCESS;
57 for(
const std::string&
key :
keys) {
58 #ifdef XAOD_STANDALONE
61 for(
const std::string& stream_key :
m_metaDataSvc->getPerStreamKeysFor(
key) ) {
64 #endif // XAOD_STANDALONE
66 return StatusCode::SUCCESS;
◆ beginInputFile() [2/2]
Collecting file metadata from input and write to output.
Definition at line 64 of file FileMetaDataTool.h.
◆ copy()
StatusCode xAODMaker::FileMetaDataTool::copy |
( |
const std::string & |
key | ) |
|
|
private |
Definition at line 70 of file FileMetaDataTool.cxx.
73 if (!inputMetaStore()->contains< xAOD::FileMetaData >(
key)) {
75 return StatusCode::SUCCESS;
84 #ifdef XAOD_STANDALONE
85 if (outputMetaStore()->contains< xAOD::FileMetaData >(
key)) {
91 if (!output)
return StatusCode::FAILURE;
92 #endif // XAOD_STANDALONE
97 const std::set<std::string>
ignore {
"runNumbers",
"lumiBlocks" };
101 return StatusCode::SUCCESS;
105 auto output = std::make_unique< xAOD::FileMetaData >();
106 auto outputAux = std::make_unique< xAOD::FileMetaDataAuxInfo >();
107 output->setStore(outputAux.get());
113 #ifdef XAOD_STANDALONE
115 outputMetaStore()->record< xAOD::FileMetaData >(
116 std::move(output),
key));
119 outputMetaStore()->record< xAOD::FileMetaDataAuxInfo >(
120 std::move(outputAux),
key +
"Aux."));
124 std::move(output),
key));
128 std::move(outputAux),
key +
"Aux."));
129 #endif // XAOD_STANDALONE
134 return StatusCode::SUCCESS;
◆ copyValues()
Definition at line 138 of file FileMetaDataTool.cxx.
141 std::vector<uint32_t> src_vec, dst_vec;
144 bool updated =
false;
146 for(
auto val : src_vec ) {
148 auto it = std::lower_bound( dst_vec.begin(), dst_vec.end(),
val );
149 if(
it == dst_vec.end() || (*
it) !=
val ) {
150 dst_vec.insert(
it,
val);
◆ endInputFile() [1/2]
StatusCode xAODMaker::FileMetaDataTool::endInputFile |
( |
| ) |
|
|
inlineoverride |
◆ endInputFile() [2/2]
◆ initialize()
StatusCode xAODMaker::FileMetaDataTool::initialize |
( |
| ) |
|
|
override |
Function initialising the tool.
Definition at line 23 of file FileMetaDataTool.cxx.
24 #ifndef XAOD_STANDALONE
26 #endif // XAOD_STANDALONE
29 return StatusCode::SUCCESS;
◆ metaDataStop()
StatusCode xAODMaker::FileMetaDataTool::metaDataStop |
( |
| ) |
|
|
inlineoverride |
◆ m_keys
Gaudi::Property<std::vector<std::string> > xAODMaker::FileMetaDataTool::m_keys |
|
private |
Initial value:{
this,
"Keys",
{},
"(optional) List of keys to copy. Copy all keys if empty"}
Definition at line 76 of file FileMetaDataTool.h.
◆ m_metaDataSvc
◆ m_toolMutex
std::mutex xAODMaker::FileMetaDataTool::m_toolMutex |
|
private |
The documentation for this class was generated from the following files: