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 'Indices;1' in things:
23 indices = f[
'Indices']
26 firstindex = indices[
'FirstIndex'].
array()
27 lastindex = indices[
'LastIndex'].
array()
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')
54 trees = [f[name][
"FullName"].
array()
for name
in treenames]
56 for run, lumi, first, last, type
in zip(runs, lumis, firstindex, lastindex, types):
57 if run == args.r
and lumi == args.l:
58 for i
in range(first, int(last + 1)):
61 print(
"This does not look like DQMIO data.")
const uint16_t range(const Frame &aFrame)
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)