20 : base_class( name ) { }
24#ifndef XAOD_STANDALONE
29 return StatusCode::SUCCESS;
38 std::vector<std::string> keys =
m_keys;
45 keys.begin(), keys.end(),
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) {
61 for(
const std::string& stream_key :
m_metaDataSvc->getPerStreamKeysFor(key) ) {
66 return StatusCode::SUCCESS;
71 ATH_MSG_DEBUG(
"Copying \"" << key <<
"\" from InputMetaDataStore");
75 return StatusCode::SUCCESS;
80 ASG_CHECK(inputMetaStore()->retrieve(input, key));
87 ASG_CHECK(outputMetaStore()->retrieve(output, key));
91 if (!output)
return StatusCode::FAILURE;
97 const std::set<std::string> ignore {
"runNumbers",
"lumiBlocks" };
98 if( !input->compareWith(*output, ignore) )
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."));
131 ATH_MSG_INFO(
"Copied \"" << key <<
"\" to MetaDataStore");
134 return StatusCode::SUCCESS;
139 const std::string& var)
141 std::vector<uint32_t> src_vec, dst_vec;
142 src->value(var, src_vec);
143 dst->
value(var, 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);
156 if( !dst->
setValue(var, dst_vec) ) {
#define ATH_MSG_WARNING(x)
#define ASG_CHECK(...)
Helper macro for checking the status code returned by a function call.
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
DataModel_detail::iterator< DVL > remove_if(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, Predicate pred)
Specialization of remove_if for DataVector/List.
FileMetaDataAuxInfo_v1 FileMetaDataAuxInfo
Declare the latest version of the class.
FileMetaData_v1 FileMetaData
Declare the latest version of the class.