Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-03-03 02:23:10

0001 #!/usr/bin/env python3
0002 
0003 import argparse
0004 
0005 from Alignment.CommonAlignment.tools.dataset import MultipleDatasets
0006 
0007 parser = argparse.ArgumentParser()
0008 parser.add_argument("-d", "--dataset", required=True, help="dataset name on DAS (can give multiple)", action="append")
0009 parser.add_argument("--hippy", help="output file name for HipPy")
0010 parser.add_argument("-v", "--validation", help="output file name for validation")
0011 parser.add_argument("-f", "--first-run", default=0, type=int)
0012 parser.add_argument("-l", "--last-run", default=float("inf"), type=int)
0013 parser.add_argument("-r", "--run", action="append", type=int)
0014 parser.add_argument("-m", "--max-events", default=float("inf"), type=int)
0015 parser.add_argument("-j", "--events-per-job", type=int)
0016 parser.add_argument("--clear-cache", action="store_true")
0017 
0018 args = parser.parse_args()
0019 dataset = MultipleDatasets(*args.dataset)
0020 
0021 if not args.validation and not args.hippy:
0022   raise RuntimeError("have to provide --validation or --hippy")
0023 if args.validation and not args.hippy and args.events_per_job:
0024   raise RuntimeError("--events-per-job is only used for HipPy")
0025 
0026 if args.hippy:
0027   dataset.writefilelist_hippy(firstrun=args.first_run, lastrun=args.last_run, runs=args.run, maxevents=args.max_events, eventsperjob=args.events_per_job, outputfile=args.hippy, usecache=not args.clear_cache)
0028 if args.validation:
0029   dataset.writefilelist_validation(firstrun=args.first_run, lastrun=args.last_run, runs=args.run, maxevents=args.max_events, outputfile=args.validation, usecache=not args.clear_cache)