66 def getObjectList (objectName, base, verbose = False, memberData = False):
67 """Get a list of interesting things from this object"""
71 rootObjConstructor = getattr (ROOT, objectName)
72 except AttributeError
as missingAttr:
73 if str(missingAttr)
in [
'double',
'int']:
74 print(
"Do not need to describe doubles or ints")
79 obj = rootObjConstructor()
80 alreadySeenFunction = set()
81 vetoedFunction = set()
82 etaFound, phiFound =
False,
False
86 classList = [ ROOT.TClass.GetClass(objectName) ]
87 if verbose:
print(classList)
90 alreadySeenFunction.update(vetoedFunction)
91 vetoedFunction.clear()
92 oneclass = classList.pop (0)
93 print(
"Looking at %s" % oneclass.GetName ())
94 bases = oneclass.GetListOfBases()
95 funcs = oneclass.GetListOfMethods()
97 print(
"baseSize", bases.GetSize())
98 print(
"FunctionMemberSize", funcs.GetSize())
99 for baseIndex
in range( bases.GetSize() ) :
100 classList.append( bases.At(baseIndex).GetClassPointer() )
101 for index
in range( funcs.GetSize() ):
102 funcMember = funcs.At (index)
104 name = funcMember.GetName()
111 if name
in alreadySeenFunction:
114 returnType = funcMember.GetReturnTypeName()
115 goType = root2GOtypeDict.get (returnType,
None)
117 print(
" type", returnType, goType)
119 vetoedTypes.add (returnType)
127 if funcMember.Property() & ROOT.kIsConstMethod
and not funcMember.GetNargs():
128 retval.append( (
"%s.%s()" % (base, name), goType))
129 alreadySeenFunction.add( name )
133 vetoedFunction.add( name )
135 print(
" failed IsConst() and GetNargs()")
138 dataList = oneclass.GetListOfDataMembers()
139 for index
in range( dataList.GetSize() ):
140 data = dataList.At( index );
141 name = data.GetName()
142 dataType = data.GetTypeName()
143 goType = root2GOtypeDict.get (dataType,
None)
147 print(
"name", name,
"dataType", dataType,
"goType", goType)
148 retval.append ( (
"%s.%s" % (base, name), goType) )
150 return retval, etaFound
and phiFound