예제 #1
0
def run(fname,parallel):

    remote = os.environ.get("storeremote")
    
    fin = open(fname)
    vals = {}
    for l in fin.read().split("\n"):
        if "output=" in l :
            for t in l.split(" "):
                if "=" in t:
                    nam,val = t.split("=",1)
                    vals[nam] = val
    dir = "%s/%s" % ( remote, os.path.dirname(vals["output"]).replace("./datastore",""))
    output = "%s.json" % os.path.dirname(vals["output"])
    
    print "listing ", dir
    files = [ f[0] for f in makeCaFiles(dir) if f[0] not in black_list ]
    print "filling", output
    if parallel.njobs == 1:
        makeLumi([output]+files)
    else:
        cmd = "./mkLumi.py --do"
        for a in [output]+files:
            cmd += " %s " % a
        sta,out= commands.getstatusoutput(cmd)
        print "filled", output, out
        return sta,out
    return None
예제 #2
0
def run(fname, parallel):
    ## print "run", fname

    fin = open(fname)
    vals = {}
    for l in fin.read().split("\n"):
        if "output=" in l or "CaDir=" in l:
            for t in l.split(" "):
                if "=" in t:
                    nam, val = t.split("=", 1)
                    vals[nam] = val
    dir = vals["CaDir"]
    output = "%s.pileup.root" % os.path.dirname(vals["output"])
    site = vals.get("site", "cern.ch")

    print "listing ", dir
    files = [
        f[0] for f in makeCaFiles(dir, site=site) if f[0] not in black_list
    ]
    print "filling", output
    if parallel.njobs == 1:
        makeHistos([output] + files)
    else:
        cmd = "./mkPileup2D.py --do"
        for a in [output] + files:
            cmd += " %s " % a
        sta, out = commands.getstatusoutput(cmd)
        print "filled", output, out
        return sta, out
    return None
예제 #3
0
def run(fname,parallel):
    ## print "run", fname
    
    fin = open(fname)
    vals = {}
    for l in fin.read().split("\n"):
        if "output=" in l or "CaDir=" in l:
            for t in l.split(" "):
                if "=" in t:
                    nam,val = t.split("=",1)
                    vals[nam] = val
    dir = vals["CaDir"]
    output = "%s.pileup.root" % os.path.dirname(vals["output"])
    site = vals.get("site","cern.ch")

    print "listing ", dir
    files = [ f[0] for f in makeCaFiles(dir,site=site) if f[0] not in black_list ]
    print "filling", output
    if parallel.njobs == 1:
        makeHistos([output]+files)        
    else:
        cmd = "./mkPileup2D.py --do"
        for a in [output]+files:
            cmd += " %s " % a
        sta,out= commands.getstatusoutput(cmd)
        print "filled", output, out
        return sta,out
    return None