ATLAS Offline Software
Loading...
Searching...
No Matches
D3PDSizeSummary.Branchgroup Class Reference
Collaboration diagram for D3PDSizeSummary.Branchgroup:

Public Member Functions

 __init__ (self, name)
 get_subgroup (self, b)
 add (self, b)
 get_dict (self, nev)
 print_stats (self, nev)

Static Public Member Functions

 print_header ()
 print_trailer ()

Public Attributes

 name = name
int nbr = 0
int totbytes = 0
int filebytes = 0
int totobj = None
dict subgroups = {}

Static Public Attributes

str text_format = '%(name)-10s %(nbr)5s %(nobj)7s %(nobjper)7s %(totsiz)8s %(totsizper)8s %(filesiz)8s %(filesizper)9s %(comp)4s'
str sg_text_format = text_format.replace ('(name)-', '(name)')
str tex_format = '%(name)-10s&%(nbr)5s&%(nobj)7s&%(nobjper)7s&%(totsiz)8s&%(totsizper)8s&%(filesiz)8s&%(filesizper)9s&%(comp)4s \\\\'
str sg_tex_format = tex_format
str format = tex_format
str sg_format = sg_tex_format

Detailed Description

Definition at line 55 of file D3PDSizeSummary.py.

Constructor & Destructor Documentation

◆ __init__()

D3PDSizeSummary.Branchgroup.__init__ ( self,
name )

Definition at line 69 of file D3PDSizeSummary.py.

69 def __init__ (self, name):
70 self.name = name
71 self.nbr = 0
72 self.totbytes = 0
73 self.filebytes = 0
74 self.totobj = None
75 self.subgroups = {}
76 return
77
78

Member Function Documentation

◆ add()

D3PDSizeSummary.Branchgroup.add ( self,
b )

Definition at line 98 of file D3PDSizeSummary.py.

98 def add (self, b):
99 self.nbr += 1
100 self.totbytes += b.GetTotalSize()
101 self.filebytes += b.GetZipBytes()
102 bname = b.GetName()
103 if bname == self.name + '_n':
104 self.totobj = 0
105 for i in range(b.GetEntries()):
106 b.GetEntry(i)
107 self.totobj += int(b.GetLeaf(bname).GetValue())
108
109 if options.subgroups:
110 sg = self.get_subgroup (b)
111 if sg: sg.add (b)
112
113
114
115 return
116
117
bool add(const std::string &hname, TKey *tobj)
Definition fastadd.cxx:55

◆ get_dict()

D3PDSizeSummary.Branchgroup.get_dict ( self,
nev )

Definition at line 118 of file D3PDSizeSummary.py.

118 def get_dict (self, nev):
119 if self.totobj == None:
120 self.totobj = nev
121
122 d = {}
123 d['name'] = self.name
124 d['nbr'] = `self.nbr`
125 d['nobj'] = `int(self.totobj)`
126 d['nobjper'] = "%.1f" % (float(self.totobj) / nev)
127 d['totsiz'] = "%dk" % int(float(self.totbytes) / 1024 + 0.5)
128 d['totsizper'] = "%.2fk" % (float(self.totbytes) / 1024 / nev )
129 d['filesiz'] = "%dk" % int(float(self.filebytes) / 1024 + 0.5)
130 d['filesizper'] = "%.2fk" % (float(self.filebytes) / 1024 / nev)
131 d['comp'] = "%.2f" % (float(self.totbytes) / self.filebytes)
132 return d
133
134

◆ get_subgroup()

D3PDSizeSummary.Branchgroup.get_subgroup ( self,
b )

Definition at line 79 of file D3PDSizeSummary.py.

79 def get_subgroup (self, b):
80 sglist = subgroups.get (self.name)
81 if not sglist: return None
82 bname = b.GetName()
83 for (sgname, pats) in sglist:
84 for p in pats.split():
85 pp = self.name + '_' + p + '$'
86 if re.match (pp, bname):
87 if sgname[0] == '*':
88 print '***', bname
89 sgname = sgname[1:]
90 sg = self.subgroups.get (sgname)
91 if not sg:
92 sg = Branchgroup (sgname)
93 self.subgroups[sgname] = sg
94 return sg
95 return None
96
97

◆ print_header()

D3PDSizeSummary.Branchgroup.print_header ( )
static

Definition at line 136 of file D3PDSizeSummary.py.

136 def print_header ():
137 if options.TeX:
138 print '\\begin{tabular}{|l|r|r|r|r|r|r|r|r|}'
139 print '\\hline'
140 d = {}
141 d['name'] = 'Name'
142 d['nbr'] = 'Nbr'
143 d['nobj'] = 'Nobj'
144 d['nobjper'] = 'Nobj/ev'
145 d['totsiz'] = 'Totsz'
146 d['totsizper'] = 'Totsz/ev'
147 d['filesiz'] = 'Filesz'
148 d['filesizper'] = 'Filesz/ev'
149 d['comp'] = 'Comp'
150 print Branchgroup.format % d
151 if options.TeX:
152 print '\\hline'
153 return
154

◆ print_stats()

D3PDSizeSummary.Branchgroup.print_stats ( self,
nev )

Definition at line 155 of file D3PDSizeSummary.py.

155 def print_stats (self, nev):
156 print Branchgroup.format % self.get_dict (nev)
157
158 sl = self.subgroups.values()
159 sl.sort (lambda a, b: int(b.filebytes - a.filebytes))
160 for sg in sl:
161 print Branchgroup.sg_format % sg.get_dict (nev)
162 return
163

◆ print_trailer()

D3PDSizeSummary.Branchgroup.print_trailer ( )
static

Definition at line 165 of file D3PDSizeSummary.py.

165 def print_trailer ():
166 if options.TeX:
167 print '\\hline'
168 print '\\end{tabular}'
169 return
170
171

Member Data Documentation

◆ filebytes

int D3PDSizeSummary.Branchgroup.filebytes = 0

Definition at line 73 of file D3PDSizeSummary.py.

◆ format

str D3PDSizeSummary.Branchgroup.format = tex_format
static

Definition at line 63 of file D3PDSizeSummary.py.

◆ name

D3PDSizeSummary.Branchgroup.name = name

Definition at line 70 of file D3PDSizeSummary.py.

◆ nbr

int D3PDSizeSummary.Branchgroup.nbr = 0

Definition at line 71 of file D3PDSizeSummary.py.

◆ sg_format

str D3PDSizeSummary.Branchgroup.sg_format = sg_tex_format
static

Definition at line 64 of file D3PDSizeSummary.py.

◆ sg_tex_format

str D3PDSizeSummary.Branchgroup.sg_tex_format = tex_format
static

Definition at line 60 of file D3PDSizeSummary.py.

◆ sg_text_format

str D3PDSizeSummary.Branchgroup.sg_text_format = text_format.replace ('(name)-', '(name)')
static

Definition at line 57 of file D3PDSizeSummary.py.

◆ subgroups

dict D3PDSizeSummary.Branchgroup.subgroups = {}

Definition at line 75 of file D3PDSizeSummary.py.

◆ tex_format

str D3PDSizeSummary.Branchgroup.tex_format = '%(name)-10s&%(nbr)5s&%(nobj)7s&%(nobjper)7s&%(totsiz)8s&%(totsizper)8s&%(filesiz)8s&%(filesizper)9s&%(comp)4s \\\\'
static

Definition at line 59 of file D3PDSizeSummary.py.

◆ text_format

str D3PDSizeSummary.Branchgroup.text_format = '%(name)-10s %(nbr)5s %(nobj)7s %(nobjper)7s %(totsiz)8s %(totsizper)8s %(filesiz)8s %(filesizper)9s %(comp)4s'
static

Definition at line 56 of file D3PDSizeSummary.py.

◆ totbytes

int D3PDSizeSummary.Branchgroup.totbytes = 0

Definition at line 72 of file D3PDSizeSummary.py.

◆ totobj

int D3PDSizeSummary.Branchgroup.totobj = None

Definition at line 74 of file D3PDSizeSummary.py.


The documentation for this class was generated from the following file: