ATLAS Offline Software
Functions
SGdebug Namespace Reference

Functions

std::string aux_var_name (SG::auxid_t id)
 Return the name corresponding to a given aux id. More...
 
void print_aux_var_name (SG::auxid_t id)
 Print the name corresponding to a given aux id. More...
 
void print_aux_vars (const SG::auxid_set_t &auxids)
 Print the list of aux variables in a set. More...
 
void print_aux_vars (const SG::IConstAuxStore &store)
 Print the list of aux variables handled by a store. More...
 
void print_aux_vars (const SG::IConstAuxStore *store)
 Print the list of aux variables handled by a store. More...
 
void print_aux_vars (const SG::AuxVectorData &vec)
 Print the list of aux variables associated with a container. More...
 
void print_aux_vars (const SG::AuxVectorData *vec)
 Print the list of aux variables associated with a container. More...
 
void print_aux_vars (const SG::AuxElement &elt)
 Print the list of aux variables associated with an element. More...
 
void print_aux_vars (const SG::AuxElement *elt)
 Print the list of aux variables associated with an element. More...
 
std::string aux_var_as_string (SG::auxid_t auxid, const void *p)
 Convert an aux variable to a string. More...
 
void dump_aux_vars (const SG::IConstAuxStore &store, size_t i)
 Dump aux variables from a store for a single element. More...
 
void dump_aux_vars (const SG::IConstAuxStore *store, size_t i)
 Dump aux variables from a store for a single element. More...
 
void dump_aux_vars (const SG::IConstAuxStore &store)
 Dump aux variables from a store for all elements. More...
 
void dump_aux_vars (const SG::IConstAuxStore *store)
 Dump aux variables from a store for all elements. More...
 
void dump_aux_vars (const SG::AuxVectorData &vec, size_t i)
 Dump aux variables from a vector for a single element. More...
 
void dump_aux_vars (const SG::AuxVectorData *vec, size_t i)
 Dump aux variables from a vector for a single element. More...
 
void dump_aux_vars (const SG::AuxVectorData &vec)
 Dump aux variables from a vector for all elements. More...
 
void dump_aux_vars (const SG::AuxVectorData *vec)
 Dump aux variables from a vector for all elements. More...
 
void dump_aux_vars (const SG::AuxElement &elt)
 Dump aux variables for an element. More...
 
void dump_aux_vars (const SG::AuxElement *elt)
 Dump aux variables for an element. More...
 

Function Documentation

◆ aux_var_as_string()

std::string SGdebug::aux_var_as_string ( SG::auxid_t  auxid,
const void *  p 
)

Convert an aux variable to a string.

Parameters
auxidThe id of the variable.
pPointer to the location of the variable.

Definition at line 211 of file Control/AthContainers/Root/debug.cxx.

212 {
213  std::ostringstream os;
214 
216  const std::type_info* ti = r.getType(auxid);
217 #define CONVERT(T) if (ti == &typeid(T)) convert (os, *reinterpret_cast<const T*>(p)); else
218 #define CONVERT1(T) CONVERT(T) CONVERT(std::vector<T>)
219  CONVERT1 (int)
220  CONVERT1 (unsigned int)
221  CONVERT1 (short)
222  CONVERT1 (unsigned short)
223  CONVERT1 (char)
224  CONVERT1 (unsigned char)
225  CONVERT1 (long)
226  CONVERT1 (unsigned long)
227  CONVERT1 (long long)
228  CONVERT1 (unsigned long long)
229  CONVERT1 (float)
230  CONVERT1 (double)
231  CONVERT1 (bool)
232  CONVERT1 (std::string)
233  //else
234  os << "<??? " << AthContainers_detail::typeinfoName(*ti) << ">";
235  return os.str();
236 }

◆ aux_var_name()

std::string SGdebug::aux_var_name ( SG::auxid_t  id)

Return the name corresponding to a given aux id.

Parameters
idThe aux id to look up.

Definition at line 30 of file Control/AthContainers/Root/debug.cxx.

31 {
33  return reg.getClassName(id) + "::" + reg.getName(id);
34 }

◆ dump_aux_vars() [1/10]

void SGdebug::dump_aux_vars ( const SG::AuxElement elt)

Dump aux variables for an element.

Parameters
eltThe element from which to dump.

Definition at line 369 of file Control/AthContainers/Root/debug.cxx.

370 {
371  const SG::AuxVectorData* cont = elt.container();
372  if (cont)
373  dump_aux_vars (*cont, elt.index());
374 }

◆ dump_aux_vars() [2/10]

void SGdebug::dump_aux_vars ( const SG::AuxElement elt)

Dump aux variables for an element.

Parameters
eltThe element from which to dump.

Definition at line 381 of file Control/AthContainers/Root/debug.cxx.

382 {
383  dump_aux_vars (*elt);
384 }

◆ dump_aux_vars() [3/10]

void SGdebug::dump_aux_vars ( const SG::AuxVectorData vec)

Dump aux variables from a vector for all elements.

Parameters
vecThe vector from which to dump.

Definition at line 347 of file Control/AthContainers/Root/debug.cxx.

348 {
349  const SG::IConstAuxStore* store = vec.getConstStore();
350  if (store)
351  dump_aux_vars (*store);
352 }

◆ dump_aux_vars() [4/10]

void SGdebug::dump_aux_vars ( const SG::AuxVectorData vec,
size_t  i 
)

Dump aux variables from a vector for a single element.

Parameters
vecThe vector from which to dump.
iThe index of the element to dump.

Definition at line 324 of file Control/AthContainers/Root/debug.cxx.

325 {
326  const SG::IConstAuxStore* store = vec.getConstStore();
327  if (store)
328  dump_aux_vars (*store, i);
329 }

◆ dump_aux_vars() [5/10]

void SGdebug::dump_aux_vars ( const SG::AuxVectorData vec)

Dump aux variables from a vector for all elements.

Parameters
vecThe vector from which to dump.

Definition at line 359 of file Control/AthContainers/Root/debug.cxx.

360 {
361  dump_aux_vars (*vec);
362 }

◆ dump_aux_vars() [6/10]

void SGdebug::dump_aux_vars ( const SG::AuxVectorData vec,
size_t  i 
)

Dump aux variables from a vector for a single element.

Parameters
vecThe vector from which to dump.
iThe index of the element to dump.

Definition at line 337 of file Control/AthContainers/Root/debug.cxx.

338 {
339  dump_aux_vars (*vec, i);
340 }

◆ dump_aux_vars() [7/10]

void SGdebug::dump_aux_vars ( const SG::IConstAuxStore store)

Dump aux variables from a store for all elements.

Parameters
storeThe store from which to dump.

Definition at line 299 of file Control/AthContainers/Root/debug.cxx.

300 {
301  size_t sz = store.size();
302  for (size_t i = 0; i < sz; i++) {
303  std::cout << "=== Element " << i << "\n";
304  dump_aux_vars (store, i);
305  }
306 }

◆ dump_aux_vars() [8/10]

void SGdebug::dump_aux_vars ( const SG::IConstAuxStore store,
size_t  i 
)

Dump aux variables from a store for a single element.

Parameters
storeThe store from which to dump.
iThe index of the element to dump.

Definition at line 244 of file Control/AthContainers/Root/debug.cxx.

245 {
246  if (i >= store.size()) return;
248  const SG::auxid_set_t& ids = store.getAuxIDs();
249  std::vector<AuxVarSort> vars (ids.begin(), ids.end());
250  std::sort (vars.begin(), vars.end());
251  for (const AuxVarSort& v : vars) {
252  if (reg.isLinked (v.id)) continue;
253  const void* pbeg = store.getData (v.id);
254  size_t eltsz = reg.getEltSize (v.id);
255  const char* p = reinterpret_cast<const char*>(pbeg) + eltsz*i;
256  std::cout << v.name << " " << aux_var_as_string (v.id, p) << "\n";
257  SG::auxid_t linked_id = reg.linkedVariable (v.id);
258  if (linked_id != SG::null_auxid) {
259  std::cout << " linked: " << aux_var_name (linked_id) << " ";
260  const SG::IAuxTypeVector* lv = store.linkedVector (v.id);
261  if (!lv) {
262  std::cout << "(missing linkedVector)\n";
263  continue;
264  }
265  size_t sz = lv->size();
266  const char* lbeg = reinterpret_cast<const char*>(lv->toPtr());
267  size_t leltsz = reg.getEltSize (linked_id);
268  std::cout << "[";
269  bool first = true;
270  for (size_t j = 0; j < sz; j++) {
271  if (first)
272  first = false;
273  else
274  std::cout << ", ";
275  const char* p = reinterpret_cast<const char*>(lbeg) + leltsz*j;
276  std::cout << aux_var_as_string (linked_id, p);
277  }
278  std::cout << "]\n";
279  }
280  }
281 }

◆ dump_aux_vars() [9/10]

void SGdebug::dump_aux_vars ( const SG::IConstAuxStore store)

Dump aux variables from a store for all elements.

Parameters
storeThe store from which to dump.

Definition at line 313 of file Control/AthContainers/Root/debug.cxx.

314 {
315  dump_aux_vars (*store);
316 }

◆ dump_aux_vars() [10/10]

void SGdebug::dump_aux_vars ( const SG::IConstAuxStore store,
size_t  i 
)

Dump aux variables from a store for a single element.

Parameters
storeThe store from which to dump.
iThe index of the element to dump.

Definition at line 289 of file Control/AthContainers/Root/debug.cxx.

290 {
291  dump_aux_vars (*store, i);
292 }

◆ print_aux_var_name()

void SGdebug::print_aux_var_name ( SG::auxid_t  id)

Print the name corresponding to a given aux id.

Parameters
idThe aux id to print.

Definition at line 41 of file Control/AthContainers/Root/debug.cxx.

42 {
43  std::cout << aux_var_name(id) << "\n";
44 }

◆ print_aux_vars() [1/7]

void SGdebug::print_aux_vars ( const SG::AuxElement elt)

Print the list of aux variables associated with an element.

Parameters
eltThe element to dump.

Definition at line 124 of file Control/AthContainers/Root/debug.cxx.

125 {
126  print_aux_vars (elt.getAuxIDs());
127 }

◆ print_aux_vars() [2/7]

void SGdebug::print_aux_vars ( const SG::AuxElement elt)

Print the list of aux variables associated with an element.

Parameters
eltThe element to dump.

Definition at line 134 of file Control/AthContainers/Root/debug.cxx.

135 {
136  print_aux_vars (*elt);
137 }

◆ print_aux_vars() [3/7]

void SGdebug::print_aux_vars ( const SG::auxid_set_t auxids)

Print the list of aux variables in a set.

Parameters
auxidsThe set to print.

Definition at line 56 of file Control/AthContainers/Root/debug.cxx.

57 {
59  std::vector<SG::auxid_t> ids (auxids.begin(), auxids.end());
60  std::sort (ids.begin(), ids.end());
61 
62  for (SG::auxid_t id : ids) {
63  std::cout << id << " "
64  << reg.getClassName(id) << "::" << reg.getName(id) << " "
65  << "[" << reg.getTypeName(id);
66 
67  SG::AuxVarFlags flags = reg.getFlags(id);
69  std::cout << " (atomic)";
70  }
72  std::cout << " (linked)";
73  }
74 
75  std::cout << "]\n";
76  }
77 }

◆ print_aux_vars() [4/7]

void SGdebug::print_aux_vars ( const SG::AuxVectorData vec)

Print the list of aux variables associated with a container.

Parameters
vecThe container to dump.

Definition at line 104 of file Control/AthContainers/Root/debug.cxx.

105 {
106  print_aux_vars (vec.getAuxIDs());
107 }

◆ print_aux_vars() [5/7]

void SGdebug::print_aux_vars ( const SG::AuxVectorData vec)

Print the list of aux variables associated with a container.

Parameters
vecThe container to dump.

Definition at line 114 of file Control/AthContainers/Root/debug.cxx.

115 {
116  print_aux_vars (*vec);
117 }

◆ print_aux_vars() [6/7]

void SGdebug::print_aux_vars ( const SG::IConstAuxStore store)

Print the list of aux variables handled by a store.

Parameters
storeThe store to dump.

Definition at line 84 of file Control/AthContainers/Root/debug.cxx.

85 {
86  print_aux_vars (store.getAuxIDs());
87 }

◆ print_aux_vars() [7/7]

void SGdebug::print_aux_vars ( const SG::IConstAuxStore store)

Print the list of aux variables handled by a store.

Parameters
storeThe store to dump.

Definition at line 94 of file Control/AthContainers/Root/debug.cxx.

95 {
97 }
beamspotman.r
def r
Definition: beamspotman.py:676
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:69
SGdebug::aux_var_as_string
std::string aux_var_as_string(SG::auxid_t auxid, const void *p)
Convert an aux variable to a string.
Definition: Control/AthContainers/Root/debug.cxx:211
fitman.sz
sz
Definition: fitman.py:527
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
SG::AuxTypeRegistry::instance
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Definition: AuxTypeRegistry.cxx:49
AthenaPoolTestRead.flags
flags
Definition: AthenaPoolTestRead.py:8
CxxUtils::ConcurrentBitset::end
const_iterator end() const
Return an end iterator.
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
python.DomainsRegistry.reg
reg
globals -----------------------------------------------------------------—
Definition: DomainsRegistry.py:343
SGdebug::print_aux_vars
void print_aux_vars(const SG::auxid_set_t &auxids)
Print the list of aux variables in a set.
Definition: Control/AthContainers/Root/debug.cxx:56
SG::AuxTypeRegistry
Handle mappings between names and auxid_t.
Definition: AuxTypeRegistry.h:62
SG::Linked
@ Linked
Mark that this variable is linked to another one.
Definition: AuxTypes.h:77
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
lumiFormat.i
int i
Definition: lumiFormat.py:92
SG::AuxElement::getAuxIDs
const SG::auxid_set_t & getAuxIDs() const
Return a set of identifiers for existing data items for this object.
Definition: AuxElement.cxx:335
SG::AuxElement::index
size_t index() const
Return the index of this element within its container.
SG::AuxVarFlags
AuxVarFlags
Additional flags to qualify an auxiliary variable.
Definition: AuxTypes.h:58
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
CxxUtils::ConcurrentBitset::begin
const_iterator begin() const
Return a begin iterator.
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
SG::Atomic
@ Atomic
Mark that this variable should only be accessed atomically.
Definition: AuxTypes.h:70
python.PyAthena.v
v
Definition: PyAthena.py:157
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
CONVERT1
#define CONVERT1(T)
DeMoScan.first
bool first
Definition: DeMoScan.py:534
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
SGdebug::dump_aux_vars
void dump_aux_vars(const SG::IConstAuxStore &store, size_t i)
Dump aux variables from a store for a single element.
Definition: Control/AthContainers/Root/debug.cxx:244
SG::AuxVectorData
Manage lookup of vectors of auxiliary data.
Definition: AuxVectorData.h:167
SG::AuxElement::container
const SG::AuxVectorData * container() const
Return the container holding this element.
SG::IConstAuxStore
Interface for const operations on an auxiliary store.
Definition: IConstAuxStore.h:64
SG::IAuxTypeVector::size
virtual size_t size() const =0
Return the size of the vector.
SGdebug::aux_var_name
std::string aux_var_name(SG::auxid_t id)
Return the name corresponding to a given aux id.
Definition: Control/AthContainers/Root/debug.cxx:30
SG::IAuxTypeVector::toPtr
virtual void * toPtr()=0
Return a pointer to the start of the vector's data.