ATLAS Offline Software
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 
10 namespace 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 {
27  }
28  catch (...) {
29  }
30  try {
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
SG::AuxTypeRegistry::instance
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Definition: AuxTypeRegistry.cxx:639
SG::AuxTypeRegistry::getName
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
Definition: AuxTypeRegistry.cxx:881
SG::AuxTypeRegistry::getVecTypeName
std::string getVecTypeName(SG::auxid_t auxid) const
Return the type of the STL vector used to hold an aux data item.
Definition: AuxTypeRegistry.cxx:951
ExpressionParsing::isAvailable
bool isAvailable(const T_Aux &cont, SG::auxid_t auxid)
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
SG::AuxTypeRegistry::getTypeName
std::string getTypeName(SG::auxid_t auxid) const
Return the type name of an aux data item.
Definition: AuxTypeRegistry.cxx:923
Utils.h
ExpressionParsing
Namespace holding all the expression evaluation code.
Definition: ExpressionParser.h:26
SG::AuxTypeRegistry::getClassName
std::string getClassName(SG::auxid_t auxid) const
Return the class name associated with an aux data item (may be blank).
Definition: AuxTypeRegistry.cxx:895
ExpressionParsing::dumpAuxId
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
ExpressionParsing::dumpAux
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
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SG::BaseInfoBase::find
static const BaseInfoBase * find(CLID clid)
Find the BaseInfoBase instance for clid.
Definition: BaseInfo.cxx:569
ExpressionParsing::dumpDeclare
void dumpDeclare(const T *key)
Function for debugging which dumps information about newly declared data handles.
Definition: DebugUtils.h:65
SG::BaseInfoBase
The non-template portion of the BaseInfo implementation.
Definition: Control/AthenaKernel/AthenaKernel/BaseInfo.h:451
SG::BaseInfoBase::typeinfo
const std::type_info & typeinfo() const
Return the std::type_info for this class.
Definition: BaseInfo.cxx:151
python.DetectStreamerInfoChanges.class_name
class_name
Definition: DetectStreamerInfoChanges.py:60
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37