1 import FWCore.ParameterSet.Config
as cms
10 finalTaus = cms.EDFilter(
"PATTauRefSelector",
11 src = cms.InputTag(
"slimmedTaus"),
12 cut = cms.string(
"pt > 18 && tauID('decayModeFindingNewDMs') && (tauID('byLooseCombinedIsolationDeltaBetaCorr3Hits') || tauID('byVLooseIsolationMVArun2v1DBoldDMwLT') || tauID('byVLooseIsolationMVArun2v1DBnewDMwLT') || tauID('byVLooseIsolationMVArun2v1DBdR03oldDMwLT'))")
17 return Var(
" + ".
join([
"%d * tauID('%s')" % (
pow(2,i), pattern % c)
for (i,c)
in enumerate(choices)]),
"uint8",
18 doc=doc+
": bitmask "+
", ".
join([
"%d = %s" % (
pow(2,i),c)
for (i,c)
in enumerate(choices)]))
20 return _tauIdWPMask(pattern,choices=(
"Loose",
"Tight"),doc=doc)
22 return _tauIdWPMask(pattern,choices=(
"VLoose",
"Loose",
"Medium",
"Tight",
"VTight"),doc=doc)
24 return _tauIdWPMask(pattern,choices=(
"VLoose",
"Loose",
"Medium",
"Tight",
"VTight",
"VVTight"),doc=doc)
27 tauTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
28 src = cms.InputTag(
"linkedObjects",
"taus"),
30 name= cms.string(
"Tau"),
31 doc = cms.string(
"slimmedTaus after basic selection (" + finalTaus.cut.value()+
")"),
32 singleton = cms.bool(
False),
33 extension = cms.bool(
False),
34 variables = cms.PSet(P4Vars,
35 charge =
Var(
"charge", int, doc=
"electric charge"),
36 jetIdx =
Var(
"?hasUserCand('jet')?userCand('jet').key():-1", int, doc=
"index of the associated jet (-1 if none)"),
37 decayMode =
Var(
"decayMode()",int),
38 idDecayMode =
Var(
"tauID('decayModeFinding')", bool),
39 idDecayModeNewDMs =
Var(
"tauID('decayModeFindingNewDMs')", bool),
41 leadTkPtOverTauPt =
Var(
"leadChargedHadrCand.pt/pt ",float, doc=
"pt of the leading track divided by tau pt",precision=10),
42 leadTkDeltaEta =
Var(
"leadChargedHadrCand.eta - eta ",float, doc=
"eta of the leading track, minus tau eta",precision=8),
43 leadTkDeltaPhi =
Var(
"deltaPhi(leadChargedHadrCand.phi, phi) ",float, doc=
"phi of the leading track, minus tau phi",precision=8),
45 dxy =
Var(
"leadChargedHadrCand().dxy()",float, doc=
"d_{xy} of lead track with respect to PV, in cm (with sign)",precision=10),
46 dz =
Var(
"leadChargedHadrCand().dz()",float, doc=
"d_{z} of lead track with respect to PV, in cm (with sign)",precision=14),
49 rawIso =
Var(
"tauID('byCombinedIsolationDeltaBetaCorrRaw3Hits')", float, doc =
"combined isolation (deltaBeta corrections)", precision=10),
50 chargedIso =
Var(
"tauID('chargedIsoPtSum')", float, doc =
"charged isolation", precision=10),
51 neutralIso =
Var(
"tauID('neutralIsoPtSum')", float, doc =
"neutral (photon) isolation", precision=10),
52 puCorr =
Var(
"tauID('puCorrPtSum')", float, doc =
"pileup correction", precision=10),
53 footprintCorr =
Var(
"tauID('footprintCorrection')", float, doc =
"footprint correction", precision=10),
54 photonsOutsideSignalCone =
Var(
"tauID('photonPtSumOutsideSignalCone')", float, doc =
"sum of photons outside signal cone", precision=10),
56 rawMVAnewDM =
Var(
"tauID('byIsolationMVArun2v1DBnewDMwLTraw')",float, doc=
"byIsolationMVArun2v1DBnewDMwLT raw output discriminator",precision=10),
57 rawMVAoldDM =
Var(
"tauID('byIsolationMVArun2v1DBoldDMwLTraw')",float, doc=
"byIsolationMVArun2v1DBoldDMwLT raw output discriminator",precision=10),
58 rawMVAoldDMdR03 =
Var(
"tauID('byIsolationMVArun2v1DBdR03oldDMwLTraw')",float, doc=
"byIsolationMVArun2v1DBdR03oldDMwLT raw output discriminator",precision=10),
59 rawAntiEle =
Var(
"tauID('againstElectronMVA6Raw')", float, doc=
"Anti-electron MVA discriminator V6 raw output discriminator", precision=10),
60 rawAntiEleCat =
Var(
"tauID('againstElectronMVA6category')", int, doc=
"Anti-electron MVA discriminator V6 category"),
62 idAntiMu =
_tauId2WPMask(
"againstMuon%s3", doc=
"Anti-muon discriminator V3: "),
63 idAntiEle =
_tauId5WPMask(
"againstElectron%sMVA6", doc=
"Anti-electron MVA discriminator V6"),
64 idMVAnewDM =
_tauId6WPMask(
"by%sIsolationMVArun2v1DBnewDMwLT", doc=
"IsolationMVArun2v1DBnewDMwLT ID working point"),
65 idMVAoldDM =
_tauId6WPMask(
"by%sIsolationMVArun2v1DBoldDMwLT", doc=
"IsolationMVArun2v1DBoldDMwLT ID working point"),
66 idMVAoldDMdR03 =
_tauId6WPMask(
"by%sIsolationMVArun2v1DBdR03oldDMwLT", doc=
"IsolationMVArun2v1DBdR03oldDMwLT ID working point"),
76 tauGenJets.GenParticles = cms.InputTag(
"prunedGenParticles")
77 tauGenJets.includeNeutrinos = cms.bool(
False)
79 genVisTaus = cms.EDProducer(
"GenVisTauProducer",
80 src = cms.InputTag(
"tauGenJetsSelectorAllHadrons"),
81 srcGenParticles = cms.InputTag(
"prunedGenParticles")
84 genVisTauTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
85 src = cms.InputTag(
"genVisTaus"),
86 cut = cms.string(
"pt > 10."),
87 name = cms.string(
"GenVisTau"),
88 doc = cms.string(
"gen hadronic taus "),
89 singleton = cms.bool(
False),
90 extension = cms.bool(
False),
92 pt =
Var(
"pt", float,precision=8),
93 phi =
Var(
"phi", float,precision=8),
94 eta =
Var(
"eta", float,precision=8),
95 mass =
Var(
"mass", float,precision=8),
96 charge =
Var(
"charge", int),
97 status =
Var(
"status", int, doc=
"Hadronic tau decay mode. 0=OneProng0PiZero, 1=OneProng1PiZero, 2=OneProng2PiZero, 10=ThreeProng0PiZero, 11=ThreeProng1PiZero, 15=Other"),
98 genPartIdxMother =
Var(
"?numberOfMothers>0?motherRef(0).key():-1", int, doc=
"index of the mother particle"),
102 tausMCMatchLepTauForTable = cms.EDProducer(
"MCMatcher",
104 matched = cms.InputTag(
"finalGenParticles"),
105 mcPdgId = cms.vint32(11,13),
106 checkCharge = cms.bool(
False),
107 mcStatus = cms.vint32(1),
108 maxDeltaR = cms.double(0.3),
109 maxDPtRel = cms.double(0.5),
110 resolveAmbiguities = cms.bool(
True),
111 resolveByMatchQuality = cms.bool(
True),
114 tausMCMatchHadTauForTable = cms.EDProducer(
"MCMatcher",
116 matched = cms.InputTag(
"genVisTaus"),
117 mcPdgId = cms.vint32(15),
118 checkCharge = cms.bool(
False),
119 mcStatus = cms.vint32(),
120 maxDeltaR = cms.double(0.3),
121 maxDPtRel = cms.double(1.),
122 resolveAmbiguities = cms.bool(
True),
123 resolveByMatchQuality = cms.bool(
True),
126 tauMCTable = cms.EDProducer(
"CandMCMatchTableProducer",
128 mcMap = cms.InputTag(
"tausMCMatchLepTauForTable"),
129 mcMapVisTau = cms.InputTag(
"tausMCMatchHadTauForTable"),
130 objName = tauTable.name,
131 objType = tauTable.name,
132 branchName = cms.string(
"genPart"),
133 docString = cms.string(
"MC matching to status==2 taus"),
137 tauSequence = cms.Sequence(finalTaus)
138 tauTables = cms.Sequence(tauTable)
139 tauMC = cms.Sequence(tauGenJets + tauGenJetsSelectorAllHadrons + genVisTaus + genVisTauTable + tausMCMatchLepTauForTable + tausMCMatchHadTauForTable + tauMCTable)
def _tauId5WPMask(pattern, doc)
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
def _tauId6WPMask(pattern, doc)
def _tauIdWPMask(pattern, choices, doc="")
Tables for final output and docs ##########################.
static std::string join(char **cmd)
def _tauId2WPMask(pattern, doc)
Power< A, B >::type pow(const A &a, const B &b)