ATLAS Offline Software
Public Types | Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
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. More...
 
typedef SG::auxid_set_t auxid_set_t
 The aux ID set type definition from IConstAuxStore. More...
 
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. More...
 

Public Member Functions

 JetTrigAuxContainer_v1 ()
 Default constructor. More...
 
virtual const void * getData (SG::auxid_t auxid) const=0
 Pick up the const version from the base class. More...
 
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. More...
 
void reset ()
 Function resetting the internal (cached) state of the object. More...
 
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. More...
 
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. More...
 
virtual bool setOption (auxid_t, const AuxDataOption &)
 Set an option for a given auxiliary variable. More...
 

Static Public Attributes

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

Private Types

typedef std::vector< std::vector< ElementLink< IParticleContainer > > > ConstituentLinks_t
 Type used for the constituent links: More...
 

Private Member Functions

size_t size_noLock () const
 Internal method: return size without taking out the lock. More...
 
template<typename T >
void * getData1 (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. More...
 
void * getData1 (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. More...
 

Transient variables used to implement the IAuxStore interface

typedef AthContainers_detail::mutex mutex_t
 Mutex for multithread synchronization. More...
 
typedef AthContainers_detail::lock_guard< mutex_tguard_t
 
auxid_set_t m_auxids ATLAS_THREAD_SAFE
 Internal list of auxiliary variables. More...
 
std::vector< SG::IAuxTypeVector * > m_dynamicVecs ATLAS_THREAD_SAFE
 Internal list of dynamic managed variables. More...
 
std::vector< SG::IAuxTypeVector * > m_staticVecs
 Internal list of static managed variables. More...
 
bool m_locked
 Has the container been locked? More...
 
SG::auxid_set_t m_decorations
 Record which variables are decorations. More...
 
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 50 of file ByteStreamAuxContainer_v1.h.

◆ auxid_t

The aux ID type definition from IConstAuxStore.

Definition at line 48 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 130 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

typedef AthContainers_detail::lock_guard<mutex_t> xAOD::ByteStreamAuxContainer_v1::guard_t
privateinherited

Definition at line 189 of file ByteStreamAuxContainer_v1.h.

◆ mutex_t

typedef AthContainers_detail::mutex xAOD::ByteStreamAuxContainer_v1::mutex_t
privateinherited

Mutex for multithread synchronization.

Definition at line 188 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 
16  AUX_VARIABLE( pt );
17  AUX_VARIABLE( eta );
18  AUX_VARIABLE( phi );
19  AUX_VARIABLE( m );
20  }

Member Function Documentation

◆ clearDecorations()

bool xAOD::ByteStreamAuxContainer_v1::clearDecorations ( )
overridevirtualinherited

Clear all decorations.

Implements SG::IConstAuxStore.

Definition at line 171 of file ByteStreamAuxContainer_v1.cxx.

172  {
173  guard_t guard (m_mutex);
174 
176 
177  bool anycleared = false;
178  for (auxid_t auxid : m_decorations) {
179  if (m_dynamicVecs[auxid]) {
180  delete m_dynamicVecs[auxid];
181  m_dynamicVecs[auxid] = nullptr;
182  m_auxids.erase( auxid );
183  anycleared = true;
184 
185  const std::string name = r.getName( auxid );
186  const std::type_info* ti = r.getType( auxid );
187  if (ti == &typeid(int))
188  m_int.erase (name);
189  else if (ti == &typeid(float))
190  m_float.erase (name);
191  else if (ti == &typeid(std::vector<int>))
192  m_vecInt.erase (name);
193  else if (ti == &typeid(std::vector<float>))
194  m_vecFloat.erase (name);
195  }
196  }
198 
199  return anycleared;
200  }

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

Implements SG::IConstAuxStore.

Definition at line 108 of file ByteStreamAuxContainer_v1.cxx.

108  {
109 
110  // Return the full list of IDs:
111  return getWritableAuxIDs();
112  }

◆ getData() [1/3]

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

Get a pointer to a given array.

Implements SG::IConstAuxStore.

Definition at line 85 of file ByteStreamAuxContainer_v1.cxx.

85  {
86 
87  guard_t guard (m_mutex);
88 
89  // If it's a static auxiliary property:
90  if( ( auxid < m_staticVecs.size() ) && ( m_staticVecs[ auxid ] ) ) {
91  // We're done already:
92  return m_staticVecs[ auxid ]->toPtr();
93  }
94  // If it's a dynamic one:
95  else if( ( auxid < m_dynamicVecs.size() ) &&
96  ( m_dynamicVecs[ auxid ] ) ) {
97  // We're done already:
98  return m_dynamicVecs[ auxid ]->toPtr();
99  }
100 
101  // Try to retrieve the dynamic variable:
102  // quiet on because this method may be called from isAccessible
103  // and that shouldn't generate any output.
104  return getData1 (auxid, 0, 0, true, false);
105  }

◆ getData() [2/3]

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 236 of file ByteStreamAuxContainer_v1.cxx.

237  {
238 
239  guard_t guard (m_mutex);
240 
241  // Check if we have such a static variable:
242  if( ( auxid < m_staticVecs.size() ) && ( m_staticVecs[ auxid ] ) ) {
243  // Set it to the right size:
244  m_staticVecs[ auxid ]->reserve( capacity );
245  m_staticVecs[ auxid ]->resize( size );
246  // We're done already:
247  return m_staticVecs[ auxid ]->toPtr();
248  }
249  // Check if we already know about this dynamic variable:
250  else if( ( auxid < m_dynamicVecs.size() ) &&
251  ( m_dynamicVecs[ auxid ] ) ) {
252  // Set it to the right size:
253  m_dynamicVecs[ auxid ]->reserve( capacity );
254  m_dynamicVecs[ auxid ]->resize( size );
255  // We're done already:
256  return m_dynamicVecs[ auxid ]->toPtr();
257  }
258 
259  return getData1 (auxid, size, capacity, false, false);
260  }

◆ getData() [3/3]

virtual const void* SG::IConstAuxStore::getData
inherited

Pick up the const version from the base class.

◆ getData1() [1/2]

void * xAOD::ByteStreamAuxContainer_v1::getData1 ( auxid_t  auxid,
size_t  size,
size_t  capacity,
bool  quiet,
bool  forDecor 
) const
privateinherited

Definition at line 504 of file ByteStreamAuxContainer_v1.cxx.

507  {
508 
509  // Private method --- should hold lock before calling this.
510 
511  if( *( SG::AuxTypeRegistry::instance().getType( auxid ) ) ==
512  typeid( int ) ) {
513 
514  return getData1( auxid, m_int, size, capacity, quiet, forDecor );
515  }
516  else if( *( SG::AuxTypeRegistry::instance().getType( auxid ) ) ==
517  typeid( float ) ) {
518 
519  return getData1( auxid, m_float, size, capacity, quiet, forDecor );
520  }
521  else if( *( SG::AuxTypeRegistry::instance().getType( auxid ) ) ==
522  typeid( std::vector< int > ) ) {
523 
524  return getData1( auxid, m_vecInt, size, capacity, quiet, forDecor );
525  }
526  else if( *( SG::AuxTypeRegistry::instance().getType( auxid ) ) ==
527  typeid( std::vector< float > ) ) {
528 
529  return getData1( auxid, m_vecFloat, size, capacity, quiet, forDecor );
530  }
531 
532  // The object can't handle this variable type...
533  std::cerr << "ERROR xAOD::ByteStreamAuxContainer_v1::getData "
534  << "Unknown variable type ("
535  << SG::AuxTypeRegistry::instance().getType( auxid )->name()
536  << ") requested" << std::endl;
537 
538  return nullptr;
539  }

◆ getData1() [2/2]

template<typename T >
void * xAOD::ByteStreamAuxContainer_v1::getData1 ( 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 verable will be created if necessary.

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

Definition at line 439 of file ByteStreamAuxContainer_v1.cxx.

444  {
445 
446  // Private method --- should hold lock before calling this.
447 
448  // Look up the name of the variable:
449  const std::string name = SG::AuxTypeRegistry::instance().getName( auxid );
450 
451  // Try to find the variable:
452  typename std::map< std::string, std::vector< T > >::iterator itr =
453  pers.find( name );
454  if( itr == pers.end() ) {
455  // Variable isn't there. Fail if capacity==0.
456  if (capacity == 0) {
457  if (!quiet) {
458  std::cerr << "ERROR xAOD::ByteStreamAuxContainer_v1::getData (const) "
459  << "Variable with unknown name (" << name << ") requested"
460  << std::endl;
461  }
462  return nullptr;
463  }
464 
465  if (m_locked && !forDecor)
466  throw SG::ExcStoreLocked ("getData");
467 
468  // Create the variable.
469  itr = pers.insert (std::make_pair (name, std::vector<T>())).first;
470  }
471 
472  // Get hold of the variable.
473  std::vector< T >& var = itr->second;
474 
475  // Make sure that the internal vector is big enough:
476  if( m_dynamicVecs.size() <= auxid ) {
477  m_dynamicVecs.resize( auxid + 1 );
478  }
479 
480  // Just an internal check...
481  if( m_dynamicVecs[ auxid ] ) {
482  std::cerr << "ERROR xAOD::ByteStreamAuxContainer_v1::getData "
483  << "Internal inconsistency detected!" << std::endl;
484  return m_dynamicVecs[ auxid ]->toPtr();
485  }
486 
487  // Register the variable:
488  m_dynamicVecs[ auxid ] = new AuxPersVector< T >( auxid, var );
489 
490  if (capacity > 0) {
491  // Set it to the right size:
492  m_dynamicVecs[ auxid ]->reserve( capacity );
493  m_dynamicVecs[ auxid ]->resize( size );
494  }
495 
496  // Remember that we are now handling this variable:
497  m_auxids.insert( auxid );
498 
499  // Return the pointer to the array:
500  return m_dynamicVecs[ auxid ]->toPtr();
501  }

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

Implements SG::IConstAuxStore.

Definition at line 115 of file ByteStreamAuxContainer_v1.cxx.

118  {
119  guard_t guard (m_mutex);
120 
121  // Does this variable already exist?
122  void* ret = nullptr;
123  if( ( auxid < m_staticVecs.size() ) && ( m_staticVecs[ auxid ] ) ) {
124  ret = m_staticVecs[ auxid ]->toPtr();
125  }
126  // If it's a dynamic one:
127  else if( ( auxid < m_dynamicVecs.size() ) &&
128  ( m_dynamicVecs[ auxid ] ) ) {
129  ret = m_dynamicVecs[ auxid ]->toPtr();
130  }
131 
132  if (!ret)
133  ret = getData1 (auxid, 0, 0, true, true);
134 
135  if (ret) {
136  // Raise exception if locked and not a decoration.
137  if (m_locked) {
138  if ( ! m_decorations.test (auxid) ) {
139  throw SG::ExcStoreLocked (auxid);
140  }
141  }
142  return ret;
143  }
144 
145  // Make a new variable.
146  ret = getData1 (auxid, size, capacity, false, true);
147 
148  // If locked, mark as a decoration.
149  if (m_locked) {
150  m_decorations.insert (auxid);
151  }
152 
153  return ret;
154  }

◆ 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 263 of file ByteStreamAuxContainer_v1.cxx.

263  {
264 
265  return m_auxids;
266  }

◆ insertMove() [1/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 335 of file ByteStreamAuxContainer_v1.cxx.

337  {
338 
339  guard_t guard( m_mutex );
340 
341  // This operation is not allowed on a locked container:
342  if( m_locked ) {
343  throw SG::ExcStoreLocked( "insertMove" );
344  }
345 
347  bool nomove = true;
348  size_t other_size = other.size();
349 
350  SG::auxid_set_t ignore = ignore_in;
351 
352  // Do the operation on the static variables:
353  for (SG::auxid_t id : m_auxids) {
354  SG::IAuxTypeVector* v_dst = nullptr;
355  if (id < m_dynamicVecs.size())
356  v_dst = m_dynamicVecs[id];
357  if (!v_dst && id < m_staticVecs.size())
358  v_dst = m_staticVecs[id];
359  if (v_dst) {
360  ignore.insert (id);
361  if (other.getData (id)) {
362  void* src_ptr = other.getData (id, other_size, other_size);
363  if (src_ptr) {
364  if (!v_dst->insertMove (pos, src_ptr,
365  reinterpret_cast<char*>(src_ptr) + other_size*r.getEltSize(id),
366  other))
367  nomove = false;
368  }
369  }
370  else {
371  const void* orig = v_dst->toPtr();
372  v_dst->shift (pos, other_size);
373  if (orig != v_dst->toPtr())
374  nomove = false;
375  }
376  }
377  }
378 
379  // Add any new variables not present in the original container.
380  for (SG::auxid_t id : other.getAuxIDs()) {
381  if (!m_auxids.test(id) &&
382  !ignore.test(id))
383  {
384  if (other.getData (id)) {
385  void* src_ptr = other.getData (id, other_size, other_size);
386  if (src_ptr) {
387  size_t sz = size_noLock();
388  getData1 (id, sz, sz, true, false);
389  m_dynamicVecs[id]->resize (sz - other_size);
390  m_dynamicVecs[id]->insertMove (pos, src_ptr, reinterpret_cast<char*>(src_ptr) + other_size*r.getEltSize(id),
391  other);
392  nomove = false;
393  }
394  }
395  }
396  }
397 
398  return nomove;
399  }

◆ insertMove() [2/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.

Implemented in SG::AuxStoreInternal.

◆ isDecoration()

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

Test if a variable is a decoration.

Implements SG::IConstAuxStore.

Definition at line 158 of file ByteStreamAuxContainer_v1.cxx.

159  {
160  guard_t guard (m_mutex);
161  return m_locked && m_decorations.test (auxid);
162  }

◆ lock()

void xAOD::ByteStreamAuxContainer_v1::lock ( )
overridevirtualinherited

Lock the container.

Implements ILockable.

Definition at line 165 of file ByteStreamAuxContainer_v1.cxx.

166  {
167  guard_t guard (m_mutex);
168  m_locked = true;
169  }

◆ lockDecoration()

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

Lock a decoration.

Implements SG::IConstAuxStore.

Definition at line 204 of file ByteStreamAuxContainer_v1.cxx.

205  {
206  guard_t guard (m_mutex);
207  m_decorations.reset (auxid);
208  }

◆ name()

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

Get the name of the container instance.

Definition at line 424 of file ByteStreamAuxContainer_v1.cxx.

424  {
425 
426  return m_name.c_str();
427  }

◆ 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 293 of file ByteStreamAuxContainer_v1.cxx.

293  {
294 
295  guard_t guard (m_mutex);
296 
297  if (m_locked)
298  throw SG::ExcStoreLocked ("reserve");
299 
300  std::vector< SG::IAuxTypeVector* >::iterator itr = m_dynamicVecs.begin();
302  for( ; itr != end; ++itr ) {
303  if( *itr ) ( *itr )->reserve( size );
304  }
305  itr = m_staticVecs.begin();
306  end = m_staticVecs.end();
307  for( ; itr != end; ++itr ) {
308  if( *itr ) ( *itr )->reserve( size );
309  }
310 
311  return;
312  }

◆ reset()

void xAOD::ByteStreamAuxContainer_v1::reset ( )
inherited

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

Definition at line 402 of file ByteStreamAuxContainer_v1.cxx.

402  {
403 
404  guard_t guard (m_mutex);
405 
406  for (SG::IAuxTypeVector* p : m_dynamicVecs)
407  delete p;
408  m_dynamicVecs.clear();
409 
411 #define ADD_IDS(VAR, TYP) \
412  do { typedef std::map< std::string, std::vector< TYP > > CONT; \
413  for (CONT::value_type& p : VAR) \
414  m_auxids.insert (r.getAuxID< TYP > (p.first, "", SG::AuxVarFlags::SkipNameCheck)); } while(0)
415  ADD_IDS(m_int, int);
416  ADD_IDS(m_float, float);
417  ADD_IDS(m_vecInt, std::vector<int>);
418  ADD_IDS(m_vecFloat, std::vector<float>);
419 #undef ADD_IDS
420 
421  return;
422  }

◆ resize()

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

Resize the arrays to a given size.

Implements SG::IAuxStore.

Definition at line 268 of file ByteStreamAuxContainer_v1.cxx.

268  {
269 
270  guard_t guard (m_mutex);
271 
272  if (m_locked)
273  throw SG::ExcStoreLocked ("resize");
274 
275  bool nomoves = true;
276  for (SG::IAuxTypeVector* v : m_dynamicVecs) {
277  if(v) {
278  if (!v->resize( size ))
279  nomoves = false;
280  }
281  }
282 
284  if(v) {
285  if (!v->resize( size ))
286  nomoves = false;
287  }
288  }
289 
290  return nomoves;
291  }

◆ setName()

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

Set the name of the container instance.

Definition at line 429 of file ByteStreamAuxContainer_v1.cxx.

429  {
430 
431  m_name = name;
432  return;
433  }

◆ 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, xAOD::AuxInfoBase, and SG::AuxStoreInternal.

Definition at line 176 of file IAuxStore.h.

177  { 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 314 of file ByteStreamAuxContainer_v1.cxx.

314  {
315 
316  guard_t guard (m_mutex);
317 
318  if (m_locked)
319  throw SG::ExcStoreLocked ("shift");
320 
321  std::vector< SG::IAuxTypeVector* >::iterator itr = m_dynamicVecs.begin();
323  for( ; itr != end; ++itr ) {
324  if( *itr ) ( *itr )->shift( pos, offs );
325  }
326  itr = m_staticVecs.begin();
327  end = m_staticVecs.end();
328  for( ; itr != end; ++itr ) {
329  if( *itr ) ( *itr )->shift( pos, offs );
330  }
331 
332  return;
333  }

◆ size()

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

Get the size of the container.

Implements SG::IConstAuxStore.

Definition at line 229 of file ByteStreamAuxContainer_v1.cxx.

230  {
231  guard_t guard (m_mutex);
232  return size_noLock();
233  }

◆ size_noLock()

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

Internal method: return size without taking out the lock.

Definition at line 211 of file ByteStreamAuxContainer_v1.cxx.

212  {
213  for (SG::auxid_t i : m_auxids) {
214  if (i < m_staticVecs.size() && m_staticVecs[i]) {
215  size_t sz = m_staticVecs[i]->size();
216  if (sz > 0)
217  return sz;
218  }
219  if (i < m_dynamicVecs.size() && m_dynamicVecs[i]) {
220  size_t sz = m_dynamicVecs[i]->size();
221  if (sz > 0)
222  return sz;
223  }
224  }
225 
226  return 0;
227  }

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/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 163 of file ByteStreamAuxContainer_v1.h.

◆ ATLAS_THREAD_SAFE [2/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 165 of file ByteStreamAuxContainer_v1.h.

◆ ATLAS_THREAD_SAFE [3/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 167 of file ByteStreamAuxContainer_v1.h.

◆ ATLAS_THREAD_SAFE [4/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 169 of file ByteStreamAuxContainer_v1.h.

◆ ATLAS_THREAD_SAFE [5/6]

auxid_set_t m_auxids xAOD::ByteStreamAuxContainer_v1::ATLAS_THREAD_SAFE
mutableprivateinherited

Internal list of auxiliary variables.

Definition at line 177 of file ByteStreamAuxContainer_v1.h.

◆ ATLAS_THREAD_SAFE [6/6]

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

Internal list of dynamic managed variables.

Definition at line 181 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 185 of file ByteStreamAuxContainer_v1.h.

◆ m_locked

bool xAOD::ByteStreamAuxContainer_v1::m_locked
privateinherited

Has the container been locked?

Definition at line 183 of file ByteStreamAuxContainer_v1.h.

◆ m_mutex

mutex_t xAOD::ByteStreamAuxContainer_v1::m_mutex
mutableprivateinherited

Definition at line 190 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 195 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 179 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

constexpr 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 189 of file IAuxStore.h.


The documentation for this class was generated from the following files:
xAOD::ByteStreamAuxContainer_v1::getData1
void * getData1(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.
Definition: ByteStreamAuxContainer_v1.cxx:439
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
SG::IAuxTypeVector::shift
virtual bool shift(size_t pos, ptrdiff_t offs)=0
Shift the elements of the vector.
beamspotman.r
def r
Definition: beamspotman.py:676
beamspotPlotBcids.sz
sz
Definition: beamspotPlotBcids.py:521
beamspotnt.var
var
Definition: bin/beamspotnt.py:1394
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
xAOD::JetTrigAuxContainer_v1::phi
std::vector< float > phi
Definition: JetTrigAuxContainer_v1.h:49
SG::AuxTypeRegistry::instance
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Definition: AuxTypeRegistry.cxx:49
quiet
bool quiet
Definition: TrigGlobEffCorrValidation.cxx:170
SG::AuxTypeRegistry::getName
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
Definition: AuxTypeRegistry.cxx:262
SG::ExcStoreLocked
Exception — Attempted to modify auxiliary data in a locked store.
Definition: Control/AthContainers/AthContainers/exceptions.h:183
xAOD::other
@ other
Definition: TrackingPrimitives.h:509
atn_test_sgProducerConsumerDataPool_jobOptions.end
end
Definition: atn_test_sgProducerConsumerDataPool_jobOptions.py:25
xAOD::ByteStreamAuxContainer_v1::m_staticVecs
std::vector< SG::IAuxTypeVector * > m_staticVecs
Internal list of static managed variables.
Definition: ByteStreamAuxContainer_v1.h:179
xAOD::JetTrigAuxContainer_v1::constituentWeights
std::vector< std::vector< float > > constituentWeights
Definition: JetTrigAuxContainer_v1.h:53
CxxUtils::ConcurrentBitset::clear
ConcurrentBitset & clear()
Clear all bits in the set.
SG::AuxTypeRegistry
Handle mappings between names and auxid_t.
Definition: AuxTypeRegistry.h:62
DiTauMassTools::ignore
void ignore(T &&)
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:54
xAOD::JetTrigAuxContainer_v1::m
std::vector< float > m
Definition: JetTrigAuxContainer_v1.h:50
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
SG::AuxTypeRegistry::getType
const std::type_info * getType(SG::auxid_t auxid) const
Return the type of an aux data item.
Definition: AuxTypeRegistry.cxx:287
xAOD::ByteStreamAuxContainer_v1::auxid_t
SG::auxid_t auxid_t
The aux ID type definition from IConstAuxStore.
Definition: ByteStreamAuxContainer_v1.h:48
xAOD::JetTrigAuxContainer_v1::constituentLinks
ConstituentLinks_t constituentLinks
Definition: JetTrigAuxContainer_v1.h:52
lumiFormat.i
int i
Definition: lumiFormat.py:92
CxxUtils::ConcurrentBitset::insert
ConcurrentBitset & insert(bit_t bit, bit_t new_nbits=0)
Set a bit to 1.
AUX_VARIABLE
#define AUX_VARIABLE(VAR,...)
Convenience macro for declaring an auxiliary variable.
Definition: AuxVariable.h:22
ret
T ret(T t)
Definition: rootspy.cxx:260
CxxUtils::ConcurrentBitset::reset
ConcurrentBitset & reset(bit_t bit)
Turn off one bit.
xAOD::ByteStreamAuxContainer_v1::m_locked
bool m_locked
Has the container been locked?
Definition: ByteStreamAuxContainer_v1.h:183
xAOD::JetTrigAuxContainer_v1::pt
std::vector< float > pt
Definition: JetTrigAuxContainer_v1.h:47
xAOD::ByteStreamAuxContainer_v1::ByteStreamAuxContainer_v1
ByteStreamAuxContainer_v1()
Default constructor.
Definition: ByteStreamAuxContainer_v1.cxx:18
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:191
xAOD::ByteStreamAuxContainer_v1::getWritableAuxIDs
virtual const auxid_set_t & getWritableAuxIDs() const override
Return a set of writable data identifiers.
Definition: ByteStreamAuxContainer_v1.cxx:263
xAOD::ByteStreamAuxContainer_v1::guard_t
AthContainers_detail::lock_guard< mutex_t > guard_t
Definition: ByteStreamAuxContainer_v1.h:189
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
xAOD::ByteStreamAuxContainer_v1::m_mutex
mutex_t m_mutex
Definition: ByteStreamAuxContainer_v1.h:190
xAOD::ByteStreamAuxContainer_v1::name
const char * name() const
Get the name of the container instance.
Definition: ByteStreamAuxContainer_v1.cxx:424
xAOD::ByteStreamAuxContainer_v1::size
virtual size_t size() const override
Get the size of the container.
Definition: ByteStreamAuxContainer_v1.cxx:229
python.PyAthena.v
v
Definition: PyAthena.py:157
xAOD::JetTrigAuxContainer_v1::eta
std::vector< float > eta
Definition: JetTrigAuxContainer_v1.h:48
SG::IAuxTypeVector::insertMove
virtual bool insertMove(size_t pos, void *beg, void *end, IAuxStore &srcStore)=0
Insert elements into the vector via move semantics.
SG::IAuxTypeVector
Abstract interface for manipulating vectors of arbitrary types.
Definition: IAuxTypeVector.h:40
SG::auxid_set_t
A set of aux data identifiers.
Definition: AuxTypes.h:47
xAOD::ByteStreamAuxContainer_v1::m_decorations
SG::auxid_set_t m_decorations
Record which variables are decorations.
Definition: ByteStreamAuxContainer_v1.h:185
xAOD::ByteStreamAuxContainer_v1::size_noLock
size_t size_noLock() const
Internal method: return size without taking out the lock.
Definition: ByteStreamAuxContainer_v1.cxx:211
Ringer::getType
T getType(const char *cStr)
Return Ringer enumeration of type T identifying string type:
ADD_IDS
#define ADD_IDS(VAR, TYP)
SG::IAuxTypeVector::toPtr
virtual void * toPtr()=0
Return a pointer to the start of the vector's data.
CxxUtils::ConcurrentBitset::test
bool test(bit_t bit) const
Test to see if a bit is set.
xAOD::ByteStreamAuxContainer_v1::m_name
std::string m_name
Name of the container in memory. Set externally.
Definition: ByteStreamAuxContainer_v1.h:195