19#include "AthLinks/DataLinkBase.h"
20#include "AthLinks/ElementLinkBase.h"
21#ifndef XAOD_STANDALONE
41 return reg.getClassName(
id) +
"::" + reg.getName(
id);
71 std::vector<SG::auxid_t> ids (auxids.begin(), auxids.end());
75 std::print (os ,
"{} {}::{} [{}",
76 id, reg.getClassName(
id), reg.getName(
id), reg.getTypeName(
id));
80 std::print (os,
" (atomic)");
82 if (flags & SG::AuxVarFlags::Linked) {
83 std::print (os,
" (linked)");
85 if (decors.test (
id)) {
86 std::print (os,
" (decor)");
89 std::println (os,
"]");
195void convert (std::ostream& os,
const T&
x)
197 std::print (os,
"{}",
x);
201void convert (std::ostream& os,
const char x)
203 std::print (os,
"{}",
static_cast<int>(
x));
207void convert (std::ostream& os,
const unsigned char x)
209 std::print (os,
"{}",
static_cast<unsigned>(
x));
213void convert (std::ostream& os,
const float x)
215 std::print (os,
"{:.3f}",
x);
219void convert (std::ostream& os,
const double x)
221 std::print (os,
"{:.3f}",
x);
225void convert (std::ostream& os,
const SG::JaggedVecEltBase&
x,
size_t i)
227 std::print (os,
"[{},{}]",
x.begin(i),
x.end());
231void convert (std::ostream& os,
const DataLinkBase&
x)
233#ifdef XAOD_STANDALONE
234 std::print (os,
"DataLink[{}]",
x.persKey());
236 std::print (os,
"DataLink[{}/{}]",
x.proxy() ?
x.proxy()->clID() : CLID_NULL,
x.dataID());
241void convert (std::ostream& os,
const ElementLinkBase&
x)
243#ifdef XAOD_STANDALONE
244 std::print (os,
"ElementLink[{}:{}]",
x.persKey(),
x.persIndex());
246 std::print (os,
"ElementLink[{}/{}:{}]",
x.proxy() ?
x.proxy()->clID() : CLID_NULL,
x.dataID(),
x.index());
251void convert (std::ostream& os,
const SG::PackedLinkBase&
x)
253 std::print (os,
"PackedLink[{}/{}]",
x.collection(),
x.index());
258void convert (std::ostream& os,
const std::vector<T>&
x)
260 std::print (os,
"[");
264 for (
decltype(
auto) elt :
x) {
268 std::print (os,
", ");
271 std::print (os,
"]");
287bool operator< (
const AuxVarSort&
a,
const AuxVarSort& b )
289 return a.name <
b.name;
308 std::ostringstream os;
311 const std::type_info* ti =
r.getType(auxid);
312#define CONVERT(T) if (ti == &typeid(T) || strcmp(ti->name(), typeid(T).name())==0) convert (os, *reinterpret_cast<const T*>(p)); else
313#define CONVERT1(T) CONVERT(T) CONVERT(std::vector<T>)
330 std::string tiname = AthContainers_detail::typeinfoName(*ti);
331 if (tiname.starts_with (
"SG::JaggedVecElt<")) {
334 else if (tiname.starts_with (
"DataLink<")) {
335 convert (os, *
reinterpret_cast<const DataLinkBase*
>(p));
337 else if (tiname.starts_with (
"ElementLink<")) {
340 else if (tiname.starts_with (
"SG::PackedLink<")) {
343 else if (tiname.starts_with (
"std::vector<SG::PackedLink<")) {
344 convert (os, *
reinterpret_cast<const std::vector<SG::PackedLinkBase>*
>(p));
347 std::print (os,
"<??? {}>", tiname);
360void dump_aux_vars (std::ostream& os,
const SG::IConstAuxStore& store,
size_t i)
362 if (i >= store.size())
return;
365 std::vector<AuxVarSort> vars (ids.begin(), ids.end());
367 for (
const AuxVarSort& v : vars) {
368 if (reg.isLinked (v.id))
continue;
369 const void* pbeg = store.getData (v.id);
370 size_t eltsz = reg.getEltSize (v.id);
371 const char* p =
reinterpret_cast<const char*
>(pbeg) + eltsz*i;
372 std::println (os,
"{} {}",
376 std::print (os,
" linked: {} ",
aux_var_name (linked_id));
379 std::println (os,
"(missing linkedVector)");
383 const char* lbeg =
reinterpret_cast<const char*
>(lv->
toPtr());
384 size_t leltsz = reg.getEltSize (linked_id);
385 std::print (os,
"[");
387 for (
size_t j = 0; j <
sz; j++) {
391 std::print (os,
", ");
392 const char* p =
reinterpret_cast<const char*
>(lbeg) + leltsz*j;
395 std::println (os,
"]");
429 size_t sz = store.size();
430 for (
size_t i = 0; i <
sz; i++) {
431 std::println (
"=== Element {}", i);
454 const SG::IConstAuxStore* store =
vec.getConstStore();
477 const SG::IConstAuxStore* store =
vec.getConstStore();
Handle mappings between names and auxid_t.
std::vector< size_t > vec
Helper functions intended to be called from the debugger.
bool operator<(const DataVector< T > &a, const DataVector< T > &b)
Vector ordering relation.
Interface for const operations on an auxiliary store.
Definition of JaggedVecElt.
Definition of PackedLink type.
Type-independent part of DataLink; holds the persistent state.
Base class for ElementLinks to vectors of pointers.
Handle mappings between names and auxid_t.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Manage lookup of vectors of auxiliary data.
Abstract interface for manipulating vectors of arbitrary types.
virtual void * toPtr()=0
Return a pointer to the start of the vector's data.
virtual size_t size() const =0
Return the size of the vector.
Describe one element of a jagged vector (base class).
A set of aux data identifiers.
Helper for emitting error messages.
AuxVarFlags
Additional flags to qualify an auxiliary variable.
@ Atomic
Mark that this variable should only be accessed atomically.
static const auxid_t null_auxid
To signal no aux data item.
AuxElement(SG::AuxVectorData *container, size_t index)
Base class for elements of a container that can have aux data.
size_t auxid_t
Identifier for a particular aux data item.
void dump_aux_vars(std::ostream &os, const SG::IConstAuxStore &store, size_t i)
Dump aux variables from a store for a single element.
void print_aux_vars(const SG::auxid_set_t &auxids, const SG::auxid_set_t &decors, std::ostream &os)
Print the list of aux variables in a set.
std::string aux_var_name(SG::auxid_t id)
Return the name corresponding to a given aux id.
std::string aux_var_as_string(SG::auxid_t auxid, const void *p, size_t i)
Convert an aux variable to a string.
void print_aux_var_name(SG::auxid_t id)
Print the name corresponding to a given aux id.
std::unique_ptr< MVAUtils::BDT > convert(TMVA::MethodBDT *bdt, bool isRegression=true, bool useYesNoLeaf=false)
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
A packed version of ElementLink.