ATLAS Offline Software
Loading...
Searching...
No Matches
xAOD::TrigNavigationAuxInfo_v1 Class Referenceabstract

Class holding the data handled by TrigNavigation_v1 (bsaed on the TrigDecision_v1) This is the auxiliary class holding the trigger navigation information in xAOD files. More...

#include <TrigNavigationAuxInfo_v1.h>

Inheritance diagram for xAOD::TrigNavigationAuxInfo_v1:
Collaboration diagram for xAOD::TrigNavigationAuxInfo_v1:

Public Types

typedef SG::auxid_t auxid_t
 The aux ID type definition.
typedef SG::auxid_set_t auxid_set_t
 The aux ID set type definition.
template<class T, class ALLOC = std::allocator<T>>
using AuxVariable_t = T
 Declare how to wrap variables for this sort of base.
template<class T, class ALLOC = std::allocator<T>>
using LinkedVariable_t = std::vector<T, ALLOC>
enum  AuxStoreType { AST_ObjectStore = 0 , AST_ContainerStore = 1 }
 Type of the auxiliary store. More...

Public Member Functions

 TrigNavigationAuxInfo_v1 ()
 Default constructor.
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.
template<typename T>
auxid_t getAuxID (const std::string &name, 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.
template<typename T>
void regAuxVar (auxid_t auxid, const std::string &name, T &info)
 Register one of the persistent variables internally.
Functions implementing the SG::IAuxStoreHolder interface
virtual SG::IAuxStoregetStore () override
 Get the currently used internal store object.
virtual const SG::IAuxStoregetStore () const override
 Get the currently used internal store object.
virtual void setStore (SG::IAuxStore *store) override
 Set a different internal store object.
virtual AuxStoreType getStoreType () const override
 Return the type of the store object.
Functions implementing the SG::IConstAuxStore interface
virtual const void * getData (auxid_t auxid) const override
 Get a pointer to a given array.
virtual const SG::IAuxTypeVectorgetVector (SG::auxid_t auxid) const override final
 Return vector interface for one aux data item.
virtual const auxid_set_tgetAuxIDs () const override
 Get the types(names) of variables handled by this container.
virtual const auxid_set_tgetDecorIDs () const override
 Get the types(names) of decorations handled by this container.
virtual SG::auxid_set_t getCopyIDs (bool warnUnlocked=false) const override
 Get the set of variables that we should deep copy.
virtual bool isDecoration (auxid_t auxid) const override
 Test if a variable is a decoration.
virtual void * getDecoration (auxid_t auxid, size_t size, size_t capacity) override
 Get a pointer to a given array, as a decoration.
virtual void lock () override
 Lock the container.
virtual bool clearDecorations () override
 Clear all decorations.
virtual size_t size () const override
 Get the size of the container.
virtual void lockDecoration (SG::auxid_t auxid) override
 Lock a decoration.
virtual const SG::IAuxTypeVectorlinkedVector (SG::auxid_t auxid) const override
 Return interface for a linked variable.
virtual void toTransient (const EventContext &ctx) override
 Perform processing on aux variable objects just after reading to make them usable as transient objects.
Functions implementing the SG::IAuxStore interface
virtual void * getData (auxid_t auxid, size_t size, size_t capacity) override
 Get a pointer to a given array, creating the array if necessary.
virtual SG::IAuxTypeVectorlinkedVector (SG::auxid_t auxid) override
 Return interface for a linked variable.
virtual const auxid_set_tgetWritableAuxIDs () const override
 Return a set of writable data identifiers.
virtual bool resize (size_t size) override
 Resize the arrays to a given size.
virtual void reserve (size_t size) override
 Reserve a given size for the arrays.
virtual void shift (size_t pos, ptrdiff_t offs) override
 Shift the contents of the stored arrays.
virtual bool insertMove (size_t pos, IAuxStore &other, const SG::auxid_set_t &ignore) override
 Insert contents of another store via move.
virtual bool setOption (auxid_t id, const SG::AuxDataOption &option) override
 Make an option setting on an aux variable.
Functions implementing the SG::IAuxStoreIO interface
virtual const void * getIOData (auxid_t auxid) const override
 Get a pointer to the data being stored for one aux data item.
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.
virtual const auxid_set_tgetDynamicAuxIDs () const override
 Get the types(names) of variables created dynamically.
virtual SG::auxid_set_t getSelectedAuxIDs () const override
 Get the IDs of the selected dynamic Aux variables (for writing).
Functions managing the instance name of the container
const charname () const
 Get the name of the container instance.
void setName (const char *name)
 Set the name of the container instance.

Static Public Attributes

static constexpr bool supportsThinning = true
 Mark that this type supports thinning operations.

Private Types

typedef AthContainers_detail::mutex mutex_t
 Mutex for multithread synchronization.
typedef AthContainers_detail::lock_guard< mutex_tguard_t

Private Attributes

std::vector< uint32_tserialized
auxid_set_t m_auxids
 Internal list of all available variables.
std::vector< SG::IAuxTypeVector * > m_vecs
 Internal list of all managed variables.
SG::IAuxStorem_store
 Internal dynamic auxiliary store object.
SG::IAuxStoreIOm_storeIO
 The IO interface to the internal auxiliary store.
bool m_ownsStore
 Flag deciding if the object owns the dynamic store or not.
bool m_locked
 Has the container been locked?
mutex_t m_mutex
std::string m_name
 Name of the container in memory. Set externally.

Detailed Description

Class holding the data handled by TrigNavigation_v1 (bsaed on the TrigDecision_v1) This is the auxiliary class holding the trigger navigation information in xAOD files.

Author
Tomasz Bold
Revision
631149
Date
2014-11-26 13:26:18 +0100 (Wed, 26 Nov 2014)

Definition at line 32 of file TrigNavigationAuxInfo_v1.h.

Member Typedef Documentation

◆ auxid_set_t

The aux ID set type definition.

Definition at line 51 of file AuxInfoBase.h.

◆ auxid_t

The aux ID type definition.

Definition at line 49 of file AuxInfoBase.h.

◆ AuxVariable_t

template<class T, class ALLOC = std::allocator<T>>
using xAOD::AuxInfoBase::AuxVariable_t = T
inherited

Declare how to wrap variables for this sort of base.

Definition at line 183 of file AuxInfoBase.h.

◆ guard_t

Definition at line 216 of file AuxInfoBase.h.

◆ LinkedVariable_t

template<class T, class ALLOC = std::allocator<T>>
using xAOD::AuxInfoBase::LinkedVariable_t = std::vector<T, ALLOC>
inherited

Definition at line 185 of file AuxInfoBase.h.

◆ mutex_t

Mutex for multithread synchronization.

Definition at line 215 of file AuxInfoBase.h.

Member Enumeration Documentation

◆ AuxStoreType

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 68 of file IAuxStoreHolder.h.

68 {
69 AST_ObjectStore = 0,
71 };
@ AST_ContainerStore
The store describes a container.
@ AST_ObjectStore
The store describes a single object.

Constructor & Destructor Documentation

◆ TrigNavigationAuxInfo_v1()

xAOD::TrigNavigationAuxInfo_v1::TrigNavigationAuxInfo_v1 ( )

Default constructor.

Definition at line 12 of file TrigNavigationAuxInfo_v1.cxx.

13 : AuxInfoBase() {
14
16
17 }
#define AUX_VARIABLE(VAR,...)
Convenience macro for declaring an auxiliary variable.
Definition AuxVariable.h:23
AuxInfoBase(bool allowDynamicVars=true)
Default constructor.

Member Function Documentation

◆ clearDecorations()

bool xAOD::AuxInfoBase::clearDecorations ( )
overridevirtualinherited

Clear all decorations.

Definition at line 328 of file AuxInfoBase.cxx.

328 {
329
330 // Guard against multi-threaded execution:
331 guard_t guard( m_mutex );
332
333 // Clear the decorations that are in the dynamic store:
334 bool anycleared = false;
335 if( m_store ) {
336 anycleared = m_store->clearDecorations();
337 }
338 // Early exit if there were no decorations.
339 if (!anycleared) return false;
340
341 // Reconstruct the list of managed auxiliary IDs from scratch:
343 for( auxid_t auxid = 0; auxid < m_vecs.size(); ++auxid ) {
344 if( m_vecs[ auxid ] ) {
345 ids.insert( auxid );
346 }
347 }
348 if( m_store ) {
349 ids.insert (m_store->getAuxIDs());
350 }
351 m_auxids = std::move(ids);
352
353 return true;
354 }
auxid_set_t m_auxids
Internal list of all available variables.
std::vector< SG::IAuxTypeVector * > m_vecs
Internal list of all managed variables.
SG::auxid_t auxid_t
The aux ID type definition.
Definition AuxInfoBase.h:49
AthContainers_detail::lock_guard< mutex_t > guard_t
SG::IAuxStore * m_store
Internal dynamic auxiliary store object.
SG::auxid_set_t auxid_set_t
The aux ID set type definition.
Definition AuxInfoBase.h:51
SG::auxid_t auxid() const
Return the aux id for this variable.

◆ getAuxID()

template<typename T>
auxid_t xAOD::AuxInfoBase::getAuxID ( const std::string & name,
T & ,
SG::AuxVarFlags flags = SG::AuxVarFlags::None,
const SG::auxid_t linkedVariable = SG::null_auxid )
inherited

Get the auxiliary ID for one of the persistent variables.

◆ getAuxIDs()

const AuxInfoBase::auxid_set_t & xAOD::AuxInfoBase::getAuxIDs ( ) const
overridevirtualinherited

Get the types(names) of variables handled by this container.

Definition at line 255 of file AuxInfoBase.cxx.

255 {
256
257 // Return the full list of IDs:
258 return getWritableAuxIDs();
259 }
virtual const auxid_set_t & getWritableAuxIDs() const override
Return a set of writable data identifiers.

◆ getCopyIDs()

SG::auxid_set_t xAOD::AuxInfoBase::getCopyIDs ( bool warnUnlocked = false) const
overridevirtualinherited

Get the set of variables that we should deep copy.

Reimplemented in xAOD::EventAuxInfo_v3.

Definition at line 240 of file AuxInfoBase.cxx.

241 {
242 return SG::getCopyIDs (getAuxIDs(), getDecorIDs(), warnUnlocked, {});
243 }
virtual const auxid_set_t & getDecorIDs() const override
Get the types(names) of decorations handled by this container.
virtual const auxid_set_t & getAuxIDs() const override
Get the types(names) of variables handled by this container.
virtual SG::auxid_set_t getCopyIDs(bool warnUnlocked=false) const override
Return the set of variables to copy in a deep copy.

◆ getData() [1/2]

const void * xAOD::AuxInfoBase::getData ( auxid_t auxid) const
overridevirtualinherited

Get a pointer to a given array.

Definition at line 196 of file AuxInfoBase.cxx.

196 {
197
198 const SG::IAuxTypeVector* v = getVector( auxid );
199 if( v ) {
200 return v->toPtr();
201 }
202 return nullptr;
203 }
virtual const SG::IAuxTypeVector * getVector(SG::auxid_t auxid) const override final
Return vector interface for one aux data item.

◆ getData() [2/2]

void * xAOD::AuxInfoBase::getData ( auxid_t auxid,
size_t size,
size_t capacity )
overridevirtualinherited

Get a pointer to a given array, creating the array if necessary.

Implements SG::IAuxStore.

Definition at line 448 of file AuxInfoBase.cxx.

449 {
450
451 // Guard against multi-threaded execution:
452 guard_t guard( m_mutex );
453
454 if( ( auxid >= m_vecs.size() ) || ( ! m_vecs[ auxid ] ) ) {
455
456 if( m_store ) {
457 void* result = m_store->getData( auxid, size, capacity );
458 if( result ) {
459 m_auxids.insert( auxid );
460 const SG::AuxTypeRegistry& r = SG::AuxTypeRegistry::instance();
461 auxid_t linked_id = r.linkedVariable( auxid );
462 if (linked_id != SG::null_auxid) {
463 m_auxids.insert( linked_id );
464 }
465 }
466 return result;
467 } else {
468 std::cout << "ERROR xAOD::AuxInfoBase::getData "
469 << "Unknown variable ("
471 << ") requested" << std::endl;
472 return nullptr;
473 }
474 }
475 m_vecs[ auxid ]->reserve( capacity );
476 if (m_vecs[ auxid ]->size() < size) {
477 m_vecs[ auxid ]->resize( size );
478 }
479
480 return m_vecs[ auxid ]->toPtr();
481 }
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
virtual size_t size() const override
Get the size of the container.
int r
Definition globals.cxx:22
static const auxid_t null_auxid
To signal no aux data item.
Definition AuxTypes.h:30

◆ getDecoration()

void * xAOD::AuxInfoBase::getDecoration ( auxid_t auxid,
size_t size,
size_t capacity )
overridevirtualinherited

Get a pointer to a given array, as a decoration.

Reimplemented in xAOD::EventAuxInfo_v1, xAOD::EventAuxInfo_v2, and xAOD::EventAuxInfo_v3.

Definition at line 271 of file AuxInfoBase.cxx.

272 {
273 {
274 // Guard against multi-threaded execution:
275 guard_t guard( m_mutex );
276
277 // Check if we have it as a static variable:
278 if( ( auxid >= m_vecs.size() ) || ( ! m_vecs[ auxid ] ) ) {
279 // If not, but we have a dynamic store, push it in there:
280 if( m_store ) {
281 void* result = m_store->getDecoration( auxid, size, capacity );
282 if( result ) {
283 m_auxids.insert( auxid );
284 const SG::AuxTypeRegistry& r = SG::AuxTypeRegistry::instance();
285 auxid_t linked_id = r.linkedVariable( auxid );
286 if (linked_id != SG::null_auxid) {
287 m_auxids.insert( linked_id );
288 }
289 }
290 return result;
291 }
292 // If we don't have a dynamic store, complain:
293 else {
294 std::cout << "ERROR xAOD::AuxInfoBase::getDecoration "
295 << "Can't provide variable "
297 << std::endl;
298 return nullptr;
299 }
300 }
301
302 // If the container is locked, static variables can't be accessed this
303 // way:
304 if( m_locked ) {
305 throw SG::ExcStoreLocked( auxid );
306 }
307 }
308
309 // If the container is not locked, then fall back on the normal accessor
310 // function:
311 return getData( auxid, size, capacity );
312 }
bool m_locked
Has the container been locked?
virtual const void * getData(auxid_t auxid) const override
Get a pointer to a given array.

◆ getDecorIDs()

const AuxInfoBase::auxid_set_t & xAOD::AuxInfoBase::getDecorIDs ( ) const
overridevirtualinherited

Get the types(names) of decorations handled by this container.

Definition at line 262 of file AuxInfoBase.cxx.

262 {
263
264 if( m_store ) {
265 return m_store->getDecorIDs();
266 }
267 static const auxid_set_t empty;
268 return empty;
269 }
static const Attributes_t empty

◆ getDynamicAuxIDs()

const AuxInfoBase::auxid_set_t & xAOD::AuxInfoBase::getDynamicAuxIDs ( ) const
overridevirtualinherited

Get the types(names) of variables created dynamically.

Implements SG::IAuxStoreIO.

Definition at line 660 of file AuxInfoBase.cxx.

660 {
661
662 // Guard against multi-threaded execution:
663 guard_t guard( m_mutex );
664
665 // All the variables handled by the internal store are dynamic
666 // if such a store exists:
667 if( m_storeIO ) {
668 // I mean, all the variables. Not just the ones reported as dynamic
669 // by the internal object. Because the internal object may be something
670 // that was put into this one in order to achieve data slimming.
671 return m_store->getAuxIDs();
672 }
673
674 // In case we don't use an internal store, there are no dynamic
675 // variables:
676 static const auxid_set_t dummy (0);
677 return dummy;
678 }
SG::IAuxStoreIO * m_storeIO
The IO interface to the internal auxiliary store.

◆ getIOData()

const void * xAOD::AuxInfoBase::getIOData ( auxid_t auxid) const
overridevirtualinherited

Get a pointer to the data being stored for one aux data item.

Implements SG::IAuxStoreIO.

Definition at line 609 of file AuxInfoBase.cxx.

609 {
610
611 // Guard against multi-threaded execution:
612 guard_t guard( m_mutex );
613
614 if( ( auxid >= m_vecs.size() ) || ( ! m_vecs[ auxid ] ) ) {
615 if( m_storeIO ) {
616 return m_storeIO->getIOData( auxid );
617 } else {
618 std::cout << "ERROR xAOD::AuxInfoBase::getIOData "
619 << "Unknown variable ("
621 << ") requested" << std::endl;
622 return nullptr;
623 }
624 }
625
626 // Update the statistics for this variable. The dynamic store registers
627 // its own variable accesses.
629
630 if( m_vecs[ auxid ]->isLinked() )
631 return m_vecs[ auxid ]->toVector();
632 else
633 return m_vecs[ auxid ]->toPtr();
634 }
std::string m_name
Name of the container in memory. Set externally.
ReadStats & stats()
Access the object belonging to the current thread.
Definition IOStats.cxx:17
static IOStats & instance()
Singleton object accessor.
Definition IOStats.cxx:11
void readBranch(const std::string &prefix, SG::auxid_t auxid)
Function incrementing the read counter on a specific branch.

◆ getIOType()

const std::type_info * xAOD::AuxInfoBase::getIOType ( auxid_t auxid) const
overridevirtualinherited

Return the type of the data to be stored for one aux data item.

Implements SG::IAuxStoreIO.

Definition at line 636 of file AuxInfoBase.cxx.

636 {
637
638 // Guard against multi-threaded execution:
639 guard_t guard( m_mutex );
640
641 if( ( auxid >= m_vecs.size() ) || ( ! m_vecs[ auxid ] ) ) {
642 if( m_storeIO ) {
643 return m_storeIO->getIOType( auxid );
644 } else {
645 std::cout << "ERROR xAOD::AuxInfoBase::getIOType "
646 << "Unknown variable ("
648 << ") requested" << std::endl;
649 return nullptr;
650 }
651 }
652
653 if( m_vecs[ auxid ]->isLinked() )
654 return SG::AuxTypeRegistry::instance().getType( auxid );
655 else
657 }
const std::type_info * getType(SG::auxid_t auxid) const
Return the type of an aux data item.
const std::type_info * getVecType(SG::auxid_t auxid) const
Return the type of the STL vector used to hold an aux data item.

◆ getSelectedAuxIDs()

AuxInfoBase::auxid_set_t xAOD::AuxInfoBase::getSelectedAuxIDs ( ) const
overridevirtualinherited

Get the IDs of the selected dynamic Aux variables (for writing).

Reimplemented from SG::IAuxStoreIO.

Definition at line 681 of file AuxInfoBase.cxx.

681 {
682
683 // Guard against multi-threaded execution:
684 guard_t guard( m_mutex );
685
686 // All the variables handled by the internal store are dynamic
687 // if such a store exists:
688 if( m_storeIO && m_store) {
689 // I mean, all the variables. Not just the ones reported as dynamic
690 // by the internal object. Because the internal object may be something
691 // that was put into this one in order to achieve data slimming.
692 return m_store->getAuxIDs();
693 }
694
695 // In case we don't use an internal store, there are no dynamic
696 // variables:
697 return auxid_set_t();
698 }

◆ getStore() [1/2]

const SG::IAuxStore * xAOD::AuxInfoBase::getStore ( ) const
overridevirtualinherited

Get the currently used internal store object.

Implements SG::IAuxStoreHolder.

Definition at line 147 of file AuxInfoBase.cxx.

148 {
149 return m_store;
150 }

◆ getStore() [2/2]

SG::IAuxStore * xAOD::AuxInfoBase::getStore ( )
overridevirtualinherited

Get the currently used internal store object.

Implements SG::IAuxStoreHolder.

Definition at line 141 of file AuxInfoBase.cxx.

142 {
143 return m_store;
144 }

◆ getStoreType()

virtual AuxStoreType xAOD::AuxInfoBase::getStoreType ( ) const
inlineoverridevirtualinherited

Return the type of the store object.

Implements SG::IAuxStoreHolder.

Definition at line 75 of file AuxInfoBase.h.

75{ return AST_ObjectStore; }

◆ getVector()

const SG::IAuxTypeVector * xAOD::AuxInfoBase::getVector ( SG::auxid_t auxid) const
finaloverridevirtualinherited

Return vector interface for one aux data item.

Definition at line 205 of file AuxInfoBase.cxx.

205 {
206
207 // Guard against multi-threaded execution:
208 guard_t guard( m_mutex );
209
210 if( ( auxid >= m_vecs.size() ) || ( ! m_vecs[ auxid ] ) ) {
211 if( m_store ) {
212 const SG::IAuxTypeVector* result = m_store->getVector( auxid );
213 if( result ) {
214 auxid_set_t& auxids_nc ATLAS_THREAD_SAFE =
215 const_cast<auxid_set_t&> (m_auxids);
216 auxids_nc.insert( auxid );
217 const SG::AuxTypeRegistry& r = SG::AuxTypeRegistry::instance();
218 auxid_t linked_id = r.linkedVariable( auxid );
219 if (linked_id != SG::null_auxid) {
220 auxids_nc.insert( linked_id );
221 }
222 }
223 return result;
224 } else {
225 std::cout << "ERROR xAOD::AuxInfoBase::getData "
226 << "Unknown variable ("
228 << ") requested" << std::endl;
229 return nullptr;
230 }
231 }
232
233 // Update the statistics for this variable. The dynamic store registers
234 // its own variable accesses.
236
237 return m_vecs[ auxid ];
238 }
#define ATLAS_THREAD_SAFE

◆ getWritableAuxIDs()

const AuxInfoBase::auxid_set_t & xAOD::AuxInfoBase::getWritableAuxIDs ( ) const
overridevirtualinherited

Return a set of writable data identifiers.

Implements SG::IAuxStore.

Definition at line 484 of file AuxInfoBase.cxx.

484 {
485
486 // Return the full list of known IDs. The constness of this object's
487 // members comes from the object being const or not.
488 return m_auxids;
489 }

◆ insertMove() [1/2]

virtual bool SG::IAuxStore::insertMove ( size_t pos,
IAuxStore & other,
const SG::auxid_set_t & ignore = SG::auxid_set_t() )
pure virtualinherited

Move all elements from other to this store.

Parameters
posThe starting index of the insertion.
otherStore from which to do the move.
ignoreSet 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.

◆ insertMove() [2/2]

bool xAOD::AuxInfoBase::insertMove ( size_t pos,
IAuxStore & other,
const SG::auxid_set_t & ignore )
overridevirtualinherited

Insert contents of another store via move.

Definition at line 573 of file AuxInfoBase.cxx.

574 {
575
576 // Guard against multi-threaded execution:
577 guard_t guard( m_mutex );
578
579 // Check if the container is locked:
580 if( m_locked ) {
581 throw SG::ExcStoreLocked( "insertMove" );
582 }
583
584 // We are just not allowed to do this...
585 throw std::runtime_error( "Calling insertMove on a non-vector" );
586
587 return false;
588 }

◆ isDecoration()

bool xAOD::AuxInfoBase::isDecoration ( auxid_t auxid) const
overridevirtualinherited

Test if a variable is a decoration.

Reimplemented in xAOD::EventAuxInfo_v1, xAOD::EventAuxInfo_v2, and xAOD::EventAuxInfo_v3.

Definition at line 245 of file AuxInfoBase.cxx.

246 {
247 guard_t guard( m_mutex );
248 if (m_store) {
249 return m_store->isDecoration (auxid);
250 }
251 return false;
252 }

◆ linkedVector() [1/2]

const SG::IAuxTypeVector * xAOD::AuxInfoBase::linkedVector ( SG::auxid_t auxid) const
overridevirtualinherited

Return interface for a linked variable.

Definition at line 365 of file AuxInfoBase.cxx.

366 {
367 const SG::AuxTypeRegistry& r = SG::AuxTypeRegistry::instance();
368 auxid_t linked_id = r.linkedVariable( auxid );
369 if (linked_id != SG::null_auxid) {
370 guard_t guard( m_mutex );
371 if (linked_id < m_vecs.size() && m_vecs[ linked_id ]) {
372 return m_vecs[ linked_id ];
373 }
374 if (m_store) {
375 return CxxUtils::as_const_ptr(m_store)->linkedVector( auxid );
376 }
377 }
378 return nullptr;
379 }
const T * as_const_ptr(const T *p)
Helper for getting a const version of a pointer.

◆ linkedVector() [2/2]

SG::IAuxTypeVector * xAOD::AuxInfoBase::linkedVector ( SG::auxid_t auxid)
overridevirtualinherited

Return interface for a linked variable.

Reimplemented from SG::IAuxStore.

Definition at line 382 of file AuxInfoBase.cxx.

383 {
384 const SG::AuxTypeRegistry& r = SG::AuxTypeRegistry::instance();
385 auxid_t linked_id = r.linkedVariable( auxid );
386 if (linked_id != SG::null_auxid) {
387 guard_t guard( m_mutex );
388 if (linked_id < m_vecs.size() && m_vecs[ linked_id ]) {
389 return m_vecs[ linked_id ];
390 }
391 if (m_store) {
392 return m_store->linkedVector( auxid );
393 }
394 }
395 return nullptr;
396 }

◆ lock()

void xAOD::AuxInfoBase::lock ( )
overridevirtualinherited

Lock the container.

Definition at line 314 of file AuxInfoBase.cxx.

314 {
315
316 // Guard against multi-threaded execution:
317 guard_t guard( m_mutex );
318
319 // Lock the container and the dynamic store:
320 m_locked = true;
321 if( m_store ) {
322 m_store->lock();
323 }
324
325 return;
326 }

◆ lockDecoration()

void xAOD::AuxInfoBase::lockDecoration ( SG::auxid_t auxid)
overridevirtualinherited

Lock a decoration.

Reimplemented in xAOD::EventAuxInfo_v1, xAOD::EventAuxInfo_v2, and xAOD::EventAuxInfo_v3.

Definition at line 357 of file AuxInfoBase.cxx.

358 {
359 guard_t guard (m_mutex);
360 if (m_store) {
361 m_store->lockDecoration (auxid);
362 }
363 }

◆ name()

const char * xAOD::AuxInfoBase::name ( ) const
inherited

Get the name of the container instance.

Definition at line 703 of file AuxInfoBase.cxx.

703 {
704
705 return m_name.c_str();
706 }

◆ regAuxVar()

template<typename T>
void xAOD::AuxInfoBase::regAuxVar ( auxid_t auxid,
const std::string & name,
T & info )
inherited

Register one of the persistent variables internally.

◆ reserve()

void xAOD::AuxInfoBase::reserve ( size_t size)
overridevirtualinherited

Reserve a given size for the arrays.

Implements SG::IAuxStore.

Definition at line 525 of file AuxInfoBase.cxx.

525 {
526
527 // Guard against multi-threaded execution:
528 guard_t guard( m_mutex );
529
530 // Check if the container is locked:
531 if( m_locked ) {
532 throw SG::ExcStoreLocked( "reserve" );
533 }
534
535 // Do a test already here:
536 if( size != 1 ) {
537 throw std::runtime_error( "Calling reserve with != 1 on a "
538 "non-vector" );
539 }
540
541 // Do the operation on the static variables:
542 for (SG::IAuxTypeVector* v : m_vecs) {
543 if(v && !v->isLinked()) {
544 v->reserve( size );
545 }
546 }
547
548 // Do the operation on the dynamic variables:
549 if( m_store ) {
550 m_store->reserve( size );
551 }
552
553 return;
554 }

◆ resize()

bool xAOD::AuxInfoBase::resize ( size_t size)
overridevirtualinherited

Resize the arrays to a given size.

Implements SG::IAuxStore.

Definition at line 491 of file AuxInfoBase.cxx.

491 {
492
493 // Guard against multi-threaded execution:
494 guard_t guard( m_mutex );
495
496 // Check if the container is locked:
497 if( m_locked ) {
498 throw SG::ExcStoreLocked( "resize" );
499 }
500
501 // Do a test already here:
502 if( size != 1 ) {
503 throw std::runtime_error( "Calling resize with != 1 on a "
504 "non-vector" );
505 }
506
507 // Do the operation on the static variables:
508 bool nomoves = true;
509 for (SG::IAuxTypeVector* v : m_vecs) {
510 if(v && !v->isLinked()) {
511 if (!v->resize( size ))
512 nomoves = false;
513 }
514 }
515
516 // Do the operation on the dynamic variables:
517 if( m_store ) {
518 if (!m_store->resize( size ))
519 nomoves = false;
520 }
521
522 return nomoves;
523 }

◆ setName()

void xAOD::AuxInfoBase::setName ( const char * name)
inherited

Set the name of the container instance.

Definition at line 708 of file AuxInfoBase.cxx.

708 {
709
710 m_name = name;
711 return;
712 }
const char * name() const
Get the name of the container instance.

◆ setOption()

bool xAOD::AuxInfoBase::setOption ( auxid_t id,
const SG::AuxDataOption & option )
overridevirtualinherited

Make an option setting on an aux variable.

Reimplemented from SG::IAuxStore.

Definition at line 591 of file AuxInfoBase.cxx.

591 {
592
593 if (id < m_vecs.size() && m_vecs[id] != nullptr)
594 return m_vecs[id]->setOption( option );
595 if (m_store)
596 return m_store->setOption( id, option );
597 return false;
598 }

◆ setStore()

void xAOD::AuxInfoBase::setStore ( SG::IAuxStore * store)
overridevirtualinherited

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.

Parameters
storeThe store that should be used for dynamic variable handling inside the object from now on

Implements SG::IAuxStoreHolder.

Definition at line 161 of file AuxInfoBase.cxx.

161 {
162
163 // Guard against multi-threaded execution:
164 guard_t guard( m_mutex );
165
166 // Check that no funny business is going on:
167 if( m_store == store ) return;
168
169 // Clean up the current store object:
170 if( m_store && m_ownsStore ) {
171 m_auxids -= m_store->getAuxIDs();
172 delete m_store;
173 }
174 m_store = nullptr;
175 m_storeIO = nullptr;
176
177 // Take posession of the new object:
178 m_store = store;
179 m_storeIO = dynamic_cast< SG::IAuxStoreIO* >( m_store );
180 m_ownsStore = true;
181 if( m_store ) {
182 m_auxids.insert (m_store->getAuxIDs());
183 }
184
185 return;
186 }
bool m_ownsStore
Flag deciding if the object owns the dynamic store or not.
TestStore store
Definition TestStore.cxx:23

◆ shift()

void xAOD::AuxInfoBase::shift ( size_t pos,
ptrdiff_t offs )
overridevirtualinherited

Shift the contents of the stored arrays.

Implements SG::IAuxStore.

Definition at line 556 of file AuxInfoBase.cxx.

556 {
557
558 // Guard against multi-threaded execution:
559 guard_t guard( m_mutex );
560
561 // Check if the container is locked:
562 if( m_locked ) {
563 throw SG::ExcStoreLocked( "shift" );
564 }
565
566 // We are just not allowed to do this...
567 throw std::runtime_error( "Calling shift on a non-vector" );
568
569 return;
570 }

◆ size()

size_t xAOD::AuxInfoBase::size ( ) const
overridevirtualinherited

Get the size of the container.

Definition at line 417 of file AuxInfoBase.cxx.

417 {
418
419 // Should really always be 1, but do the general thing anyway...
420
421 // Guard against multi-threaded execution:
422 guard_t guard( m_mutex );
423
424 // Try to find a variable:
425 for (SG::auxid_t i : m_auxids) {
426 if( ( i < m_vecs.size() ) && m_vecs[ i ] && !m_vecs[ i ]->isLinked()) {
427 size_t sz = m_vecs[ i ]->size();
428 if( sz > 0 ) {
429 return sz;
430 }
431 }
432 }
433
434 // If we didn't find any statically defined variables, then we just
435 // need to claim 1. Because pool::AuxStoreAPR at the moment always
436 // returns 0 for the size.
437 return 1;
438 }
static Double_t sz
size_t auxid_t
Identifier for a particular aux data item.
Definition AuxTypes.h:27

◆ toTransient()

void xAOD::AuxInfoBase::toTransient ( const EventContext & ctx)
overridevirtualinherited

Perform processing on aux variable objects just after reading to make them usable as transient objects.

Implements SG::IAuxStore.

Reimplemented in xAOD::EventAuxInfo_v1, xAOD::EventAuxInfo_v2, and xAOD::EventAuxInfo_v3.

Definition at line 399 of file AuxInfoBase.cxx.

400 {
401 // Guard against multi-threaded execution:
402 guard_t guard (m_mutex);
403
404 for (SG::IAuxTypeVector* v : m_vecs) {
405 if(v) {
406 v->toTransient( ctx );
407 }
408 }
409
410 // Do the operation on the dynamic variables:
411 if( m_store ) {
412 m_store->toTransient( ctx );
413 }
414 }

Member Data Documentation

◆ m_auxids

auxid_set_t xAOD::AuxInfoBase::m_auxids
privateinherited

Internal list of all available variables.

Definition at line 201 of file AuxInfoBase.h.

◆ m_locked

bool xAOD::AuxInfoBase::m_locked
privateinherited

Has the container been locked?

Definition at line 212 of file AuxInfoBase.h.

◆ m_mutex

mutex_t xAOD::AuxInfoBase::m_mutex
mutableprivateinherited

Definition at line 217 of file AuxInfoBase.h.

◆ m_name

std::string xAOD::AuxInfoBase::m_name
privateinherited

Name of the container in memory. Set externally.

Definition at line 220 of file AuxInfoBase.h.

◆ m_ownsStore

bool xAOD::AuxInfoBase::m_ownsStore
privateinherited

Flag deciding if the object owns the dynamic store or not.

Definition at line 210 of file AuxInfoBase.h.

◆ m_store

SG::IAuxStore* xAOD::AuxInfoBase::m_store
privateinherited

Internal dynamic auxiliary store object.

Definition at line 206 of file AuxInfoBase.h.

◆ m_storeIO

SG::IAuxStoreIO* xAOD::AuxInfoBase::m_storeIO
privateinherited

The IO interface to the internal auxiliary store.

Definition at line 208 of file AuxInfoBase.h.

◆ m_vecs

std::vector< SG::IAuxTypeVector* > xAOD::AuxInfoBase::m_vecs
privateinherited

Internal list of all managed variables.

Definition at line 203 of file AuxInfoBase.h.

◆ serialized

std::vector< uint32_t > xAOD::TrigNavigationAuxInfo_v1::serialized
private

Definition at line 39 of file TrigNavigationAuxInfo_v1.h.

◆ supportsThinning

bool SG::IAuxStore::supportsThinning = true
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 216 of file IAuxStore.h.


The documentation for this class was generated from the following files: