CMS 3D CMS Logo

Classes | Functions
dqmMemoryStats Namespace Reference

Classes

class  HistogramAnalyzer
 

Functions

def displayDirectoryStatistics (stats, args)
 
def kibisize (num, args)
 

Function Documentation

def dqmMemoryStats.displayDirectoryStatistics (   stats,
  args 
)

Definition at line 85 of file dqmMemoryStats.py.

References funct.abs(), ALCARECOTkAlBeamHalo_cff.filter, and kibisize().

85 def displayDirectoryStatistics(stats, args):
86  group_stats = stats.group(args.depth)
87 
88  cutoff, display = args.cutoff * 1024, args.display
89 
90  as_list = [(v, k, ) for (k, v) in group_stats.items()]
91  as_list.sort(reverse=True, key=lambda (v, k): abs(v))
92 
93  if cutoff is not None:
94  as_list = filter(lambda (v, k): abs(v) > cutoff, as_list)
95 
96  if display is not None:
97  as_list = as_list[:display]
98 
99  if args.human:
100  print "*" * 80
101  print (" DQM level %d folder breakdown " % args.depth).center(80, "*")
102  if cutoff:
103  print ("* Size cutoff: %s" % kibisize(cutoff,args)).ljust(79) + "*"
104  if display:
105  print ("* Showing top %d entries." % display).ljust(79) + "*"
106  print "*" * 80
107 
108  for v, k in as_list:
109  if args.human:
110  print kibisize(v,args).ljust(16, " "), k
111  else:
112  print v, k
113 
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def kibisize(num, args)
def displayDirectoryStatistics(stats, args)
def dqmMemoryStats.kibisize (   num,
  args 
)

Definition at line 76 of file dqmMemoryStats.py.

References harvestTrackValidationPlots.str.

Referenced by displayDirectoryStatistics().

76 def kibisize(num,args):
77  pStr="%."+str(args.precision)+"f %s"
78  for prefix in ['KiB','MiB','GiB']:
79  num /= 1024.0
80 
81  if num < 1024.0 or args.units == prefix:
82  return pStr % (num, prefix)
83  return pStr % (num, prefix)
84 
def kibisize(num, args)