x) and x.lostHits < 2 susy_ttH_mu = lambda x: x.pt > minmupt and abs( x.eta) < maxmueta and isoAndIPCuts(x) and x.looseId susy_tau_extraloose = lambda x: x.pt > mintaupt and abs( x.eta ) < maxtaueta and abs( x.dz ) < 0.4 and x.idMVAoldDM2017v2 >= 1 and x.idAntiMu >= 1 and x.idAntiEle >= 1 goodElec = lambda x: susy_ttH_el(x) goodMuon = lambda x: susy_ttH_mu(x) goodTau = lambda x: susy_tau_extraloose(x) goodLepProducer = collectionMerger(input=["Electron", "Muon"], output="LepGood", maxObjects=10, selector=dict([("Electron", goodElec), ("Muon", goodMuon)])) goodTauProducer = collectionMerger(input=["Tau"], output="TauGood", maxObjects=10, selector=dict([("Tau", goodTau)])) from PhysicsTools.NanoAODTools.postprocessing.framework.crabhelper import inputFiles, runsAndLumis skimRecoLeps = SkimRecoLeps(sampOpt['isData'] == True) mod = [goodLepProducer, goodTauProducer, skimRecoLeps] splitMass = splitSMSmasses(sampOpt["LSPID"], sampOpt["NLSPID1"]) ISRReweight = ISRReWeighting(
muonSelection = lambda l: abs(l.eta) < 2.4 and l.pt > conf["muPt"] and l.sip3d < conf["sip3d"] and abs(l.dxy) < conf["dxy"] and abs(l.dz) < conf["dz"] and l.pfRelIso03_all*l.pt < ( conf["iperbolic_iso_0"]+conf["iperbolic_iso_1"]/l.pt) and abs(l.ip3d) < conf["ip3d"] electronSelection = lambda l: abs(l.eta) < 2.5 and l.pt > conf["elePt"] and l.sip3d < conf["sip3d"] and abs(l.dxy) < conf["dxy"] and abs(l.dz) < conf["dz"] and l.pfRelIso03_all*l.pt < ( conf["iperbolic_iso_0"]+conf["iperbolic_iso_1"]/l.pt) and abs(l.ip3d) < conf["ip3d"] from CMGTools.TTHAnalysis.tools.nanoAOD.ttHPrescalingLepSkimmer import ttHPrescalingLepSkimmer # NB: do not wrap lepSkim a lambda, as we modify the configuration in the cfg itself lepSkim = ttHPrescalingLepSkimmer(0, ##do not apply prescale muonSel = muonSelection, electronSel = electronSelection, minLeptonsNoPrescale = 2, # things with less than 2 leptons are rejected irrespectively of the prescale minLeptons = 2, requireSameSignPair = False, jetSel = lambda j: j.pt > 25 and abs(j.eta) < 2.4 and j.jetId > 0, minJets = 0, minMET = 0, minMETNoPrescale = 50) from PhysicsTools.NanoAODTools.postprocessing.modules.common.collectionMerger import collectionMerger lepMerge = collectionMerger(input = ["Electron","Muon"], output = "LepGood", selector = dict(Muon = muonSelection, Electron = electronSelection)) from CMGTools.TTHAnalysis.tools.nanoAOD.ttHLeptonCombMasses import ttHLeptonCombMasses lepMasses = ttHLeptonCombMasses( [ ("Muon",muonSelection), ("Electron",electronSelection) ], maxLeps = 4) from CMGTools.TTHAnalysis.tools.nanoAOD.autoPuWeight import autoPuWeight from CMGTools.TTHAnalysis.tools.nanoAOD.yearTagger import yearTag from CMGTools.TTHAnalysis.tools.nanoAOD.xsecTagger import xsecTag from CMGTools.TTHAnalysis.tools.nanoAOD.lepJetBTagAdder import lepJetBTagCSV, lepJetBTagDeepCSV susySOS_sequence_step1 = [autoPuWeight, lepSkim, lepMerge, yearTag, xsecTag, lepJetBTagCSV, lepJetBTagDeepCSV, lepMasses] #from PhysicsTools.NanoAODTools.postprocessing.tools import deltaR #from CMGTools.TTHAnalysis.tools.nanoAOD.ttHLepQCDFakeRateAnalyzer import ttHLepQCDFakeRateAnalyzer
from PhysicsTools.NanoAODTools.postprocessing.modules.common.puWeightProducer import * from LatinoAnalysis.NanoGardener.modules.Grafter import * from LatinoAnalysis.NanoGardener.modules.GenericFormulaAdder import * from LatinoAnalysis.NanoGardener.modules.HiggsGenVarsProducer import * from LatinoAnalysis.NanoGardener.modules.PromptParticlesGenVarsProducer import * from LatinoAnalysis.NanoGardener.modules.GenLeptonMatchProducer import * from LatinoAnalysis.NanoGardener.modules.TopGenVarsProducer import * from LatinoAnalysis.NanoGardener.modules.wwNLLcorrectionWeightProducer import * from LatinoAnalysis.NanoGardener.modules.MetUnclustered import * from LatinoAnalysis.NanoGardener.modules.qq2vvEWKcorrectionsWeightProducer import * from LatinoAnalysis.NanoGardener.modules.qq2VEWKcorrectionsWeightProducer import * from PhysicsTools.NanoAODTools.postprocessing.modules.common.collectionMerger import collectionMerger from PhysicsTools.NanoAODTools.postprocessing.modules.btv.btagSFProducer import btagSFProducer lepMergerLatino = lambda: collectionMerger( input=["Electron", "Muon"], output="Lepton", reverse=True) from LatinoAnalysis.NanoGardener.modules.l2KinProducer import * from LatinoAnalysis.NanoGardener.modules.l3KinProducer import * from LatinoAnalysis.NanoGardener.modules.l4KinProducer import * from LatinoAnalysis.NanoGardener.modules.GenVarProducer import * from LatinoAnalysis.NanoGardener.modules.BTagEventWeightProducer import * #/WZTo3LNu_TuneCP5_13TeV-amcatnloFXFX-pythia8/RunIIAutumn18NanoAODv5-Nano1June2019_102X_upgrade2018_realistic_v19-v1/NANOAODSIM #/store/mc/RunIIAutumn18NanoAODv5/WZTo3LNu_TuneCP5_13TeV-amcatnloFXFX-pythia8/NANOAODSIM/Nano1June2019_102X_upgrade2018_realistic_v19-v1/60000/F575D852-8B1F-1C4A-B788-E049F3892AE3.root #xrdcp root://cms-xrd-global.cern.ch//store/mc/RunIIAutumn18NanoAODv5/WZTo3LNu_TuneCP5_13TeV-amcatnloFXFX-pythia8/NANOAODSIM/Nano1June2019_102X_upgrade2018_realistic_v19-v1/60000/F575D852-8B1F-1C4A-B788-E049F3892AE3.root . files = ["F575D852-8B1F-1C4A-B788-E049F3892AE3.root"] #selection = "nElectron>0 && nMuon>0 && Electron_pt[0]>20 && Muon_pt[0]>20 && nJet>1 && Jet_pt[0]>30 && Jet_pt[1]>30"