Commit 9c8de3d6 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

TriggerJobOpts: Deprecate TriggerFlags.[AOD,ESD]EDMSet

Deprecate the old `AODEDMSet` and `ESDEDMSet` `TriggerFlags`. Forward
the setting to the new equivalent `ConfigFlags` and migrate the internal
code to use only the new-style flags.
parent daa4c166
......@@ -3,7 +3,6 @@
from TriggerJobOpts.TriggerFlags import TriggerFlags
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from AthenaCommon.Logging import logging
from AthenaCommon.GlobalFlags import globalflags
from AthenaCommon.AppMgr import ServiceMgr
from RecExConfig.Configured import Configured
......@@ -40,7 +39,7 @@ class xAODConversionGetter(Configured):
# (previously this was defined in HLTTriggerResultGetter def configure)
from TrigEDMConfig.TriggerEDM import getTriggerEDMList
self.xaodlist = {}
self.xaodlist.update( getTriggerEDMList(TriggerFlags.ESDEDMSet(), 2 ))
self.xaodlist.update( getTriggerEDMList(ConfigFlags.Trigger.ESDEDMSet, 2 ))
return True
......@@ -269,10 +268,6 @@ class HLTTriggerResultGetter(Configured):
log = logging.getLogger("HLTTriggerResultGetter.py")
from RecExConfig.ObjKeyStore import objKeyStore
# Set AODFULL for data unless it was set explicitly already
if TriggerFlags.AODEDMSet.isDefault() and globalflags.DataSource()=='data':
TriggerFlags.AODEDMSet = 'AODFULL'
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
log.info("BS unpacking (ConfigFlags.Trigger.readBS): %d", ConfigFlags.Trigger.readBS )
......@@ -348,17 +343,17 @@ class HLTTriggerResultGetter(Configured):
if(xAODContainers):
_TriggerESDList.update( xAODContainers )
else:
_TriggerESDList.update( getTriggerEDMList(TriggerFlags.ESDEDMSet(), ConfigFlags.Trigger.EDMVersion) )
_TriggerESDList.update( getTriggerEDMList(ConfigFlags.Trigger.ESDEDMSet, ConfigFlags.Trigger.EDMVersion) )
log.info("ESD content set according to the ESDEDMSet flag: %s and EDM version %d", TriggerFlags.ESDEDMSet(), ConfigFlags.Trigger.EDMVersion)
log.info("ESD content set according to the ESDEDMSet flag: %s and EDM version %d", ConfigFlags.Trigger.ESDEDMSet, ConfigFlags.Trigger.EDMVersion)
# AOD objects choice
_TriggerAODList = {}
#from TrigEDMConfig.TriggerEDM import getAODList
_TriggerAODList.update( getTriggerEDMList(TriggerFlags.AODEDMSet(), ConfigFlags.Trigger.EDMVersion) )
_TriggerAODList.update( getTriggerEDMList(ConfigFlags.Trigger.AODEDMSet, ConfigFlags.Trigger.EDMVersion) )
log.info("AOD content set according to the AODEDMSet flag: %s and EDM version %d", TriggerFlags.AODEDMSet(),ConfigFlags.Trigger.EDMVersion)
log.info("AOD content set according to the AODEDMSet flag: %s and EDM version %d", ConfigFlags.Trigger.AODEDMSet, ConfigFlags.Trigger.EDMVersion)
log.debug("ESD EDM list: %s", _TriggerESDList)
log.debug("AOD EDM list: %s", _TriggerAODList)
......
......@@ -162,7 +162,7 @@ def createTriggerFlags():
flags.addFlag('Trigger.doTransientByteStream', False)
# list of EDM objects to be written to AOD
flags.addFlag('Trigger.AODEDMSet', 'AODSLIM')
flags.addFlag('Trigger.AODEDMSet', lambda flags: 'AODSLIM' if flags.Input.isMC else 'AODFULL')
# list of objects to be written to ESD
flags.addFlag('Trigger.ESDEDMSet', 'ESD')
......
......@@ -74,6 +74,10 @@ class AODEDMSet(JobProperty):
statusOn=True
allowedType=['list']
StoredValue='AODSLIM'
def _do_action(self):
log.warning("TriggerFlags.AODEDMSet is deprecated. Use ConfigFlags.Trigger.AODEDMSet instead.")
from AthenaConfiguration.AllConfigFlags import ConfigFlags
ConfigFlags.Trigger.AODEDMSet = self.get_Value()
_flags.append(AODEDMSet)
......@@ -82,6 +86,10 @@ class ESDEDMSet(JobProperty):
statusOn=True
allowedType=['list']
StoredValue='ESD'
def _do_action(self):
log.warning("TriggerFlags.ESDEDMSet is deprecated. Use ConfigFlags.Trigger.ESDEDMSet instead.")
from AthenaConfiguration.AllConfigFlags import ConfigFlags
ConfigFlags.Trigger.ESDEDMSet = self.get_Value()
_flags.append(ESDEDMSet)
......@@ -377,5 +385,3 @@ def sync_Trigger2Reco():
ConfigFlags.Trigger.readBS = True
TriggerFlags.doLVL1 = False
TriggerFlags.doHLT = False
del log
#
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
#
......@@ -63,9 +63,8 @@ outSequence.remove( StreamESD )
# Define what to write into ESD
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from TriggerJobOpts.TriggerFlags import TriggerFlags
from TrigEDMConfig.TriggerEDM import getTriggerEDMList
edmList = getTriggerEDMList(TriggerFlags.ESDEDMSet(), ConfigFlags.Trigger.EDMVersion)
edmList = getTriggerEDMList(ConfigFlags.Trigger.ESDEDMSet, ConfigFlags.Trigger.EDMVersion)
if len(ItemList) == 0:
for edmType, edmKeys in edmList.items():
for key in edmKeys:
......
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