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

Temporary container used until we have I/O for AuxStoreInternal. More...

#include <JetTrigAuxContainer_v1.h>

Inheritance diagram for xAOD::JetTrigAuxContainer_v1:
Collaboration diagram for xAOD::JetTrigAuxContainer_v1:

Public Types

typedef SG::auxid_t auxid_t
 The aux ID type definition from IConstAuxStore.
typedef SG::auxid_set_t auxid_set_t
 The aux ID set type definition from IConstAuxStore.
template<class T, class ALLOC = std::allocator<T>>
using AuxVariable_t = std::vector<T, ALLOC>
 Declare how to wrap variables for this sort of base.

Public Member Functions

 JetTrigAuxContainer_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.
void reset ()
 Function resetting the internal (cached) state of the object.
template<typename T>
auxid_t getAuxID (const std::string &name, std::vector< T > &, SG::AuxVarFlags flags=SG::AuxVarFlags::None)
 Get the auxiliary ID for one of the persistent variables.
template<typename T>
void regAuxVar (auxid_t auxid, const std::string &name, std::vector< T > &vec)
 Register one of the user defined persistent variables internally.
virtual bool setOption (auxid_t, const AuxDataOption &)
 Set an option for a given auxiliary variable.
virtual IAuxTypeVector * linkedVector (SG::auxid_t)
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 (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 void * getDecoration (auxid_t auxid, size_t size, size_t capacity) override
 Get a pointer to a given array, as a decoration.
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 lock () override
 Lock the container.
virtual bool clearDecorations () override
 Clear all decorations.
virtual void lockDecoration (SG::auxid_t auxid) override
 Lock a decoration.
virtual size_t size () const override
 Get the size of the container.
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 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.
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 std::vector< std::vector< ElementLink< IParticleContainer > > > ConstituentLinks_t
 Type used for the constituent links:

Private Member Functions

size_t size_noLock () const
 Internal method: return size without taking out the lock.
template<typename T>
SG::IAuxTypeVectorgetVector1 (auxid_t auxid, std::map< std::string, std::vector< T > > &pers, size_t size, size_t capacity, bool quiet, bool forDecor) const
 Function retrieving a simple dynamic variable.
SG::IAuxTypeVectorgetVector1 (auxid_t auxid, size_t size, size_t capacity, bool quiet, bool forDecor) const

Private Attributes

std::vector< floatpt
std::vector< floateta
std::vector< floatphi
std::vector< floatm
ConstituentLinks_t constituentLinks
std::vector< std::vector< float > > constituentWeights
std::string m_name
 Name of the container in memory. Set externally.
Variables persisified into the ByteStream
std::map< std::string, std::vector< int > > m_int ATLAS_THREAD_SAFE
 Variable holding integer auxiliary variables.
std::map< std::string, std::vector< float > > m_float ATLAS_THREAD_SAFE
 Variable holding float auxiliary variables.
std::map< std::string, std::vector< std::vector< int > > > m_vecInt ATLAS_THREAD_SAFE
 Variable holding vector of integer auxiliary variables.
std::map< std::string, std::vector< std::vector< float > > > m_vecFloat ATLAS_THREAD_SAFE
 Variable holding vector of float auxiliary variables.

Transient variables used to implement the IAuxStore interface

typedef AthContainers_detail::mutex mutex_t
 Mutex for multithread synchronization.
typedef AthContainers_detail::lock_guard< mutex_tguard_t
auxid_set_t m_auxids ATLAS_THREAD_SAFE
 Internal list of auxiliary variables.
std::vector< SG::IAuxTypeVector * > m_dynamicVecs ATLAS_THREAD_SAFE
 Internal list of dynamic managed variables.
std::vector< SG::IAuxTypeVector * > m_staticVecs
 Internal list of static managed variables.
bool m_locked
 Has the container been locked?
SG::auxid_set_t m_decorations
 Record which variables are decorations.
mutex_t m_mutex

Detailed Description

Temporary container used until we have I/O for AuxStoreInternal.

This class is meant to serve as a temporary way to provide an auxiliary store with Athena I/O capabilities for the jet EDM. Will be exchanged for a generic auxiliary container type (AuxStoreInternal) later on.

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
576027
Date
2013-12-17 22:15:51 +0100 (Tue, 17 Dec 2013)

Definition at line 36 of file JetTrigAuxContainer_v1.h.

Member Typedef Documentation

◆ auxid_set_t

The aux ID set type definition from IConstAuxStore.

Definition at line 46 of file ByteStreamAuxContainer_v1.h.

◆ auxid_t

The aux ID type definition from IConstAuxStore.

Definition at line 44 of file ByteStreamAuxContainer_v1.h.

◆ AuxVariable_t

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

Declare how to wrap variables for this sort of base.

Definition at line 135 of file ByteStreamAuxContainer_v1.h.

◆ ConstituentLinks_t

typedef std::vector< std::vector< ElementLink< IParticleContainer > > > xAOD::JetTrigAuxContainer_v1::ConstituentLinks_t
private

Type used for the constituent links:

Definition at line 45 of file JetTrigAuxContainer_v1.h.

◆ guard_t

◆ mutex_t

Mutex for multithread synchronization.

Definition at line 193 of file ByteStreamAuxContainer_v1.h.

Constructor & Destructor Documentation

◆ JetTrigAuxContainer_v1()

xAOD::JetTrigAuxContainer_v1::JetTrigAuxContainer_v1 ( )

Default constructor.

Definition at line 10 of file JetTrigAuxContainer_v1.cxx.

12
15
19 AUX_VARIABLE( m );
20 }
#define AUX_VARIABLE(VAR,...)
Convenience macro for declaring an auxiliary variable.
Definition AuxVariable.h:23
std::vector< std::vector< float > > constituentWeights

Member Function Documentation

◆ clearDecorations()

bool xAOD::ByteStreamAuxContainer_v1::clearDecorations ( )
overridevirtualinherited

Clear all decorations.

Definition at line 204 of file ByteStreamAuxContainer_v1.cxx.

205 {
206 guard_t guard (m_mutex);
207
208 const SG::AuxTypeRegistry& r = SG::AuxTypeRegistry::instance();
209
210 bool anycleared = false;
211 for (auxid_t auxid : m_decorations) {
212 if (m_dynamicVecs[auxid]) {
213 delete m_dynamicVecs[auxid];
214 m_dynamicVecs[auxid] = nullptr;
215 m_auxids.erase( auxid );
216 anycleared = true;
217
218 const std::string name = r.getName( auxid );
219 const std::type_info* ti = r.getType( auxid );
220 if (ti == &typeid(int))
221 m_int.erase (name);
222 else if (ti == &typeid(float))
223 m_float.erase (name);
224 else if (ti == &typeid(std::vector<int>))
225 m_vecInt.erase (name);
226 else if (ti == &typeid(std::vector<float>))
227 m_vecFloat.erase (name);
228 }
229 }
230 m_decorations.clear();
231
232 return anycleared;
233 }
static AuxTypeRegistry & instance()
Return the singleton registry instance.
SG::auxid_set_t m_decorations
Record which variables are decorations.
const char * name() const
Get the name of the container instance.
SG::auxid_t auxid_t
The aux ID type definition from IConstAuxStore.
AthContainers_detail::lock_guard< mutex_t > guard_t
int r
Definition globals.cxx:22
SG::auxid_t auxid() const
Return the aux id for this variable.
SG::auxid_set_t m_auxids
Set of auxid's for which we've created a vector.

◆ getAuxID()

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

Get the auxiliary ID for one of the persistent variables.

◆ getAuxIDs()

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

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

Definition at line 122 of file ByteStreamAuxContainer_v1.cxx.

122 {
123
124 // Return the full list of IDs:
125 return getWritableAuxIDs();
126 }
virtual const auxid_set_t & getWritableAuxIDs() const override
Return a set of writable data identifiers.

◆ getCopyIDs()

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

Get the set of variables that we should deep copy.

Definition at line 185 of file ByteStreamAuxContainer_v1.cxx.

186 {
187 return SG::getCopyIDs (getAuxIDs(), getDecorIDs(), warnUnlocked, {});
188 }
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::ByteStreamAuxContainer_v1::getData ( auxid_t auxid) const
overridevirtualinherited

Get a pointer to a given array.

Definition at line 90 of file ByteStreamAuxContainer_v1.cxx.

90 {
91
92 const SG::IAuxTypeVector* v = getVector( auxid );
93 if( v ) {
94 return v->toPtr();
95 }
96 return nullptr;
97 }
virtual const SG::IAuxTypeVector * getVector(auxid_t auxid) const override final
Return vector interface for one aux data item.

◆ getData() [2/2]

void * xAOD::ByteStreamAuxContainer_v1::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 269 of file ByteStreamAuxContainer_v1.cxx.

270 {
271
272 guard_t guard (m_mutex);
273
274 // Check if we have such a static variable:
275 if( ( auxid < m_staticVecs.size() ) && ( m_staticVecs[ auxid ] ) ) {
276 // Set it to the right size:
277 m_staticVecs[ auxid ]->reserve( capacity );
278 m_staticVecs[ auxid ]->resize( size );
279 // We're done already:
280 return m_staticVecs[ auxid ]->toPtr();
281 }
282 // Check if we already know about this dynamic variable:
283 else if( ( auxid < m_dynamicVecs.size() ) &&
284 ( m_dynamicVecs[ auxid ] ) ) {
285 // Set it to the right size:
286 m_dynamicVecs[ auxid ]->reserve( capacity );
287 m_dynamicVecs[ auxid ]->resize( size );
288 // We're done already:
289 return m_dynamicVecs[ auxid ]->toPtr();
290 }
291
292 SG::IAuxTypeVector* v = getVector1 (auxid, size, capacity, false, false);
293 if( v ) {
294 return v->toPtr();
295 }
296 return nullptr;
297 }
virtual size_t size() const override
Get the size of the container.
std::vector< SG::IAuxTypeVector * > m_staticVecs
Internal list of static managed variables.
SG::IAuxTypeVector * getVector1(auxid_t auxid, std::map< std::string, std::vector< T > > &pers, size_t size, size_t capacity, bool quiet, bool forDecor) const
Function retrieving a simple dynamic variable.

◆ getDecoration()

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

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

Definition at line 136 of file ByteStreamAuxContainer_v1.cxx.

139 {
140 guard_t guard (m_mutex);
141
142 // Does this variable already exist?
143 void* ret = nullptr;
144 if( ( auxid < m_staticVecs.size() ) && ( m_staticVecs[ auxid ] ) ) {
145 ret = m_staticVecs[ auxid ]->toPtr();
146 }
147 // If it's a dynamic one:
148 else if( ( auxid < m_dynamicVecs.size() ) &&
149 ( m_dynamicVecs[ auxid ] ) ) {
150 ret = m_dynamicVecs[ auxid ]->toPtr();
151 }
152
153 if (!ret) {
154 SG::IAuxTypeVector* v = getVector1 (auxid, 0, 0, true, true);
155 if( v ) {
156 ret = v->toPtr();
157 }
158 }
159
160 if (ret) {
161 // Raise exception if locked and not a decoration.
162 if (m_locked) {
163 if ( ! m_decorations.test (auxid) ) {
164 throw SG::ExcStoreLocked (auxid);
165 }
166 }
167 return ret;
168 }
169
170 // Make a new variable.
171 // If locked, mark as a decoration.
172 if (m_locked) {
173 m_decorations.insert (auxid);
174 std::atomic_thread_fence (std::memory_order_seq_cst);
175 }
176 SG::IAuxTypeVector* v = getVector1 (auxid, size, capacity, false, true);
177 if( v ) {
178 ret = v->toPtr();
179 }
180
181 return ret;
182 }
bool m_locked
Has the container been locked?

◆ getDecorIDs()

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

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

Definition at line 129 of file ByteStreamAuxContainer_v1.cxx.

129 {
130
131 // Return the full list of IDs:
132 return m_decorations;
133 }

◆ getVector()

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

Return vector interface for one aux data item.

Definition at line 99 of file ByteStreamAuxContainer_v1.cxx.

99 {
100
101 guard_t guard (m_mutex);
102
103 // If it's a static auxiliary property:
104 if( ( auxid < m_staticVecs.size() ) && ( m_staticVecs[ auxid ] ) ) {
105 // We're done already:
106 return m_staticVecs[ auxid ];
107 }
108 // If it's a dynamic one:
109 else if( ( auxid < m_dynamicVecs.size() ) &&
110 ( m_dynamicVecs[ auxid ] ) ) {
111 // We're done already:
112 return m_dynamicVecs[ auxid ];
113 }
114
115 // Try to retrieve the dynamic variable:
116 // quiet on because this method may be called from isAccessible
117 // and that shouldn't generate any output.
118 return getVector1 (auxid, 0, 0, true, false);
119 }

◆ getVector1() [1/2]

SG::IAuxTypeVector * xAOD::ByteStreamAuxContainer_v1::getVector1 ( auxid_t auxid,
size_t size,
size_t capacity,
bool quiet,
bool forDecor ) const
privateinherited

Definition at line 546 of file ByteStreamAuxContainer_v1.cxx.

549 {
550
551 // Private method --- should hold lock before calling this.
552
553 if( *( SG::AuxTypeRegistry::instance().getType( auxid ) ) ==
554 typeid( int ) ) {
555
556 return getVector1( auxid, m_int, size, capacity, quiet, forDecor );
557 }
558 else if( *( SG::AuxTypeRegistry::instance().getType( auxid ) ) ==
559 typeid( float ) ) {
560
561 return getVector1( auxid, m_float, size, capacity, quiet, forDecor );
562 }
563 else if( *( SG::AuxTypeRegistry::instance().getType( auxid ) ) ==
564 typeid( std::vector< int > ) ) {
565
566 return getVector1( auxid, m_vecInt, size, capacity, quiet, forDecor );
567 }
568 else if( *( SG::AuxTypeRegistry::instance().getType( auxid ) ) ==
569 typeid( std::vector< float > ) ) {
570
571 return getVector1( auxid, m_vecFloat, size, capacity, quiet, forDecor );
572 }
573
574 // The object can't handle this variable type...
575 std::cerr << "ERROR xAOD::ByteStreamAuxContainer_v1::getData "
576 << "Unknown variable type ("
577 << SG::AuxTypeRegistry::instance().getType( auxid )->name()
578 << ") requested" << std::endl;
579
580 return nullptr;
581 }
const std::type_info * getType(SG::auxid_t auxid) const
Return the type of an aux data item.
T getType(const char *cStr)
Return Ringer enumeration of type T identifying string type:

◆ getVector1() [2/2]

template<typename T>
SG::IAuxTypeVector * xAOD::ByteStreamAuxContainer_v1::getVector1 ( auxid_t auxid,
std::map< std::string, std::vector< T > > & pers,
size_t size,
size_t capacity,
bool quiet,
bool forDecor ) const
privateinherited

Function retrieving a simple dynamic variable.

Look for variable auxid in pers.

If capacity > 0, a new variable will be created if necessary.

If not found, create it if capacity != 0.

Definition at line 474 of file ByteStreamAuxContainer_v1.cxx.

479 {
480
481 // Private method --- should hold lock before calling this.
482
483 // Look up the name of the variable:
484 const SG::AuxTypeRegistry& r = SG::AuxTypeRegistry::instance();
485 const std::string name = r.getName( auxid );
486
487 // Try to find the variable:
488 typename std::map< std::string, std::vector< T > >::iterator itr =
489 pers.find( name );
490 if( itr == pers.end() ) {
491 // Variable isn't there. Fail if capacity==0.
492 if (capacity == 0) {
493 if (!quiet) {
494 std::cerr << "ERROR xAOD::ByteStreamAuxContainer_v1::getData (const) "
495 << "Variable with unknown name (" << name << ") requested"
496 << std::endl;
497 }
498 return nullptr;
499 }
500
501 if (m_locked && !forDecor)
502 throw SG::ExcStoreLocked ("getData");
503
504 if (r.isLinked(auxid)) {
505 std::cerr << "ERROR xAOD::ByteStreamAuxContainer_v1 doesn't implement linked variables"
506 << std::endl;
507 return nullptr;
508 }
509
510 // Create the variable.
511 itr = pers.insert (std::make_pair (name, std::vector<T>())).first;
512 }
513
514 // Get hold of the variable.
515 std::vector< T >& var = itr->second;
516
517 // Make sure that the internal vector is big enough:
518 if( m_dynamicVecs.size() <= auxid ) {
519 m_dynamicVecs.resize( auxid + 1 );
520 }
521
522 // Just an internal check...
523 if( m_dynamicVecs[ auxid ] ) {
524 std::cerr << "ERROR xAOD::ByteStreamAuxContainer_v1::getData "
525 << "Internal inconsistency detected!" << std::endl;
526 return m_dynamicVecs[ auxid ];
527 }
528
529 // Register the variable:
530 m_dynamicVecs[ auxid ] = new AuxPersVector< T >( auxid, var, false, nullptr );
531
532 if (capacity > 0) {
533 // Set it to the right size:
534 m_dynamicVecs[ auxid ]->reserve( capacity );
535 m_dynamicVecs[ auxid ]->resize( size );
536 }
537
538 // Remember that we are now handling this variable:
539 m_auxids.insert( auxid );
540
541 // Return the pointer to the array:
542 return m_dynamicVecs[ auxid ];
543 }
JetConstituentVector::iterator iterator

◆ getWritableAuxIDs()

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

Return a set of writable data identifiers.

Implements SG::IAuxStore.

Definition at line 300 of file ByteStreamAuxContainer_v1.cxx.

300 {
301
302 return m_auxids;
303 }

◆ 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::ByteStreamAuxContainer_v1::insertMove ( size_t pos,
IAuxStore & other,
const SG::auxid_set_t & ignore )
overridevirtualinherited

Insert contents of another store via move.

Definition at line 372 of file ByteStreamAuxContainer_v1.cxx.

374 {
375
376 guard_t guard( m_mutex );
377
378 // This operation is not allowed on a locked container:
379 if( m_locked ) {
380 throw SG::ExcStoreLocked( "insertMove" );
381 }
382
383 bool nomove = true;
384 size_t other_size = other.size();
385
386 SG::auxid_set_t ignore = ignore_in;
387
388 // Do the operation on the static variables:
389 for (SG::auxid_t id : m_auxids) {
390 SG::IAuxTypeVector* v_dst = nullptr;
391 if (id < m_dynamicVecs.size())
392 v_dst = m_dynamicVecs[id];
393 if (!v_dst && id < m_staticVecs.size())
394 v_dst = m_staticVecs[id];
395 if (v_dst) {
396 ignore.insert (id);
397 if (other.getData (id)) {
398 void* src_ptr = other.getData (id, other_size, other_size);
399 if (src_ptr) {
400 if (!v_dst->insertMove (pos, src_ptr, 0, other_size,
401 other))
402 nomove = false;
403 }
404 }
405 else {
406 const void* orig = v_dst->toPtr();
407 v_dst->shift (pos, other_size);
408 if (orig != v_dst->toPtr())
409 nomove = false;
410 }
411 }
412 }
413
414 // Add any new variables not present in the original container.
415 for (SG::auxid_t id : other.getAuxIDs()) {
416 if (!m_auxids.test(id) &&
417 !ignore.test(id))
418 {
419 if (other.getData (id)) {
420 void* src_ptr = other.getData (id, other_size, other_size);
421 if (src_ptr) {
422 size_t sz = size_noLock();
423 getVector1 (id, sz, sz, true, false);
424 m_dynamicVecs[id]->resize (sz - other_size);
425 (void)m_dynamicVecs[id]->insertMove (pos, src_ptr, 0, other_size,
426 other);
427 nomove = false;
428 }
429 }
430 }
431 }
432
433 return nomove;
434 }
static Double_t sz
virtual void * toPtr()=0
Return a pointer to the start of the vector's data.
virtual bool insertMove(size_t pos, void *src, size_t src_pos, size_t src_n, IAuxStore &srcStore)=0
Insert elements into the vector via move semantics.
virtual bool shift(size_t pos, ptrdiff_t offs)=0
Shift the elements of the vector.
size_t size_noLock() const
Internal method: return size without taking out the lock.
virtual bool insertMove(size_t pos, IAuxStore &other, const SG::auxid_set_t &ignore) override
Insert contents of another store via move.
size_t auxid_t
Identifier for a particular aux data item.
Definition AuxTypes.h:27

◆ isDecoration()

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

Test if a variable is a decoration.

Definition at line 191 of file ByteStreamAuxContainer_v1.cxx.

192 {
193 guard_t guard (m_mutex);
194 return m_locked && m_decorations.test (auxid);
195 }

◆ linkedVector()

virtual IAuxTypeVector * SG::IAuxStore::linkedVector ( SG::auxid_t )
inlinevirtualinherited

Reimplemented in xAOD::AuxContainerBase, xAOD::AuxInfoBase, and xAOD::details::AuxStoreBase.

Definition at line 187 of file IAuxStore.h.

188 { return nullptr; }

◆ lock()

void xAOD::ByteStreamAuxContainer_v1::lock ( )
overridevirtualinherited

Lock the container.

Definition at line 198 of file ByteStreamAuxContainer_v1.cxx.

199 {
200 guard_t guard (m_mutex);
201 m_locked = true;
202 }

◆ lockDecoration()

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

Lock a decoration.

Definition at line 237 of file ByteStreamAuxContainer_v1.cxx.

238 {
239 guard_t guard (m_mutex);
240 m_decorations.reset (auxid);
241 }

◆ name()

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

Get the name of the container instance.

Definition at line 459 of file ByteStreamAuxContainer_v1.cxx.

459 {
460
461 return m_name.c_str();
462 }
std::string m_name
Name of the container in memory. Set externally.

◆ regAuxVar()

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

Register one of the user defined persistent variables internally.

◆ reserve()

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

Reserve a given size for the arrays.

Implements SG::IAuxStore.

Definition at line 330 of file ByteStreamAuxContainer_v1.cxx.

330 {
331
332 guard_t guard (m_mutex);
333
334 if (m_locked)
335 throw SG::ExcStoreLocked ("reserve");
336
337 std::vector< SG::IAuxTypeVector* >::iterator itr = m_dynamicVecs.begin();
338 std::vector< SG::IAuxTypeVector* >::iterator end = m_dynamicVecs.end();
339 for( ; itr != end; ++itr ) {
340 if( *itr ) ( *itr )->reserve( size );
341 }
342 itr = m_staticVecs.begin();
343 end = m_staticVecs.end();
344 for( ; itr != end; ++itr ) {
345 if( *itr ) ( *itr )->reserve( size );
346 }
347
348 return;
349 }

◆ reset()

void xAOD::ByteStreamAuxContainer_v1::reset ( )
inherited

Function resetting the internal (cached) state of the object.

Definition at line 437 of file ByteStreamAuxContainer_v1.cxx.

437 {
438
439 guard_t guard (m_mutex);
440
441 for (SG::IAuxTypeVector* p : m_dynamicVecs)
442 delete p;
443 m_dynamicVecs.clear();
444
445 SG::AuxTypeRegistry& r = SG::AuxTypeRegistry::instance();
446#define ADD_IDS(VAR, TYP) \
447 do { typedef std::map< std::string, std::vector< TYP > > CONT; \
448 for (CONT::value_type& p : VAR) \
449 m_auxids.insert (r.getAuxID< TYP > (p.first, emptyStr, SG::AuxVarFlags::SkipNameCheck)); } while(0)
450 ADD_IDS(m_int, int);
451 ADD_IDS(m_float, float);
452 ADD_IDS(m_vecInt, std::vector<int>);
453 ADD_IDS(m_vecFloat, std::vector<float>);
454#undef ADD_IDS
455
456 return;
457 }
#define ADD_IDS(VAR, TYP)

◆ resize()

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

Resize the arrays to a given size.

Implements SG::IAuxStore.

Definition at line 305 of file ByteStreamAuxContainer_v1.cxx.

305 {
306
307 guard_t guard (m_mutex);
308
309 if (m_locked)
310 throw SG::ExcStoreLocked ("resize");
311
312 bool nomoves = true;
313 for (SG::IAuxTypeVector* v : m_dynamicVecs) {
314 if(v) {
315 if (!v->resize( size ))
316 nomoves = false;
317 }
318 }
319
320 for (SG::IAuxTypeVector* v : m_staticVecs) {
321 if(v) {
322 if (!v->resize( size ))
323 nomoves = false;
324 }
325 }
326
327 return nomoves;
328 }

◆ setName()

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

Set the name of the container instance.

Definition at line 464 of file ByteStreamAuxContainer_v1.cxx.

464 {
465
466 m_name = name;
467 return;
468 }

◆ setOption()

virtual bool SG::IAuxStore::setOption ( auxid_t ,
const AuxDataOption &  )
inlinevirtualinherited

Set an option for a given auxiliary variable.

Parameters
auxidThe identifier of the desired aux data item.
optionThe option to set.

The interpretation of the option depends on the particular representation of the variable.

Returns true if the option setting was successful; false otherwise.

Reimplemented in xAOD::AuxContainerBase, and xAOD::AuxInfoBase.

Definition at line 173 of file IAuxStore.h.

174 { return false; }

◆ shift()

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

Shift the contents of the stored arrays.

Implements SG::IAuxStore.

Definition at line 351 of file ByteStreamAuxContainer_v1.cxx.

351 {
352
353 guard_t guard (m_mutex);
354
355 if (m_locked)
356 throw SG::ExcStoreLocked ("shift");
357
358 std::vector< SG::IAuxTypeVector* >::iterator itr = m_dynamicVecs.begin();
359 std::vector< SG::IAuxTypeVector* >::iterator end = m_dynamicVecs.end();
360 for( ; itr != end; ++itr ) {
361 if( *itr ) ( *itr )->shift( pos, offs );
362 }
363 itr = m_staticVecs.begin();
364 end = m_staticVecs.end();
365 for( ; itr != end; ++itr ) {
366 if( *itr ) ( *itr )->shift( pos, offs );
367 }
368
369 return;
370 }

◆ size()

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

Get the size of the container.

Definition at line 262 of file ByteStreamAuxContainer_v1.cxx.

263 {
264 guard_t guard (m_mutex);
265 return size_noLock();
266 }

◆ size_noLock()

size_t xAOD::ByteStreamAuxContainer_v1::size_noLock ( ) const
privateinherited

Internal method: return size without taking out the lock.

Definition at line 244 of file ByteStreamAuxContainer_v1.cxx.

245 {
246 for (SG::auxid_t i : m_auxids) {
247 if (i < m_staticVecs.size() && m_staticVecs[i]) {
248 size_t sz = m_staticVecs[i]->size();
249 if (sz > 0)
250 return sz;
251 }
252 if (i < m_dynamicVecs.size() && m_dynamicVecs[i]) {
253 size_t sz = m_dynamicVecs[i]->size();
254 if (sz > 0)
255 return sz;
256 }
257 }
258
259 return 0;
260 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/6]

std::vector< SG::IAuxTypeVector* > m_dynamicVecs xAOD::ByteStreamAuxContainer_v1::ATLAS_THREAD_SAFE
mutableprivateinherited

Internal list of dynamic managed variables.

Definition at line 186 of file ByteStreamAuxContainer_v1.h.

◆ ATLAS_THREAD_SAFE [2/6]

auxid_set_t m_auxids xAOD::ByteStreamAuxContainer_v1::ATLAS_THREAD_SAFE
mutableprivateinherited

Internal list of auxiliary variables.

Definition at line 182 of file ByteStreamAuxContainer_v1.h.

◆ ATLAS_THREAD_SAFE [3/6]

std::map< std::string, std::vector< std::vector< float > > > m_vecFloat xAOD::ByteStreamAuxContainer_v1::ATLAS_THREAD_SAFE
mutableprivateinherited

Variable holding vector of float auxiliary variables.

Definition at line 174 of file ByteStreamAuxContainer_v1.h.

◆ ATLAS_THREAD_SAFE [4/6]

std::map< std::string, std::vector< std::vector< int > > > m_vecInt xAOD::ByteStreamAuxContainer_v1::ATLAS_THREAD_SAFE
mutableprivateinherited

Variable holding vector of integer auxiliary variables.

Definition at line 172 of file ByteStreamAuxContainer_v1.h.

◆ ATLAS_THREAD_SAFE [5/6]

std::map< std::string, std::vector< float > > m_float xAOD::ByteStreamAuxContainer_v1::ATLAS_THREAD_SAFE
mutableprivateinherited

Variable holding float auxiliary variables.

Definition at line 170 of file ByteStreamAuxContainer_v1.h.

◆ ATLAS_THREAD_SAFE [6/6]

std::map< std::string, std::vector< int > > m_int xAOD::ByteStreamAuxContainer_v1::ATLAS_THREAD_SAFE
mutableprivateinherited

Variable holding integer auxiliary variables.

Definition at line 168 of file ByteStreamAuxContainer_v1.h.

◆ constituentLinks

ConstituentLinks_t xAOD::JetTrigAuxContainer_v1::constituentLinks
private

Definition at line 52 of file JetTrigAuxContainer_v1.h.

◆ constituentWeights

std::vector< std::vector< float > > xAOD::JetTrigAuxContainer_v1::constituentWeights
private

Definition at line 53 of file JetTrigAuxContainer_v1.h.

◆ eta

std::vector<float> xAOD::JetTrigAuxContainer_v1::eta
private

Definition at line 48 of file JetTrigAuxContainer_v1.h.

◆ m

std::vector<float> xAOD::JetTrigAuxContainer_v1::m
private

Definition at line 50 of file JetTrigAuxContainer_v1.h.

◆ m_decorations

SG::auxid_set_t xAOD::ByteStreamAuxContainer_v1::m_decorations
privateinherited

Record which variables are decorations.

Definition at line 190 of file ByteStreamAuxContainer_v1.h.

◆ m_locked

bool xAOD::ByteStreamAuxContainer_v1::m_locked
privateinherited

Has the container been locked?

Definition at line 188 of file ByteStreamAuxContainer_v1.h.

◆ m_mutex

mutex_t xAOD::ByteStreamAuxContainer_v1::m_mutex
mutableprivateinherited

Definition at line 195 of file ByteStreamAuxContainer_v1.h.

◆ m_name

std::string xAOD::ByteStreamAuxContainer_v1::m_name
privateinherited

Name of the container in memory. Set externally.

Definition at line 200 of file ByteStreamAuxContainer_v1.h.

◆ m_staticVecs

std::vector< SG::IAuxTypeVector* > xAOD::ByteStreamAuxContainer_v1::m_staticVecs
privateinherited

Internal list of static managed variables.

Definition at line 184 of file ByteStreamAuxContainer_v1.h.

◆ phi

std::vector<float> xAOD::JetTrigAuxContainer_v1::phi
private

Definition at line 49 of file JetTrigAuxContainer_v1.h.

◆ pt

std::vector<float> xAOD::JetTrigAuxContainer_v1::pt
private

Definition at line 47 of file JetTrigAuxContainer_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: