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 9 of file mps_prepare_input_db.py.

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