Example #1
0
def main(opts):
    ROOT.gROOT.SetBatch(True)
    
    crossSections = {}
    for o in opts.xsections:
        (name, value) = o.split(":")
        crossSections[name] = float(value)
    
    style = tdrstyle.TDRStyle()

    datasets = []
    if len(opts.files) > 0:
        for f in opts.files:
            datasets.append(counter.readDataset(f, opts.counterdir, f, crossSections))
    else:
        readDatasetDirs(opts, crossSections, datasets)

    if len(datasets) == 0:
        return

    if len(opts.list) > 0:
        printList(datasets[0], opts.list)

    for plot in opts.plots:
        drawSavePlot(opts, datasets, plot)    

    return 0
Example #2
0
def main(opts):
    ROOT.gROOT.SetBatch(True)

    crossSections = {}
    for o in opts.xsections:
        (name, value) = o.split(":")
        crossSections[name] = float(value)

    style = tdrstyle.TDRStyle()

    datasets = []
    if len(opts.files) > 0:
        for f in opts.files:
            datasets.append(
                counter.readDataset(f, opts.counterdir, f, crossSections))
    else:
        readDatasetDirs(opts, crossSections, datasets)

    if len(datasets) == 0:
        return

    if len(opts.list) > 0:
        printList(datasets[0], opts.list)

    for plot in opts.plots:
        drawSavePlot(opts, datasets, plot)

    return 0
Example #3
0
def readDatasetDirs(opts, crossSections, datasets):
    taskdirs = multicrab.getTaskDirectories(opts)
    for d in taskdirs:
        files = glob.glob(os.path.join(d, "res", opts.input))
        if len(files) > 1:
            raise Exception("Only one file should match the input (%d matched) for task %s" % (len(files), d))
            return 1
        elif len(files) == 0:
            raise Exception("No files matched to input for task %s" % d)

        datasets.append(counter.readDataset(files[0], opts.counterdir, d, crossSections))
Example #4
0
def readDatasetDirs(opts, crossSections, datasets):
    taskdirs = multicrab.getTaskDirectories(opts)
    for d in taskdirs:
        files = glob.glob(os.path.join(d, "res", opts.input))
        if len(files) > 1:
            raise Exception(
                "Only one file should match the input (%d matched) for task %s"
                % (len(files), d))
            return 1
        elif len(files) == 0:
            raise Exception("No files matched to input for task %s" % d)

        datasets.append(
            counter.readDataset(files[0], opts.counterdir, d, crossSections))