1 import FWCore.ParameterSet.Config
as cms
5 from PhysicsTools.NanoAOD.taus_cff import _tauId2WPMask,_tauId5WPMask,_tauId7WPMask,tausMCMatchLepTauForTable,tausMCMatchHadTauForTable,tauMCTable
10 finalBoostedTaus = cms.EDFilter(
"PATTauRefSelector",
11 src = cms.InputTag(
"slimmedTausBoostedNewID"),
12 cut = cms.string(
"pt > 40 && tauID('decayModeFindingNewDMs') && (tauID('byVVLooseIsolationMVArun2017v2DBoldDMwLT2017') || tauID('byVVLooseIsolationMVArun2017v2DBoldDMdR0p3wLT2017') || tauID('byVVLooseIsolationMVArun2017v2DBnewDMwLT2017'))")
15 boostedTauTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
16 src = cms.InputTag(
"finalBoostedTaus"),
18 name= cms.string(
"boostedTau"),
19 doc = cms.string(
"slimmedBoostedTaus after basic selection (" + finalBoostedTaus.cut.value()+
")"),
20 singleton = cms.bool(
False),
21 extension = cms.bool(
False),
22 variables = cms.PSet()
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),
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: "),
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)"),
51 boostedTauTable.variables = _boostedTauVarsBase
54 boostedTausMCMatchLepTauForTable = tausMCMatchLepTauForTable.clone(
55 src = boostedTauTable.src
59 boostedTausMCMatchHadTauForTable = tausMCMatchHadTauForTable.clone(
60 src = boostedTauTable.src
63 boostedTauMCTable = tauMCTable.clone(
64 src = boostedTauTable.src,
65 mcMap = cms.InputTag(
"boostedTausMCMatchLepTauForTable"),
66 mcMapVisTau = cms.InputTag(
"boostedTausMCMatchHadTauForTable"),
67 objName = boostedTauTable.name,
71 boostedTauSequence = cms.Sequence(finalBoostedTaus)
72 boostedTauTables = cms.Sequence(boostedTauTable)
73 boostedTauMC = cms.Sequence(boostedTausMCMatchLepTauForTable + boostedTausMCMatchHadTauForTable + boostedTauMCTable)
def _tauId7WPMask(pattern, doc)
def _tauId5WPMask(pattern, doc)
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
def _tauId2WPMask(pattern, doc)