Skip to content

Commit

Permalink
Add suffixes to protect against recreaction of tauId modules with sam…
Browse files Browse the repository at this point in the history
…e names and different inputs
  • Loading branch information
mbluj committed Aug 2, 2022
1 parent 969573d commit 1885608
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions PhysicsTools/NanoAOD/python/nano_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,11 @@ def nanoAOD_addTauIds(process, idsToRun=[]):
updatedTauName = "slimmedTausUpdated"
tauIdEmbedder = tauIdConfig.TauIDEmbedder(process, debug = False,
updatedTauName = updatedTauName,
postfix = "ForNano",
toKeep = idsToRun)
tauIdEmbedder.runTauID()
_tauTask = patTauMVAIDsTask.copy()
_tauTask.add(process.rerunMvaIsolationTask)
_tauTask.add(process.rerunMvaIsolationTaskForNano)
_tauTask.add(finalTaus)
process.finalTaus.src = updatedTauName
#remember to adjust the selection and tables with added IDs
Expand All @@ -139,10 +140,10 @@ def nanoAOD_addBoostedTauIds(process, idsToRun=[]):
boostedTauIdEmbedder = tauIdConfig.TauIDEmbedder(process, debug = False,
originalTauName = "slimmedTausBoosted",
updatedTauName = updatedBoostedTauName,
postfix = "Boosted",
postfix = "BoostedForNano",
toKeep = idsToRun)
boostedTauIdEmbedder.runTauID()
_boostedTauTask = process.rerunMvaIsolationTaskBoosted.copy()
_boostedTauTask = process.rerunMvaIsolationTaskBoostedForNano.copy()
_boostedTauTask.add(getattr(process, updatedBoostedTauName))
_boostedTauTask.add(process.finalBoostedTaus)
process.finalBoostedTaus.src = updatedBoostedTauName
Expand Down
5 changes: 3 additions & 2 deletions PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ def _add_deepFlavour(process):
process, debug = False,
originalTauName = _noUpdatedTauName,
updatedTauName = _updatedTauName,
postfix = 'ForMini',
toKeep = ['deepTau2017v2p1','deepTau2018v2p5']
)
from Configuration.Eras.Modifier_phase2_common_cff import phase2_common #Phase2 Tau MVA
Expand All @@ -386,8 +387,8 @@ def _add_deepFlavour(process):
addToProcessAndTask(_noUpdatedTauName, process.slimmedTaus.clone(),process,task)
delattr(process, 'slimmedTaus')
process.slimmedTaus = getattr(process, _updatedTauName).clone()
process.rerunMvaIsolationTask.add(process.slimmedTaus)
task.add(process.rerunMvaIsolationTask)
process.rerunMvaIsolationTaskForMini.add(process.slimmedTaus)
task.add(process.rerunMvaIsolationTaskForMini)

#-- Rerun tauID against dead ECal towers to taus for the various re-MiniAOD eras
# to enable default behoviour with leading track extrapolation to ECAL
Expand Down

0 comments on commit 1885608

Please sign in to comment.