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

Auxiliary information about the event. More...

#include <EventAuxInfo_v2.h>

Inheritance diagram for xAOD::EventAuxInfo_v2:
Collaboration diagram for xAOD::EventAuxInfo_v2:

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

 EventAuxInfo_v2 ()
 Default constructor.
virtual void * getDecoration (SG::auxid_t auxid, size_t size, size_t capacity) override
 Return the data vector for one aux data decoration item.
virtual bool isDecoration (auxid_t auxid) const override
 Test if a particular variable is tagged as a decoration.
virtual void lockDecoration (SG::auxid_t auxid) override
 Lock a decoration.
virtual void toTransient (const EventContext &ctx) override
 Called after one of these objects is read.
void toTransient ()
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 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 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.

Public Attributes

CxxUtils::ConcurrentBitset m_decorFlags
 Keep track of the event status flags.
Basic event information
uint32_t runNumber
uint64_t eventNumber
uint32_t lumiBlock
uint32_t timeStamp
uint32_t timeStampNSOffset
uint32_t bcid
uint32_t detectorMask0
uint32_t detectorMask1
uint32_t detectorMask2
uint32_t detectorMask3
Event type information
std::vector< std::pair< std::string, std::string > > detDescrTags
uint32_t eventTypeBitmask
Trigger related information
uint32_t statusElement
uint32_t extendedLevel1ID
uint16_t level1TriggerType
std::vector< std::string > streamTagNames
std::vector< std::string > streamTagTypes
std::vector< charstreamTagObeysLumiblock
Detector flags
uint32_t pixelFlags
uint32_t sctFlags
uint32_t trtFlags
uint32_t larFlags
uint32_t tileFlags
uint32_t muonFlags
uint32_t forwardDetFlags
uint32_t coreFlags
uint32_t backgroundFlags
uint32_t lumiFlags
Beam spot information
float beamPosX
float beamPosY
float beamPosZ
float beamPosSigmaX
float beamPosSigmaY
float beamPosSigmaZ
float beamPosSigmaXY
float beamTiltXZ
float beamTiltYZ
uint32_t beamStatus

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

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 information about the event.

This object describes the "static" auxiliary information about an event.

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

Definition at line 28 of file EventAuxInfo_v2.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

◆ EventAuxInfo_v2()

xAOD::EventAuxInfo_v2::EventAuxInfo_v2 ( )

Default constructor.

Definition at line 10 of file EventAuxInfo_v2.cxx.

11 : AuxInfoBase(),
12 runNumber(0),
13 eventNumber(0),
14 lumiBlock(0),
15 timeStamp(0),
17 bcid(0),
26 pixelFlags(0),
27 sctFlags(0),
28 trtFlags(0),
29 larFlags(0),
30 tileFlags(0),
31 muonFlags(0),
33 coreFlags(0),
35 lumiFlags(0),
36 beamPosX(0),
37 beamPosY(0),
38 beamPosZ(0),
43 beamTiltXZ(0),
44 beamTiltYZ(0),
45 beamStatus(0),
47 {
48
49 // Basic event information:
60
61 // Event type information:
64
65 // Trigger related information:
72
73 // Beam spot information:
84
85 // Detector flags:
86#define DET_FLAG(VAR) \
87 AUX_VARIABLE( VAR, SG::AuxTypeRegistry::Flags::Atomic ); \
88 do { \
89 static const auxid_t auxid = \
90 getAuxID( #VAR, VAR, \
91 SG::AuxTypeRegistry::Flags::Atomic ); \
92 m_decorFlags.insert( auxid ); \
93 } while( false )
94
105#undef DET_FLAG
106 }
#define AUX_VARIABLE(VAR,...)
Convenience macro for declaring an auxiliary variable.
Definition AuxVariable.h:23
#define DET_FLAG(VAR)
AuxInfoBase(bool allowDynamicVars=true)
Default constructor.
std::vector< std::string > streamTagTypes
std::vector< char > streamTagObeysLumiblock
std::vector< std::pair< std::string, std::string > > detDescrTags
CxxUtils::ConcurrentBitset m_decorFlags
Keep track of the event status flags.
std::vector< std::string > streamTagNames
static const auxid_t auxid_set_size_hint
A hint for how large we should make the auxid bitsets.
Definition AuxTypes.h:40

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::EventAuxInfo_v2::getDecoration ( SG::auxid_t auxid,
size_t size,
size_t capacity )
overridevirtual

Return the data vector for one aux data decoration item.

Parameters
auxidThe identifier of the desired aux data item.
sizeThe current size of the container (in case the data item does not already exist).
capacityThe current capacity of the container (in case the data item does not already exist).

Reimplemented from xAOD::AuxInfoBase.

Definition at line 117 of file EventAuxInfo_v2.cxx.

120 {
121 if (m_decorFlags.test (auxid)) {
122 return AuxInfoBase::getData (auxid, size, capacity);
123 }
124
125 return AuxInfoBase::getDecoration (auxid, size, capacity);
126 }
virtual const void * getData(auxid_t auxid) const override
Get a pointer to a given array.
virtual void * getDecoration(auxid_t auxid, size_t size, size_t capacity) override
Get a pointer to a given array, as a decoration.

◆ 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 }
bool m_locked
Has the container been locked?

◆ isDecoration()

bool xAOD::EventAuxInfo_v2::isDecoration ( SG::auxid_t auxid) const
overridevirtual

Test if a particular variable is tagged as a decoration.

Parameters
auxidThe identifier of the desired aux data item.

Reimplemented from xAOD::AuxInfoBase.

Definition at line 133 of file EventAuxInfo_v2.cxx.

134 {
135 if (m_decorFlags.test (auxid)) {
136 return true;
137 }
138
139 return AuxInfoBase::isDecoration (auxid);
140 }
virtual bool isDecoration(auxid_t auxid) const override
Test if a variable is a decoration.

◆ 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::EventAuxInfo_v2::lockDecoration ( SG::auxid_t auxid)
overridevirtual

Lock a decoration.

Parameters
auxidIdentifier of the decoration to lock.

Reimplemented from xAOD::AuxInfoBase.

Definition at line 147 of file EventAuxInfo_v2.cxx.

148 {
149 if (m_decorFlags.test (auxid)) {
150 m_decorFlags.reset (auxid);
151 return;
152 }
153
155 }
virtual void lockDecoration(SG::auxid_t auxid) override
Lock a decoration.

◆ 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() [1/2]

void xAOD::EventAuxInfo_v2::toTransient ( )

List of all detector flag aux IDs.

Definition at line 171 of file EventAuxInfo_v2.cxx.

172 {
174 static const std::vector<SG::auxid_t> flagIds (m_decorFlags.begin(),
175 m_decorFlags.end());
176
177 // Check each detector flag. If it has been set to something,
178 // then lock this flag.
179 // This check may be too strict; we'll have to see.
180 for (SG::auxid_t id : flagIds) {
181 if (*reinterpret_cast<const uint32_t*>(getData (id)) != 0) {
182 m_decorFlags.reset (id);
183 }
184 }
185 }
virtual void * getData(auxid_t auxid, size_t size, size_t capacity)=0
Return the data vector for one aux data item.
setEventNumber uint32_t

◆ toTransient() [2/2]

void xAOD::EventAuxInfo_v2::toTransient ( const EventContext & ctx)
overridevirtual

Called after one of these objects is read.

Parameters
ctxCurrent event context. Make contained variables usable after reading. Also locks any detector flag words that appear to have already been set.

Reimplemented from xAOD::AuxInfoBase.

Definition at line 165 of file EventAuxInfo_v2.cxx.

166 {
168 toTransient( );
169 }
virtual void toTransient(const EventContext &ctx) override
Perform processing on aux variable objects just after reading to make them usable as transient object...

Member Data Documentation

◆ backgroundFlags

uint32_t xAOD::EventAuxInfo_v2::backgroundFlags

Definition at line 113 of file EventAuxInfo_v2.h.

◆ bcid

uint32_t xAOD::EventAuxInfo_v2::bcid

Definition at line 80 of file EventAuxInfo_v2.h.

◆ beamPosSigmaX

float xAOD::EventAuxInfo_v2::beamPosSigmaX

Definition at line 122 of file EventAuxInfo_v2.h.

◆ beamPosSigmaXY

float xAOD::EventAuxInfo_v2::beamPosSigmaXY

Definition at line 125 of file EventAuxInfo_v2.h.

◆ beamPosSigmaY

float xAOD::EventAuxInfo_v2::beamPosSigmaY

Definition at line 123 of file EventAuxInfo_v2.h.

◆ beamPosSigmaZ

float xAOD::EventAuxInfo_v2::beamPosSigmaZ

Definition at line 124 of file EventAuxInfo_v2.h.

◆ beamPosX

float xAOD::EventAuxInfo_v2::beamPosX

Definition at line 119 of file EventAuxInfo_v2.h.

◆ beamPosY

float xAOD::EventAuxInfo_v2::beamPosY

Definition at line 120 of file EventAuxInfo_v2.h.

◆ beamPosZ

float xAOD::EventAuxInfo_v2::beamPosZ

Definition at line 121 of file EventAuxInfo_v2.h.

◆ beamStatus

uint32_t xAOD::EventAuxInfo_v2::beamStatus

Definition at line 128 of file EventAuxInfo_v2.h.

◆ beamTiltXZ

float xAOD::EventAuxInfo_v2::beamTiltXZ

Definition at line 126 of file EventAuxInfo_v2.h.

◆ beamTiltYZ

float xAOD::EventAuxInfo_v2::beamTiltYZ

Definition at line 127 of file EventAuxInfo_v2.h.

◆ coreFlags

uint32_t xAOD::EventAuxInfo_v2::coreFlags

Definition at line 112 of file EventAuxInfo_v2.h.

◆ detDescrTags

std::vector< std::pair< std::string, std::string > > xAOD::EventAuxInfo_v2::detDescrTags

Definition at line 89 of file EventAuxInfo_v2.h.

◆ detectorMask0

uint32_t xAOD::EventAuxInfo_v2::detectorMask0

Definition at line 81 of file EventAuxInfo_v2.h.

◆ detectorMask1

uint32_t xAOD::EventAuxInfo_v2::detectorMask1

Definition at line 82 of file EventAuxInfo_v2.h.

◆ detectorMask2

uint32_t xAOD::EventAuxInfo_v2::detectorMask2

Definition at line 83 of file EventAuxInfo_v2.h.

◆ detectorMask3

uint32_t xAOD::EventAuxInfo_v2::detectorMask3

Definition at line 84 of file EventAuxInfo_v2.h.

◆ eventNumber

uint64_t xAOD::EventAuxInfo_v2::eventNumber

Definition at line 76 of file EventAuxInfo_v2.h.

◆ eventTypeBitmask

uint32_t xAOD::EventAuxInfo_v2::eventTypeBitmask

Definition at line 90 of file EventAuxInfo_v2.h.

◆ extendedLevel1ID

uint32_t xAOD::EventAuxInfo_v2::extendedLevel1ID

Definition at line 96 of file EventAuxInfo_v2.h.

◆ forwardDetFlags

uint32_t xAOD::EventAuxInfo_v2::forwardDetFlags

Definition at line 111 of file EventAuxInfo_v2.h.

◆ larFlags

uint32_t xAOD::EventAuxInfo_v2::larFlags

Definition at line 108 of file EventAuxInfo_v2.h.

◆ level1TriggerType

uint16_t xAOD::EventAuxInfo_v2::level1TriggerType

Definition at line 97 of file EventAuxInfo_v2.h.

◆ lumiBlock

uint32_t xAOD::EventAuxInfo_v2::lumiBlock

Definition at line 77 of file EventAuxInfo_v2.h.

◆ lumiFlags

uint32_t xAOD::EventAuxInfo_v2::lumiFlags

Definition at line 114 of file EventAuxInfo_v2.h.

◆ 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_decorFlags

CxxUtils::ConcurrentBitset xAOD::EventAuxInfo_v2::m_decorFlags

Keep track of the event status flags.

The set bits here correspond to the auxids of all unlocked detector flag words. This is not persistent, but is filled in the constructor and toTransient.

Definition at line 136 of file EventAuxInfo_v2.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.

◆ muonFlags

uint32_t xAOD::EventAuxInfo_v2::muonFlags

Definition at line 110 of file EventAuxInfo_v2.h.

◆ pixelFlags

uint32_t xAOD::EventAuxInfo_v2::pixelFlags

Definition at line 105 of file EventAuxInfo_v2.h.

◆ runNumber

uint32_t xAOD::EventAuxInfo_v2::runNumber

Definition at line 75 of file EventAuxInfo_v2.h.

◆ sctFlags

uint32_t xAOD::EventAuxInfo_v2::sctFlags

Definition at line 106 of file EventAuxInfo_v2.h.

◆ statusElement

uint32_t xAOD::EventAuxInfo_v2::statusElement

Definition at line 95 of file EventAuxInfo_v2.h.

◆ streamTagNames

std::vector< std::string > xAOD::EventAuxInfo_v2::streamTagNames

Definition at line 98 of file EventAuxInfo_v2.h.

◆ streamTagObeysLumiblock

std::vector< char > xAOD::EventAuxInfo_v2::streamTagObeysLumiblock

Definition at line 100 of file EventAuxInfo_v2.h.

◆ streamTagTypes

std::vector< std::string > xAOD::EventAuxInfo_v2::streamTagTypes

Definition at line 99 of file EventAuxInfo_v2.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.

◆ tileFlags

uint32_t xAOD::EventAuxInfo_v2::tileFlags

Definition at line 109 of file EventAuxInfo_v2.h.

◆ timeStamp

uint32_t xAOD::EventAuxInfo_v2::timeStamp

Definition at line 78 of file EventAuxInfo_v2.h.

◆ timeStampNSOffset

uint32_t xAOD::EventAuxInfo_v2::timeStampNSOffset

Definition at line 79 of file EventAuxInfo_v2.h.

◆ trtFlags

uint32_t xAOD::EventAuxInfo_v2::trtFlags

Definition at line 107 of file EventAuxInfo_v2.h.


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