12 #include <TInterpreter.h>
14 #include <TClassGenerator.h>
15 #include <TClassEdit.h>
35 class xAODClassGenerator :
public TClassGenerator
38 using TClassGenerator::GetClass;
39 virtual TClass *GetClass(
const char* classname, Bool_t
load)
override;
40 virtual TClass *GetClass(
const std::type_info& , Bool_t )
override
44 static thread_local
bool m_active;
47 BeActive() { m_active =
true; }
48 ~BeActive() { m_active =
false; }
55 thread_local
bool xAODClassGenerator::m_active =
false;
58 TClass* xAODClassGenerator::GetClass(
const char* classname, Bool_t
load)
60 static const std::string prefs[] = {
61 "SG::AuxTypeVectorFactory<",
67 if (m_active)
return nullptr;
68 for (
const std::string& pref : prefs) {
69 if (strncmp (classname,
pref.c_str(),
pref.size()) == 0) {
75 R__WRITE_LOCKGUARD(ROOT::gCoreMutex);
76 TClassEdit::TSplitType
s (classname);
77 if (
s.fElements.size() >= 2) {
78 eltName =
s.fElements[1];
81 if (!eltName.empty()) {
82 TClass::GetClass (eltName.c_str(),
load);
84 return TClass::GetClass (classname,
load);
107 static std::once_flag libLoadFlag;
108 std::call_once( libLoadFlag, []( TInterpreter& interpreter ) {
112 interpreter.LoadLibraryMap();
113 interpreter.SetClassAutoloading(
true );
116 if( ! TClass::GetClass(
"DataVector<xAOD::TDVCollectionProxyDummy>" ) ) {
117 ::Error(
"xAOD::AddDVProxy::loadDictionaries",
118 "Couldn't load the dictionary for "
119 "DataVector<xAOD::TDVCollectionProxyDummy>" );