コード例 #1
0
ファイル: hplusLumiCalc.py プロジェクト: aashaqshah/cmssw-1
        # Save the json file after each data task in case of future errors
        if len(data) > 0:
            f = open(opts.output, "wb")
            json.dump(data, f, sort_keys=True, indent=2)
            f.close()

    if len(data) > 0:
        f = open(opts.output, "wb")
        json.dump(data, f, sort_keys=True, indent=2)
        f.close()

    return 0

if __name__ == "__main__":
    parser = OptionParser(usage="Usage: %prog [options]")
    multicrab.addOptions(parser)
    parser.add_option("-f", dest="files", type="string", action="append", default=[],
                      help="JSON files to calculate the luminosity for (this or -d is required)")
    parser.add_option("--output", "-o", dest="output", type="string", default="lumi.json",
                      help="Output file to write the dataset integrated luminosities")
    parser.add_option("--truncate", dest="truncate", default=False, action="store_true",
                      help="Truncate the output file before writing")
    parser.add_option("--noreport", dest="report", action="store_false", default=True,
                      help="Do not run 'crab -report', i.e. you guarantee that the lumiSummary.json contains already all jobs.")
    parser.add_option("--verbose", dest="verbose", action="store_true", default=False,
                      help="Print outputs of the commands which are executed")
    parser.add_option("--lumicalc1", dest="lumicalc1", action="store_true", default=False,
                      help="Use lumiCalc.py instead of lumiCalc2.py (default is to use lumiCalc2.py")
    
    (opts, args) = parser.parse_args()
コード例 #2
0
    # Print out


#    print
#    for key, task in tasks.iteritems():
#        print "# %s events, %d jobs" % (task.events, task.jobs)
        print "# %d jobs" % (task.jobs)
        print "# %s" % task.time
        print "# %s" % task.size
        print '"%s": TaskDef("%s", dbs="phys03"),' % (key, task.dbsPath)

    return 0

if __name__ == "__main__":
    parser = OptionParser(
        usage=
        "Usage: %prog [options] [crab task dirs]\n\nCRAB task directories can be given either as the last arguments, or with -d."
    )
    multicrab.addOptions(parser)
    parser.add_option(
        "--sizeFile",
        dest="sizeFile",
        default="pattuple.root",
        help=
        "For --size, specify the output file name (default: 'pattuple.root')")
    (opts, args) = parser.parse_args()
    opts.dirs.extend(args)

    sys.exit(main(opts))