254 print "Number of branch groups:", len(self.
branchgroups)
255 print "Values of branch groups:", list(self.
branchgroups.keys())
258 blist.sort (
lambda a, b: int(b.filebytes - a.filebytes))
259 pie = ROOT.TPie(
"BranchPie",
"", len(self.
branchgroups))
260 for i, bgroup
in enumerate( blist ):
261 bginfo = bgroup.get_dict(self.
nev)
264 print "Branch group #%d, named %s with size %f = %f%%" % (i , bginfo[
'name'], (float(bgroup.filebytes) / 1024 / self.
nev ), (100. * float(bgroup.filebytes) / float(self.
file_size)) )
266 pie.SetEntryLabel(i, bginfo[
'name'])
267 pie.SetEntryVal (i, (100. * float(bgroup.filebytes) / float(self.
file_size)) )
268 pie.SetEntryFillColor(i, i+2)
271 c1 = ROOT.TCanvas(
'c1' ,
'c1' )
273 pie.SetCircle(.5,.45,.2)
274 pie.SetLabelFormat(
"#splitline{%txt}{(%perc)}")
275 pie.SetLabelFormat(
"%txt")
277 pie.SetTextSize(0.03)
278 pie.SetCircle(0.4808696, 0.7940109, 0.2)
279 pie.SetValueFormat(
"%4.2f")
280 pie.SetLabelFormat(
"%txt")
281 pie.SetPercentFormat(
"%3.1f")
282 pie.SetLabelsOffset(0.005)
283 pie.SetAngularOffset(265.2655)
284 leg = ROOT.TLegend(0.05580866, 0.06554878, 0.785877, 0.4512195)
285 for i, bgroup
in enumerate( blist ):
286 if ( (float(bgroup.filebytes) / float(self.
file_size)) > 0.05):
287 pie.SetEntryRadiusOffset(i,.07)
288 bginfo = bgroup.get_dict(self.
nev)
289 leg.AddEntry( pie.GetSlice(i),
"%s : %1.1lf%%" % (bginfo[
'name'] , 100. * float(bgroup.filebytes) / float(self.
file_size)) ,
"f" )
291 pie.SetEntryLabel(i,
"")
299 c1.SaveAs(options.filename +
"." + options.extension)