10 """Main routine of the script. 13 - `argv`: arguments passed to the main routine 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,
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)
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)