ATLAS Offline Software
RNTupleAuxDynWriter.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "RNTupleAuxDynWriter.h"
6 
10 
11 namespace RootAuxDynIO {
14  : AthMessaging(std::string("RNTupleAuxDynWriter")) {}
15 
17 std::vector<attrDataTuple> RNTupleAuxDynWriter::collectAuxAttributes(
18  const std::string& base_name, SG::IAuxStoreIO* store) {
19  std::vector<attrDataTuple> result;
20  const SG::auxid_set_t selection = store->getSelectedAuxIDs();
21  ATH_MSG_DEBUG("Writing " << base_name << " with " << selection.size()
22  << " Dynamic attributes");
23  for (SG::auxid_t id : selection) {
24  const std::string attr_type =
25  SG::normalizedTypeinfoName(*store->getIOType(id));
26  const std::string attr_name = SG::AuxTypeRegistry::instance().getName(id);
27  const std::string field_name =
29  void* attr_data ATLAS_THREAD_SAFE = const_cast<void*>(store->getIOData(id));
30 
31  result.emplace_back(field_name, attr_type, attr_data);
32  }
33  return result;
34 }
35 
36 } // namespace RootAuxDynIO
SGTest::store
TestStore store
Definition: TestStore.cxx:23
get_generator_info.result
result
Definition: get_generator_info.py:21
SG::AuxTypeRegistry::instance
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Definition: AuxTypeRegistry.cxx:639
SG::normalizedTypeinfoName
std::string normalizedTypeinfoName(const std::type_info &info)
Convert a type_info to a normalized string representation (matching the names used in the root dictio...
Definition: normalizedTypeinfoName.cxx:120
SG::AuxTypeRegistry::getName
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
Definition: AuxTypeRegistry.cxx:881
SG::IAuxStoreIO
Interface providing I/O for a generic auxiliary store.
Definition: IAuxStoreIO.h:44
AthMessaging::ATLAS_THREAD_SAFE
std::atomic_flag m_initialized ATLAS_THREAD_SAFE
Messaging initialized (initMessaging)
Definition: AthMessaging.h:141
collListGuids.attr_name
attr_name
Definition: collListGuids.py:72
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
RootAuxDynIO::RNTupleAuxDynWriter::collectAuxAttributes
virtual std::vector< attrDataTuple > collectAuxAttributes(const std::string &base_branch, SG::IAuxStoreIO *store) override final
Collect Aux data information to be written out.
Definition: RNTupleAuxDynWriter.cxx:17
RootAuxDynIO::auxFieldName
std::string auxFieldName(const std::string &attr_name, const std::string &baseName)
Construct field name for a given dynamic attribute.
Definition: RootAuxDynDefs.h:69
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
RNTupleAuxDynWriter.h
normalizedTypeinfoName.h
Convert a type_info to a normalized string representation (matching the names used in the root dictio...
selection
const std::string selection
Definition: fbtTestBasics.cxx:74
RootAuxDynIO
Specialization of RootAuxDynStore for reading Aux Dynamic attributes from RNTuple.
Definition: RNTupleContainer.h:26
AuxTypeRegistry.h
Handle mappings between names and auxid_t.
SG::auxid_set_t
A set of aux data identifiers.
Definition: AuxTypes.h:47
AuxStoreInternal.h
An auxiliary data store that holds data internally.
RootAuxDynIO::RNTupleAuxDynWriter::RNTupleAuxDynWriter
RNTupleAuxDynWriter()
Default Constructor.
Definition: RNTupleAuxDynWriter.cxx:13