Ejemplo n.º 1
0
if era == "2016":
    if isMC:
        modules = [puWeight_2016(), SkimmerDiMuon_2016_mc()]
    else:
        modules = [SkimmerDiMuon_2016_data()]
        jsonInput = CMSSW_BASE + "/src/PUjetID/Skimmer/data/lumi/Cert_271036-284044_13TeV_ReReco_07Aug2017_Collisions16_JSON.txt"
elif era == "2017":
    if isMC:
        modules = [puWeight_2017(), SkimmerDiMuon_2017_mc()]
    else:
        modules = [SkimmerDiMuon_2017_data()]
        jsonInput = CMSSW_BASE + "/src/PUjetID/Skimmer/data/lumi/Cert_294927-306462_13TeV_EOY2017ReReco_Collisions17_JSON.txt"
elif era == "2018":
    if isMC:
        modules = [puWeight_2018(), SkimmerDiMuon_2018_mc()]
    else:
        modules = [SkimmerDiMuon_2018_data()]
        jsonInput = CMSSW_BASE + "/src/PUjetID/Skimmer/data/lumi/Cert_314472-325175_13TeV_17SeptEarlyReReco2018ABC_PromptEraD_Collisions18_JSON.txt"

#
# This takes care of converting the input files from CRAB
#
from PhysicsTools.NanoAODTools.postprocessing.framework.crabhelper import inputFiles, runsAndLumis

p = PostProcessor(
    ".",
    inputFiles(),
    cut=selection,
    branchsel=varTxtFileIn,
    outputbranchsel=varTxtFileOut,
Ejemplo n.º 2
0
cut_Trigger = "(HLT_IsoMu24||HLT_IsoMu27||HLT_Mu50||HLT_OldMu100||HLT_TkMu100)"
cut_MuMu = "(Sum$(Muon_pt>=20. && TMath::Abs(Muon_eta)<2.4 && Muon_mediumId && Muon_pfIsoId>=4)>=2)"
cut_MuTau = "(Sum$(Muon_pt>=30. && TMath::Abs(Muon_eta)<2.1 && Muon_tightId)>0 && Sum$(Tau_pt>=20. && TMath::Abs(Tau_eta)<2.3 && (128&Tau_idDeepTau2017v2p1VSjet) && (128&Tau_idDeepTau2017v2p1VSe) && (8&Tau_idDeepTau2017v2p1VSmu))>0)"
cut_Photon = "(Sum$(Photon_pt>=45. && TMath::Abs(Photon_eta)<2.6 && Photon_mvaID_WP90 && (Photon_electronVeto||!Photon_pixelSeed))==0)"
cut_BJets = "(Sum$(Jet_pt>=20. && TMath::Abs(Jet_eta)<2.5 && (4&Jet_jetId) && Jet_btagDeepB>=0.7527)==0)"
cut_Electron = "(Sum$(Electron_pt>=30. && TMath::Abs(Electron_eta)<2.5 && Electron_mvaFall17V2Iso_WP80)==0)"
cut_ = cut_Trigger + " && ( " + cut_MuMu + " || " + cut_MuTau + " ) && " + cut_Photon + " && " + cut_BJets + " && " + cut_Electron
print "PreSelection:"
print cut_

modules_ = [
    ZMuTauProducerConstr(True),
    ZMuMuProducerConstr(True),
    JetProducerConstr(),
    puWeight_2018()
]
#modules_ = [ZProducerConstr(False), ZMuMuProducerConstr(False)]

p = PostProcessor(
    outputDir=".",
    #inputFiles = inputFiles(),
    inputFiles=testfile,
    cut=cut_,
    modules=modules_,
    provenance=True,
    fwkJobReport=True,
    jsonInput=runsAndLumis(),
    outputbranchsel="keep_and_drop.txt")
p.run()