CMS 3D CMS Logo

boostedTaus_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
3 
4 ##################### Import reusable funtions and objects from std taus ########
5 from PhysicsTools.NanoAOD.taus_cff import _tauId2WPMask,_tauId5WPMask,_tauId7WPMask,tausMCMatchLepTauForTable,tausMCMatchHadTauForTable,tauMCTable
6 
7 ##################### User floats producers, selectors ##########################
8 
9 
10 finalBoostedTaus = cms.EDFilter("PATTauRefSelector",
11  src = cms.InputTag("slimmedTausBoostedNewID"),
12  cut = cms.string("pt > 40 && tauID('decayModeFindingNewDMs') && (tauID('byVVLooseIsolationMVArun2017v2DBoldDMwLT2017') || tauID('byVVLooseIsolationMVArun2017v2DBoldDMdR0p3wLT2017') || tauID('byVVLooseIsolationMVArun2017v2DBnewDMwLT2017'))")
13 )
14 
15 boostedTauTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
16  src = cms.InputTag("finalBoostedTaus"),
17  cut = cms.string(""), #we should not filter on cross linked collections
18  name= cms.string("boostedTau"),
19  doc = cms.string("slimmedBoostedTaus after basic selection (" + finalBoostedTaus.cut.value()+")"),
20  singleton = cms.bool(False), # the number of entries is variable
21  extension = cms.bool(False), # this is the main table for the taus
22  variables = cms.PSet() # PSet defined below in era dependent way
23 )
24 _boostedTauVarsBase = cms.PSet(P4Vars,
25  charge = Var("charge", int, doc="electric charge"),
26  jetIdx = Var("?hasUserCand('jet')?userCand('jet').key():-1", int, doc="index of the associated jet (-1 if none)"),
27  decayMode = Var("decayMode()",int),
28  leadTkPtOverTauPt = Var("leadChargedHadrCand.pt/pt ",float, doc="pt of the leading track divided by tau pt",precision=10),
29  leadTkDeltaEta = Var("leadChargedHadrCand.eta - eta ",float, doc="eta of the leading track, minus tau eta",precision=8),
30  leadTkDeltaPhi = Var("deltaPhi(leadChargedHadrCand.phi, phi) ",float, doc="phi of the leading track, minus tau phi",precision=8),
31 
32  rawIso = Var( "tauID('byCombinedIsolationDeltaBetaCorrRaw3Hits')", float, doc = "combined isolation (deltaBeta corrections)", precision=10),
33  rawIsodR03 = Var( "(tauID('chargedIsoPtSumdR03')+max(0.,tauID('neutralIsoPtSumdR03')-0.072*tauID('puCorrPtSum')))", float, doc = "combined isolation (deltaBeta corrections, dR=0.3)", precision=10),
34  chargedIso = Var( "tauID('chargedIsoPtSum')", float, doc = "charged isolation", precision=10),
35  neutralIso = Var( "tauID('neutralIsoPtSum')", float, doc = "neutral (photon) isolation", precision=10),
36  puCorr = Var( "tauID('puCorrPtSum')", float, doc = "pileup correction", precision=10),
37  photonsOutsideSignalCone = Var( "tauID('photonPtSumOutsideSignalCone')", float, doc = "sum of photons outside signal cone", precision=10),
38  idAntiMu = _tauId2WPMask("againstMuon%s3", doc= "Anti-muon discriminator V3: "),
39  #MVA 2017 v2 variables
40  rawMVAoldDM2017v2=Var("tauID('byIsolationMVArun2017v2DBoldDMwLTraw2017')",float, doc="byIsolationMVArun2017v2DBoldDMwLT raw output discriminator (2017v2)",precision=10),
41  rawMVAnewDM2017v2 = Var("tauID('byIsolationMVArun2017v2DBnewDMwLTraw2017')",float,doc='byIsolationMVArun2017v2DBnewDMwLT raw output discriminator (2017v2)',precision=10),
42  rawMVAoldDMdR032017v2 = Var("tauID('byIsolationMVArun2017v2DBoldDMdR0p3wLTraw2017')",float,doc='byIsolationMVArun2017v2DBoldDMdR0p3wLT raw output discriminator (2017v2)'),
43  idMVAnewDM2017v2 = _tauId7WPMask("by%sIsolationMVArun2017v2DBnewDMwLT2017", doc="IsolationMVArun2017v2DBnewDMwLT ID working point (2017v2)"),
44  idMVAoldDM2017v2=_tauId7WPMask("by%sIsolationMVArun2017v2DBoldDMwLT2017",doc="IsolationMVArun2017v2DBoldDMwLT ID working point (2017v2)"),
45  idMVAoldDMdR032017v2 = _tauId7WPMask("by%sIsolationMVArun2017v2DBoldDMdR0p3wLT2017",doc="IsolationMVArun2017v2DBoldDMdR0p3wLT ID working point (2017v2)"),
46  rawAntiEle2018 = Var("tauID('againstElectronMVA6Raw')", float, doc= "Anti-electron MVA discriminator V6 raw output discriminator (2018)", precision=10),
47  rawAntiEleCat2018 = Var("tauID('againstElectronMVA6category')", int, doc="Anti-electron MVA discriminator V6 category (2018)"),
48  idAntiEle2018 = _tauId5WPMask("againstElectron%sMVA6", doc= "Anti-electron MVA discriminator V6 (2018)"),
49 )
50 
51 boostedTauTable.variables = _boostedTauVarsBase
52 
53 
54 boostedTausMCMatchLepTauForTable = tausMCMatchLepTauForTable.clone(
55  src = boostedTauTable.src
56 )
57 
58 #This requires genVisTaus in taus_cff.py
59 boostedTausMCMatchHadTauForTable = tausMCMatchHadTauForTable.clone(
60  src = boostedTauTable.src
61 )
62 
63 boostedTauMCTable = tauMCTable.clone(
64  src = boostedTauTable.src,
65  mcMap = cms.InputTag("boostedTausMCMatchLepTauForTable"),
66  mcMapVisTau = cms.InputTag("boostedTausMCMatchHadTauForTable"),
67  objName = boostedTauTable.name,
68 )
69 
70 
71 boostedTauSequence = cms.Sequence(finalBoostedTaus)
72 boostedTauTables = cms.Sequence(boostedTauTable)
73 boostedTauMC = cms.Sequence(boostedTausMCMatchLepTauForTable + boostedTausMCMatchHadTauForTable + boostedTauMCTable)
74 
def _tauId7WPMask(pattern, doc)
Definition: taus_cff.py:46
def _tauId5WPMask(pattern, doc)
Definition: taus_cff.py:42
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
Definition: common_cff.py:20
def _tauId2WPMask(pattern, doc)
Definition: taus_cff.py:36