2 from array
import array
7 Safely re-build and navigate the directory structure.
10 if not tfile.GetDirectory(dirname):
13 for component
in dirname.split(
'/'):
14 path+=
"/%s" %component
15 if not tfile.GetDirectory(path):
16 gDirectory.mkdir(component)
17 gDirectory.cd(component)
26 Convert an hexadecimal string into a root-object. The correct TStreamerInfo
27 is passed in order to avoid inconsistencies.
29 bitsarray = array(
'B')
30 bitsarray.fromstring(literal.decode(
'hex'))
32 tbuffer = TBufferFile(TBufferFile.kRead)
34 tbuffer.IncrementLevel(tstreamerinfo)
35 tbuffer.SetBuffer(bitsarray,len(bitsarray),
False)
38 if rootType ==
'TPROF':
40 if rootType ==
'TPROF2D':
41 rootType =
'TProfile2D'
43 root_class=eval(rootType+
'.Class()')
45 return tbuffer.ReadObject(root_class)