Commit 6297743a authored by scott snyder's avatar scott snyder Committed by scott snyder
Browse files

TriggerJobOpts: Use MT-safe thinning.

Convert TrigNavigation thinning to use MT-safe mechanisms.
parent c8918dcd
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
from TriggerJobOpts.TriggerFlags import TriggerFlags
from AthenaCommon.Logging import logging
......@@ -488,43 +488,30 @@ class HLTTriggerResultGetter(Configured):"AOD list is subset of ESD list - good.")
def _addSlimming(stream, thinningSvc, edm):
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
from TrigNavTools.TrigNavToolsConf import HLT__TrigNavigationSlimming
from TrigNavTools.TrigNavToolsConfig import navigationSlimming
def _addSlimming(stream, edm):
from TrigNavTools.TrigNavToolsConfig import navigationThinningSvc
edmlist = list(y.split('-')[0] for x in edm.values() for y in x) #flatten names
# from HLT result drop unrecorded features
# slimmerHLT = HLT__StreamTrigNavSlimming('HLTNavSlimmer_%s'%stream)
slimmerHLT = HLT__TrigNavigationSlimming('TrigNavigationSlimmer_%s'%stream)
tHLT = navigationSlimming({'name':'HLTNav_%s'%stream, 'mode':'cleanup',
'ThinningSvc':thinningSvc, 'result':'HLTResult_HLT',
slimmerHLT.ThinningTool = tHLT
slimmerHLT.ExtraInputs = [('xAOD::TrigNavigation','StoreGateSvc+TrigNavigation')]
topSequence += slimmerHLT"Configured slimming of HLT")
print(slimmerHLT.ThinningTool) # noqa: ATL901
svc = navigationThinningSvc ({'name':'HLTNav_%s'%stream, 'mode':'cleanup',
from OutputStreamAthenaPool.CreateOutputStreams import registerTrigNavThinningSvc
registerTrigNavThinningSvc (stream, svc)"Configured slimming of HLT for %s", stream)
print(svc) # noqa: ATL901
del edmlist
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
from AthenaServices.Configurables import ThinningSvc
if TriggerFlags.doNavigationSlimming() and rec.readRDO() and rec.doWriteAOD():
if not hasattr(svcMgr, 'ThinningSvc'): # if the default is there it is configured for AODs
svcMgr += ThinningSvc(name='ThinningSvc', Streams=['StreamAOD'])
_addSlimming('StreamAOD', svcMgr.ThinningSvc, _TriggerESDList ) #Use ESD item list also for AOD!
_addSlimming('StreamAOD', _TriggerESDList ) #Use ESD item list also for AOD!"configured navigation slimming for AOD output")
if TriggerFlags.doNavigationSlimming() and rec.readRDO() and rec.doWriteESD():
if not hasattr(svcMgr, 'ESDThinningSvc'):
svcMgr += ThinningSvc(name='ESDThinningSvc', Streams=['StreamESD']) # the default is configured for AODs
_addSlimming('StreamESD', svcMgr.ESDThinningSvc, _TriggerESDList )"configured navigation slimming for ESD output")
_addSlimming('StreamESD', _TriggerESDList )"configured navigation slimming for ESD output")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment