File indexing completed on 2024-04-06 12:23:30
0001 if __name__ == '__main__':
0002 from optparse import OptionParser
0003 from PhysicsTools.HeppyCore.framework.heppy_loop import main
0004
0005 parser = OptionParser()
0006 parser.usage = """
0007 %prog <name> <analysis_cfg>
0008 For each component, start a Loop.
0009 'name' is whatever you want.
0010 """
0011
0012 parser.add_option("-N", "--nevents",
0013 dest="nevents",
0014 type="int",
0015 help="number of events to process",
0016 default=None)
0017 parser.add_option("-p", "--nprint",
0018 dest="nprint",
0019 help="number of events to print at the beginning",
0020 default=5)
0021 parser.add_option("-e", "--iEvent",
0022 dest="iEvent",
0023 help="jump to a given event. ignored in multiprocessing.",
0024 default=None)
0025 parser.add_option("-f", "--force",
0026 dest="force",
0027 action='store_true',
0028 help="don't ask questions in case output directory already exists.",
0029 default=False)
0030 parser.add_option("-i", "--interactive",
0031 dest="interactive",
0032 action='store_true',
0033 help="stay in the command line prompt instead of exiting",
0034 default=False)
0035 parser.add_option("-t", "--timereport",
0036 dest="timeReport",
0037 action='store_true',
0038 help="Make a report of the time used by each analyzer",
0039 default=False)
0040 parser.add_option("-v", "--verbose",
0041 dest="verbose",
0042 action='store_true',
0043 help="increase the verbosity of the output (from 'warning' to 'info' level)",
0044 default=False)
0045 parser.add_option("-q", "--quiet",
0046 dest="quiet",
0047 action='store_true',
0048 help="do not print log messages to screen.",
0049 default=False)
0050 parser.add_option("-o", "--option",
0051 dest="extraOptions",
0052 type="string",
0053 action="append",
0054 default=[],
0055 help="Save one extra option (either a flag, or a key=value pair) that can be then accessed from the job config file")
0056 parser.add_option("-j", "--ntasks",
0057 dest="ntasks",
0058 type="int",
0059 help="number of parallel tasks to span",
0060 default=10)
0061
0062 (options,args) = parser.parse_args()
0063
0064 loop = main(options, args, parser)
0065 if not options.interactive:
0066 exit()