2 from __future__
import print_function
7 parser = argparse.ArgumentParser(description=
'List the full name of all MEs for a given run and lumi. ' +
8 'If lumi is omitted, per run MEs will be printed out')
10 parser.add_argument(
'filename', help=
'Name of local root file. For remote files, use edmCopyUtil first: `edmCopyUtil root://cms-xrd-global.cern.ch/<FILEPATH> .`')
11 parser.add_argument(
'-r', type=int, help=
'Run to list MEs of')
12 parser.add_argument(
'-l', type=int, default=0, help=
'Lumisection to list MEs of')
14 args = parser.parse_args()
16 if args.l ==
None or args.l < 0:
17 print(
'Please provide a valid lumisection number')
20 f = uproot.open(args.filename)
22 if b
'Indices;1' in things:
23 indices = f[b
'Indices']
24 runs = indices.array(b
"Run")
25 lumis = indices.array(b
"Lumi")
26 firstindex = indices.array(b
"FirstIndex")
27 lastindex = indices.array(b
"LastIndex")
28 types = indices.array(b
"Type")
31 if args.r ==
None or args.r < 0:
32 print(
'Please provide a valid run number. Runs contained in a given file:')
33 print(
'To figure out which lumisections are available for each run, use dqmiodumpmetadata.py')
52 trees = [f[name][b
"FullName"].
array()
for name
in treenames]
54 for run, lumi, first, last, type
in zip(runs, lumis, firstindex, lastindex, types):
55 if run == args.r
and lumi == args.l:
56 for i
in range(first,
int(last + 1)):
59 print(
"This does not look like DQMIO data.")