|
ATLAS Offline Software
|
Go to the documentation of this file.
27 m_auxids(), m_vecs(), m_store( nullptr ), m_storeIO( nullptr ),
32 if( allowDynamicVars ) {
48 m_auxids(), m_vecs(), m_store( nullptr ), m_storeIO( nullptr ),
76 m_storeIO( nullptr ), m_ownsStore( false ),
90 for( ; itr !=
end; ++itr ) {
91 if( ! *itr )
continue;
108 if(
this == &rhs )
return *
this;
209 if( ( auxid >=
m_vecs.size() ) || ( !
m_vecs[ auxid ] ) ) {
215 auxids_nc.
insert( auxid );
217 auxid_t linked_id =
r.linkedVariable( auxid );
218 if (linked_id != SG::null_auxid) {
219 auxids_nc.insert( linked_id );
224 std::cout <<
"ERROR xAOD::AuxInfoBase::getData "
225 <<
"Unknown variable ("
227 <<
") requested" << std::endl;
272 if( ( auxid >=
m_vecs.size() ) || ( !
m_vecs[ auxid ] ) ) {
279 auxid_t linked_id =
r.linkedVariable( auxid );
280 if (linked_id != SG::null_auxid) {
288 std::cout <<
"ERROR xAOD::AuxInfoBase::getDecoration "
289 <<
"Can't provide variable "
328 bool anycleared =
false;
333 if (!anycleared)
return false;
362 auxid_t linked_id =
r.linkedVariable( auxid );
363 if (linked_id != SG::null_auxid) {
366 return m_vecs[ linked_id ];
379 auxid_t linked_id =
r.linkedVariable( auxid );
380 if (linked_id != SG::null_auxid) {
383 return m_vecs[ linked_id ];
430 if( ( auxid >=
m_vecs.size() ) || ( !
m_vecs[ auxid ] ) ) {
437 auxid_t linked_id =
r.linkedVariable( auxid );
438 if (linked_id != SG::null_auxid) {
444 std::cout <<
"ERROR xAOD::AuxInfoBase::getData "
445 <<
"Unknown variable ("
447 <<
") requested" << std::endl;
451 m_vecs[ auxid ]->reserve( capacity );
456 return m_vecs[ auxid ]->toPtr();
479 throw std::runtime_error(
"Calling resize with != 1 on a "
486 if(
v && !
v->isLinked()) {
487 if (!
v->resize(
size ))
513 throw std::runtime_error(
"Calling reserve with != 1 on a "
519 if(
v && !
v->isLinked()) {
543 throw std::runtime_error(
"Calling shift on a non-vector" );
561 throw std::runtime_error(
"Calling insertMove on a non-vector" );
570 return m_vecs[
id]->setOption( option );
590 if( ( auxid >=
m_vecs.size() ) || ( !
m_vecs[ auxid ] ) ) {
594 std::cout <<
"ERROR xAOD::AuxInfoBase::getIOData "
595 <<
"Unknown variable ("
597 <<
") requested" << std::endl;
606 if(
m_vecs[ auxid ]->isLinked() )
607 return m_vecs[ auxid ]->toVector();
609 return m_vecs[ auxid ]->toPtr();
617 if( ( auxid >=
m_vecs.size() ) || ( !
m_vecs[ auxid ] ) ) {
621 std::cout <<
"ERROR xAOD::AuxInfoBase::getIOType "
622 <<
"Unknown variable ("
624 <<
") requested" << std::endl;
629 if(
m_vecs[ auxid ]->isLinked() )
Common base class for auxiliary info objects.
JetConstituentVector::iterator iterator
virtual const SG::IAuxTypeVector * linkedVector(SG::auxid_t auxid) const override
Return interface for a linked variable.
virtual void lockDecoration(SG::auxid_t auxid)=0
Lock a decoration.
virtual const IAuxTypeVector * getVector(SG::auxid_t auxid) const =0
Return vector interface for one aux data item.
SG::auxid_t auxid_t
The aux ID type definition.
ReadStats & stats()
Access the object belonging to the current thread.
virtual SG::auxid_set_t getSelectedAuxIDs() const override
Get the IDs of the selected dynamic Aux variables (for writing)
static AuxTypeRegistry & instance()
Return the singleton registry instance.
AuxInfoBase(bool allowDynamicVars=true)
Default constructor.
virtual const std::type_info * getIOType(auxid_t auxid) const override
Return the type of the data to be stored for one aux data item.
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
std::vector< SG::IAuxTypeVector * > m_vecs
Internal list of all managed variables.
const_iterator end() const
Return an end iterator.
Exception — Attempted to modify auxiliary data in a locked store.
virtual size_t size() const override
Get the size of the container.
Exceptions that can be thrown from AthContainers.
Helper for getting a const version of a pointer.
virtual const auxid_set_t & getDynamicAuxIDs() const override
Get the types(names) of variables created dynamically.
virtual bool setOption(auxid_t id, const SG::AuxDataOption &option) override
Make an option setting on an aux variable.
virtual bool resize(size_t size) override
Resize the arrays to a given size.
virtual const void * getIOData(auxid_t auxid) const override
Get a pointer to the data being stored for one aux data item.
virtual const auxid_set_t & getWritableAuxIDs() const override
Return a set of writable data identifiers.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
void setName(const char *name)
Set the name of the container instance.
bool m_ownsStore
Flag deciding if the object owns the dynamic store or not.
const char * name() const
Get the name of the container instance.
virtual const std::type_info * getIOType(SG::auxid_t auxid) const =0
Return the type of the data to be stored for one aux data item.
virtual const SG::IAuxTypeVector * getVector(SG::auxid_t auxid) const override final
Return vector interface for one aux data item.
virtual IAuxTypeVector * linkedVector(SG::auxid_t)
Interface providing I/O for a generic auxiliary store.
Hold information about an option setting request.
virtual bool insertMove(size_t pos, IAuxStore &other, const SG::auxid_set_t &ignore) override
Insert contents of another store via move.
virtual const void * getData(auxid_t auxid) const override
Get a pointer to a given array.
Handle mappings between names and auxid_t.
virtual void * getDecoration(auxid_t auxid, size_t size, size_t capacity) override
Get a pointer to a given array, as a decoration.
virtual bool isDecoration(auxid_t auxid) const override
Test if a variable is a decoration.
virtual bool setOption(auxid_t, const AuxDataOption &)
Set an option for a given auxiliary variable.
size_t auxid_t
Identifier for a particular aux data item.
const std::type_info * getType(SG::auxid_t auxid) const
Return the type of an aux data item.
virtual bool clearDecorations()=0
Clear all decorations.
SG::IAuxStore * m_store
Internal dynamic auxiliary store object.
virtual const auxid_set_t & getDecorIDs() const override
Get the types(names) of decorations handled by this container.
ConcurrentBitset & insert(bit_t bit, bit_t new_nbits=0)
Set a bit to 1.
std::string m_name
Name of the container in memory. Set externally.
AuxInfoBase & operator=(const AuxInfoBase &rhs)
Assignment operator.
Auxiliary data store for standalone objects.
virtual void * getDecoration(auxid_t auxid, size_t size, size_t capacity)=0
Return the data vector for one aux data decoration item.
virtual SG::IAuxStore * getStore() override
Get the currently used internal store object.
const std::type_info * getVecType(SG::auxid_t auxid) const
Return the type of the STL vector used to hold an aux data item.
static IOStats & instance()
Singleton object accessor.
SG::auxid_set_t auxid_set_t
The aux ID set type definition.
virtual const auxid_set_t & getAuxIDs() const override
Get the types(names) of variables handled by this container.
const_iterator begin() const
Return a begin iterator.
Hold information about an option setting request.
virtual void setStore(SG::IAuxStore *store) override
Set a different internal store object.
virtual void shift(size_t pos, ptrdiff_t offs) override
Shift the contents of the stored arrays.
const T * as_const_ptr(const T *p)
Helper for getting a const version of a pointer.
virtual void reserve(size_t size) override
Reserve a given size for the arrays.
AthContainers_detail::lock_guard< mutex_t > guard_t
virtual void lockDecoration(SG::auxid_t auxid) override
Lock a decoration.
virtual const void * getIOData(SG::auxid_t auxid) const =0
Return a pointer to the data to be stored for one aux data item.
void readBranch(const std::string &prefix, SG::auxid_t auxid)
Function incrementing the read counter on a specific branch.
Interface for non-const operations on an auxiliary store.
Auxiliary data store for standalone objects.
virtual void * getData(auxid_t auxid, size_t size, size_t capacity)=0
Return the data vector for one aux data item.
SG::IAuxStoreIO * m_storeIO
The IO interface to the internal auxiliary store.
Abstract interface for manipulating vectors of arbitrary types.
virtual const SG::auxid_set_t & getDecorIDs() const =0
Return a set of identifiers for decorations in this store.
Handle mappings between names and auxid_t.
virtual void lock()=0
Lock the container.
virtual bool resize(size_t sz)=0
Change the size of all aux data vectors.
A set of aux data identifiers.
~AuxInfoBase()
Destructor.
virtual bool clearDecorations() override
Clear all decorations.
#define ATLAS_THREAD_SAFE
virtual bool isDecoration(auxid_t auxid) const =0
Test if a particular variable is tagged as a decoration.
Define macros for attributes used to control the static checker.
auxid_set_t m_auxids
Internal list of all available variables.
virtual const SG::auxid_set_t & getAuxIDs() const =0
Return a set of identifiers for existing data items in this store.
bool m_locked
Has the container been locked?
virtual void reserve(size_t sz)=0
Change the capacity of all aux data vectors.
virtual void lock() override
Lock the container.