ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Database
AthenaRoot
RootAuxDynIO
src
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
5
#include "
RNTupleAuxDynWriter.h
"
6
7
#include "
AthContainers/AuxStoreInternal.h
"
8
#include "
AthContainers/AuxTypeRegistry.h
"
9
#include "
AthContainers/normalizedTypeinfoName.h
"
10
11
#include "TClass.h"
12
13
namespace
RootAuxDynIO
{
14
16
RNTupleAuxDynWriter::RNTupleAuxDynWriter
(TClass&
tc
)
17
:
AthMessaging
(
std
::
string
(
"AuxDynAttrTool"
)),
18
AuxDynAttrAccess
(
tc
)
19
{
20
}
21
22
24
std::vector<attrDataTuple>
25
RNTupleAuxDynWriter::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
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
AuxStoreInternal.h
An auxiliary data store that holds data internally.
AuxTypeRegistry.h
Handle mappings between names and auxid_t.
tc
static Double_t tc
Definition
LArPhysWaveHECTool.cxx:38
RNTupleAuxDynWriter.h
AthMessaging::ATLAS_THREAD_SAFE
std::atomic_flag m_initialized ATLAS_THREAD_SAFE
Messaging initialized (initMessaging).
Definition
AthMessaging.h:141
AthMessaging::AthMessaging
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
Definition
AthMessaging.cxx:13
RootAuxDynIO::AuxDynAttrAccess::AuxDynAttrAccess
AuxDynAttrAccess(TClass &tc)
Definition
RootAuxDynIO.cxx:25
RootAuxDynIO::AuxDynAttrAccess::castIOStore
SG::IAuxStoreIO * castIOStore(void *object)
Definition
RootAuxDynIO.cxx:46
RootAuxDynIO::RNTupleAuxDynWriter::RNTupleAuxDynWriter
RNTupleAuxDynWriter(TClass &tc)
Default Constructor.
Definition
RNTupleAuxDynWriter.cxx:16
RootAuxDynIO::RNTupleAuxDynWriter::collectAuxAttributes
virtual std::vector< attrDataTuple > collectAuxAttributes(const std::string &base_branch, void *object) override final
Collect Aux data information to be written out.
Definition
RNTupleAuxDynWriter.cxx:25
SG::AuxTypeRegistry::getName
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
Definition
AuxTypeRegistry.cxx:882
SG::AuxTypeRegistry::instance
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Definition
AuxTypeRegistry.cxx:640
SG::IAuxStoreIO
Interface providing I/O for a generic auxiliary store.
Definition
IAuxStoreIO.h:44
SG::auxid_set_t
A set of aux data identifiers.
Definition
AuxTypes.h:47
string
STL class.
selection
const std::string selection
Definition
fbtTestBasics.cxx:75
RootAuxDynIO
Specialization of RootAuxDynStore for reading Aux Dynamic attributes from RNTuple.
Definition
RNTupleContainer.h:28
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
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::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition
AuxTypes.h:27
std
STL namespace.
normalizedTypeinfoName.h
Convert a type_info to a normalized string representation (matching the names used in the root dictio...
Generated on
for ATLAS Offline Software by
1.17.0