![]() |
ATLAS Offline Software
|
"ROOT @c RNTuple implementation" of IAuxStore
More...
#include <RAuxStore.h>
Classes | |
| struct | impl |
Public Types | |
| enum class | EStructMode { kUndefinedStore = 0 , kContainerStore = 1 , kObjectStore = 2 } |
| "Structural" modes of the object More... | |
Public Member Functions | |
| RAuxStore (std::string_view prefix="", bool topStore=true, EStructMode mode=EStructMode::kUndefinedStore) | |
| Constructor. | |
| virtual | ~RAuxStore () |
| Destructor. | |
| virtual void | setPrefix (std::string_view prefix) override |
| Set the object name prefix. | |
| StatusCode | readFrom (ROOT::RNTupleReader &reader) |
| Connect the object to an input RNTuple. | |
| StatusCode | writeTo (ROOT::RNTupleWriter &writer) |
| Add the variables of the store to an output RNTuple. | |
| StatusCode | getEntry (std::int64_t entry, int getall=0) |
| Get entry from the input RNTuple. | |
| StatusCode | commitTo (ROOT::REntry &entry) |
| Commit a new entry to the output RNTuple. | |
| EStructMode | structMode () const |
| Get what structure mode the object was constructed with. | |
| void | setStructMode (EStructMode mode) |
| Set the structure mode of the object to a new value. | |
| const std::string & | prefix () const |
| Get the currently configured object name prefix. | |
| bool | isTopStore () const |
| Check if the object is a "top store", or not. | |
| void | setTopStore (bool value=true) |
| Set whether the object should behave as a "top store" or not. | |
| virtual void * | getData (auxid_t auxid, size_t size, size_t capacity)=0 |
| Return the data vector for one aux data item. | |
| virtual bool | resize (size_t sz)=0 |
| Change the size of all aux data vectors. | |
| virtual void | reserve (size_t sz)=0 |
| Change the capacity of all aux data vectors. | |
| virtual void | shift (size_t pos, ptrdiff_t offs)=0 |
| Shift the elements of the container. | |
| 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. | |
| virtual bool | setOption (auxid_t, const AuxDataOption &) |
| Set an option for a given auxiliary variable. | |
Functions implementing the @c SG::IConstAuxStore interface | |
| virtual const void * | getData (SG::auxid_t auxid) const override |
| Get a pointer to a given array. | |
| virtual const SG::IAuxTypeVector * | getVector (SG::auxid_t auxid) const override |
| Return vector interface for one aux data item. | |
| virtual const SG::auxid_set_t & | getAuxIDs () const override |
| Get the types(names) of variables handled by this container. | |
| virtual const SG::auxid_set_t & | getDecorIDs () const override |
| Get the types(names) of decorations handled by this container. | |
| virtual void * | getDecoration (SG::auxid_t auxid, std::size_t size, std::size_t capacity) override |
| Get a pointer to a given array, creating the array if necessary. | |
| virtual SG::auxid_set_t | getCopyIDs (bool warnUnlocked=false) const override |
| Get the set of variables that we should deep copy. | |
| virtual bool | isDecoration (SG::auxid_t auxid) const override |
| Test if a variable is a decoration. | |
| virtual void | lock () override |
| Lock the object, and don't let decorations be added. | |
| virtual bool | clearDecorations () override |
| Remove the decorations added so far. | |
| virtual void | lockDecoration (SG::auxid_t auxid) override |
| Lock a decoration. | |
| virtual std::size_t | size () const override |
| Return the number of elements in the store. | |
| virtual const SG::IAuxTypeVector * | linkedVector (SG::auxid_t auxid) const override |
| Return (const) interface for a linked variable. | |
| virtual SG::IAuxTypeVector * | linkedVector (SG::auxid_t auxid) override |
| Return (non-const) interface for a linked variable. | |
Functions implementing the @c SG::IAuxStore interface | |
| virtual void * | getData (SG::auxid_t auxid, std::size_t size, std::size_t capacity) override |
| Get a pointer to a given array, creating the array if necessary. | |
| virtual const SG::auxid_set_t & | getWritableAuxIDs () const override |
| Return a set of writable data identifiers. | |
| virtual bool | resize (std::size_t size) override |
| Resize the arrays to a given size. | |
| virtual void | reserve (std::size_t size) override |
| Reserve a given size for the arrays. | |
| virtual void | shift (std::size_t pos, std::ptrdiff_t offs) override |
| Shift the contents of the stored arrays. | |
| virtual bool | insertMove (std::size_t pos, SG::IAuxStore &other, const SG::auxid_set_t &ignore) override |
| Insert contents of another store via move. | |
Functions implementing the SG::IAuxStoreIO interface | |
| virtual const void * | getIOData (SG::auxid_t auxid) const override |
| Get a pointer to the data being stored for one aux data item. | |
| virtual const std::type_info * | getIOType (SG::auxid_t auxid) const override |
| Return the type of the data to be stored for one aux data item. | |
| virtual const SG::auxid_set_t & | getDynamicAuxIDs () const override |
| Get the types(names) of variables created dynamically. | |
| virtual void | selectAux (const std::set< std::string > &attributes) |
| Select dynamic auxiliary attributes for writing. | |
| virtual SG::auxid_set_t | getSelectedAuxIDs () const override |
| Get the IDs of the selected aux variables. | |
Static Public Attributes | |
| static constexpr bool | supportsThinning = true |
| Mark that this type supports thinning operations. | |
Protected Types | |
| using | mutex_t = AthContainers_detail::mutex |
| Mutex type for multithread synchronization. | |
| using | guard_t = AthContainers_detail::lock_guard<mutex_t> |
| Guard type for multithreaded synchronisation. | |
Protected Member Functions | |
| bool | isAuxIDSelected (SG::auxid_t auxid) const |
| Check if an auxiliary variable is selected for ouput writing. | |
Protected Attributes | |
| Members | m_data |
| Member variables of the base class. | |
Private Attributes | |
| std::unique_ptr< impl > | m_impl |
| Pointer to the internal object. | |
| AuxSelection | m_selection |
| Object helping to select which auxiliary variables to write. | |
| bool | m_locked = false |
| Is this container locked? | |
| mutex_t | m_mutex1 |
| Mutex objects used for multithreaded synchronisation. | |
| 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. | |
| virtual bool | hasEntryFor (SG::auxid_t auxid) const override |
| Check if a given variable is available from the input. | |
| virtual StatusCode | getEntryFor (SG::auxid_t auxid) override |
| Load a single variable from the input. | |
| virtual bool | hasOutput () const override |
| Check if an output is being written by the object. | |
| virtual StatusCode | setupInputData (SG::auxid_t auxid) override |
| Connect a variable to the input. | |
| virtual StatusCode | setupOutputData (SG::auxid_t auxid) override |
| Connect a variable to the output. | |
| virtual const void * | getInputObject (SG::auxid_t auxid) const override |
Get a pointer to an input object, as it is in memory, for getIOData(). | |
| virtual const std::type_info * | getInputType (SG::auxid_t auxid) const override |
Get the type of an input object, for getIOType(). | |
"ROOT @c RNTuple implementation" of IAuxStore
Definition at line 38 of file RAuxStore.h.
|
protectedinherited |
Guard type for multithreaded synchronisation.
Definition at line 209 of file AuxStoreBase.h.
|
protectedinherited |
Mutex type for multithread synchronization.
Definition at line 207 of file AuxStoreBase.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 ) |
Constructor.
Definition at line 596 of file RAuxStore.cxx.
|
virtualdefault |
Destructor.
|
overridevirtualinherited |
Remove the decorations added so far.
Only works for transient decorations.
Definition at line 222 of file AuxStoreBase.cxx.
| StatusCode xAOD::RAuxStore::commitTo | ( | ROOT::REntry & | entry | ) |
Commit a new entry to the output RNTuple.
Definition at line 716 of file RAuxStore.cxx.
|
overridevirtualinherited |
Get the types(names) of variables handled by this container.
Definition at line 106 of file AuxStoreBase.cxx.
|
overridevirtualinherited |
Get the set of variables that we should deep copy.
Definition at line 193 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 xAOD::AuxContainerBase, xAOD::AuxInfoBase, xAOD::ByteStreamAuxContainer_v1, and xAOD::ShallowAuxContainer.
|
overridevirtualinherited |
Get a pointer to a given array.
Definition at line 56 of file AuxStoreBase.cxx.
|
overridevirtualinherited |
Get a pointer to a given array, creating the array if necessary.
Definition at line 314 of file AuxStoreBase.cxx.
|
overridevirtualinherited |
Get a pointer to a given array, creating the array if necessary.
Definition at line 116 of file AuxStoreBase.cxx.
|
overridevirtualinherited |
Get the types(names) of decorations handled by this container.
Definition at line 111 of file AuxStoreBase.cxx.
|
overridevirtualinherited |
Get the types(names) of variables created dynamically.
Implements SG::IAuxStoreIO.
Definition at line 623 of file AuxStoreBase.cxx.
| StatusCode xAOD::RAuxStore::getEntry | ( | std::int64_t | entry, |
| int | getall = 0 ) |
Get entry from the input RNTuple.
Definition at line 667 of file RAuxStore.cxx.
|
overrideprivatevirtual |
Load a single variable from the input.
Implements xAOD::details::AuxStoreBase.
Definition at line 756 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 1126 of file RAuxStore.cxx.
|
overrideprivatevirtual |
Get the type of an input object, for getIOType().
Implements xAOD::details::AuxStoreBase.
Definition at line 1134 of file RAuxStore.cxx.
|
overridevirtualinherited |
Get a pointer to the data being stored for one aux data item.
Implements SG::IAuxStoreIO.
Definition at line 525 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 584 of file AuxStoreBase.cxx.
|
overridevirtualinherited |
Get the IDs of the selected aux variables.
Reimplemented from SG::IAuxStoreIO.
Definition at line 638 of file AuxStoreBase.cxx.
|
overridevirtualinherited |
Return vector interface for one aux data item.
Definition at line 65 of file AuxStoreBase.cxx.
|
overridevirtualinherited |
Return a set of writable data identifiers.
Implements SG::IAuxStore.
Definition at line 381 of file AuxStoreBase.cxx.
|
overrideprivatevirtual |
Check if a given variable is available from the input.
Implements xAOD::details::AuxStoreBase.
Definition at line 750 of file RAuxStore.cxx.
|
overrideprivatevirtual |
Check if an output is being written by the object.
Implements xAOD::details::AuxStoreBase.
Definition at line 769 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.
|
overridevirtualinherited |
Insert contents of another store via move.
Definition at line 475 of file AuxStoreBase.cxx.
|
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 654 of file AuxStoreBase.cxx.
|
overridevirtualinherited |
Test if a variable is a decoration.
Definition at line 199 of file AuxStoreBase.cxx.
|
inherited |
Check if the object is a "top store", or not.
Definition at line 45 of file AuxStoreBase.cxx.
|
overridevirtualinherited |
Return (const) interface for a linked variable.
Definition at line 287 of file AuxStoreBase.cxx.
|
overridevirtualinherited |
Return (non-const) interface for a linked variable.
Reimplemented from SG::IAuxStore.
Definition at line 301 of file AuxStoreBase.cxx.
|
overridevirtualinherited |
|
overridevirtualinherited |
Lock a decoration.
Definition at line 252 of file AuxStoreBase.cxx.
|
inherited |
Get the currently configured object name prefix.
Definition at line 40 of file AuxStoreBase.cxx.
| StatusCode xAOD::RAuxStore::readFrom | ( | ROOT::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 619 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 xAOD::AuxContainerBase, xAOD::AuxInfoBase, xAOD::ByteStreamAuxContainer_v1, and xAOD::ShallowAuxContainer.
|
overridevirtualinherited |
Reserve a given size for the arrays.
Definition at line 419 of file AuxStoreBase.cxx.
|
overridevirtual |
Tell the object that all branches will need to be re-read.
Implements xAOD::details::AuxStoreBase.
Definition at line 738 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 xAOD::AuxContainerBase, xAOD::AuxInfoBase, xAOD::ByteStreamAuxContainer_v1, and xAOD::ShallowAuxContainer.
|
overridevirtualinherited |
Resize the arrays to a given size.
Definition at line 386 of file AuxStoreBase.cxx.
|
virtualinherited |
Select dynamic auxiliary attributes for writing.
Definition at line 631 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, and xAOD::AuxInfoBase.
Definition at line 173 of file IAuxStore.h.
|
overridevirtual |
Set the object name prefix.
Implements xAOD::details::AuxStoreBase.
Definition at line 605 of file RAuxStore.cxx.
|
inherited |
Set the structure mode of the object to a new value.
Definition at line 34 of file AuxStoreBase.cxx.
|
inherited |
Set whether the object should behave as a "top store" or not.
Definition at line 50 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 782 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 989 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 xAOD::AuxContainerBase, xAOD::AuxInfoBase, xAOD::ByteStreamAuxContainer_v1, and xAOD::ShallowAuxContainer.
|
overridevirtualinherited |
Shift the contents of the stored arrays.
Definition at line 443 of file AuxStoreBase.cxx.
|
overridevirtualinherited |
Return the number of elements in the store.
Definition at line 259 of file AuxStoreBase.cxx.
|
inherited |
Get what structure mode the object was constructed with.
Definition at line 29 of file AuxStoreBase.cxx.
| StatusCode xAOD::RAuxStore::writeTo | ( | ROOT::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 645 of file RAuxStore.cxx.
|
protectedinherited |
Member variables of the base class.
Definition at line 204 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 215 of file AuxStoreBase.h.
|
mutableprivateinherited |
Mutex objects used for multithreaded synchronisation.
Definition at line 217 of file AuxStoreBase.h.
|
privateinherited |
Definition at line 217 of file AuxStoreBase.h.
|
privateinherited |
Object helping to select which auxiliary variables to write.
Definition at line 213 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.