ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
D3PDSizeSummary.Branchgroup Class Reference
Collaboration diagram for D3PDSizeSummary.Branchgroup:

Public Member Functions

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

Static Public Member Functions

def print_header ()
 
def print_trailer ()
 

Public Attributes

 name
 
 nbr
 
 totbytes
 
 filebytes
 
 totobj
 
 subgroups
 

Static Public Attributes

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

Detailed Description

Definition at line 55 of file D3PDSizeSummary.py.

Constructor & Destructor Documentation

◆ __init__()

def 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()

def 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 

◆ get_dict()

def 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()

def 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()

def 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()

def 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()

def 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

D3PDSizeSummary.Branchgroup.filebytes

Definition at line 73 of file D3PDSizeSummary.py.

◆ format

string D3PDSizeSummary.Branchgroup.format = tex_format
static

Definition at line 63 of file D3PDSizeSummary.py.

◆ name

D3PDSizeSummary.Branchgroup.name

Definition at line 70 of file D3PDSizeSummary.py.

◆ nbr

D3PDSizeSummary.Branchgroup.nbr

Definition at line 71 of file D3PDSizeSummary.py.

◆ sg_format

string D3PDSizeSummary.Branchgroup.sg_format = sg_tex_format
static

Definition at line 64 of file D3PDSizeSummary.py.

◆ sg_tex_format

string D3PDSizeSummary.Branchgroup.sg_tex_format = tex_format
static

Definition at line 60 of file D3PDSizeSummary.py.

◆ sg_text_format

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

Definition at line 57 of file D3PDSizeSummary.py.

◆ subgroups

D3PDSizeSummary.Branchgroup.subgroups

Definition at line 75 of file D3PDSizeSummary.py.

◆ tex_format

string 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

string 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

D3PDSizeSummary.Branchgroup.totbytes

Definition at line 72 of file D3PDSizeSummary.py.

◆ totobj

D3PDSizeSummary.Branchgroup.totobj

Definition at line 74 of file D3PDSizeSummary.py.


The documentation for this class was generated from the following file:
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
python.Bindings.values
values
Definition: Control/AthenaPython/python/Bindings.py:805
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
add
bool add(const std::string &hname, TKey *tobj)
Definition: fastadd.cxx:55
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
ros2rob_from_partition.print_header
def print_header(dbfile, outname, out)
Definition: ros2rob_from_partition.py:101
readCCLHist.float
float
Definition: readCCLHist.py:83