btagM_thr=lambda year: 0.6324 if year==2016 else 0.4941 if year==2017 else 0.4184, jetBTag='btagDeepB', isMC = True) recleaner_step2_data = lambda : fastCombinedObjectRecleaner(label="Recl", inlabel="_InternalRecl", cleanTausWithLooseLeptons=True, cleanJetsWithFOTaus=True, doVetoZ=False, doVetoLMf=False, doVetoLMt=False, jetPts=[25,40], jetPtsFwd=[25,40], btagL_thr=lambda year: 0.4 if year==2016 else 0.1522 if year==2017 else 0.1241, btagM_thr=lambda year: 0.6324 if year==2016 else 0.4941 if year==2017 else 0.4184, jetBTag='btagDeepB', isMC = False) from CMGTools.TTHAnalysis.tools.eventVars_2lss import EventVars2LSS eventVars = lambda : EventVars2LSS('','Recl', doSystJEC=False) from CMGTools.TTHAnalysis.tools.objTagger import ObjTagger isMatchRightCharge = lambda : ObjTagger('isMatchRightCharge','LepGood', [lambda l,g: (l.genPartFlav==1 or l.genPartFlav == 15) and (g.pdgId*l.pdgId > 0) ], linkColl='GenPart',linkVar='genPartIdx') mcMatchId = lambda : ObjTagger('mcMatchId','LepGood', [lambda l: (l.genPartFlav==1 or l.genPartFlav == 15) ]) mcPromptGamma = lambda : ObjTagger('mcPromptGamma','LepGood', [lambda l: (l.genPartFlav==22)]) mcMatch_seq = [ isMatchRightCharge, mcMatchId ,mcPromptGamma] from PhysicsTools.NanoAODTools.postprocessing.modules.jme.jetmetUncertainties import jetmetUncertainties2016, jetmetUncertainties2017, jetmetUncertainties2018 isVLFOEle = lambda : ObjTagger('isVLFOEle', "Electron", [lambda lep,year: VLooseFOEleID(lep,year) ]) isTightEle = lambda : ObjTagger('isTightEle', "Electron", [lambda lep,year: tightEleID(lep,year) ]) isCleanEle = lambda : ObjTagger('isCleanEle', "Electron", [ lambda lep,year: fullCleaningLeptonSel(lep,year) and electronSelection(lep) ]) isCleanMu = lambda : ObjTagger('isCleanMu', "Muon", [ lambda lep,year: fullCleaningLeptonSel(lep,year) and muonSelection(lep) ]) isCleanEle_noBtag = lambda : ObjTagger('isCleanEle_noBtag', "Electron", [ lambda lep,year: fullCleaningLeptonSel_noBtag(lep,year) and electronSelection(lep) ])
label="Recl", inlabel="_InternalRecl", cleanTausWithLooseLeptons=True, cleanJetsWithFOTaus=True, doVetoZ=False, doVetoLMf=False, doVetoLMt=False, jetPts=[25, 40], jetPtsFwd=[25, 60 ], # second number for 2.7 < abseta < 3, the first for the rest btagL_thr=-99., # they are set at runtime btagM_thr=-99., # they are set at runtime isMC=False) from CMGTools.TTHAnalysis.tools.eventVars_2lss import EventVars2LSS eventVars = lambda: EventVars2LSS('', 'Recl') from CMGTools.TTHAnalysis.tools.objTagger import ObjTagger isMatchRightCharge = lambda: ObjTagger('isMatchRightCharge', 'LepGood', [ lambda l, g: (l.genPartFlav == 1 or l.genPartFlav == 15) and (g.pdgId * l.pdgId > 0) ], linkColl='GenPart', linkVar='genPartIdx') mcMatchId = lambda: ObjTagger('mcMatchId', 'LepGood', [ lambda l: (l.genPartFlav == 1 or l.genPartFlav == 15) ]) mcPromptGamma = lambda: ObjTagger('mcPromptGamma', 'LepGood', [lambda l: (l.genPartFlav == 22)])
postfix="up", name="vtxWeightUp"))) MODULES.append(('puWeightsTrue_down', lambda: VertexWeightFriend(putruefilemc, putruefiledata_down, "nTrueInt_signal", "pileup", verbose=True, vtx_coll_to_reweight="nTrueInt", postfix="down", name="vtxWeightDown"))) #--- TTH event variables from CMGTools.TTHAnalysis.tools.eventVars_2lss import EventVars2LSS MODULES.append(('ttH2lss', lambda: EventVars2LSS())) from CMGTools.TTHAnalysis.tools.kinMVA_2D_2lss_3l import KinMVA_2D_2lss_3l MODULES.append(('kinMVA_2D_2lss_3l', lambda: KinMVA_2D_2lss_3l( os.environ["CMSSW_BASE"] + "/src/CMGTools/TTHAnalysis/data/kinMVA/tth/%s_BDTG.weights.xml", skip_BDTv8=True, skip_MEM=True))) from CMGTools.TTHAnalysis.tools.kinMVA_MultiClass import KinMVA_MultiClass MODULES.append(('kinMVA_MultiClass', lambda: KinMVA_MultiClass(os.environ[ "CMSSW_BASE" ] + "/src/CMGTools/TTHAnalysis/macros/leptons/weights/MultiClassICHEP16_%s_BDTG.weights.xml" ))) from CMGTools.TTHAnalysis.tools.HadTopSimple import HadTopSimple MODULES.append(('HadTopSimple', lambda: HadTopSimple())) from CMGTools.TTHAnalysis.tools.BDT2_HadTop import BDT2_HadTop MODULES.append(('BDT2_HadTop', lambda: BDT2_HadTop(os.environ[
MODULES.append( ('leptonJetFastReCleanerTTH_step2_data', lambda: fastCombinedObjectRecleaner(label="Recl", inlabel="_InternalRecl", cleanTausWithLooseLeptons=True, cleanJetsWithFOTaus=True, doVetoZ=False, doVetoLMf=False, doVetoLMt=False, jetPts=[25, 40], btagL_thr=0.1522, btagM_thr=0.4941, isMC=False))) from CMGTools.TTHAnalysis.tools.eventVars_2lss import EventVars2LSS MODULES.append(('eventVars', lambda: EventVars2LSS('', 'Recl'))) from CMGTools.TTHAnalysis.tools.kinMVA_2D_2lss_3l import KinMVA_2D_2lss_3l MODULES.append(('kinMVA_2D_2lss_3l', lambda: KinMVA_2D_2lss_3l( os.environ["CMSSW_BASE"] + "/src/CMGTools/TTHAnalysis/data/kinMVA/tth/%s_BDTG.weights.xml", useTT_2lss='v8,rTT,httTT', useMEM_3l=False))) MODULES.append(('noTTMVA_2D_2lss_3l', lambda: KinMVA_2D_2lss_3l( os.environ["CMSSW_BASE"] + "/src/CMGTools/TTHAnalysis/data/kinMVA/tth/%s_BDTG.weights.xml", useTT_2lss='', useMEM_3l=False))) MODULES.append(('kinMEMMVA_2D_2lss_3l', lambda: KinMVA_2D_2lss_3l( os.environ["CMSSW_BASE"] + "/src/CMGTools/TTHAnalysis/data/kinMVA/tth/%s_BDTG.weights.xml",
inlabel="_InternalRecl", cleanTausWithLooseLeptons=True, cleanJetsWithFOTaus=True, doVetoZ=False, doVetoLMf=False, doVetoLMt=False, jetPts=[25, 40], jetPtsFwd=[25, 60 ], # second number for 2.7 < abseta < 3, the first for the rest btagL_thr=-99., # they are set at runtime btagM_thr=-99., # they are set at runtime isMC=False, variations=[]) from CMGTools.TTHAnalysis.tools.eventVars_2lss import EventVars2LSS eventVars = lambda: EventVars2LSS('', 'Recl') eventVars_allvariations = lambda: EventVars2LSS( '', 'Recl', variations=['jes%s' % v for v in jecGroups] + [ 'jer%s' % x for x in [ 'barrel', 'endcap1', 'endcap2highpt', 'endcap2lowpt', 'forwardhighpt', 'forwardlowpt' ] ] + ['HEM']) from CMGTools.TTHAnalysis.tools.hjDummCalc import HjDummyCalc hjDummy = lambda: HjDummyCalc(variations=['jes%s' % v for v in jecGroups] + [ 'jer%s' % x for x in [ 'barrel', 'endcap1', 'endcap2highpt', 'endcap2lowpt', 'forwardhighpt', 'forwardlowpt'
inlabel="_InternalRecl", cleanTausWithLooseLeptons=True, cleanJetsWithFOTaus=True, doVetoZ=False, doVetoLMf=False, doVetoLMt=False, jetPts=[25, 40], jetPtsFwd=[25, 60 ], # second number for 2.7 < abseta < 3, the first for the rest btagL_thr=-99., # they are set at runtime btagM_thr=-99., # they are set at runtime isMC=False, variations=[]) from CMGTools.TTHAnalysis.tools.eventVars_2lss import EventVars2LSS eventVars = lambda: EventVars2LSS('', 'Recl') eventVars_allvariations = lambda: EventVars2LSS( '', 'Recl', variations=['jes%s' % v for v in jecGroups] + ['jer']) from CMGTools.TTHAnalysis.tools.objTagger import ObjTagger isMatchRightCharge = lambda: ObjTagger('isMatchRightCharge', 'LepGood', [ lambda l, g: (l.genPartFlav == 1 or l.genPartFlav == 15) and (g.pdgId * l.pdgId > 0) ], linkColl='GenPart', linkVar='genPartIdx') mcMatchId = lambda: ObjTagger('mcMatchId', 'LepGood', [ lambda l: (l.genPartFlav == 1 or l.genPartFlav == 15) ])