ATLAS Offline Software
|
Common base class for the auxiliary containers. More...
#include <AuxContainerBase.h>
Inherits SG::IAuxStore, SG::IAuxStoreIO, SG::IAuxStoreHolder, and ILockable.
Inherited by DMTest::AllocTestAuxContainer_v1, DMTest::CAuxContainer_v1, DMTest::CLinksAuxContainer_v1, DMTest::GAuxContainer_v1, DMTest::HAuxContainer_v1, DMTest::HAuxContainer_v2, DMTest::JVecAuxContainer_v1, DMTest::PAuxContainer_v1, DMTest::PLinksAuxContainer_v1, TrigNavTest::TestAuxB, xAOD::AFPDataAuxContainer_v1, xAOD::AFPProtonAuxContainer_v1, xAOD::AFPSiHitAuxContainer_v1, xAOD::AFPSiHitAuxContainer_v2, xAOD::AFPSiHitsClusterAuxContainer_v1, xAOD::AFPToFHitAuxContainer_v1, xAOD::AFPToFTrackAuxContainer_v1, xAOD::AFPTrackAuxContainer_v1, xAOD::AFPTrackAuxContainer_v2, xAOD::AFPVertexAuxContainer_v1, xAOD::ALFADataAuxContainer_v1, xAOD::BCMRawDataAuxContainer_v1, xAOD::BTaggingAuxContainer_v1, xAOD::BTaggingAuxContainer_v2, xAOD::BTaggingTrigAuxContainer_v1, xAOD::BTagVertexAuxContainer_v1, xAOD::BunchConfAuxContainer_v1, xAOD::CaloClusterAuxContainer_v1, xAOD::CaloClusterAuxContainer_v2, xAOD::CaloClusterTrigAuxContainer_v1, xAOD::CaloRingsAuxContainer_v1, xAOD::CaloTowerAuxContainer_v1, xAOD::CMMCPHitsAuxContainer_v1, xAOD::CMMEtSumsAuxContainer_v1, xAOD::CMMJetHitsAuxContainer_v1, xAOD::CMXCPHitsAuxContainer_v1, xAOD::CMXCPTobAuxContainer_v1, xAOD::CMXEtSumsAuxContainer_v1, xAOD::CMXJetHitsAuxContainer_v1, xAOD::CMXJetTobAuxContainer_v1, xAOD::CMXRoIAuxContainer_v1, xAOD::CompositeParticleAuxContainer_v1, xAOD::CPMHitsAuxContainer_v1, xAOD::CPMRoIAuxContainer_v1, xAOD::CPMTobRoIAuxContainer_v1, xAOD::CPMTowerAuxContainer_v1, xAOD::CPMTowerAuxContainer_v2, xAOD::CutBookkeeperAuxContainer_v1, xAOD::DiTauJetAuxContainer_v1, xAOD::eFexEMRoIAuxContainer_v1, xAOD::eFexTauRoIAuxContainer_v1, xAOD::eFexTowerAuxContainer_v1, xAOD::EgammaAuxContainer_v1, xAOD::ElectronAuxContainer_v2, xAOD::ElectronAuxContainer_v3, xAOD::ElectronTrigAuxContainer_v1, xAOD::EmTauRoIAuxContainer_v1, xAOD::EmTauRoIAuxContainer_v2, xAOD::EventInfoAuxContainer_v1, xAOD::ExampleElectronAuxContainer_v1, xAOD::FlowElementAuxContainer_v1, xAOD::ForwardEventInfoAuxContainer_v1, xAOD::GBlockAuxContainer_v1, xAOD::gFexGlobalRoIAuxContainer_v1, xAOD::gFexJetRoIAuxContainer_v1, xAOD::gFexTowerAuxContainer_v1, xAOD::HGTDClusterAuxContainer_v1, xAOD::HIEventShapeAuxContainer_v1, xAOD::HIEventShapeAuxContainer_v2, xAOD::JEMEtSumsAuxContainer_v1, xAOD::JEMEtSumsAuxContainer_v2, xAOD::JEMHitsAuxContainer_v1, xAOD::JEMRoIAuxContainer_v1, xAOD::JEMTobRoIAuxContainer_v1, xAOD::JetAuxContainer_v1, xAOD::JetElementAuxContainer_v1, xAOD::JetElementAuxContainer_v2, xAOD::JetRoIAuxContainer_v1, xAOD::JetRoIAuxContainer_v2, xAOD::jFexFwdElRoIAuxContainer_v1, xAOD::jFexLRJetRoIAuxContainer_v1, xAOD::jFexMETRoIAuxContainer_v1, xAOD::jFexSRJetRoIAuxContainer_v1, xAOD::jFexSumETRoIAuxContainer_v1, xAOD::jFexTauRoIAuxContainer_v1, xAOD::jFexTowerAuxContainer_v1, xAOD::JGTowerAuxContainer_v1, xAOD::L1TopoRawDataAuxContainer_v1, xAOD::L1TopoSimResultsAuxContainer_v1, xAOD::L2CombinedMuonAuxContainer_v1, xAOD::L2IsoMuonAuxContainer_v1, xAOD::L2StandAloneMuonAuxContainer_v1, xAOD::L2StandAloneMuonAuxContainer_v2, xAOD::LumiBlockRangeAuxContainer_v1, xAOD::MBTSModuleAuxContainer_v1, xAOD::MdtDriftCircleAuxContainer_v1, xAOD::MdtTwinDriftCircleAuxContainer_v1, xAOD::MissingETAuxAssociationMap_v1, xAOD::MissingETAuxAssociationMap_v2, xAOD::MissingETAuxComponentMap_v1, xAOD::MissingETAuxContainer_v1, xAOD::MMClusterAuxContainer_v1, xAOD::MuonAuxContainer_v1, xAOD::MuonAuxContainer_v2, xAOD::MuonAuxContainer_v3, xAOD::MuonAuxContainer_v4, xAOD::MuonAuxContainer_v5, xAOD::MuonRoIAuxContainer_v1, xAOD::MuonSegmentAuxContainer_v1, xAOD::MuonSimHitAuxContainer_v1, xAOD::NeutralParticleAuxContainer_v1, xAOD::NRPCRDOAuxContainer_v1, xAOD::NSWMMTPRDOAuxContainer_v1, xAOD::NSWTPRDOAuxContainer_v1, xAOD::ParticleAuxContainer_v1, xAOD::PFOAuxContainer_v1, xAOD::PhotonAuxContainer_v2, xAOD::PhotonAuxContainer_v3, xAOD::PhotonTrigAuxContainer_v1, xAOD::PixelClusterAuxContainer_v1, xAOD::RingSetAuxContainer_v1, xAOD::RingSetConfAuxContainer_v1, xAOD::RODHeaderAuxContainer_v1, xAOD::RODHeaderAuxContainer_v2, xAOD::RpcStrip2DAuxContainer_v1, xAOD::RpcStripAuxContainer_v1, xAOD::SCTRawHitValidationAuxContainer_v1, xAOD::SlowMuonAuxContainer_v1, xAOD::SpacePointAuxContainer_v1, xAOD::sTgcPadAuxContainer_v1, xAOD::sTgcStripAuxContainer_v1, xAOD::sTgcWireAuxContainer_v1, xAOD::StripClusterAuxContainer_v1, xAOD::TauJetAuxContainer_v1, xAOD::TauJetAuxContainer_v2, xAOD::TauJetAuxContainer_v3, xAOD::TauTrackAuxContainer_v1, xAOD::TgcStripAuxContainer_v1, xAOD::TrackCaloClusterAuxContainer_v1, xAOD::TrackJacobianAuxContainer_v1, xAOD::TrackMeasurementAuxContainer_v1, xAOD::TrackMeasurementValidationAuxContainer_v1, xAOD::TrackParametersAuxContainer_v1, xAOD::TrackParticleAuxContainer_v1, xAOD::TrackParticleAuxContainer_v2, xAOD::TrackParticleAuxContainer_v3, xAOD::TrackParticleAuxContainer_v4, xAOD::TrackParticleAuxContainer_v5, xAOD::TrackParticleClusterAssociationAuxContainer_v1, xAOD::TrackStateAuxContainer_v1, xAOD::TrackStateValidationAuxContainer_v1, xAOD::TrackSummaryAuxContainer_v1, xAOD::TrackSurfaceAuxContainer_v1, xAOD::TrigBphysAuxContainer_v1, xAOD::TrigCaloClusterAuxContainer_v1, xAOD::TrigCompositeAuxContainer_v2, xAOD::TrigElectronAuxContainer_v1, xAOD::TrigEMClusterAuxContainer_v2, xAOD::TriggerMenuAuxContainer_v1, xAOD::TriggerMenuJsonAuxContainer_v1, xAOD::TriggerTowerAuxContainer_v1, xAOD::TriggerTowerAuxContainer_v2, xAOD::TrigHisto2DAuxContainer_v1, xAOD::TrigMissingETAuxContainer_v1, xAOD::TrigPassBitsAuxContainer_v1, xAOD::TrigPhotonAuxContainer_v1, xAOD::TrigRingerRingsAuxContainer_v1, xAOD::TrigRingerRingsAuxContainer_v2, xAOD::TrigRNNOutputAuxContainer_v1, xAOD::TrigRNNOutputAuxContainer_v2, xAOD::TrigSpacePointCountsAuxContainer_v1, xAOD::TrigT2MbtsBitsAuxContainer_v1, xAOD::TrigT2ZdcSignalsAuxContainer_v1, xAOD::TrigTrackCountsAuxContainer_v1, xAOD::TrigVertexCountsAuxContainer_v1, xAOD::TruthEventAuxContainer_v1, xAOD::TruthMetaDataAuxContainer_v1, xAOD::TruthParticleAuxContainer_v1, xAOD::TruthPileupEventAuxContainer_v1, xAOD::TruthVertexAuxContainer_v1, xAOD::VertexAuxContainer_v1, xAOD::ZdcModuleAuxContainer_v1, and xAOD::ZdcModuleAuxContainer_v2.
Public Types | |
typedef SG::auxid_t | auxid_t |
The aux ID type definition. More... | |
typedef SG::auxid_set_t | auxid_set_t |
The aux ID set type definition. More... | |
template<class T , class ALLOC = std::allocator<T>> | |
using | AuxVariable_t = std::vector< T, ALLOC > |
Declare how to wrap variables for this sort of base. More... | |
template<class T , class ALLOC = std::allocator<T>> | |
using | LinkedVariable_t = AuxVariable_t< T, ALLOC > |
enum | AuxStoreType { AST_ObjectStore = 0, AST_ContainerStore = 1 } |
Type of the auxiliary store. More... | |
Public Member Functions | |
AuxContainerBase (bool allowDynamicVars=true) | |
Default constructor. More... | |
AuxContainerBase (std::pmr::memory_resource *memResource, bool allowDynamicVars=true) | |
Passing in a memory resource. More... | |
AuxContainerBase (const AuxContainerBase &parent) | |
Copy constructor. More... | |
AuxContainerBase (SG::IAuxStore *store, std::pmr::memory_resource *memResource=nullptr) | |
Constructor receiving a "dynamic auxiliary store". More... | |
~AuxContainerBase () | |
Destructor. More... | |
AuxContainerBase & | operator= (const AuxContainerBase &rhs) |
Assignment operator. More... | |
template<typename T , typename ALLOC > | |
auxid_t | getAuxID (const std::string &name, std::vector< T, ALLOC > &, SG::AuxVarFlags flags=SG::AuxVarFlags::None, const SG::auxid_t linkedVariable=SG::null_auxid) |
Get the auxiliary ID for one of the persistent variables. More... | |
template<typename T > | |
auxid_t | getAuxID (const std::string &name, SG::PackedContainer< T > &, SG::AuxVarFlags flags=SG::AuxVarFlags::None, const SG::auxid_t linkedVariable=SG::null_auxid) |
Get the auxiliary ID for one of the persistent variables. More... | |
template<typename T , typename ALLOC > | |
void | regAuxVar (auxid_t auxid, const std::string &name, std::vector< T, ALLOC > &vec) |
Register one of the persistent variables internally. More... | |
template<typename T > | |
void | regAuxVar (auxid_t auxid, const std::string &name, SG::PackedContainer< T > &vec) |
Register one of the persistent variables internally. More... | |
virtual const void * | getData (SG::auxid_t auxid) const=0 |
Pick up the const version from the base class. 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 const IAuxTypeVector * | linkedVector (SG::auxid_t) const |
Return interface for a linked variable. More... | |
Static Public Attributes | |
static constexpr bool | supportsThinning = true |
Mark that this type supports thinning operations. More... | |
Private Types | |
typedef AthContainers_detail::mutex | mutex_t |
Mutex for multithread synchronization. More... | |
typedef AthContainers_detail::lock_guard< mutex_t > | guard_t |
Private Member Functions | |
template<typename ELT , typename CONT > | |
void | regAuxVar1 (auxid_t auxid, const std::string &name, CONT &vec) |
Common code between regAuxVar cases. More... | |
Private Attributes | |
auxid_set_t | m_auxids |
Internal list of all available variables. More... | |
std::vector< SG::IAuxTypeVector * > | m_vecs |
Internal list of all managed variables. More... | |
SG::IAuxStore * | m_store |
Internal dynamic auxiliary store object. More... | |
SG::IAuxStoreIO * | m_storeIO |
The IO interface to the internal auxiliary store. More... | |
bool | m_ownsStore |
Flag deciding if the object owns the dynamic store or not. More... | |
bool | m_locked |
Has the container been locked? More... | |
mutex_t | m_mutex |
std::string | m_name |
Name of the container in memory. Set externally. More... | |
CxxUtils::CachedPointer< std::pmr::memory_resource > m_memResource | ATLAS_THREAD_SAFE |
Memory resource to use for this container. More... | |
Friends | |
class | ::xAODAuxContainerBaseCnv |
Common base class for the auxiliary containers.
To make the development of auxiliary containers simpler, they can all inherit from this one class. Then all they need to do is just to declare their data members, everything else is taken care of by this transient base class.
Definition at line 53 of file AuxContainerBase.h.
The aux ID set type definition.
Definition at line 65 of file AuxContainerBase.h.
The aux ID type definition.
Definition at line 63 of file AuxContainerBase.h.
using xAOD::AuxContainerBase::AuxVariable_t = std::vector<T, ALLOC> |
Declare how to wrap variables for this sort of base.
Definition at line 195 of file AuxContainerBase.h.
|
private |
Definition at line 247 of file AuxContainerBase.h.
using xAOD::AuxContainerBase::LinkedVariable_t = AuxVariable_t<T, ALLOC> |
Definition at line 197 of file AuxContainerBase.h.
|
private |
Mutex for multithread synchronization.
Definition at line 246 of file AuxContainerBase.h.
|
inherited |
Type of the auxiliary store.
In the xAOD EDM we use auxiliary store objects in some cases to describe a single object, and in most cases to describe a container of objects. This enumeration declares which type the object implementing this interface is.
Enumerator | |
---|---|
AST_ObjectStore | The store describes a single object. |
AST_ContainerStore | The store describes a container. |
Definition at line 66 of file IAuxStoreHolder.h.
xAOD::AuxContainerBase::AuxContainerBase | ( | bool | allowDynamicVars = true | ) |
xAOD::AuxContainerBase::AuxContainerBase | ( | std::pmr::memory_resource * | memResource, |
bool | allowDynamicVars = true |
||
) |
xAOD::AuxContainerBase::AuxContainerBase | ( | const AuxContainerBase & | parent | ) |
Copy constructor.
This is an interesting one.
The internal variables of AuxContainerBase are set up by the derived class(es) at construction. So, this internal state is not to be copied!
However, since the derived classes (the contents of their regular members) are allowed to be copied, let's not make this constructor private.
Definition at line 58 of file AuxContainerBase.cxx.
xAOD::AuxContainerBase::AuxContainerBase | ( | SG::IAuxStore * | store, |
std::pmr::memory_resource * | memResource = nullptr |
||
) |
Constructor receiving a "dynamic auxiliary store".
This constructor is used to wrap another object that is stored in StoreGate, and hence we should not take ownership of.
store | Another store that should be wrapped, but not owned |
Definition at line 84 of file AuxContainerBase.cxx.
xAOD::AuxContainerBase::~AuxContainerBase | ( | ) |
|
overridevirtual |
Clear all decorations.
Implements SG::IConstAuxStore.
Definition at line 357 of file AuxContainerBase.cxx.
auxid_t xAOD::AuxContainerBase::getAuxID | ( | const std::string & | name, |
SG::PackedContainer< T > & | , | ||
SG::AuxVarFlags | flags = SG::AuxVarFlags::None , |
||
const SG::auxid_t | linkedVariable = SG::null_auxid |
||
) |
Get the auxiliary ID for one of the persistent variables.
auxid_t xAOD::AuxContainerBase::getAuxID | ( | const std::string & | name, |
std::vector< T, ALLOC > & | , | ||
SG::AuxVarFlags | flags = SG::AuxVarFlags::None , |
||
const SG::auxid_t | linkedVariable = SG::null_auxid |
||
) |
Get the auxiliary ID for one of the persistent variables.
|
overridevirtual |
Get the types(names) of variables handled by this container.
Implements SG::IConstAuxStore.
Definition at line 275 of file AuxContainerBase.cxx.
Get a pointer to a given array.
Implements SG::IConstAuxStore.
Definition at line 230 of file AuxContainerBase.cxx.
|
overridevirtual |
Get a pointer to a given array, creating the array if necessary.
Implements SG::IAuxStore.
Definition at line 462 of file AuxContainerBase.cxx.
|
inherited |
Pick up the const version from the base class.
|
overridevirtual |
Get a pointer to a given array, as a decoration.
Implements SG::IConstAuxStore.
Reimplemented in xAOD::EventInfoAuxContainer_v1.
Definition at line 300 of file AuxContainerBase.cxx.
|
overridevirtual |
Get the types(names) of decorations handled by this container.
Implements SG::IConstAuxStore.
Definition at line 282 of file AuxContainerBase.cxx.
|
overridevirtual |
Get the types(names) of variables created dynamically.
Implements SG::IAuxStoreIO.
Definition at line 701 of file AuxContainerBase.cxx.
Get a pointer to the data being stored for one aux data item.
Implements SG::IAuxStoreIO.
Definition at line 659 of file AuxContainerBase.cxx.
Return the type of the data to be stored for one aux data item.
Implements SG::IAuxStoreIO.
Definition at line 684 of file AuxContainerBase.cxx.
|
overridevirtual |
Get the IDs of the selected dynamic Aux variables (for writing)
Reimplemented from SG::IAuxStoreIO.
Definition at line 721 of file AuxContainerBase.cxx.
|
overridevirtual |
Implements SG::IAuxStoreHolder.
Definition at line 181 of file AuxContainerBase.cxx.
|
overridevirtual |
Get the currently used internal store object.
Implements SG::IAuxStoreHolder.
Definition at line 154 of file AuxContainerBase.cxx.
|
inlineoverridevirtual |
Return the type of the store object.
Implements SG::IAuxStoreHolder.
Definition at line 92 of file AuxContainerBase.h.
|
finaloverridevirtual |
Return vector interface for one aux data item.
Implements SG::IConstAuxStore.
Definition at line 239 of file AuxContainerBase.cxx.
|
overridevirtual |
Return a set of writable data identifiers.
Implements SG::IAuxStore.
Definition at line 498 of file AuxContainerBase.cxx.
|
overridevirtual |
|
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.
Test if a variable is a decoration.
Implements SG::IConstAuxStore.
Reimplemented in xAOD::EventInfoAuxContainer_v1.
Definition at line 291 of file AuxContainerBase.cxx.
|
overridevirtual |
Return interface for a linked variable.
Reimplemented from SG::IConstAuxStore.
Definition at line 396 of file AuxContainerBase.cxx.
|
overridevirtual |
Return interface for a linked variable.
Reimplemented from SG::IAuxStore.
Definition at line 413 of file AuxContainerBase.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.
|
overridevirtual |
|
overridevirtual |
Lock a decoration.
Implements SG::IConstAuxStore.
Reimplemented in xAOD::EventInfoAuxContainer_v1.
Definition at line 387 of file AuxContainerBase.cxx.
std::pmr::memory_resource * xAOD::AuxContainerBase::memResource | ( | ) |
Return the memory resource to use.
Definition at line 159 of file AuxContainerBase.cxx.
Get the name of the container instance.
Definition at line 743 of file AuxContainerBase.cxx.
AuxContainerBase & xAOD::AuxContainerBase::operator= | ( | const AuxContainerBase & | rhs | ) |
Assignment operator.
Just like the copy constructor, this operator doesn't actually copy anything either.
It's just here to make it clear to C++ that the internal state of these objects is not to be messed with.
Definition at line 119 of file AuxContainerBase.cxx.
void xAOD::AuxContainerBase::regAuxVar | ( | auxid_t | auxid, |
const std::string & | name, | ||
SG::PackedContainer< T > & | vec | ||
) |
Register one of the persistent variables internally.
void xAOD::AuxContainerBase::regAuxVar | ( | auxid_t | auxid, |
const std::string & | name, | ||
std::vector< T, ALLOC > & | vec | ||
) |
Register one of the persistent variables internally.
|
private |
Common code between regAuxVar cases.
|
overridevirtual |
Reserve a given size for the arrays.
Implements SG::IAuxStore.
Definition at line 533 of file AuxContainerBase.cxx.
|
overridevirtual |
Resize the arrays to a given size.
Implements SG::IAuxStore.
Definition at line 505 of file AuxContainerBase.cxx.
Set the name of the container instance.
Definition at line 748 of file AuxContainerBase.cxx.
|
overridevirtual |
Make an option setting on an aux variable.
Reimplemented from SG::IAuxStore.
Definition at line 638 of file AuxContainerBase.cxx.
|
overridevirtual |
Set a different internal store object.
This function is used by the I/O infrastructure to possibly put a store object into this one, which can interact with dynamic variables directly.
Note that the object takes ownership of the received store.
store | The store that should be used for dynamic variable handling inside the object from now on |
Implements SG::IAuxStoreHolder.
Definition at line 195 of file AuxContainerBase.cxx.
|
overridevirtual |
Shift the contents of the stored arrays.
Implements SG::IAuxStore.
Definition at line 558 of file AuxContainerBase.cxx.
|
overridevirtual |
Get the size of the container.
Implements SG::IConstAuxStore.
Definition at line 430 of file AuxContainerBase.cxx.
|
friend |
Definition at line 224 of file AuxContainerBase.h.
|
mutableprivate |
Memory resource to use for this container.
Definition at line 254 of file AuxContainerBase.h.
|
private |
Internal list of all available variables.
Definition at line 232 of file AuxContainerBase.h.
|
private |
Has the container been locked?
Definition at line 243 of file AuxContainerBase.h.
|
mutableprivate |
Definition at line 248 of file AuxContainerBase.h.
|
private |
Name of the container in memory. Set externally.
Definition at line 251 of file AuxContainerBase.h.
|
private |
Flag deciding if the object owns the dynamic store or not.
Definition at line 241 of file AuxContainerBase.h.
|
private |
Internal dynamic auxiliary store object.
Definition at line 237 of file AuxContainerBase.h.
|
private |
The IO interface to the internal auxiliary store.
Definition at line 239 of file AuxContainerBase.h.
|
private |
Internal list of all managed variables.
Definition at line 234 of file AuxContainerBase.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.