Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up tau related nanoAOD content #33513

Merged
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 16 additions & 7 deletions PhysicsTools/NanoAOD/python/taus_cff.py
Expand Up @@ -12,9 +12,13 @@

finalTaus = cms.EDFilter("PATTauRefSelector",
src = cms.InputTag("slimmedTausUpdated"),
cut = cms.string("pt > 18 && tauID('decayModeFindingNewDMs') && (tauID('byLooseCombinedIsolationDeltaBetaCorr3Hits') || tauID('byVLooseIsolationMVArun2v1DBoldDMwLT2015') || tauID('byVLooseIsolationMVArun2v1DBnewDMwLT') || tauID('byVLooseIsolationMVArun2v1DBdR03oldDMwLT') || tauID('byVVLooseIsolationMVArun2v1DBoldDMwLT') || tauID('byVVLooseIsolationMVArun2v1DBoldDMwLT2017v2') || tauID('byVVLooseIsolationMVArun2v1DBnewDMwLT2017v2') || tauID('byVVLooseIsolationMVArun2v1DBdR03oldDMwLT2017v2') || tauID('byVVVLooseDeepTau2017v2p1VSjet'))")
cut = cms.string("pt > 18 && tauID('decayModeFindingNewDMs') && (tauID('byLooseCombinedIsolationDeltaBetaCorr3Hits') || (tauID('chargedIsoPtSumdR03')+max(0.,tauID('neutralIsoPtSumdR03')-0.072*tauID('puCorrPtSum'))<2.5) || tauID('byVVVLooseDeepTau2017v2p1VSjet'))")
)

for era in [run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_94X2016, run2_nanoAOD_102Xv1, run2_nanoAOD_106Xv1]:
era.toModify(finalTaus,
cut = cms.string("pt > 18 && tauID('decayModeFindingNewDMs') && (tauID('byLooseCombinedIsolationDeltaBetaCorr3Hits') || tauID('byVLooseIsolationMVArun2v1DBoldDMwLT2015') || tauID('byVLooseIsolationMVArun2v1DBnewDMwLT') || tauID('byVLooseIsolationMVArun2v1DBdR03oldDMwLT') || tauID('byVVLooseIsolationMVArun2v1DBoldDMwLT') || tauID('byVVLooseIsolationMVArun2v1DBoldDMwLT2017v2') || tauID('byVVLooseIsolationMVArun2v1DBnewDMwLT2017v2') || tauID('byVVLooseIsolationMVArun2v1DBdR03oldDMwLT2017v2') || tauID('byVVVLooseDeepTau2017v2p1VSjet'))")
)
for era in [run2_nanoAOD_94XMiniAODv1,]:
era.toModify(finalTaus,
cut = cms.string("pt > 18 && tauID('decayModeFindingNewDMs') && (tauID('byLooseCombinedIsolationDeltaBetaCorr3Hits') || tauID('byVLooseIsolationMVArun2v1DBoldDMwLT') || tauID('byVLooseIsolationMVArun2v1DBnewDMwLT') || tauID('byVLooseIsolationMVArun2v1DBdR03oldDMwLT') || tauID('byVVLooseIsolationMVArun2v1DBoldDMwLT2017v1') || tauID('byVVLooseIsolationMVArun2v1DBoldDMwLT2017v2') || tauID('byVVLooseIsolationMVArun2v1DBnewDMwLT2017v2') || tauID('byVVLooseIsolationMVArun2v1DBdR03oldDMwLT2017v2') || tauID('byVVVLooseDeepTau2017v2p1VSjet'))")
Comment on lines +18 to 24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these selection (i.e. EOY16, EOY17part2 vs EOY17part1) differs for the following:

tauID('byVLooseIsolationMVArun2v1DBoldDMwLT') --> byVLooseIsolationMVArun2v1DBoldDMwLT2015

byVVLooseIsolationMVArun2v1DBoldDMwLT -->
byVVLooseIsolationMVArun2v1DBoldDMwLT2017v1

this appears also later for the cleanup of the

is this expected ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is expected in the sense that it was like this before the clean up and I did not intend to change anything about earlier eras. But I can't tell you the reason why this was treated this way. I would have to ask back to TauPOG.

Expand Down Expand Up @@ -56,8 +60,7 @@ def _tauId8WPMask(pattern,doc):
charge = Var("charge", int, doc="electric charge"),
jetIdx = Var("?hasUserCand('jet')?userCand('jet').key():-1", int, doc="index of the associated jet (-1 if none)"),
decayMode = Var("decayMode()",int),
idDecayMode = Var("tauID('decayModeFinding')", bool),
idDecayModeNewDMs = Var("tauID('decayModeFindingNewDMs')", bool),
idDecayModeOldDMs = Var("tauID('decayModeFinding')", bool),

leadTkPtOverTauPt = Var("leadChargedHadrCand.pt/pt ",float, doc="pt of the leading track divided by tau pt",precision=10),
leadTkDeltaEta = Var("leadChargedHadrCand.eta - eta ",float, doc="eta of the leading track, minus tau eta",precision=8),
Expand Down Expand Up @@ -130,10 +133,6 @@ def _tauId8WPMask(pattern,doc):

_variablesMiniV2 = cms.PSet(
_tauVarsBase,
_mvaAntiEVars,
_mvaIsoVars2015Reduced,
_mvaIsoVars2017v1,
_mvaIsoVars2017v2,
_deepTauVars2017v2p1
)
_variablesMiniV1 = _variablesMiniV2.clone()
Expand All @@ -149,6 +148,9 @@ def _tauId8WPMask(pattern,doc):

tauTable.variables = _variablesMiniV2

(run2_nanoAOD_92X | run2_nanoAOD_94XMiniAODv2 | run2_nanoAOD_94X2016 | run2_nanoAOD_102Xv1 | run2_nanoAOD_106Xv1).toModify(tauTable,
variables = cms.PSet(tauTable.variables, _mvaAntiEVars, _mvaIsoVars2015Reduced, _mvaIsoVars2017v1, _mvaIsoVars2017v2)
)
for era in [run2_nanoAOD_94XMiniAODv1,]:
era.toModify(tauTable,
variables = _variablesMiniV1
Expand All @@ -167,6 +169,13 @@ def _tauId8WPMask(pattern,doc):
idAntiEle = _tauId5WPMask("againstElectron%sMVA6", doc= "Anti-electron MVA discriminator V6 (2015)")
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines replace the PSet _mvaAntiEVars in all cases it is used. Therefore I suggest to remove _mvaAntiEVars above and only keep this modifier.


for era in [run2_miniAOD_80XLegacy, run2_nanoAOD_92X, run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2, \
run2_nanoAOD_94X2016, run2_nanoAOD_102Xv1, run2_nanoAOD_106Xv1]:
era.toModify(tauTable.variables,
idDecayMode = Var("tauID('decayModeFinding')", bool),
idDecayModeNewDMs = Var("tauID('decayModeFindingNewDMs')", bool),
idDecayModeOldDMs = None
)
run2_miniAOD_80XLegacy.toModify(tauTable.variables,
idAntiEleDeadECal = None)
for era in [run2_nanoAOD_92X, run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2, \
Expand Down