ATLAS Offline Software
Loading...
Searching...
No Matches
python.root_lsr_rank Namespace Reference

Functions

 dumpdir (d)

Variables

 parser = argparse.ArgumentParser()
 help
 default
 choices
 action
 args = parser.parse_args()
 ordering = args.rankorder
dict accounting = {}
dict hashes = {}
dict types = {}
 f = ROOT.TFile.Open(args.filename)
 d = f.Get(args.path.rstrip('/'))
 key = lambda x: (x[1][1], x[1][0], x[0])
 sortedl = sorted(accounting.items(), key=key, reverse=True)

Function Documentation

◆ dumpdir()

python.root_lsr_rank.dumpdir ( d)

Definition at line 42 of file root_lsr_rank.py.

42def dumpdir(d):
43 thispath = d.GetPath()
44 if ':' in thispath:
45 thispath = thispath.split(':', 1)[1]
46 #print (thispath)
47 subdirs = []
48 for k in d.GetListOfKeys():
49 if not args.metadata and k.GetName() == 'metadata' and k.GetClassName() == 'TTree':
50 continue
51 if k.GetClassName().startswith('TDirectory'):
52 subdirs.append(k)
53 else:
54 if args.hash:
55 #lhash = ROOT.bufferhash(k)
56 #objsize = (k.GetNbytes()-k.GetKeylen())/8
57 #print ((k.GetNbytes()-k.GetKeylen())/8.)
58 #buf = ROOT.getbuffer(k); buf.SetSize(objsize)
59 #print (buf[objsize-1], objsize)
60 #lhash = zlib.adler32(str(buf))
61 #k.DeleteBuffer()
62 #obj=k.ReadObj();
63 #tm=ROOT.TMessage(ROOT.TMessage.kMESS_OBJECT)
64 #tm.WriteObject(obj)
65 lhash = ROOT.bufferhash2(k)
66 #obj.IsA().Destructor(obj)
67 #lhash = 0
68 else:
69 lhash = 0
70 idxname = os.path.join(thispath, k.GetName())
71 accounting[idxname] = (k.GetObjlen(), k.GetNbytes()-k.GetKeylen())
72 hashes[idxname] = lhash
73 types[idxname] = k.GetClassName()
74 #print ('%s,' % os.path.join(thispath, k.GetName()), end='')
75 #obj = k.ReadObj(); obj.IsA().Destructor(obj)
76 #print ('OK')
77 for k in subdirs:
78 dumpdir(k.ReadObj())
79

Variable Documentation

◆ accounting

dict python.root_lsr_rank.accounting = {}

Definition at line 33 of file root_lsr_rank.py.

◆ action

python.root_lsr_rank.action

Definition at line 25 of file root_lsr_rank.py.

◆ args

python.root_lsr_rank.args = parser.parse_args()

Definition at line 29 of file root_lsr_rank.py.

◆ choices

python.root_lsr_rank.choices

Definition at line 21 of file root_lsr_rank.py.

◆ d

python.root_lsr_rank.d = f.Get(args.path.rstrip('/'))

Definition at line 82 of file root_lsr_rank.py.

◆ default

python.root_lsr_rank.default

Definition at line 20 of file root_lsr_rank.py.

◆ f

python.root_lsr_rank.f = ROOT.TFile.Open(args.filename)

Definition at line 80 of file root_lsr_rank.py.

◆ hashes

dict python.root_lsr_rank.hashes = {}

Definition at line 34 of file root_lsr_rank.py.

◆ help

python.root_lsr_rank.help

Definition at line 19 of file root_lsr_rank.py.

◆ key

python.root_lsr_rank.key = lambda x: (x[1][1], x[1][0], x[0])

Definition at line 92 of file root_lsr_rank.py.

◆ ordering

python.root_lsr_rank.ordering = args.rankorder

Definition at line 31 of file root_lsr_rank.py.

◆ parser

python.root_lsr_rank.parser = argparse.ArgumentParser()

Definition at line 17 of file root_lsr_rank.py.

◆ sortedl

python.root_lsr_rank.sortedl = sorted(accounting.items(), key=key, reverse=True)

Definition at line 97 of file root_lsr_rank.py.

◆ types

dict python.root_lsr_rank.types = {}

Definition at line 35 of file root_lsr_rank.py.