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

Auxiliary store for xAOD::FileMetaData_v1. More...

#include <FileMetaDataAuxInfo_v1.h>

Inheritance diagram for xAOD::FileMetaDataAuxInfo_v1:
Collaboration diagram for xAOD::FileMetaDataAuxInfo_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

 FileMetaDataAuxInfo_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.
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::string productionRelease
 Release that was used to make the file.
std::string dataType
 Type of the data that's in the file.
std::vector< uint32_trunNumbers
 run numbers in the file that went into making the file
std::vector< uint32_tlumiBlocks
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

Auxiliary store for xAOD::FileMetaData_v1.

This is a fairly generic auxiliary store implementation to be used with xAOD::FileMetaData_v1. Most of the variables in that class are dynamic, so this class is fairly small.

Author
Attila Krasznahorkay Attil.nosp@m.a.Kr.nosp@m.aszna.nosp@m.hork.nosp@m.ay@ce.nosp@m.rn.c.nosp@m.h
Revision
670157
Date
2015-05-27 13:52:51 +0200 (Wed, 27 May 2015)

Definition at line 31 of file FileMetaDataAuxInfo_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 178 of file AuxInfoBase.h.

◆ guard_t

Definition at line 211 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 180 of file AuxInfoBase.h.

◆ mutex_t

Mutex for multithread synchronization.

Definition at line 210 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 66 of file IAuxStoreHolder.h.

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

Constructor & Destructor Documentation

◆ FileMetaDataAuxInfo_v1()

xAOD::FileMetaDataAuxInfo_v1::FileMetaDataAuxInfo_v1 ( )

Default constructor.

Definition at line 12 of file FileMetaDataAuxInfo_v1.cxx.

13 : AuxInfoBase() {
14
15 // Declare the auxiliary variables of the class:
20 }
#define AUX_VARIABLE(VAR,...)
Convenience macro for declaring an auxiliary variable.
Definition AuxVariable.h:23
AuxInfoBase(bool allowDynamicVars=true)
Default constructor.
std::string dataType
Type of the data that's in the file.
std::vector< uint32_t > runNumbers
run numbers in the file that went into making the file
std::vector< uint32_t > lumiBlocks
std::string productionRelease
Release that was used to make the file.

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 430 of file AuxInfoBase.cxx.

431 {
432
433 // Guard against multi-threaded execution:
434 guard_t guard( m_mutex );
435
436 if( ( auxid >= m_vecs.size() ) || ( ! m_vecs[ auxid ] ) ) {
437
438 if( m_store ) {
439 void* result = m_store->getData( auxid, size, capacity );
440 if( result ) {
441 m_auxids.insert( auxid );
442 const SG::AuxTypeRegistry& r = SG::AuxTypeRegistry::instance();
443 auxid_t linked_id = r.linkedVariable( auxid );
444 if (linked_id != SG::null_auxid) {
445 m_auxids.insert( linked_id );
446 }
447 }
448 return result;
449 } else {
450 std::cout << "ERROR xAOD::AuxInfoBase::getData "
451 << "Unknown variable ("
453 << ") requested" << std::endl;
454 return nullptr;
455 }
456 }
457 m_vecs[ auxid ]->reserve( capacity );
458 if (m_vecs[ auxid ]->size() < size) {
459 m_vecs[ auxid ]->resize( size );
460 }
461
462 return m_vecs[ auxid ]->toPtr();
463 }
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 642 of file AuxInfoBase.cxx.

642 {
643
644 // Guard against multi-threaded execution:
645 guard_t guard( m_mutex );
646
647 // All the variables handled by the internal store are dynamic
648 // if such a store exists:
649 if( m_storeIO ) {
650 // I mean, all the variables. Not just the ones reported as dynamic
651 // by the internal object. Because the internal object may be something
652 // that was put into this one in order to achieve data slimming.
653 return m_store->getAuxIDs();
654 }
655
656 // In case we don't use an internal store, there are no dynamic
657 // variables:
658 static const auxid_set_t dummy (0);
659 return dummy;
660 }
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 591 of file AuxInfoBase.cxx.

591 {
592
593 // Guard against multi-threaded execution:
594 guard_t guard( m_mutex );
595
596 if( ( auxid >= m_vecs.size() ) || ( ! m_vecs[ auxid ] ) ) {
597 if( m_storeIO ) {
598 return m_storeIO->getIOData( auxid );
599 } else {
600 std::cout << "ERROR xAOD::AuxInfoBase::getIOData "
601 << "Unknown variable ("
603 << ") requested" << std::endl;
604 return nullptr;
605 }
606 }
607
608 // Update the statistics for this variable. The dynamic store registers
609 // its own variable accesses.
611
612 if( m_vecs[ auxid ]->isLinked() )
613 return m_vecs[ auxid ]->toVector();
614 else
615 return m_vecs[ auxid ]->toPtr();
616 }
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 618 of file AuxInfoBase.cxx.

618 {
619
620 // Guard against multi-threaded execution:
621 guard_t guard( m_mutex );
622
623 if( ( auxid >= m_vecs.size() ) || ( ! m_vecs[ auxid ] ) ) {
624 if( m_storeIO ) {
625 return m_storeIO->getIOType( auxid );
626 } else {
627 std::cout << "ERROR xAOD::AuxInfoBase::getIOType "
628 << "Unknown variable ("
630 << ") requested" << std::endl;
631 return nullptr;
632 }
633 }
634
635 if( m_vecs[ auxid ]->isLinked() )
636 return SG::AuxTypeRegistry::instance().getType( auxid );
637 else
639 }
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 663 of file AuxInfoBase.cxx.

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

◆ 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 466 of file AuxInfoBase.cxx.

466 {
467
468 // Return the full list of known IDs. The constness of this object's
469 // members comes from the object being const or not.
470 return m_auxids;
471 }

◆ 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 555 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( "insertMove" );
564 }
565
566 // We are just not allowed to do this...
567 throw std::runtime_error( "Calling insertMove on a non-vector" );
568
569 return false;
570 }

◆ 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 685 of file AuxInfoBase.cxx.

685 {
686
687 return m_name.c_str();
688 }

◆ 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 507 of file AuxInfoBase.cxx.

507 {
508
509 // Guard against multi-threaded execution:
510 guard_t guard( m_mutex );
511
512 // Check if the container is locked:
513 if( m_locked ) {
514 throw SG::ExcStoreLocked( "reserve" );
515 }
516
517 // Do a test already here:
518 if( size != 1 ) {
519 throw std::runtime_error( "Calling reserve with != 1 on a "
520 "non-vector" );
521 }
522
523 // Do the operation on the static variables:
524 for (SG::IAuxTypeVector* v : m_vecs) {
525 if(v && !v->isLinked()) {
526 v->reserve( size );
527 }
528 }
529
530 // Do the operation on the dynamic variables:
531 if( m_store ) {
532 m_store->reserve( size );
533 }
534
535 return;
536 }

◆ resize()

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

Resize the arrays to a given size.

Implements SG::IAuxStore.

Definition at line 473 of file AuxInfoBase.cxx.

473 {
474
475 // Guard against multi-threaded execution:
476 guard_t guard( m_mutex );
477
478 // Check if the container is locked:
479 if( m_locked ) {
480 throw SG::ExcStoreLocked( "resize" );
481 }
482
483 // Do a test already here:
484 if( size != 1 ) {
485 throw std::runtime_error( "Calling resize with != 1 on a "
486 "non-vector" );
487 }
488
489 // Do the operation on the static variables:
490 bool nomoves = true;
491 for (SG::IAuxTypeVector* v : m_vecs) {
492 if(v && !v->isLinked()) {
493 if (!v->resize( size ))
494 nomoves = false;
495 }
496 }
497
498 // Do the operation on the dynamic variables:
499 if( m_store ) {
500 if (!m_store->resize( size ))
501 nomoves = false;
502 }
503
504 return nomoves;
505 }

◆ setName()

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

Set the name of the container instance.

Definition at line 690 of file AuxInfoBase.cxx.

690 {
691
692 m_name = name;
693 return;
694 }
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 573 of file AuxInfoBase.cxx.

573 {
574
575 if (id < m_vecs.size() && m_vecs[id] != nullptr)
576 return m_vecs[id]->setOption( option );
577 if (m_store)
578 return m_store->setOption( id, option );
579 return false;
580 }

◆ 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 538 of file AuxInfoBase.cxx.

538 {
539
540 // Guard against multi-threaded execution:
541 guard_t guard( m_mutex );
542
543 // Check if the container is locked:
544 if( m_locked ) {
545 throw SG::ExcStoreLocked( "shift" );
546 }
547
548 // We are just not allowed to do this...
549 throw std::runtime_error( "Calling shift on a non-vector" );
550
551 return;
552 }

◆ size()

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

Get the size of the container.

Definition at line 399 of file AuxInfoBase.cxx.

399 {
400
401 // Should really always be 1, but do the general thing anyway...
402
403 // Guard against multi-threaded execution:
404 guard_t guard( m_mutex );
405
406 // Try to find a variable:
407 for (SG::auxid_t i : m_auxids) {
408 if( ( i < m_vecs.size() ) && m_vecs[ i ] && !m_vecs[ i ]->isLinked()) {
409 size_t sz = m_vecs[ i ]->size();
410 if( sz > 0 ) {
411 return sz;
412 }
413 }
414 }
415
416 // If we didn't find any statically defined variables, then we just
417 // need to claim 1. Because pool::AuxStoreAPR at the moment always
418 // returns 0 for the size.
419 return 1;
420 }
static Double_t sz
size_t auxid_t
Identifier for a particular aux data item.
Definition AuxTypes.h:27

Member Data Documentation

◆ dataType

std::string xAOD::FileMetaDataAuxInfo_v1::dataType
private

Type of the data that's in the file.

Definition at line 41 of file FileMetaDataAuxInfo_v1.h.

◆ lumiBlocks

std::vector<uint32_t> xAOD::FileMetaDataAuxInfo_v1::lumiBlocks
private

Definition at line 45 of file FileMetaDataAuxInfo_v1.h.

◆ m_auxids

auxid_set_t xAOD::AuxInfoBase::m_auxids
privateinherited

Internal list of all available variables.

Definition at line 196 of file AuxInfoBase.h.

◆ m_locked

bool xAOD::AuxInfoBase::m_locked
privateinherited

Has the container been locked?

Definition at line 207 of file AuxInfoBase.h.

◆ m_mutex

mutex_t xAOD::AuxInfoBase::m_mutex
mutableprivateinherited

Definition at line 212 of file AuxInfoBase.h.

◆ m_name

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

Name of the container in memory. Set externally.

Definition at line 215 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 205 of file AuxInfoBase.h.

◆ m_store

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

Internal dynamic auxiliary store object.

Definition at line 201 of file AuxInfoBase.h.

◆ m_storeIO

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

The IO interface to the internal auxiliary store.

Definition at line 203 of file AuxInfoBase.h.

◆ m_vecs

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

Internal list of all managed variables.

Definition at line 198 of file AuxInfoBase.h.

◆ productionRelease

std::string xAOD::FileMetaDataAuxInfo_v1::productionRelease
private

Release that was used to make the file.

Definition at line 39 of file FileMetaDataAuxInfo_v1.h.

◆ runNumbers

std::vector<uint32_t> xAOD::FileMetaDataAuxInfo_v1::runNumbers
private

run numbers in the file that went into making the file

Definition at line 43 of file FileMetaDataAuxInfo_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 199 of file IAuxStore.h.


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