CMS 3D CMS Logo

Functions
mps_prepare_input_db Namespace Reference

Functions

def main (argv=None)
 

Function Documentation

def mps_prepare_input_db.main (   argv = None)
Main routine of the script.

Arguments:
- `argv`: arguments passed to the main routine

Definition at line 8 of file mps_prepare_input_db.py.

8 def main(argv = None):
9  """Main routine of the script.
10 
11  Arguments:
12  - `argv`: arguments passed to the main routine
13  """
14 
15  if argv == None:
16  argv = sys.argv[1:]
17 
18  parser = argparse.ArgumentParser(
19  description="Prepare input db file for MillePede workflow.")
20  parser.add_argument("-g", "--global-tag", dest="global_tag", required=True,
21  metavar="TAG",
22  help="global tag to extract the alignment payloads")
23  parser.add_argument("-r", "--run-number", dest="run_number", required=True,
24  metavar="INTEGER", type=int,
25  help="run number to select IOV")
26  parser.add_argument("-o", "--output-db", dest="output_db",
27  default="alignment_input.db", metavar="PATH",
28  help="name of the output file (default: '%(default)s')")
29  args = parser.parse_args(argv)
30 
31  inputs = mps_tools.get_tags(args.global_tag,
32  ["TrackerAlignmentRcd",
33  "TrackerSurfaceDeformationRcd",
34  "TrackerAlignmentErrorExtendedRcd"])
35  for inp in inputs.itervalues():
36  inp["iovs"] = mps_tools.get_iovs(inp["connect"], inp["tag"])
37  mps_tools.create_single_iov_db(inputs, args.run_number, args.output_db)
38 
39