Exemplo n.º 1
0
def submitIso(sample):

    #    if sample.name == 'WZJets':
    #        for subJob in xrange(sample.splitJobs):
    #            log = "/user/lwezenbe/private/PhD/Results/TauStudy/Efficiency/log/Iso/"+sample.name+ "Eff_subjob_"+str(subJob)+".log"
    #            command = 'python /storage_mnt/storage/user/lwezenbe/private/PhD/Code/TauStudy/Efficiency/IsoEfficiency.py --sample='+sample.name+ ' --subJob='+str(subJob)+ ' --method=Bluj --inputFile=inputFilesv3'
    #            sub.launchCream02(command, log, True, "IsoEff")

    if sample.name == 'DYJetsToLL_M-50':
        for subJob in xrange(sample.splitJobs):
            log = "/user/lwezenbe/private/PhD/Results/TauStudy/Efficiency/log/Iso/" + sample.name + "FR_subjob_" + str(
                subJob) + ".log"
            command = 'python /storage_mnt/storage/user/lwezenbe/private/PhD/Code/TauStudy/Efficiency/IsoFakeRate.py --sample=' + sample.name + ' --subJob=' + str(
                subJob) + ' --method=Bluj --inputFile=inputFilesv3'
            sub.launchCream02(command, log, True, "IsoFR")
Exemplo n.º 2
0
def submitLepDiscr(sample):

    if sample.name == 'WZJets':
        for subJob in xrange(sample.splitJobs):
            log = "/user/lwezenbe/private/PhD/Results/TauStudy/Efficiency/log/lepDiscr/" + sample.name + "Eff_subjob_" + str(
                subJob) + ".log"
            command = 'python /storage_mnt/storage/user/lwezenbe/private/PhD/Code/TauStudy/Efficiency/LightLepDiscrEff.py --sample=' + sample.name + ' --subJob=' + str(
                subJob) + ' --inputFile=inputFilesv3'
            sub.launchCream02(command, log, True, "LightLepEff")

    if sample.name == 'DYJetsToLL_M-50':
        for subJob in xrange(sample.splitJobs):
            log = "/user/lwezenbe/private/PhD/Results/TauStudy/Efficiency/log/lepDiscr/" + sample.name + "FR_subjob_" + str(
                subJob) + ".log"
            command = 'python /storage_mnt/storage/user/lwezenbe/private/PhD/Code/TauStudy/Efficiency/LightLepDiscrFR.py --sample=' + sample.name + ' --subJob=' + str(
                subJob) + ' --inputFile=inputFilesv3'
            sub.launchCream02(command, log, True, "LightLepFR")
Exemplo n.º 3
0
if not args.isCheck:
    sampleList = createSampleList(
        '/user/lwezenbe/private/PhD/Code/TauStudy/FakeRate/ClosureTest/Data/inputFiles_'
        + args.year + '.conf')
else:
    sampleList = createSampleList(
        '/user/lwezenbe/private/PhD/Code/TauStudy/FakeRate/Data/inputFiles_' +
        args.year + '.conf')

if args.isCheck:
    MCsamples = ['DYJets']
else:
    MCsamples = ['DYJets', 'TT']

for sample in sampleList:
    if not args.inData:
        if not sample.output in MCsamples: continue
    for subJob in xrange(sample.splitJobs):
        log = "/user/lwezenbe/private/PhD/Code/TauStudy/FakeRate/ClosureTest/log/" + sample.name + "_subjob_" + str(
            subJob) + ".log"
        command = 'python /storage_mnt/storage/user/lwezenbe/private/PhD/Code/TauStudy/FakeRate/ClosureTest/closureTest.py --sampleName=' + sample.name + ' --subJob=' + str(
            subJob) + ' --year=' + args.year
        if args.isCheck: command += ' --isCheck'
        if args.inData: command += ' --inData'
        if (args.runLocal):
            sub.runLocal(command, log)
        else:
            sub.launchCream02(command, log, False,
                              'ClosureTest_' + str(subJob))
Exemplo n.º 4
0
        if not args.path: paths = getAllPaths(year)
        else: paths = [args.path]

        for path in paths:
            if not args.overwrite and (os.path.exists(
                    os.path.join('triggerPrescales', year, path + '.php'))):
                print 'Found already php file for ' + path + ' (' + year + '), skipping'
                continue
            jobs.append((path, year, args.minRun, args.maxRun))
            print 'Added job for ' + path + ' (' + year + ')'

    if args.useCluster:
        from jobSubmitter import launchCream02
        for i, job in enumerate(jobs):
            path, year, minRun, maxRun = job
            if ' ' in path: continue
            command = './makePrescaleWebpage.py --path=' + path + ' --year=' + year + (
                ' --overwrite' if args.overwrite else '')
            if minRun: command += ' --minRun=' + minRun
            if maxRun: command += ' --maxRun=' + maxRun
            logFile = './log/' + path + '_' + year + '.log'
            launchCream02(command, logFile, checkQueue=(i % 100 == 0))
    elif int(args.cores) > 1:
        from multiprocessing import Pool
        pool = Pool(processes=int(args.cores))
        pool.map(analyzePath, jobs)
        pool.close()
        pool.join()
    else:
        map(analyzePath, jobs)
Exemplo n.º 5
0
import ROOT
import os
from Sample import createSampleList, getSampleFromList
import jobSubmitter as sub

sampleList = createSampleList(
    '/user/lwezenbe/private/PhD/Code/TauStudy/ReproduceAN2017_094/Data/inputFiles.conf'
)

for sample in sampleList:
    for subJob in xrange(sample.splitJobs):
        log = "/user/lwezenbe/private/PhD/Results/TauStudy/ReproduceAN2017_094/log/" + sample.name + "_subjob_" + str(
            subJob) + ".log"
        command = 'python /storage_mnt/storage/user/lwezenbe/private/PhD/Code/TauStudy/ReproduceAN2017_094/ReproduceAN2017_094.py --sampleName=' + sample.name + ' --subJob=' + str(
            subJob)
        sub.launchCream02(command, log, False, 'ReproduceANjob')
        #sub.runLocal(command, log)
Exemplo n.º 6
0
import ROOT, subprocess
import subSample
import jobSubmitter as sub
from helpers import makeDirIfNeeded

import argparse
argParser = argparse.ArgumentParser(description = "Argument parser")
argParser.add_argument('--year',        action='store',         default='2016')
argParser.add_argument('--skim',        action='store',         default='FR')
argParser.add_argument('--analysis',        action='store',         default='ewkino')

args = argParser.parse_args()

files_to_skim = subSample.createSampleList('Data/'+args.analysis+'_'+args.year+'.conf')
makeDirIfNeeded('/user/lwezenbe/public/ntuples/'+args.year+'/'+args.skim+'/Log')

for f in files_to_skim:
    number_of_subdir = int(subprocess.check_output("/bin/ls -lA " + f + "/* | egrep -c '^-|^d'", shell=True, stderr=subprocess.STDOUT))
    for subdir in xrange(number_of_subdir):
        subsample = subSample.subSample(f, subdir)
        nJobs = len(subsample.arrangeFilesInSubjobs())
        for job in xrange(nJobs):
            log = '/user/lwezenbe/public/ntuples/'+args.year+'/'+args.skim+'/Log/'+subsample.group+'_'+subsample.name+ '_'+ str(subdir)+ '_' +str(job)+'.log'   #temporary lazy log
            command = 'python /storage_mnt/storage/user/lwezenbe/private/PhD/Code/TauStudy/Skimmer/main.py --path='+f+' --subDir='+ str(subdir)+ ' --subJob=' +str(job) + ' --skim=' + args.skim + ' --year='+args.year
            name = subsample.group+'_'+subsample.name+ '_'+ str(subdir)+ '_' +str(job)
            sub.launchCream02(command, log, False, str(job)+ '_'+args.skim+'_' + name)

Exemplo n.º 7
0
import os, argparse
from Sample import createSampleList, getSampleFromList
import jobSubmitter as sub

argParser = argparse.ArgumentParser(description="Argument parser")
argParser.add_argument('--only_submit_signal', action='store', default=False)

args = argParser.parse_args()

NUMBER_OF_ELE_WP = 6
NUMBER_OF_MU_WP = 3

sampleList = createSampleList(
    '/user/lwezenbe/private/PhD/Code/TauStudy/Significance/Data/inputFilesv3.conf'
)

for sample in sampleList:
    if args.only_submit_signal and not 'SMS' in sample.name: continue
    #if not sample.output == 'ST': continue
    for subJob in xrange(sample.splitJobs):
        for ele in range(NUMBER_OF_ELE_WP):
            for mu in range(NUMBER_OF_MU_WP):
                log = "/user/lwezenbe/private/PhD/Results/TauStudy/Significance/log/" + sample.name + "_subjob_" + str(
                    subJob) + "_ele_" + str(ele) + "_mu_" + str(mu) + ".log"
                command = 'python /storage_mnt/storage/user/lwezenbe/private/PhD/Code/TauStudy/Significance/main.py --sampleName=' + sample.name + ' --subJob=' + str(
                    subJob) + ' --ele_cut_index=' + str(
                        ele) + ' --mu_cut_index=' + str(mu)
                sub.launchCream02(command, log, False,
                                  'SignificanceJob_' + str(subJob))
                #sub.runLocal(command, log)
Exemplo n.º 8
0
import ROOT, os, glob
import jobSubmitter as sub
from helpers import makeDirIfNeeded

baseFolderInput = '/user/lwezenbe/public/ntuples/2016/ewkino_Oldtrilep'
baseFolderOutput = '/user/lwezenbe/public/ntuples/2016/ewkino_Oldtrilep'

makeDirIfNeeded(baseFolderOutput)

list_of_folders = glob.glob(baseFolderInput + '/tmp*')
for f in list_of_folders:
    log = baseFolderOutput + '/Log/' + f.rsplit('/', 1)[1] + '.log'
    command = 'python /storage_mnt/storage/user/lwezenbe/private/PhD/Code/TauStudy/Skimmer_Old/mergeTuples.py --f=' + f + ' --Input=' + baseFolderInput + ' --Output=' + baseFolderOutput
    sub.launchCream02(command, log, True, 'Merge ' + f.rsplit('/', 1)[1])
Exemplo n.º 9
0

def isData(f):
    list_of_datafiles = [
        'SingleMuon', 'SingleElectron', 'DoubleMuon', 'DoubleEG', 'MuonEG',
        'EGamma'
    ]
    for dataf in list_of_datafiles:
        if dataf in f: return True
    return False


makeDirIfNeeded(baseFolderOutput)

#data_included = True

list_of_folders = glob.glob(baseFolderInput + '/tmp_*')
for f in list_of_folders:
    makeDirIfNeeded(baseFolderOutput + '/Log')
    if not isData(f):
        log = baseFolderOutput + '/Log/' + f.rsplit('/', 1)[1] + '.log'
        command = 'python /storage_mnt/storage/user/lwezenbe/private/PhD/Code/TauStudy/Skimmer/mergeTuples.py --f=' + f + ' --Output=' + baseFolderOutput
        sub.launchCream02(command, log, False, 'Merge_' + f.rsplit('/', 1)[1])
#    else:
#        data_included = True
#
#if data_included:
#    log = baseFolderOutput + '/Log/data.log'
#    command = 'python /storage_mnt/storage/user/lwezenbe/private/PhD/Code/TauStudy/Skimmer/mergeData.py --year='+args.year + ' --skim='+args.skim
#    sub.launchCream02(command, log, False, 'Merge_Data')
Exemplo n.º 10
0
argParser.add_argument('--year', action='store', default='2016')
argParser.add_argument('--inData', action='store_true')
argParser.add_argument('--runLocal', action='store_true')

args = argParser.parse_args()

sampleList = createSampleList(
    '/user/lwezenbe/private/PhD/Code/TauStudy/FakeRate/Data/inputFiles_' +
    args.year + '.conf')
makeDirIfNeeded("/user/lwezenbe/private/PhD/Code/TauStudy/FakeRate/log")

for sample in sampleList:
    if not args.inData and not 'DYJets' in sample.output: continue

    for subJob in xrange(sample.splitJobs):
        log = "/user/lwezenbe/private/PhD/Code/TauStudy/FakeRate/log/" + sample.name + "_subjob_" + str(
            subJob) + ".log"
        command = 'python /storage_mnt/storage/user/lwezenbe/private/PhD/Code/TauStudy/FakeRate/main.py --sampleName=' + sample.name + ' --subJob=' + str(
            subJob) + ' --year=' + args.year
        if args.inData: command += ' --inData'
        if args.inData:
            inDataStr = "True"
        else:
            inDataStr = "False"
        if args.runLocal:
            sub.runLocal(command, log)
        else:
            sub.launchCream02(
                command, log, False,
                'FR_' + inDataStr + "_" + sample.name + str(subJob))