ATLAS Offline Software
Loading...
Searching...
No Matches
RNTupleAuxDynWriter.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6
10
11#include "TClass.h"
12
13namespace RootAuxDynIO {
14
21
22
24std::vector<attrDataTuple>
25RNTupleAuxDynWriter::collectAuxAttributes( const std::string& base_name, void* object )
26{
27 SG::IAuxStoreIO* store = castIOStore(object);
28 std::vector<attrDataTuple> result;
29 if( !store ) return result;
30 const SG::auxid_set_t selection = store->getSelectedAuxIDs();
31 ATH_MSG_DEBUG("Writing " << base_name << " with " << selection.size()
32 << " Dynamic attributes");
33 for (SG::auxid_t id : selection) {
34 const std::string attr_type = SG::normalizedTypeinfoName(*store->getIOType(id));
35 const std::string attr_name = SG::AuxTypeRegistry::instance().getName(id);
36 const std::string field_name = RootAuxDynIO::auxFieldName(attr_name, base_name);
37 void* attr_data ATLAS_THREAD_SAFE = const_cast<void*>(store->getIOData(id));
38
39 result.emplace_back(field_name, attr_type, attr_data);
40 }
41 return result;
42}
43
44} // namespace RootAuxDynIO
#define ATH_MSG_DEBUG(x)
An auxiliary data store that holds data internally.
Handle mappings between names and auxid_t.
static Double_t tc
std::atomic_flag m_initialized ATLAS_THREAD_SAFE
Messaging initialized (initMessaging)
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
SG::IAuxStoreIO * castIOStore(void *object)
RNTupleAuxDynWriter(TClass &tc)
Default Constructor.
virtual std::vector< attrDataTuple > collectAuxAttributes(const std::string &base_branch, void *object) override final
Collect Aux data information to be written out.
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Interface providing I/O for a generic auxiliary store.
Definition IAuxStoreIO.h:44
A set of aux data identifiers.
Definition AuxTypes.h:47
STL class.
const std::string selection
Specialization of RootAuxDynStore for reading Aux Dynamic attributes from RNTuple.
std::string auxFieldName(const std::string &attr_name, const std::string &baseName)
Construct field name for a given dynamic attribute.
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...
size_t auxid_t
Identifier for a particular aux data item.
Definition AuxTypes.h:27
STL namespace.
Convert a type_info to a normalized string representation (matching the names used in the root dictio...