def main():
    """Main executable function"""
    # Command line arguments
    args = parse_args()
    logger.info('Application begin')

    # Delete jobDir if requested
    if args.overwrite and os.path.exists(args.jobDir):
        shutil.rmtree(args.jobDir)

    # RootCore libraries
    logger.info('Loading RootCore libraries')
    load_rc_libs(batch=True)
    from ROOT import EL, AnalysisAlg

    # Setup samples
    logger.info('Loading samples')
    sh = load_samples(args)
    print_samples(sh)
    if len(sh) == 0:
        logger.info('Exiting early due to empty sample list')
        return

    # Configure the job
    job = EL.Job()
    job.sampleHandler(sh)
    jobOpts = job.options()
    jobOpts.setString(EL.Job.optXaodAccessMode, args.accessMode)
    # Perf stats
    jobOpts.setDouble(EL.Job.optXAODPerfStats, 1)
    jobOpts.setDouble(EL.Job.optCacheSize, 100*1024*1024)
    jobOpts.setDouble(EL.Job.optCacheLearnEntries, 10)
    if args.maxEvents is not None:
        job.options().setInteger(job.optMaxEvents, args.maxEvents)

    # Setup the algorithm
    alg = AnalysisAlg()
    alg.electronDef = 'default'
    alg.muonDef = 'default'
    alg.tauDef = 'default'
    alg.jetDef = 'default'
    alg.metDef = 'default'
    alg.orDef = 'none'
    if args.noSysts:
        alg.doSystematics = False
    if args.opt:
        alg.schedulerDef = 'optimized'
    if args.writeXAOD:
        alg.writeXAOD = True
    job.algsAdd(alg)

    # Driver
    logger.info('Launching job with %s driver', args.driver)
    driver = setup_driver(args)
    driver.submit(job, args.jobDir)

    logger.info('Application finished')
Example #2
0
def main():
    """Main executable function"""
    # Command line arguments
    args = parse_args()
    logger.info('Application begin')

    # Delete jobDir if requested
    if args.overwrite and os.path.exists(args.jobDir):
        shutil.rmtree(args.jobDir)

    # RootCore libraries
    logger.info('Loading RootCore libraries')
    load_rc_libs(batch=True)
    from ROOT import EL, AnalysisAlg

    # Setup samples
    logger.info('Loading samples')
    sh = load_samples(args)
    print_samples(sh)

    # Configure the job
    job = EL.Job()
    job.sampleHandler(sh)
    if args.maxEvents:
        job.options().setInteger(job.optMaxEvents, int(args.maxEvents))

    # Setup the algorithm
    alg = AnalysisAlg()
    alg.electronDef = 'default'
    alg.muonDef = 'default'
    alg.tauDef = 'default'
    alg.jetDef = 'default'
    alg.metDef = 'default'
    alg.orDef = 'default'
    if args.noSysts:
        alg.doSystematics = False
    if args.opt:
        alg.schedulerDef = 'optimized'
    job.algsAdd(alg)

    # Driver
    logger.info('Launching job with %s driver', args.driver)
    driver = setup_driver(args)
    driver.submit(job, args.jobDir)

    logger.info('Application finished')