Exemple #1
0
if options.lheHTCut:
    try:
        float(options.lheHTCut)
    except:
        sys.exit("Float conversion of option lheHTCut failed. Got this: %s" %
                 options.lheHTCut)
    sample.name += "_lheHT" + options.lheHTCut
    skimCond += "&&lheHTIncoming<" + options.lheHTCut

if "Run2015D" in sample.name and not hasattr(sample, "vetoList"):
    sys.exit(
        "ERROR. Sample %s seems to be data but no vetoList was provided!!" %
        sample.name)

vetoList_ = vetoList(sample.vetoList) if hasattr(sample, "vetoList") else None

outDir = os.path.join(options.targetDir, options.skim, sample.name)
if os.path.exists(outDir):
    existingFiles = [
        outDir + '/' + f for f in os.listdir(outDir) if f.endswith('.root')
    ]
    hasBadFile = any([
        not checkRootFile(f, checkForObjects=["Events"]) for f in existingFiles
    ])
else:
    existingFiles = []
    hasBadFile = False

#print "Found bad file? %r"%hasBadFile
if os.path.exists(outDir) and len(existingFiles) > 0 and (
Exemple #2
0
    elif args.mode == "muEle":
        data_sample = fromHeppySample(
            "MuonEG_Run2015D_16Dec",
            data_path='/scratch/rschoefbeck/cmgTuples/763',
            maxN=maxN)

    data_sample.style = styles.errorStyle(ROOT.kBlack)
    #lumi_scale = data_sample.lumi/1000

    import StopsDilepton.tools.vetoList as vetoList_

    # MET group veto lists from 74X
    fileNames = [
        'Run2015D/csc2015_Dec01.txt.gz', 'Run2015D/ecalscn1043093_Dec01.txt.gz'
    ]
    vetoList = vetoList_.vetoList(
        [os.path.join(user.veto_lists, f) for f in fileNames])

    from FWCore.PythonUtilities.LumiList import LumiList
    # Apply golden JSON
    json = '$CMSSW_BASE/src/CMGTools/TTHAnalysis/data/json/Cert_13TeV_16Dec2015ReReco_Collisions15_25ns_JSON_v2.txt'
    lumiList = LumiList(os.path.expandvars(json))

from StopsDilepton.samples.color import color
DYJetsToLL_M50.color = color.DY
TTJets.color = color.TTJets
TToLeptons_tch_amcatnlo.color = color.singleTop
TBarToLeptons_tch_powheg.color = color.singleTop
TBar_tWch.color = color.singleTop
T_tWch.color = color.singleTop

noTT = [TToLeptons_tch_amcatnlo, TBarToLeptons_tch_powheg, TBar_tWch, T_tWch]
Exemple #3
0
    if args.mode=="doubleMu":
        data_sample = fromHeppySample("DoubleMuon_Run2015D_16Dec", data_path = '/scratch/rschoefbeck/cmgTuples/763', maxN = maxN)
    elif args.mode=="doubleEle":
        data_sample = fromHeppySample("DoubleEG_Run2015D_16Dec", data_path = '/scratch/rschoefbeck/cmgTuples/763', maxN = maxN)
    elif args.mode=="muEle":
        data_sample = fromHeppySample("MuonEG_Run2015D_16Dec", data_path = '/scratch/rschoefbeck/cmgTuples/763', maxN = maxN)

    data_sample.style = styles.errorStyle( ROOT.kBlack )
    #lumi_scale = data_sample.lumi/1000

    import StopsDilepton.tools.vetoList as vetoList_

    # MET group veto lists from 74X
    fileNames  = ['Run2015D/csc2015_Dec01.txt.gz', 'Run2015D/ecalscn1043093_Dec01.txt.gz']
    vetoList = vetoList_.vetoList( [os.path.join(user.veto_lists, f) for f in fileNames] )

    from FWCore.PythonUtilities.LumiList import LumiList
    # Apply golden JSON
    json = '$CMSSW_BASE/src/CMGTools/TTHAnalysis/data/json/Cert_13TeV_16Dec2015ReReco_Collisions15_25ns_JSON_v2.txt'
    lumiList = LumiList(os.path.expandvars(json))

from StopsDilepton.samples.color import color
DYJetsToLL_M50.color = color.DY
TTJets.color = color.TTJets
TToLeptons_tch_amcatnlo.color  = color.singleTop
TBarToLeptons_tch_powheg.color = color.singleTop
TBar_tWch.color = color.singleTop
T_tWch.color    = color.singleTop

noTT = [ TToLeptons_tch_amcatnlo, TBarToLeptons_tch_powheg, TBar_tWch, T_tWch ]
Exemple #4
0
  maxMultBTagWeight = 2
  btagEff_1b = btagEfficiency(method='1b', fastSim = options.fastSim)

if options.lheHTCut:
  try:
    float(options.lheHTCut)
  except:
    sys.exit("Float conversion of option lheHTCut failed. Got this: %s"%options.lheHTCut)
  sample.name+="_lheHT"+options.lheHTCut
  skimCond+="&&lheHTIncoming<"+options.lheHTCut

if "Run2015D" in sample.name and not hasattr(sample, "vetoList"):
  sys.exit("ERROR. Sample %s seems to be data but no vetoList was provided!!" %sample.name)

vetoList_ = vetoList(sample.vetoList) if hasattr(sample, "vetoList") else None

outDir = os.path.join(options.targetDir, options.skim, sample.name)
if os.path.exists(outDir):
  existingFiles = [outDir+'/'+f for f in os.listdir(outDir) if f.endswith('.root')]
  hasBadFile = any([not checkRootFile(f, checkForObjects=["Events"]) for f in existingFiles])
else:
  existingFiles = []
  hasBadFile = False
  
#print "Found bad file? %r"%hasBadFile
if os.path.exists(outDir) and len(existingFiles)>0 and (not hasBadFile) and not options.overwrite:
  print "Found non-empty directory: %s -> skipping! (found a bad file? %r.)"%(outDir, hasBadFile)
  sys.exit(0)
else:
  tmpDir = os.path.join(outDir,'tmp')