Skip to content
Snippets Groups Projects

DerivationFrameworkTau, tauRec, tauRecTools: optimise muon-tau removal sequence

Merged Bertrand Martin Dit Latour requested to merge martindl/athena:main_test into main
12 files
+ 108
115
Compare changes
  • Side-by-side
  • Inline
Files
12
  • Hello,
    
    This MR is addressing the CPU increase in DAOD_PHYS/LITE reported in ATLASG-2712 coming from the recent addition of GNTau ID.
    The main changes are in TauAODRunnerAlg, which first run a tool to remove muon tracks and clusters associated with tau candidate, then reruns most of the tau reconstruction with muon-free inputs.
    Now, in the muon-tau removal, if no muon track nor cluster is found near the tau, we discard the tau candidate by effectively removing it from the container. This prevents afterburner tools like GNN tau ID from running over the full container (which so far includes irrelevant tau candidates removed later on by a thinning algorithm), thereby saving CPU. I've checked that the TauJets_MuonRM_TauIDDecorKernel CPU time is reduced, it's no longer visible in the SPOT test summary. The DAOD output is unchanged (checked over 1000 events).
    
    Adding the urgent flag in case it would sill arrive in time for the imminent DAOD bulk prod.
    
    Cheers,
    Bertrand
# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
# PhysCommonThinningConfig
# Contains the configuration for the thinning for PHYS(LITE)
@@ -6,7 +6,7 @@
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory
def PhysCommonThinningCfg(ConfigFlags, StreamName = "StreamDAOD_PHYS", **kwargs):
def PhysCommonThinningCfg(flags, StreamName = "StreamDAOD_PHYS", **kwargs):
"""Configure the common augmentation"""
acc = ComponentAccumulator()
@@ -21,7 +21,7 @@ def PhysCommonThinningCfg(ConfigFlags, StreamName = "StreamDAOD_PHYS", **kwargs)
if "TrackParticleThinningToolName" in kwargs:
tp_thinning_expression = "InDetTrackParticles.DFCommonTightPrimary && abs(DFCommonInDetTrackZ0AtPV)*sin(InDetTrackParticles.theta) < 3.0*mm && InDetTrackParticles.pt > 10*GeV"
acc.merge(TrackParticleThinningCfg(
ConfigFlags,
flags,
name = kwargs['TrackParticleThinningToolName'],
StreamName = StreamName,
SelectionString = tp_thinning_expression,
@@ -30,7 +30,7 @@ def PhysCommonThinningCfg(ConfigFlags, StreamName = "StreamDAOD_PHYS", **kwargs)
# Include inner detector tracks associated with muons
if "MuonTPThinningToolName" in kwargs:
acc.merge(MuonTrackParticleThinningCfg(
ConfigFlags,
flags,
name = kwargs['MuonTPThinningToolName'],
StreamName = StreamName,
MuonKey = "Muons",
@@ -38,8 +38,8 @@ def PhysCommonThinningCfg(ConfigFlags, StreamName = "StreamDAOD_PHYS", **kwargs)
# Tau-related containers: taus, tau tracks and associated ID tracks, neutral PFOs, secondary vertices
if "TauJetThinningToolName" in kwargs:
tau_thinning_expression = "TauJets.pt >= 13*GeV"
acc.merge(TauThinningCfg(ConfigFlags,
tau_thinning_expression = f"TauJets.pt >= {flags.Tau.MinPtDAOD}"
acc.merge(TauThinningCfg(flags,
name = kwargs['TauJetThinningToolName'],
StreamName = StreamName,
Taus = "TauJets",
@@ -51,8 +51,7 @@ def PhysCommonThinningCfg(ConfigFlags, StreamName = "StreamDAOD_PHYS", **kwargs)
if "TauJets_MuonRMThinningToolName" in kwargs:
tau_murm_thinning_expression = tau_thinning_expression.replace('TauJets', 'TauJets_MuonRM')
tau_murm_thinning_expression += " && TauJets_MuonRM.ModifiedInAOD"
acc.merge(TauThinningCfg(ConfigFlags,
acc.merge(TauThinningCfg(flags,
name = kwargs['TauJets_MuonRMThinningToolName'],
StreamName = StreamName,
Taus = "TauJets_MuonRM",
@@ -64,7 +63,7 @@ def PhysCommonThinningCfg(ConfigFlags, StreamName = "StreamDAOD_PHYS", **kwargs)
if "TauJets_EleRMThinningToolName" in kwargs:
tau_erm_thinning_expression = tau_thinning_expression.replace('TauJets', 'TauJets_EleRM')
acc.merge(TauThinningCfg(ConfigFlags,
acc.merge(TauThinningCfg(flags,
name = kwargs['TauJets_EleRMThinningToolName'],
StreamName = StreamName,
Taus = "TauJets_EleRM",
@@ -77,7 +76,7 @@ def PhysCommonThinningCfg(ConfigFlags, StreamName = "StreamDAOD_PHYS", **kwargs)
# ID tracks associated with high-pt di-tau
if "DiTauTPThinningToolName" in kwargs:
acc.merge(DiTauTrackParticleThinningCfg(
ConfigFlags,
flags,
name = kwargs['DiTauTPThinningToolName'],
StreamName = StreamName,
DiTauKey = "DiTauJets",
@@ -86,7 +85,7 @@ def PhysCommonThinningCfg(ConfigFlags, StreamName = "StreamDAOD_PHYS", **kwargs)
## Low-pt di-tau thinning
if "DiTauLowPtThinningToolName" in kwargs:
acc.merge(GenericObjectThinningCfg(
ConfigFlags,
flags,
name = kwargs['DiTauLowPtThinningToolName'],
StreamName = StreamName,
ContainerName = "DiTauJetsLowPt",
@@ -95,7 +94,7 @@ def PhysCommonThinningCfg(ConfigFlags, StreamName = "StreamDAOD_PHYS", **kwargs)
# ID tracks associated with low-pt ditau
if "DiTauLowPtTPThinningToolName" in kwargs:
acc.merge(DiTauTrackParticleThinningCfg(
ConfigFlags,
flags,
name = kwargs['DiTauLowPtTPThinningToolName'],
StreamName = StreamName,
DiTauKey = "DiTauJetsLowPt",
@@ -105,7 +104,7 @@ def PhysCommonThinningCfg(ConfigFlags, StreamName = "StreamDAOD_PHYS", **kwargs)
# keep calo clusters around electrons
if "ElectronCaloClusterThinningToolName" in kwargs:
acc.merge(CaloClusterThinningCfg(
ConfigFlags,
flags,
name = kwargs['ElectronCaloClusterThinningToolName'],
StreamName = StreamName,
SGKey = "AnalysisElectrons",
@@ -115,7 +114,7 @@ def PhysCommonThinningCfg(ConfigFlags, StreamName = "StreamDAOD_PHYS", **kwargs)
# keep calo clusters around photons
if "PhotonCaloClusterThinningToolName" in kwargs:
acc.merge(CaloClusterThinningCfg(
ConfigFlags,
flags,
name = kwargs['PhotonCaloClusterThinningToolName'],
StreamName = StreamName,
SGKey = "AnalysisPhotons",
Loading