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
backport tau pog nanoAOD clean up to 10_6_X #33658
Changes from 8 commits
2cb79cb
d28a422
a26149f
52d8d91
3acf64b
94cceac
6714a54
5b595f1
3b57fbf
b4d88c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,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'))") | ||
|
@@ -57,8 +61,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), | ||
|
@@ -139,13 +142,13 @@ def _tauId8WPMask(pattern,doc): | |
|
||
_variablesMiniV2 = cms.PSet( | ||
_tauVarsBase, | ||
_mvaAntiEVars, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The _deepTauVars2017v2 is not present in master and is also unused in 10_6, so can be cleaned up |
||
_mvaIsoVars2015Reduced, | ||
_mvaIsoVars2017v1, | ||
_mvaIsoVars2017v2, | ||
_deepTauVars2017v2p1 | ||
) | ||
_variablesMiniV1 = _variablesMiniV2.clone() | ||
_variablesMiniV1 = cms.PSet( | ||
_variablesMiniV2, | ||
_mvaIsoVars2017v2, | ||
_mvaAntiEVars | ||
) | ||
_variablesMiniV1.rawMVAoldDM = Var( "tauID('byIsolationMVArun2v1DBoldDMwLTraw')",float, doc="byIsolationMVArun2v1DBoldDMwLT raw output discriminator (2015)",precision=10) | ||
_variablesMiniV1.rawMVAoldDM2017v1 = Var( "tauID('byIsolationMVArun2v1DBoldDMwLTraw2017v1')",float, doc="byIsolationMVArun2v1DBoldDMwLT raw output discriminator (2017v1)",precision=10) | ||
_variablesMiniV1.idMVAoldDM = _tauId6WPMask( "by%sIsolationMVArun2v1DBoldDMwLT", doc="IsolationMVArun2v1DBoldDMwLT ID working point (2015)") | ||
|
@@ -158,25 +161,29 @@ 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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we removed the _mvaAntiEVars in the master, why not here as well ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know why, but the era dependency of _mvaAntiEVars here was arranged the other way round than in master, i.e. the default was what is needed in previous eras and for 106v2 it was changed via modifier. I was conservative with my change and only removed the modifier, but if you prefer, I can arrange it like master. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just for completeness: Concerning the line above in particular, this required to restore mvaAntiEVars since it is not done by a following modifier. |
||
) | ||
for era in [run2_nanoAOD_94XMiniAODv1,]: | ||
era.toModify(tauTable, | ||
variables = _variablesMiniV1 | ||
) | ||
run2_miniAOD_80XLegacy.toModify(tauTable, | ||
variables = _variables80X | ||
) | ||
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 | ||
) | ||
|
||
(run2_nanoAOD_106Xv2 | run2_miniAOD_devel).toModify(tauTable.variables, | ||
idAntiEleDeadECal = Var("tauID('againstElectronDeadECAL')", bool, doc = "Anti-electron dead-ECal discriminator"), | ||
rawAntiEle2018 = Var("tauID('againstElectronMVA6Raw')", float, doc= "Anti-electron MVA discriminator V6 raw output discriminator (2018)", precision=10), | ||
rawAntiEleCat2018 = Var("tauID('againstElectronMVA6category')", int, doc="Anti-electron MVA discriminator V6 category (2018)"), | ||
idAntiEle2018 = _tauId5WPMask("againstElectron%sMVA6", doc= "Anti-electron MVA discriminator V6 (2018)"), | ||
rawAntiEle = Var("tauID('againstElectronMVA6Raw2015')", float, doc= "Anti-electron MVA discriminator V6 raw output discriminator (2015)", precision=10), | ||
rawAntiEleCat = Var("tauID('againstElectronMVA6category2015')", int, doc="Anti-electron MVA discriminator V6 category (2015"), | ||
idAntiEle = _tauId5WPMask("againstElectron%sMVA62015", doc= "Anti-electron MVA discriminator V6 (2015)") | ||
idAntiEleDeadECal = Var("tauID('againstElectronDeadECAL')", bool, doc = "Anti-electron dead-ECal discriminator") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be done like in master: one set the future as default, and then rewire the past. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. alright, to be updated. As I said above, I tried to keep changes wrt. present implementation small. But in fact I was wondering why this was not consistent with the convention you are describing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will adapt the logic for idAntiEleDeadECal as well (while the quantity itself was not part of the clean up so far) |
||
) | ||
|
||
tauGenJets.GenParticles = cms.InputTag("prunedGenParticles") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can profit to replace all these import with
from PhysicsTools.NanoAOD.nano_eras_cff import *
(to add at the beginning of the file)