![]() |
ATLAS Offline Software
|
"ROOT @c RNTuple implementation" of IAuxStore
More...
#include <RAuxStore.h>
Classes | |
struct | impl |
Public Types | |
using | RNTupleReader = ROOT::Experimental::RNTupleReader |
The RNTuple reader type. More... | |
using | RNTupleWriter = ROOT::Experimental::RNTupleWriter |
The RNTuple writer type. More... | |
using | REntry = ROOT::Experimental::REntry |
The RNTuple entry type. More... | |
enum | EStructMode { EStructMode::kUndefinedStore = 0, EStructMode::kContainerStore = 1, EStructMode::kObjectStore = 2 } |
"Structural" modes of the object More... | |
Public Member Functions | |
RAuxStore (std::string_view prefix="", bool topStore=true, EStructMode mode=EStructMode::kUndefinedStore) | |
Constructor. More... | |
virtual | ~RAuxStore () |
Destructor. More... | |
virtual void | setPrefix (std::string_view prefix) override |
Set the object name prefix. More... | |
StatusCode | readFrom (RNTupleReader &reader) |
Connect the object to an input RNTuple. More... | |
StatusCode | writeTo (RNTupleWriter &writer) |
Add the variables of the store to an output RNTuple. More... | |
StatusCode | getEntry (std::int64_t entry, int getall=0) |
Get entry from the input RNTuple. More... | |
StatusCode | commitTo (REntry &entry) |
Commit a new entry to the output RNTuple. More... | |
EStructMode | structMode () const |
Get what structure mode the object was constructed with. More... | |
void | setStructMode (EStructMode mode) |
Set the structure mode of the object to a new value. More... | |
const std::string & | prefix () const |
Get the currently configured object name prefix. More... | |
bool | isTopStore () const |
Check if the object is a "top store", or not. More... | |
void | setTopStore (bool value=true) |
Set whether the object should behave as a "top store" or not. More... | |
virtual void * | getData (auxid_t auxid, size_t size, size_t capacity)=0 |
Return the data vector for one aux data item. More... | |
virtual const void * | getData (SG::auxid_t auxid) const=0 |
Pick up the const version from the base class. More... | |
virtual void * | getDecoration (auxid_t auxid, size_t size, size_t capacity)=0 |
Return the data vector for one aux data decoration item. More... | |
virtual const IAuxTypeVector * | linkedVector (SG::auxid_t) const |
Return interface for a linked variable. More... | |
virtual bool | resize (size_t sz)=0 |
Change the size of all aux data vectors. More... | |
virtual void | reserve (size_t sz)=0 |
Change the capacity of all aux data vectors. More... | |
virtual void | shift (size_t pos, ptrdiff_t offs)=0 |
Shift the elements of the container. More... | |
virtual bool | insertMove (size_t pos, IAuxStore &other, const SG::auxid_set_t &ignore=SG::auxid_set_t())=0 |
Move all elements from other to this store. More... | |
virtual bool | setOption (auxid_t, const AuxDataOption &) |
Set an option for a given auxiliary variable. More... | |
Static Public Attributes | |
static constexpr bool | supportsThinning = true |
Mark that this type supports thinning operations. More... | |
Protected Types | |
using | mutex_t = AthContainers_detail::mutex |
Mutex type for multithread synchronization. More... | |
using | guard_t = AthContainers_detail::lock_guard< mutex_t > |
Guard type for multithreaded synchronisation. More... | |
Protected Member Functions | |
bool | isAuxIDSelected (SG::auxid_t auxid) const |
Check if an auxiliary variable is selected for ouput writing. More... | |
Protected Attributes | |
Members | m_data |
Member variables of the base class. More... | |
Private Attributes | |
std::unique_ptr< impl > | m_impl |
Pointer to the internal object. More... | |
AuxSelection | m_selection |
Object helping to select which auxiliary variables to write. More... | |
bool | m_locked = false |
Is this container locked? More... | |
mutex_t | m_mutex1 |
Mutex objects used for multithreaded synchronisation. More... | |
mutex_t | m_mutex2 |
Functions implementing functionality for @c AuxStoreBase | |
virtual void | reset () override |
Tell the object that all branches will need to be re-read. More... | |
virtual bool | hasEntryFor (SG::auxid_t auxid) const override |
Check if a given variable is available from the input. More... | |
virtual StatusCode | getEntryFor (SG::auxid_t auxid) override |
Load a single variable from the input. More... | |
virtual bool | hasOutput () const override |
Check if an output is being written by the object. More... | |
virtual StatusCode | setupInputData (SG::auxid_t auxid) override |
Connect a variable to the input. More... | |
virtual StatusCode | setupOutputData (SG::auxid_t auxid) override |
Connect a variable to the output. More... | |
virtual const void * | getInputObject (SG::auxid_t auxid) const override |
Get a pointer to an input object, as it is in memory, for getIOData() More... | |
virtual const std::type_info * | getInputType (SG::auxid_t auxid) const override |
Get the type of an input object, for getIOType() More... | |
"ROOT @c RNTuple implementation" of IAuxStore
Definition at line 31 of file RAuxStore.h.
|
protectedinherited |
Guard type for multithreaded synchronisation.
Definition at line 206 of file AuxStoreBase.h.
|
protectedinherited |
Mutex type for multithread synchronization.
Definition at line 204 of file AuxStoreBase.h.
using xAOD::RAuxStore::REntry = ROOT::Experimental::REntry |
The RNTuple entry type.
Definition at line 39 of file RAuxStore.h.
using xAOD::RAuxStore::RNTupleReader = ROOT::Experimental::RNTupleReader |
The RNTuple reader type.
Definition at line 35 of file RAuxStore.h.
using xAOD::RAuxStore::RNTupleWriter = ROOT::Experimental::RNTupleWriter |
The RNTuple writer type.
Definition at line 37 of file RAuxStore.h.
|
stronginherited |
"Structural" modes of the object
Enumerator | |
---|---|
kUndefinedStore | The structure mode is not defined. |
kContainerStore | The object describes an entire container. |
kObjectStore | The object describes a single object. |
Definition at line 30 of file AuxStoreBase.h.
xAOD::RAuxStore::RAuxStore | ( | std::string_view | prefix = "" , |
bool | topStore = true , |
||
EStructMode | mode = EStructMode::kUndefinedStore |
||
) |
|
virtualdefault |
Destructor.
|
overridevirtualinherited |
Remove the decorations added so far.
Only works for transient decorations.
Implements SG::IConstAuxStore.
Definition at line 207 of file AuxStoreBase.cxx.
StatusCode xAOD::RAuxStore::commitTo | ( | REntry & | entry | ) |
|
overridevirtualinherited |
Get the types(names) of variables handled by this container.
Implements SG::IConstAuxStore.
Definition at line 99 of file AuxStoreBase.cxx.
|
pure virtualinherited |
Return the data vector for one aux data item.
auxid | The identifier of the desired aux data item. |
size | The current size of the container (in case the data item does not already exist). |
capacity | The current capacity of the container (in case the data item does not already exist). |
Each aux data item is stored as a vector, with one entry per entry in the owning container. This returns a pointer to the start of the vector.
If the data item does not exist, it should be created and initialized to default values. size
and capacity
give the size for the new aux data item vector.
If the container is locked, throw an exception.
Implemented in SG::AuxStoreInternal, APRTest::AuxStore, RootAuxDynStore, xAOD::AuxContainerBase, xAOD::ShallowAuxContainer, xAOD::AuxInfoBase, and xAOD::ByteStreamAuxContainer_v1.
|
overridevirtualinherited |
Get a pointer to a given array.
Implements SG::IConstAuxStore.
Definition at line 54 of file AuxStoreBase.cxx.
|
inherited |
Pick up the const version from the base class.
|
overridevirtualinherited |
Get a pointer to a given array, creating the array if necessary.
Definition at line 299 of file AuxStoreBase.cxx.
|
pure virtualinherited |
Return the data vector for one aux data decoration item.
auxid | The identifier of the desired aux data item. |
size | The current size of the container (in case the data item does not already exist). |
capacity | The current capacity of the container (in case the data item does not already exist). |
Each aux data item is stored as a vector, with one entry per entry in the owning container. This returns a pointer to the start of the vector.
If the data item does not exist, it then it will be created and initialized with default values. If the container is locked, then the new item will be marked as a decoration. size
and capacity
give the size for the new aux data item vector.
If the data item already exists, then we return it if either the container is not locked or the item is marked as a decoration. Otherwise we throw an exception.
Implemented in xAOD::EventAuxInfo_v1, xAOD::EventInfoAuxContainer_v1, xAOD::EventAuxInfo_v2, xAOD::EventAuxInfo_v3, RootAuxDynStore, SG::AuxStoreInternal, xAOD::AuxContainerBase, xAOD::ShallowAuxContainer, xAOD::AuxInfoBase, SG::AuxStoreConstMem, and xAOD::ByteStreamAuxContainer_v1.
|
overridevirtualinherited |
Get a pointer to a given array, creating the array if necessary.
Definition at line 109 of file AuxStoreBase.cxx.
|
overridevirtualinherited |
Get the types(names) of decorations handled by this container.
Implements SG::IConstAuxStore.
Definition at line 104 of file AuxStoreBase.cxx.
|
overridevirtualinherited |
Get the types(names) of variables created dynamically.
Implements SG::IAuxStoreIO.
Definition at line 608 of file AuxStoreBase.cxx.
StatusCode xAOD::RAuxStore::getEntry | ( | std::int64_t | entry, |
int | getall = 0 |
||
) |
|
overrideprivatevirtual |
Load a single variable from the input.
Implements xAOD::details::AuxStoreBase.
Definition at line 780 of file RAuxStore.cxx.
|
overrideprivatevirtual |
Get a pointer to an input object, as it is in memory, for getIOData()
Implements xAOD::details::AuxStoreBase.
Definition at line 1147 of file RAuxStore.cxx.
|
overrideprivatevirtual |
Get the type of an input object, for getIOType()
Implements xAOD::details::AuxStoreBase.
Definition at line 1155 of file RAuxStore.cxx.
|
overridevirtualinherited |
Get a pointer to the data being stored for one aux data item.
Implements SG::IAuxStoreIO.
Definition at line 510 of file AuxStoreBase.cxx.
|
overridevirtualinherited |
Return the type of the data to be stored for one aux data item.
Implements SG::IAuxStoreIO.
Definition at line 569 of file AuxStoreBase.cxx.
|
overridevirtualinherited |
Get the IDs of the selected aux variables.
Reimplemented from SG::IAuxStoreIO.
Definition at line 623 of file AuxStoreBase.cxx.
|
overridevirtualinherited |
Return vector interface for one aux data item.
Implements SG::IConstAuxStore.
Definition at line 63 of file AuxStoreBase.cxx.
|
overridevirtualinherited |
Return a set of writable data identifiers.
Implements SG::IAuxStore.
Definition at line 366 of file AuxStoreBase.cxx.
|
overrideprivatevirtual |
Check if a given variable is available from the input.
Implements xAOD::details::AuxStoreBase.
Definition at line 774 of file RAuxStore.cxx.
|
overrideprivatevirtual |
Check if an output is being written by the object.
Implements xAOD::details::AuxStoreBase.
Definition at line 790 of file RAuxStore.cxx.
|
pure virtualinherited |
Move all elements from other
to this store.
pos | The starting index of the insertion. |
other | Store from which to do the move. |
ignore | Set of variables that should not be added to the store. |
Let len
be the size of other
. The store will be increased in size by len
elements, with the elements at pos
being copied to pos+len
. Then, for each auxiliary variable, the entire contents of that variable for other
will be moved to this store at index pos
. This will be done via move semantics if possible; otherwise, it will be done with a copy. Variables present in this store but not in other
will have the corresponding elements default-initialized. Variables in other
but not in this store will be added unless they are in ignore
.
Returns true if it is known that none of the vectors' memory moved, false otherwise.
Implemented in SG::AuxStoreInternal.
|
overridevirtualinherited |
|
protectedinherited |
Check if an auxiliary variable is selected for ouput writing.
This is a tricky one.
The function can't just rely on getSelectedAuxIDs, as the aux ID received here may be a new ID that the object doesn't yet know about. So we have no other choice but to check this ID explicitly.
@apram auxid The auxiliary ID that should be checked
true
if the variable needs to be written out, false
if not Definition at line 639 of file AuxStoreBase.cxx.
|
overridevirtualinherited |
Test if a variable is a decoration.
Implements SG::IConstAuxStore.
Definition at line 184 of file AuxStoreBase.cxx.
|
inherited |
Check if the object is a "top store", or not.
Definition at line 43 of file AuxStoreBase.cxx.
|
overridevirtualinherited |
Return (const) interface for a linked variable.
Reimplemented from SG::IConstAuxStore.
Definition at line 272 of file AuxStoreBase.cxx.
|
overridevirtualinherited |
Return (non-const) interface for a linked variable.
Reimplemented from SG::IAuxStore.
Definition at line 286 of file AuxStoreBase.cxx.
|
inlineinherited |
Return interface for a linked variable.
auxid | The ID of the parent variable. |
If auxid
has a linked variable, then return the IAuxTypeVector
describing it. Otherwise, return nullptr
. May return nullptr
unconditionally if this store does not support linked variables.
Definition at line 189 of file IConstAuxStore.h.
|
overridevirtualinherited |
Lock the object, and don't let decorations be added.
Implements SG::IConstAuxStore.
Definition at line 196 of file AuxStoreBase.cxx.
|
overridevirtualinherited |
|
inherited |
Get the currently configured object name prefix.
Definition at line 38 of file AuxStoreBase.cxx.
StatusCode xAOD::RAuxStore::readFrom | ( | RNTupleReader & | reader | ) |
Connect the object to an input RNTuple.
This function is called by the infrastructure to connect the object to an input RNTuple whenever a new input file is opened.
reader | The reader object set up by a parent object |
StatusCode::SUCCESS
if the function was successful, something else otherwise Definition at line 643 of file RAuxStore.cxx.
|
pure virtualinherited |
Change the capacity of all aux data vectors.
sz | The new capacity. |
This should be called when the capacity of the container changes (by reserve
). This should change the capacity for the vectors for all aux data items.
Implemented in SG::AuxStoreInternal, xAOD::AuxContainerBase, xAOD::ShallowAuxContainer, xAOD::AuxInfoBase, and xAOD::ByteStreamAuxContainer_v1.
|
overridevirtualinherited |
|
overridevirtual |
Tell the object that all branches will need to be re-read.
Implements xAOD::details::AuxStoreBase.
Definition at line 762 of file RAuxStore.cxx.
|
pure virtualinherited |
Change the size of all aux data vectors.
sz | The new size. |
This should be called when the size of the container changes. This should resize the vectors for all aux data items.
If the size of the container grows, the new elements should be default-initialized; if it shrinks, destructors should be run as appropriate.
Should return true
if it is known that none of the data pointers changed (and thus the cache does not need to be cleared), false otherwise.
Implemented in SG::AuxStoreInternal, xAOD::AuxContainerBase, xAOD::ShallowAuxContainer, xAOD::AuxInfoBase, and xAOD::ByteStreamAuxContainer_v1.
|
overridevirtualinherited |
|
virtualinherited |
Select dynamic auxiliary attributes for writing.
Definition at line 616 of file AuxStoreBase.cxx.
|
inlinevirtualinherited |
Set an option for a given auxiliary variable.
auxid | The identifier of the desired aux data item. |
option | The option to set. |
The interpretation of the option depends on the particular representation of the variable.
Returns true if the option setting was successful; false otherwise.
Reimplemented in xAOD::AuxContainerBase, xAOD::AuxInfoBase, and SG::AuxStoreInternal.
Definition at line 173 of file IAuxStore.h.
|
overridevirtual |
Set the object name prefix.
Implements xAOD::details::AuxStoreBase.
Definition at line 629 of file RAuxStore.cxx.
|
inherited |
Set the structure mode of the object to a new value.
Definition at line 32 of file AuxStoreBase.cxx.
|
inherited |
Set whether the object should behave as a "top store" or not.
Definition at line 48 of file AuxStoreBase.cxx.
|
overrideprivatevirtual |
Connect a variable to the input.
This internal function takes care of connecting to an individual (sub-)field in the input file for a given auxiliary variable.
auxid | The ID of the variable to connect to |
StatusCode::SUCCESS
if the function was successful, something else otherwise Implements xAOD::details::AuxStoreBase.
Definition at line 803 of file RAuxStore.cxx.
|
overrideprivatevirtual |
Connect a variable to the output.
This function is used internally to create an output field with the contents of a single auxiliary variable.
auxid | The ID of the variable to create an output field for |
StatusCode::SUCCESS
if the function was successful, something else otherwise Implements xAOD::details::AuxStoreBase.
Definition at line 1010 of file RAuxStore.cxx.
|
pure virtualinherited |
Shift the elements of the container.
pos | The starting index for the shift. |
offs | The (signed) amount of the shift. |
This operation shifts the elements in the vectors for all aux data items, to implement an insertion or deletion. offs
may be either positive or negative.
If offs
is positive, then the container is growing. The container size should be increased by offs
, the element at pos
moved to pos
+ offs
, and similarly for following elements. The elements between pos
and pos
+ offs
should be default-initialized.
If offs
is negative, then the container is shrinking. The element at pos
should be moved to pos
+ offs
, and similarly for following elements. The container should then be shrunk by -offs
elements (running destructors as appropriate).
Implemented in SG::AuxStoreInternal, xAOD::AuxContainerBase, xAOD::ShallowAuxContainer, xAOD::AuxInfoBase, and xAOD::ByteStreamAuxContainer_v1.
|
overridevirtualinherited |
|
overridevirtualinherited |
Return the number of elements in the store.
Implements SG::IConstAuxStore.
Definition at line 244 of file AuxStoreBase.cxx.
|
inherited |
Get what structure mode the object was constructed with.
Definition at line 27 of file AuxStoreBase.cxx.
StatusCode xAOD::RAuxStore::writeTo | ( | RNTupleWriter & | writer | ) |
Add the variables of the store to an output RNTuple.
This function is called by the infrastructure to connect the object to an output RNTuple.
writer | The writer object used for creating an output ntuple |
kTRUE
if successful, kFALSE
otherwise Definition at line 669 of file RAuxStore.cxx.
|
protectedinherited |
Member variables of the base class.
Definition at line 201 of file AuxStoreBase.h.
|
private |
Pointer to the internal object.
Definition at line 89 of file RAuxStore.h.
|
privateinherited |
Is this container locked?
Definition at line 212 of file AuxStoreBase.h.
|
mutableprivateinherited |
Mutex objects used for multithreaded synchronisation.
Definition at line 214 of file AuxStoreBase.h.
|
privateinherited |
Definition at line 214 of file AuxStoreBase.h.
|
privateinherited |
Object helping to select which auxiliary variables to write.
Definition at line 210 of file AuxStoreBase.h.
|
staticconstexprinherited |
Mark that this type supports thinning operations.
See AthContainers/supportsThinning.h and AthenaPoolCnvSvc/T_AthenaPoolCnv.h. Helps guide which pool converter template will be used. If false, the default pool converter will be used rather than the aux store-specific one. Ordinary xAOD type should not touch this, but may be overridden in a derived class to handle certain special cases.
Definition at line 199 of file IAuxStore.h.