ATLAS Offline Software
Loading...
Searching...
No Matches
DebugUtils.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef _ExpressionEvaluation_DebugUtils_h_
5#define _ExpressionEvaluation_DebugUtils_h_
6#include <string>
7#include <iostream>
8#include "Utils.h"
9
10namespace ExpressionParsing {
11
13 template <class T>
14 void dumpAuxId(const T &cont, SG::auxid_t method_id ) {
15 std::string name;
16 std::string class_name;
17 std::string type_name;
18 std::string vec_name;
19 bool is_avaail=false;
20 try {
21 is_avaail=isAvailable (cont, method_id);
22 }
23 catch (...) {
24 }
25 try {
26 name = SG::AuxTypeRegistry::instance().getName(method_id);
27 }
28 catch (...) {
29 }
30 try {
31 class_name = SG::AuxTypeRegistry::instance().getClassName(method_id);
32 }
33 catch (...) {
34 }
35 try {
36 type_name = SG::AuxTypeRegistry::instance().getTypeName(method_id);
37 }
38 catch (...) {
39 }
40 try {
41 vec_name = SG::AuxTypeRegistry::instance().getVecTypeName(method_id);
42 }
43 catch (...) {
44 }
45 std::cout << "DEBUG SGxAODProxyLoader aux " << method_id << " : " << name << " -> "
46 << " class=" << class_name
47 << " type=" << type_name
48 << " type=" << vec_name
49 << " avail=" << is_avaail
50 << std::endl;
51 }
52
54 template <class T>
55 void dumpAux(const T &cont, SG::auxid_t method_id) {
56 dumpAuxId(cont, method_id);
57 for ( auto id : cont.getAuxIDs()) {
58 dumpAuxId(cont,id);
59 }
60 }
61
64 template <class T>
65 void dumpDeclare(const T *key) {
66 if (key) {
67 std::string type_name;
68 const SG::BaseInfoBase* base_info = SG::BaseInfoBase::find (key->clid());
69 if (base_info) {
70 type_name =base_info->typeinfo().name();
71 }
72 std::cout << "DEBUG SGxAODProxyLoader declare " << key->key() << " -> " << type_name << std::endl;
73 }
74 }
75}
76#endif
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
std::string getTypeName(SG::auxid_t auxid) const
Return the type name of an aux data item.
std::string getVecTypeName(SG::auxid_t auxid) const
Return the type of the STL vector used to hold an aux data item.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
std::string getClassName(SG::auxid_t auxid) const
Return the class name associated with an aux data item (may be blank).
The non-template portion of the BaseInfo implementation.
static const BaseInfoBase * find(CLID clid)
Find the BaseInfoBase instance for clid.
Definition BaseInfo.cxx:570
const std::type_info & typeinfo() const
Return the std::type_info for this class.
Definition BaseInfo.cxx:151
Namespace holding all the expression evaluation code.
bool isAvailable(const T_Aux &cont, SG::auxid_t auxid)
void dumpAuxId(const T &cont, SG::auxid_t method_id)
Method for debugging to dump information for the given aux member.
Definition DebugUtils.h:14
void dumpDeclare(const T *key)
Function for debugging which dumps information about newly declared data handles.
Definition DebugUtils.h:65
void dumpAux(const T &cont, SG::auxid_t method_id)
Method for debugging to dump information of all aux member of the given container and the specific au...
Definition DebugUtils.h:55
size_t auxid_t
Identifier for a particular aux data item.
Definition AuxTypes.h:27