Example #1
0
def go():
    directory = "/afs/cern.ch/user/e/elaird/work/public/d1_utca/"
    uscFiles = rootFiles(directory, mode="usc")
    if options.onlysummary:
        castorFiles = []
    else:
        castorFiles = rootFiles(directory, mode="castor")

    labels = []
    for run in sorted(uscFiles.keys()):
        if any([options.min and run < int(options.min),
                options.max and run > int(options.max),
                options.run and run != int(options.run),
                #(not options.onlyutca) and (run not in castorFiles),
                ]):
            continue
        label = "Run%d" % run
        labels.append(label)
        if options.onlysummary:
            continue

        if options.onlyutca:
            cmsFileName = ""
        else:
            #cmsFileName = castorFiles[run]
            cmsFileName = eosFile(run)

        analyze.oneRun(utcaFileName="" if options.onlycms else uscFiles[run],
                       cmsFileName=cmsFileName,
                       label=label, useEvn=False,
                       filterEvn=options.filterevn, ornTolerance=1)

    if options.onlysummary and options.run:
        labels = ["Run"+options.run]
    graphs.makeSummaryPdf(labels)
Example #2
0
def plot(prefix, roots, feds1s, feds2s):
    graphs.makeSummaryPdfMulti(inputFiles=roots, feds1s=feds1s, feds2s=feds2s, pdf="output/%s.pdf" % prefix)

    if not any(feds2s):
        outputFile = "output/%s.root" % prefix
        cmd = " ".join(["hadd -f", outputFile] + roots)
        os.system(cmd)

        graphs.makeSummaryPdf(
            inputFile=outputFile, feds1=sorted(sum(feds1s, [])), pdf=outputFile.replace(".root", "_merged.pdf")
        )
Example #3
0
def plot(prefix, roots, feds1s, feds2s):
    graphs.makeSummaryPdfMulti(inputFiles=roots,
                               feds1s=feds1s,
                               feds2s=feds2s,
                               pdf="output/%s.pdf" % prefix)

    if not any(feds2s):
        outputFile = "output/%s.root" % prefix
        cmd = " ".join(["hadd -f", outputFile] + roots)
        os.system(cmd)

        graphs.makeSummaryPdf(inputFile=outputFile,
                              feds1=sorted(sum(feds1s, [])),
                              pdf=outputFile.replace(".root", "_merged.pdf"))
Example #4
0
        uhtr=True,
        printEventMap=False,
        nEvents=nEvents,
    )

if run <= 200000:  # including None
    if options.file:
        fileName = options.file
    else:
        fileName = baseDir + "/904/B904_Integration_%06d.root" % run
    analyze.oneRun(
        utcaFileName=fileName if not options.patterns else "",
        utcaFedIds=[931],
        cmsFileName=fileName,
        cmsFedIds=[702],
        cmsIsLocal=True,
        cmsPatternMode=options.patterns,
        label=label,
        useEvn=False,
        filterEvn=False,
        ornTolerance=1,
        uhtr=True,
        printEventMap=False,
        nEvents=nEvents,
    )

if not options.patterns:
    import graphs
    analyze.printHisto(label)
    graphs.makeSummaryPdf(labels=[label])