ATLAS Offline Software
DataQuality/DCSCalculator2/python/config.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
2 
3 from optparse import OptionParser
4 
5 opts, args = None, None
6 
7 def parse_options(argv):
8  if argv:
9  from DCSCalculator2.subdetectors import SYS_NAMES
10  else:
11  SYS_NAMES = "-"
12 
13  # Parse options
14  optp = OptionParser(
15  usage="Usage: %prog [--help] [options]",
16  prog="" if not argv else argv[0],
17  description="ATLAS DCS summariser"
18  )
19 
20  O = optp.add_option
21 
22  O('-r', '--run', type=int, help="Run number to process")
23 
24  O('-R', '--range', help="Run range: e.g. 150000-151000")
25 
26  O('-L', '--lbs', help="Specify a luminosity block range")
27 
28  O('-s', '--system', dest="systems", action="append", metavar="system",
29  help="Valid systems: %s. Specify once for each system. (Default: all)" % SYS_NAMES)
30 
31  O('-d', '--input-database', default="CONDBR2",
32  help="Database instance to use for input (Default: CONDBR2)")
33 
34  O('-o', '--output-database', default="None",
35  help="(Default: None. Other valid input: any COOL connection string, "
36  "or sqlite filename)")
37 
38  O('-v', '--verbose', action='count', default=0,
39  help="Increase verbosity (specify multiple times for more)")
40 
41  O('-e', '--shell-on-exception', action="store_true",
42  help="Drop to ipython shell on exception")
43 
44  O('-X', '--dont-ignore-system-exceptions', action="store_true",
45  help="Instead of supressing system exceptions, raise them (useful with -e)")
46 
47  O('-T', '--timewise', action="store_true",
48  help="Compute result in time rather than LBs")
49 
50  O('-U', '--mark-unfilled-grey', action="store_true",
51  help="If there are any unfilled channels, mark that LB grey.")
52 
53  O('-t', '--tally-system-states', action="store_true",
54  help="Tally system states (only makes sense for discrete "
55  "states)")
56 
57  #O('-P', '--parallel', default=0, type=int, metavar="N",
58  # help="Number of systems to run in parallel (-1 for all)")
59 
60  O('--check-input-time', action="store_true",
61  help="Print statistics on when input IoVs became available")
62 
63  O('--email-on-failure', action="store_true",
64  help="Send an email to atlas-dqm-core if a system fails")
65 
66  O('-f', '--flask', action="store_true",
67  help="Use COOLFLASK mechanism to write")
68 
69  global opts, args
70  opts, args = optp.parse_args(argv)
71 
72  return optp, opts, args
73 
74 # Set some default options
75 parse_options([])
python.config.parse_options
def parse_options(argv)
Definition: DataQuality/DCSCalculator2/python/config.py:7