22 '''Recursive function to find all contents in a given ROOT file'''
23 keys = in_tfile.GetDirectory(full_path).GetListOfKeys()
26 classname = key.GetClassName()
27 if 'TDirectory' in classname:
32 if options.name
and name != options.name:
continue
33 full_name =
'/'.
join([full_path,name])
34 obj = in_tfile.Get(full_name)
37 simple_name = full_name[2:]
38 print "%s" % simple_name,
39 for arg
in [x[2:]
for x
in sys.argv
if x.startswith(
"--")]:
40 if "classname" == arg:
41 print "%s" % classname,
42 if obj.InheritsFrom(
'TH1'):
44 print " %i" % obj.GetEntries(),
46 if obj.InheritsFrom(
'TH2'):
49 for j
in reversed(range(obj.GetNbinsY())):
51 print " %s" %
' '.
join(
52 [str(obj.GetBinContent(i+1, j+1))
for i
in range(obj.GetNbinsX())]),
54 print " %s" %
' '.
join(
55 [str(obj.GetBinContent(i+1))
for i
in range(obj.GetNbinsX())]),
57 if obj.InheritsFrom(
'TH2'):
58 for j
in reversed(range(obj.GetNbinsY())):
60 print " %s" %
' '.
join(
61 [str(obj.GetBinError(i+1, j+1))
for i
in range(obj.GetNbinsX())]),
63 print " %s" %
' '.
join(
64 [str(obj.GetBinError(i+1))
for i
in range(obj.GetNbinsX())]),
65 if "bincenter" == arg:
66 print " %s" %
' '.
join(
67 [str(obj.GetBinCenter(i+1))
for i
in range(obj.GetNbinsX())]),
69 print " %i" % obj.GetMaximum(),
71 print " %i" % obj.GetMinimum(),
73 print " %i" % obj.GetBinContent(obj.GetNbinsX()),
74 if "underflow" == arg:
75 print " %i" % obj.GetBinContent(0),
76 if obj.InheritsFrom(
'TGraph'):
78 x, y = Double(0), Double(0)
81 for i
in range(obj.GetN()):
83 xvals.append(copy.copy(x))
84 yvals.append(copy.copy(y))
85 for point
in zip(xvals,yvals):
86 print " (%d, %d)" % point,
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)