ATLAS Offline Software
AuxStoreBase.cxx
Go to the documentation of this file.
1 // Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2 
3 // Local include(s).
5 
8 
9 // Framework include(s).
14 #include "CxxUtils/as_const_ptr.h"
16 
17 // ROOT include(s):
18 #include <TError.h>
19 
20 #include <atomic>
21 
22 namespace xAOD::details {
23 
25  : m_data{mode, topStore} {}
26 
27 AuxStoreBase::~AuxStoreBase() = default;
28 
30 
31  return m_data.m_structMode;
32 }
33 
35 
37  reset();
38 }
39 
40 const std::string& AuxStoreBase::prefix() const {
41 
42  return m_data.m_prefix;
43 }
44 
46 
47  return m_data.m_topStore;
48 }
49 
51 
53  reset();
54 }
55 
56 const void* AuxStoreBase::getData(SG::auxid_t auxid) const {
57 
58  const SG::IAuxTypeVector* v = getVector(auxid);
59  if (v) {
60  return v->toPtr();
61  }
62  return nullptr;
63 }
64 
66 
67  // Guard against multi-threaded execution:
68  guard_t guard(m_mutex1);
69 
70  // Check if the transient store already handles this variable:
72  (m_data.m_transientStore->getAuxIDs().test(auxid))) {
73  return m_data.m_transientStore->getVector(auxid);
74  }
75 
76  // Access the object through a non-const pointer. This is "safe" because
77  // of the mutex lock above.
78  auto this_nc ATLAS_THREAD_SAFE = const_cast<AuxStoreBase*>(this);
79 
80  // Connect this auxiliary variable both to the input and output
81  // if needed:
82  if ((auxid >= m_data.m_vecs.size()) || (!m_data.m_vecs[auxid])) {
83  if ((!this_nc->setupInputData(auxid).isSuccess()) ||
84  (!this_nc->setupOutputData(auxid).isSuccess())) {
85  return nullptr;
86  }
87  }
88 
89  // Make sure the variable is up to date:
90  if (this_nc->getEntryFor(auxid).isSuccess() == false) {
91  ::Error("xAOD::AuxStoreBase::getVector",
92  XAOD_MESSAGE("Couldn't read in variable %s"),
93  SG::AuxTypeRegistry::instance().getName(auxid).c_str());
94  return nullptr;
95  }
96 
97  // Return the pointer to the object:
98  return m_data.m_vecs[auxid].get();
99 }
100 
102 
103  return m_data.m_auxIDs;
104 }
105 
107 
108  return m_data.m_decorIDs;
109 }
110 
112  std::size_t capacity) {
113 
114  // Guard against multi-threaded execution:
115  guard_t guard(m_mutex1);
116 
117  // Remember the requested size:
118  m_data.m_size = size;
119 
120  // If this is a locked object, deal with it correctly:
121  if (m_locked) {
122  // If the variable exists already and it's a decoration, then let's
123  // give it back.
124  if ((auxid < m_data.m_vecs.size()) && m_data.m_vecs[auxid] &&
125  (auxid < m_data.m_isDecoration.size() &&
126  m_data.m_isDecoration[auxid])) {
127  // Things look okay...
128  m_data.m_vecs[auxid]->reserve(capacity);
129  m_data.m_vecs[auxid]->resize(size);
130  return m_data.m_vecs[auxid]->toPtr();
131  }
132  // If it's in the transient store already, return it from there.
133  // Since in a locked store *everything* is a decoration in the
134  // transient store.
135  if (m_data.m_transientStore &&
136  m_data.m_transientStore->getAuxIDs().test(auxid)) {
137  return m_data.m_transientStore->getDecoration(auxid, size, capacity);
138  }
139  // If we know this auxiliary ID, but it was not found as a decoration
140  // by the previous checks, then we're in trouble.
141  if (m_data.m_auxIDs.test(auxid)) {
142  throw SG::ExcStoreLocked(auxid);
143  }
144  }
145 
146  // Check if we want to write this variable to the output:
147  if (!(isAuxIDSelected(auxid) && hasOutput())) {
148 
149  // Create the store only when necessary:
150  if (!m_data.m_transientStore) {
151  m_data.m_transientStore = std::make_unique<SG::AuxStoreInternal>(
153  if (m_locked) {
154  m_data.m_transientStore->lock();
155  }
156  }
157  // Let the transient store create the decoration:
158  const std::size_t nids = m_data.m_transientStore->getAuxIDs().size();
159  void* result =
160  m_data.m_transientStore->getDecoration(auxid, size, capacity);
161  if (result && (nids != m_data.m_transientStore->getAuxIDs().size())) {
162  if (m_data.m_transientStore->isDecoration(auxid)) {
163  m_data.m_decorIDs.insert(auxid);
164  }
165  std::atomic_thread_fence( std::memory_order_seq_cst );
166  m_data.m_auxIDs.insert(auxid);
167  }
168  // Return the memory address from the transient store:
169  return result;
170  }
171 
172  // Doesn't exist yet. So let's make it:
173  if (m_locked) {
174  // If the container is locked, remember that this is a decoration:
175  if (m_data.m_isDecoration.size() <= auxid) {
176  m_data.m_isDecoration.resize(auxid + 1);
177  }
178  m_data.m_isDecoration[auxid] = true;
179  m_data.m_decorIDs.insert(auxid);
180  std::atomic_thread_fence( std::memory_order_seq_cst );
181  }
182  void* result = getData(auxid, size, capacity);
183 
184  // Return the pointer made by getData(...):
185  return result;
186 }
187 
189  if (m_locked) {
190  if (auxid < m_data.m_isDecoration.size() && m_data.m_isDecoration[auxid]) {
191  return true;
192  }
193  if (m_data.m_transientStore) {
194  return m_data.m_transientStore->isDecoration(auxid);
195  }
196  }
197  return false;
198 }
199 
201 
202  // Guard against multi-threaded execution:
203  guard_t guard(m_mutex1);
204 
205  m_locked = true;
206  if (m_data.m_transientStore) {
207  m_data.m_transientStore->lock();
208  }
209 }
210 
212 
213  // Guard against multi-threaded execution:
214  guard_t guard(m_mutex1);
215 
216  // Clear the transient decorations:
217  bool anycleared = false;
218  if (m_data.m_transientStore) {
219  SG::auxid_set_t old_id_set = m_data.m_transientStore->getAuxIDs();
220 
221  // Clear the decorations from the transient store:
222  anycleared = m_data.m_transientStore->clearDecorations();
223 
224  // Now remove ids that were cleared.
225  if (anycleared) {
226  old_id_set -= m_data.m_transientStore->getAuxIDs();
227  // old_id_set is now the set of ids that were cleared.
228  m_data.m_auxIDs -= old_id_set;
230  }
231  }
232 
233  // The decorations which are going into the output file, are here to stay.
234  // Removing their IDs from the internal set would just cause more problems
235  // in my mind than just leaving them be.
236 
237  return anycleared;
238 }
239 
242  if (m_data.m_transientStore) {
243  m_data.m_transientStore->lockDecoration(auxid);
244  }
245  m_data.m_decorIDs.erase(auxid);
246 }
247 
248 std::size_t AuxStoreBase::size() const {
249 
250  // First, try to find a managed vector in the store:
251  for (SG::auxid_t id : m_data.m_auxIDs) {
252  // Make sure that we are still within the bounds of our vector:
253  if (id >= m_data.m_vecs.size())
254  break;
255  // Skip non-existent or linked objects:
256  if (!m_data.m_vecs[id] || m_data.m_vecs[id]->isLinked()) {
257  continue;
258  }
259  // Ask the vector for its size:
260  const std::size_t size = m_data.m_vecs[id]->size();
261  // Only accept a non-zero size. Not sure why...
262  if (size > 0) {
263  return size;
264  }
265  }
266 
267  // Check if we have a transient store, and get the size from that:
268  if (m_data.m_transientStore) {
269  return m_data.m_transientStore->size();
270  }
271 
272  // Apparently the store is empty:
273  return 0;
274 }
275 
278  SG::auxid_t linked_id = r.linkedVariable(auxid);
279  guard_t guard(m_mutex1);
280  if (linked_id < m_data.m_vecs.size()) {
281  return m_data.m_vecs[linked_id].get();
282  }
283  if (m_data.m_transientStore) {
285  ->linkedVector(auxid);
286  }
287  return nullptr;
288 }
289 
292  SG::auxid_t linked_id = r.linkedVariable(auxid);
293  guard_t guard(m_mutex1);
294  if (linked_id < m_data.m_vecs.size()) {
295  return m_data.m_vecs[linked_id].get();
296  }
297  if (m_data.m_transientStore) {
298  return m_data.m_transientStore->linkedVector(auxid);
299  }
300  return nullptr;
301 }
302 
303 void* AuxStoreBase::getData(SG::auxid_t auxid, std::size_t size,
304  std::size_t capacity) {
305 
306  // Guard against multi-threaded execution:
307  guard_t guard(m_mutex2);
308 
309  // Remember the size:
310  m_data.m_size = size;
311 
312  // Check if we want to write this variable to the output:
313  if (!(isAuxIDSelected(auxid) && hasOutput())) {
314  // Create the store only when necessary:
315  if (!m_data.m_transientStore) {
316  m_data.m_transientStore = std::make_unique<SG::AuxStoreInternal>(
318  if (m_locked) {
319  m_data.m_transientStore->lock();
320  }
321  }
322  // Let the transient store create the variable:
323  std::size_t nids = m_data.m_transientStore->getAuxIDs().size();
324  void* result = m_data.m_transientStore->getData(auxid, size, capacity);
325  if (result && (nids != m_data.m_transientStore->getAuxIDs().size())) {
326  m_data.m_auxIDs.insert(auxid);
327  }
328  // Return the address in the transient memory:
329  return result;
330  }
331 
332  // If the variable exists already, and this is a locked store, then
333  // we are in trouble.
334  if (m_locked && (auxid < m_data.m_vecs.size()) && m_data.m_vecs[auxid]) {
335  if (!((auxid < m_data.m_isDecoration.size()) &&
336  m_data.m_isDecoration[auxid])) {
337  throw SG::ExcStoreLocked(auxid);
338  }
339  }
340 
341  // Connect this auxiliary variable just to the output:
342  if (setupOutputData(auxid).isFailure()) {
343  ::Error("xAOD::AuxStoreBase::getData",
344  XAOD_MESSAGE("Failed to set up variable %s"),
345  SG::AuxTypeRegistry::instance().getName(auxid).c_str());
346  return nullptr;
347  }
348 
349  // Check whether things make sense:
350  if ((m_data.m_structMode == EStructMode::kObjectStore) && (size != 1)) {
351  ::Error("xAOD::AuxStoreBase::getData",
352  XAOD_MESSAGE("Branch creation requested with:"));
353  ::Error("xAOD::AuxStoreBase::getData", XAOD_MESSAGE(" name = %s"),
354  SG::AuxTypeRegistry::instance().getName(auxid).c_str());
355  ::Error("xAOD::AuxStoreBase::getData", XAOD_MESSAGE(" size = %i"),
356  static_cast<int>(size));
357  ::Error("xAOD::AuxStoreBase::getData",
358  XAOD_MESSAGE(" m_structMode = EStructMode::kObjectStore"));
359  return nullptr;
360  }
361 
362  // Make sure the variable is of the right size:
363  m_data.m_vecs[auxid]->reserve(capacity);
364  m_data.m_vecs[auxid]->resize(size);
365 
366  // Return the object:
367  return m_data.m_vecs[auxid]->toPtr();
368 }
369 
371 
372  return getAuxIDs();
373 }
374 
375 bool AuxStoreBase::resize(std::size_t size) {
376 
377  // Guard against multi-threaded execution:
378  guard_t guard(m_mutex1);
379 
380  // A sanity check:
381  if ((m_data.m_structMode == EStructMode::kObjectStore) && (size != 1)) {
382  ::Error("xAOD::AuxStoreBase::resize",
383  XAOD_MESSAGE("size = %i for single-object store"),
384  static_cast<int>(size));
385  return false;
386  }
387 
388  // Remember the new size:
389  m_data.m_size = size;
390 
391  bool nomoves = true;
392  for (auto& v : m_data.m_vecs) {
393  if (v && !v->isLinked()) {
394  if (!v->resize(size)) {
395  nomoves = false;
396  }
397  }
398  }
399  if (m_data.m_transientStore) {
400  if (!m_data.m_transientStore->resize(size)) {
401  nomoves = false;
402  }
403  }
404 
405  return nomoves;
406 }
407 
408 void AuxStoreBase::reserve(std::size_t size) {
409 
410  // Guard against multi-threaded execution:
411  guard_t guard(m_mutex1);
412 
413  // A sanity check:
414  if ((m_data.m_structMode == EStructMode::kObjectStore) && (size != 1)) {
415  ::Error("xAOD::AuxStoreBase::reserve",
416  XAOD_MESSAGE("size = %i for single-object store"),
417  static_cast<int>(size));
418  return;
419  }
420 
421  for (auto& v : m_data.m_vecs) {
422  if (v && !v->isLinked()) {
423  v->reserve(size);
424  }
425  }
426 
427  if (m_data.m_transientStore) {
428  m_data.m_transientStore->reserve(size);
429  }
430 }
431 
432 void AuxStoreBase::shift(std::size_t pos, std::ptrdiff_t offs) {
433 
434  // Guard against multi-threaded execution:
435  guard_t guard(m_mutex1);
436 
437  // A sanity check:
439  ::Error("xAOD::AuxStoreBase::shift",
440  XAOD_MESSAGE("Should not have been called for single-object "
441  "store"));
442  return;
443  }
444 
445  // Adjust the size of the container:
446  if ((static_cast<std::size_t>(std::abs(offs)) > m_data.m_size) &&
447  (offs < 0)) {
448  m_data.m_size = 0;
449  } else {
450  m_data.m_size += offs;
451  }
452 
453  for (auto& v : m_data.m_vecs) {
454  if (v && !v->isLinked()) {
455  v->shift(pos, offs);
456  }
457  }
458 
459  if (m_data.m_transientStore) {
460  m_data.m_transientStore->shift(pos, offs);
461  }
462 }
463 
465  const SG::auxid_set_t& ignore_in) {
466  // Guard against multi-threaded execution:
467  guard_t guard(m_mutex1);
468 
469  // A sanity check:
471  ::Error("xAOD::AuxStoreBase::insertMove",
472  XAOD_MESSAGE("Should not have been called for single-object "
473  "store"));
474  return false;
475  }
476 
477  bool nomove = true;
478  std::size_t other_size = other.size();
479 
480  SG::auxid_set_t ignore = ignore_in;
481 
482  for (SG::auxid_t id : m_data.m_auxIDs) {
483  SG::IAuxTypeVector* v_dst = nullptr;
484  if (id < m_data.m_vecs.size()) {
485  v_dst = m_data.m_vecs[id].get();
486  }
487  if (v_dst && !v_dst->isLinked()) {
488  ignore.insert(id);
489  if (other.getData(id)) {
490  void* src_ptr = other.getData(id, other_size, other_size);
491  if (src_ptr) {
492  if (!v_dst->insertMove(pos, src_ptr, 0, other_size, other)) {
493  nomove = false;
494  }
495  }
496  } else {
497  const void* orig = v_dst->toPtr();
498  v_dst->shift(pos, other_size);
499  if (orig != v_dst->toPtr()) {
500  nomove = false;
501  }
502  }
503  }
504  }
505 
506  if (m_data.m_transientStore) {
507  if (!m_data.m_transientStore->insertMove(pos, other, ignore))
508  nomove = false;
509  }
510 
511  return nomove;
512 }
513 
514 const void* AuxStoreBase::getIOData(SG::auxid_t auxid) const {
515 
516  // Guard against multi-threaded execution:
517  guard_t guard(m_mutex1);
518 
519  auto this_nc ATLAS_THREAD_SAFE =
520  const_cast<AuxStoreBase*>(this); // locked above
521 
522  // If the variable is coming from the input, and is connected to already.
523  if (hasEntryFor(auxid)) {
524  if (!this_nc->getEntryFor(auxid).isSuccess()) {
525  ::Error("xAOD::AuxStoreBase::getIOData",
526  XAOD_MESSAGE("Couldn't read in variable %s"),
527  SG::AuxTypeRegistry::instance().getName(auxid).c_str());
528  return nullptr;
529  }
530  return getInputObject(auxid);
531  }
532 
533  // Check if it's in the transient store:
534  if (m_data.m_transientStore &&
535  m_data.m_transientStore->getAuxIDs().test(auxid)) {
536  return m_data.m_transientStore->getIOData(auxid);
537  }
538 
539  // If not, try connecting to it now:
540  if (!this_nc->setupInputData(auxid).isSuccess()) {
541  // This is not actually an error condition anymore. We can end up here
542  // when we decorate constant objects coming from the input file, but
543  // on one event we can't set any decorations. For instance when the
544  // input container is empty. In that case the object will still list
545  // the auxiliary ID belonging to that decoration as being available,
546  // but it really isn't.
547  //
548  // Later on it might be needed to tweak the logic of all of this, but
549  // for now just silently returning 0 seems to do the right thing.
550  return nullptr;
551  }
552 
553  // Now we should know this variable:
554  if (!hasEntryFor(auxid)) {
555  ::Fatal("xAOD::AuxStoreBase::getIOData",
556  XAOD_MESSAGE("Internal logic error detected"));
557  return nullptr;
558  }
559 
560  // Make sure that the right payload is in memory:
561  if (!this_nc->getEntryFor(auxid).isSuccess()) {
562  ::Error("xAOD::AuxStoreBase::getIOData",
563  XAOD_MESSAGE("Couldn't read in variable %s"),
564  SG::AuxTypeRegistry::instance().getName(auxid).c_str());
565  return nullptr;
566  }
567 
568  // Return the pointer.
569  return getInputObject(auxid);
570 }
571 
573 const std::type_info* AuxStoreBase::getIOType(SG::auxid_t auxid) const {
574 
575  // Guard against multi-threaded execution:
576  guard_t guard(m_mutex1);
577 
578  // If the variable is connected to already:
579  if (hasEntryFor(auxid)) {
580  return getInputType(auxid);
581  }
582 
583  // Check if it's in the transient store:
584  if (m_data.m_transientStore &&
585  m_data.m_transientStore->getAuxIDs().test(auxid)) {
586  return m_data.m_transientStore->getIOType(auxid);
587  }
588 
589  // If not, try connecting to it now:
590  auto this_nc ATLAS_THREAD_SAFE =
591  const_cast<AuxStoreBase*>(this); // locked above
592  if (!this_nc->setupInputData(auxid).isSuccess()) {
593  ::Error("xAOD::AuxStoreBase::getIOType",
594  XAOD_MESSAGE("Couldn't connect to auxiliary variable "
595  "%i %s"),
596  static_cast<int>(auxid),
597  SG::AuxTypeRegistry::instance().getName(auxid).c_str());
598  return nullptr;
599  }
600 
601  // Now we should know this variable:
602  if (!hasEntryFor(auxid)) {
603  ::Fatal("xAOD::AuxStoreBase::getIOType",
604  XAOD_MESSAGE("Internal logic error detected"));
605  return nullptr;
606  }
607 
608  // Return the type info:
609  return getInputType(auxid);
610 }
611 
613 
614  // All the auxiliary decorations handled by this object are considered
615  // dynamic:
616  return getAuxIDs();
617 }
618 
620 void AuxStoreBase::selectAux(const std::set<std::string>& attributes) {
621 
622  guard_t guard(m_mutex1);
624 }
625 
628 
629  // Guard against multi-threaded execution:
630  guard_t guard(m_mutex1);
631  // Leave the calculation up to the internal object:
633 }
634 
644 
645  // A temporary object:
646  SG::auxid_set_t auxids;
647  auxids.insert(auxid);
648 
649  // Check if the auxid is returned as a selected ID:
650  return m_selection.getSelectedAuxIDs(auxids).size();
651 }
652 
653 } // namespace xAOD::details
xAOD::details
Definition: AuxStoreBase.cxx:22
xAOD::details::AuxStoreBase::prefix
const std::string & prefix() const
Get the currently configured object name prefix.
Definition: AuxStoreBase.cxx:40
SG::IAuxTypeVector::shift
virtual bool shift(size_t pos, ptrdiff_t offs)=0
Shift the elements of the vector.
SG::IAuxTypeVector::isLinked
bool isLinked() const
Return true if this variable is linked from another one.
Definition: IAuxTypeVector.h:226
beamspotman.r
def r
Definition: beamspotman.py:674
get_generator_info.result
result
Definition: get_generator_info.py:21
xAOD::details::AuxStoreBase::Members::m_vecs
std::vector< std::unique_ptr< SG::IAuxTypeVector > > m_vecs
Variables handled currently by the object (indexed by auxiliary ID)
Definition: AuxStoreBase.h:191
SG::AuxTypeRegistry::instance
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Definition: AuxTypeRegistry.cxx:639
xAOD::details::AuxStoreBase::getAuxIDs
virtual const SG::auxid_set_t & getAuxIDs() const override
Get the types(names) of variables handled by this container.
Definition: AuxStoreBase.cxx:101
xAOD::details::AuxStoreBase::getInputType
virtual const std::type_info * getInputType(SG::auxid_t auxid) const =0
Get the type of an input object, for getIOType()
m_data
std::vector< T > m_data
Definition: TrackTruthMatchingBaseAlg.cxx:660
xAOD::details::AuxStoreBase::selectAux
virtual void selectAux(const std::set< std::string > &attributes)
Select dynamic auxiliary attributes for writing.
Definition: AuxStoreBase.cxx:620
xAOD::details::AuxStoreBase::setTopStore
void setTopStore(bool value=true)
Set whether the object should behave as a "top store" or not.
Definition: AuxStoreBase.cxx:50
SG::ExcStoreLocked
Exception — Attempted to modify auxiliary data in a locked store.
Definition: Control/AthContainers/AthContainers/exceptions.h:183
xAOD::details::AuxStoreBase::clearDecorations
virtual bool clearDecorations() override
Remove the decorations added so far.
Definition: AuxStoreBase.cxx:211
xAOD::details::AuxStoreBase::Members::m_auxIDs
SG::auxid_set_t m_auxIDs
Internal list of auxiliary variable IDs handled currently by the object.
Definition: AuxStoreBase.h:186
exceptions.h
Exceptions that can be thrown from AthContainers.
xAOD::details::AuxStoreBase::EStructMode
EStructMode
"Structural" modes of the object
Definition: AuxStoreBase.h:30
as_const_ptr.h
Helper for getting a const version of a pointer.
xAOD::details::AuxStoreBase::guard_t
AthContainers_detail::lock_guard< mutex_t > guard_t
Guard type for multithreaded synchronisation.
Definition: AuxStoreBase.h:206
xAOD::details::AuxStoreBase::linkedVector
virtual const SG::IAuxTypeVector * linkedVector(SG::auxid_t auxid) const override
Return (const) interface for a linked variable.
Definition: AuxStoreBase.cxx:276
xAOD::details::AuxStoreBase::Members::m_transientStore
std::unique_ptr< SG::AuxStoreInternal > m_transientStore
Store for the in-memory-only variables.
Definition: AuxStoreBase.h:183
xAOD::other
@ other
Definition: TrackingPrimitives.h:510
athena.value
value
Definition: athena.py:124
xAOD::details::AuxStoreBase::Members::m_size
std::size_t m_size
The current size of the container being described.
Definition: AuxStoreBase.h:193
SG::IAuxTypeVector::insertMove
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.
xAOD::details::AuxStoreBase::hasOutput
virtual bool hasOutput() const =0
Check if an output is being written by the object.
XAOD_MESSAGE
#define XAOD_MESSAGE(MESSAGE)
Simple macro for printing error/verbose messages.
Definition: Control/xAODRootAccess/xAODRootAccess/tools/Message.h:19
Utils.h
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
xAOD::details::AuxStoreBase::hasEntryFor
virtual bool hasEntryFor(SG::auxid_t auxid) const =0
Check if a given variable is available from the input.
xAOD::details::AuxStoreBase::EStructMode::kObjectStore
@ kObjectStore
The object describes a single object.
xAOD::details::AuxStoreBase::structMode
EStructMode structMode() const
Get what structure mode the object was constructed with.
Definition: AuxStoreBase.cxx:29
CxxUtils::ConcurrentBitset::clear
ConcurrentBitset & clear()
Clear all bits in the set.
xAOD::details::AuxStoreBase::size
virtual std::size_t size() const override
Return the number of elements in the store.
Definition: AuxStoreBase.cxx:248
dumpTruth.getName
getName
Definition: dumpTruth.py:34
xAOD::details::AuxStoreBase::Members::m_decorIDs
SG::auxid_set_t m_decorIDs
Internal list of auxiliary decoration IDs handled currently by the object.
Definition: AuxStoreBase.h:189
IAuxTypeVector.h
Abstract interface for manipulating vectors of arbitrary types.
xAOD::details::AuxStoreBase::getDynamicAuxIDs
virtual const SG::auxid_set_t & getDynamicAuxIDs() const override
Get the types(names) of variables created dynamically.
Definition: AuxStoreBase.cxx:612
xAOD::details::AuxStoreBase::getWritableAuxIDs
virtual const SG::auxid_set_t & getWritableAuxIDs() const override
Return a set of writable data identifiers.
Definition: AuxStoreBase.cxx:370
SG::AuxTypeRegistry
Handle mappings between names and auxid_t.
Definition: AuxTypeRegistry.h:61
xAOD::details::AuxStoreBase
Common base class for the auxiliary store implementations.
Definition: AuxStoreBase.h:26
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
DiTauMassTools::ignore
void ignore(T &&)
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:58
xAOD::details::AuxStoreBase::~AuxStoreBase
virtual ~AuxStoreBase()
Destructor.
xAOD::details::AuxStoreBase::getDecorIDs
virtual const SG::auxid_set_t & getDecorIDs() const override
Get the types(names) of decorations handled by this container.
Definition: AuxStoreBase.cxx:106
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
CxxUtils::ConcurrentBitset::size
bit_t size() const
Count the number of 1 bits in the set.
xAOD::details::AuxStoreBase::reset
virtual void reset()=0
Reset all (transient) information in the object.
xAOD::details::AuxStoreBase::m_data
Members m_data
Member variables of the base class.
Definition: AuxStoreBase.h:201
xAOD::details::AuxStoreBase::setStructMode
void setStructMode(EStructMode mode)
Set the structure mode of the object to a new value.
Definition: AuxStoreBase.cxx:34
xAOD::details::AuxStoreBase::getIOType
virtual const std::type_info * getIOType(SG::auxid_t auxid) const override
Return the type of the data to be stored for one aux data item.
Definition: AuxStoreBase.cxx:573
AuxStoreBase.h
CxxUtils::ConcurrentBitset::insert
ConcurrentBitset & insert(bit_t bit, bit_t new_nbits=0)
Set a bit to 1.
Message.h
xAOD::details::AuxStoreBase::m_mutex2
mutex_t m_mutex2
Definition: AuxStoreBase.h:214
xAOD::details::AuxStoreBase::Members::m_prefix
std::string m_prefix
Static prefix for the branch names.
Definition: AuxStoreBase.h:178
xAOD::details::AuxStoreBase::getData
virtual const void * getData(SG::auxid_t auxid) const override
Get a pointer to a given array.
Definition: AuxStoreBase.cxx:56
xAOD::details::AuxStoreBase::lock
virtual void lock() override
Lock the object, and don't let decorations be added.
Definition: AuxStoreBase.cxx:200
Preparation.mode
mode
Definition: Preparation.py:107
xAOD::details::AuxStoreBase::resize
virtual bool resize(std::size_t size) override
Resize the arrays to a given size.
Definition: AuxStoreBase.cxx:375
xAOD::details::AuxStoreBase::setupOutputData
virtual StatusCode setupOutputData(SG::auxid_t auxid)=0
Connect a variable to the output.
xAOD::details::AuxStoreBase::getSelectedAuxIDs
virtual SG::auxid_set_t getSelectedAuxIDs() const override
Get the IDs of the selected aux variables.
Definition: AuxStoreBase.cxx:627
xAOD::details::AuxStoreBase::getVector
virtual const SG::IAuxTypeVector * getVector(SG::auxid_t auxid) const override
Return vector interface for one aux data item.
Definition: AuxStoreBase.cxx:65
xAOD::details::AuxStoreBase::isAuxIDSelected
bool isAuxIDSelected(SG::auxid_t auxid) const
Check if an auxiliary variable is selected for ouput writing.
Definition: AuxStoreBase.cxx:643
xAOD::details::AuxStoreBase::AuxStoreBase
AuxStoreBase(bool topStore=true, EStructMode mode=EStructMode::kUndefinedStore)
Constructor.
Definition: AuxStoreBase.cxx:24
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:239
xAOD::details::AuxStoreBase::Members::m_structMode
EStructMode m_structMode
The "structural" mode of the object.
Definition: AuxStoreBase.h:174
CxxUtils::as_const_ptr
const T * as_const_ptr(const T *p)
Helper for getting a const version of a pointer.
Definition: as_const_ptr.h:32
xAOD::details::AuxStoreBase::insertMove
virtual bool insertMove(std::size_t pos, SG::IAuxStore &other, const SG::auxid_set_t &ignore) override
Insert contents of another store via move.
Definition: AuxStoreBase.cxx:464
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:16
xAOD::details::AuxStoreBase::getInputObject
virtual const void * getInputObject(SG::auxid_t auxid) const =0
Get a pointer to an input object, as it is in memory, for getIOData()
xAOD::details::AuxStoreBase::shift
virtual void shift(std::size_t pos, std::ptrdiff_t offs) override
Shift the contents of the stored arrays.
Definition: AuxStoreBase.cxx:432
SG::IAuxStore
Interface for non-const operations on an auxiliary store.
Definition: IAuxStore.h:48
python.PyAthena.v
v
Definition: PyAthena.py:154
xAOD::details::AuxStoreBase::m_locked
bool m_locked
Is this container locked?
Definition: AuxStoreBase.h:212
xAOD::details::AuxStoreBase::reserve
virtual void reserve(std::size_t size) override
Reserve a given size for the arrays.
Definition: AuxStoreBase.cxx:408
xAOD::details::AuxStoreBase::isTopStore
bool isTopStore() const
Check if the object is a "top store", or not.
Definition: AuxStoreBase.cxx:45
xAOD::details::AuxStoreBase::getDecoration
virtual void * getDecoration(SG::auxid_t auxid, std::size_t size, std::size_t capacity) override
Get a pointer to a given array, creating the array if necessary.
Definition: AuxStoreBase.cxx:111
SG::IAuxTypeVector
Abstract interface for manipulating vectors of arbitrary types.
Definition: IAuxTypeVector.h:42
AuxTypeRegistry.h
Handle mappings between names and auxid_t.
xAOD::details::AuxStoreBase::lockDecoration
virtual void lockDecoration(SG::auxid_t auxid) override
Lock a decoration.
Definition: AuxStoreBase.cxx:241
xAOD::details::AuxStoreBase::getIOData
virtual const void * getIOData(SG::auxid_t auxid) const override
Get a pointer to the data being stored for one aux data item.
Definition: AuxStoreBase.cxx:514
xAOD::details::AuxStoreBase::m_mutex1
mutex_t m_mutex1
Mutex objects used for multithreaded synchronisation.
Definition: AuxStoreBase.h:214
SG::auxid_set_t
A set of aux data identifiers.
Definition: AuxTypes.h:47
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
xAOD::AuxSelection::selectAux
virtual void selectAux(const std::set< std::string > &attributes)
Select which variables should be written out.
Definition: AuxSelection.cxx:47
CxxUtils::ConcurrentBitset::erase
ConcurrentBitset & erase(bit_t bit)
Turn off one bit.
xAOD::details::AuxStoreBase::Members::m_isDecoration
std::vector< bool > m_isDecoration
Per variable lock status (indexed by auxiliary ID)
Definition: AuxStoreBase.h:196
xAOD::AuxSelection::getSelectedAuxIDs
virtual SG::auxid_set_t getSelectedAuxIDs(const SG::auxid_set_t &fullset) const
Return which variables were selected to be written out.
Definition: AuxSelection.cxx:62
checker_macros.h
Define macros for attributes used to control the static checker.
AuxStoreInternal.h
An auxiliary data store that holds data internally.
xAOD::details::AuxStoreBase::isDecoration
virtual bool isDecoration(SG::auxid_t auxid) const override
Test if a variable is a decoration.
Definition: AuxStoreBase.cxx:188
xAOD::details::AuxStoreBase::Members::m_topStore
bool m_topStore
Flag stating whether this is a "top store".
Definition: AuxStoreBase.h:176
python.TransformConfig.attributes
def attributes(self)
Definition: TransformConfig.py:384
xAOD::details::AuxStoreBase::m_selection
AuxSelection m_selection
Object helping to select which auxiliary variables to write.
Definition: AuxStoreBase.h:210
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.