4 from optparse
import OptionParser
8 self.
parser = OptionParser(usage=
"usage: %prog options")
9 self.
parser.add_option(
"-r",
13 help =
"A list of run ranges 90923,89500-89600,92050-" )
15 self.
parser.add_option(
"-t",
19 help =
"A list of time ranges 10.9.2008-30.9.2008,15.10.2008-" )
21 self.
parser.add_option(
"-p",
24 help =
"The partition name [default: %DEFAULT]" )
26 self.
parser.add_option(
"--readyforphysics",
27 dest =
"readyforphysics",
28 help =
"ReadyForPhysics flag" )
30 self.
parser.add_option(
"--db",
33 choices = [
'COMP200',
'CONDBR2',
'OFLP200',
'DATA',
'MC'],
34 help =
"The detabase [default: %DEFAULT]" )
36 self.
parser.add_option(
"-c",
39 help =
"The top conditions tag" )
41 self.
parser.add_option(
"-l",
44 help =
"The duration limit of a run in seconds e.g.: -l 36000 (longer than 10 hours) or -l 300- (less than 5 minutes)" )
46 self.
parser.add_option(
"-e",
49 help =
"Number of events (EF accepts) in run e.g. 10000-20000" )
51 self.
parser.add_option(
"--allevents",
53 help =
"Shows number of EFA/SFO/L1A/L2A events in selected runs e.g. 10000-20000" )
55 self.
parser.add_option(
"-k",
58 help =
"A list of smks 359,365,372-" )
60 self.
parser.add_option(
"-b",
63 choices = [
'on',
'off',
'solenoidon',
'solenoidoff',
'toroidon',
'toroidoff'],
65 help =
"Bfield ['on', 'off', 'solenoidon', 'solenoidoff', 'toroidon', 'toroidoff']" )
67 self.
parser.add_option(
"-q",
71 help =
"Data quality flags, e.g. --dq 'PIXB green SHIFTOFL'" )
73 self.
parser.add_option(
"--detmaskin",
76 help =
"Detector mask, e.g. --detmaskin 0x3123 " )
78 self.
parser.add_option(
"--detmaskout",
81 help =
"Detector mask of absent detectors, e.g. --detmaskout 0x2174 " )
83 self.
parser.add_option(
"--filenametag",
85 help =
"Filename tag, e.g. --filenametag !data_test " )
87 self.
parser.add_option(
"--projecttag",
89 help =
"Project tag, e.g. --projecttag !data_test " )
91 self.
parser.add_option(
"-s",
95 help =
"List of items to query" )
97 self.
parser.add_option(
"--streams",
100 help =
'Streams, --streams "phy*" ' )
102 self.
parser.add_option(
"--trigger",
105 help =
'Triggers, --trigger "EF_Electron*" ' )
107 self.
parser.add_option(
"--release",
110 help =
'Release, --release "14.2.5-14.3.1" ' )
112 self.
parser.add_option(
"--luminosity",
115 help =
'Luminosity, --luminosit' )
117 self.
parser.add_option(
"--olclumi",
120 help =
'olclumi, --olclumi "1ub+"' )
122 self.
parser.add_option(
"--olcfillparams",
124 dest =
"olcfillparams",
125 help =
'olcfillparams, --olcfillparams "channel"' )
127 self.
parser.add_option(
"--beamspot",
130 help =
'Beamspot, --beamspot' )
132 self.
parser.add_option(
"--bpm",
135 help =
'BPM, --bpm' )
137 self.
parser.add_option(
"--datasets",
140 help =
'Datasets, --datasets *NTUP*' )
142 self.
parser.add_option(
"--ami",
145 help =
'Ami, --ami' )
147 self.
parser.add_option(
"--larcond",
150 help =
'Larcond, --larcond "nsamples 7"' )
152 self.
parser.add_option(
"--lhc",
155 help =
'LHC information, --lhc "fillnumber 851"' )
157 self.
parser.add_option(
"--summary",
160 help =
'Print summary, --summary ' )
162 self.
parser.add_option(
"--dqeff",
165 help =
'Print DQ efficiency summary, --dqeff ' )
167 self.
parser.add_option(
"-v",
171 help =
"Verbosity level" )
173 self.
parser.add_option(
"--noroot",
174 action =
"store_false",
176 help =
"Do not create root files and python dict" )
178 self.
parser.add_option(
"--root",
179 action =
"store_true",
181 help =
"Do create root files and python dict" )
183 self.
parser.add_option(
"--nohtml",
184 action =
"store_false",
186 help =
"Text output instead of html" )
188 self.
parser.add_option(
"--html",
189 action =
"store_true",
191 help =
"Text output instead of html" )
193 self.
parser.add_option(
"--selectOnUnknown",
194 action =
"store_true",
195 dest =
"selectonunknown",
197 help =
"Select when information is not known (only for #evt and partition name)" )
199 self.
parser.add_option(
"--skipUnknown",
200 action =
"store_false",
201 dest =
"selectonunknown",
202 help =
"Select when information is not known (only for #evt and partition name)" )
204 self.
parser.add_option(
"--xmlfile",
208 help =
"Give filename and label (format: filename:label) for XML GoodRunList file" )
210 self.
parser.add_option(
"--nogrl",
211 action =
"store_false",
213 help =
"Do not produce a good run list" )
215 self.
parser.add_option(
"--utc",
216 action =
"store_true",
218 help =
"Use utc for everything, default is local time (CET/CEST)" )
220 self.
parser.add_option(
"--dqsumgrl",
224 help =
"Define tolerable/intolerable defects for DQ summary relative to GRL or other virtual defect, default is PHYS_StandardGRL_All_Good_25ns")
226 self.
parser.add_option(
"--defecttag",
230 help =
'Define defect tag for defect database used for DQ summary relative to GRL or other virtual defect, default is "HEAD"')
232 self.
parser.add_option(
"--logictag",
236 help =
'Define logic tag for defect database used for DQ summary relative to GRL or other virtual defect, default is "HEAD"')
239 arg = argstring.split()
240 m =
list(zip([x
for x
in range(len(arg))
if arg[x][0]==
'"'],[x
for x
in range(len(arg))
if arg[x][-1]==
'"']))
244 arg[p[0]] = arg[p[0]].strip(
'"')
246 arg[p[0]:p[1]+1]=[(
"%s %s %s" % (arg[p[0]],arg[p[0]+1],arg[p[1]])).strip(
'"')]
248 arg[p[0]:p[1]+1]=[(
"%s %s" % (arg[p[0]],arg[p[1]])).strip(
'"')]