2 from __future__
import print_function
3 from sys
import stderr, exit
13 from optparse
import OptionParser
14 parser = OptionParser(usage=
"usage: %prog [options] ")
15 parser.add_option(
"--firstRun", dest=
"firstRun", help=
"first run", type=
"int", metavar=
"RUN", default=
"1")
16 parser.add_option(
"--lastRun", dest=
"lastRun", help=
"last run", type=
"int", metavar=
"RUN", default=
"9999999")
17 parser.add_option(
"--groupName", dest=
"groupName", help=
"select runs of name like NAME", metavar=
"NAME", default=
"Collisions%")
18 parser.add_option(
"--HLTkey", dest=
"HLTkey", help=
"name of the HLTkey e.g. /cdaq/physics/Run2010/v3.1/HLT_1.6E30/V1",metavar=
"HLT")
19 parser.add_option(
"--perKey", action=
"store_true",default=
False,dest=
"perKey",help=
"list the runs per HLT key",metavar=
"perKey")
20 (options, args) = parser.parse_args()
22 from queryRR
import queryRR
24 runKeys =
queryRR(options.firstRun,options.lastRun,options.groupName)
25 runs = runKeys.keys(); runs.sort()
31 if not key
in runsPerKey.keys():
34 runsPerKey[key] = tmpruns
36 runsPerKey[key].
append(run)
37 theKeys = runsPerKey.keys()
39 theruns = runsPerKey[key]
47 HLTkey = options.HLTkey
48 print(
"List of runs taken with HLT key = ",HLTkey)
52 if not options.HLTkey:
55 if key == options.HLTkey:
S & print(S &os, JobReport::InputFile const &f)