Commit af88ffad authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

TriggerJobOpts: remove readLVL1FromJSON and configurationSourceList flag

Delete the obsolete legacy `TriggerFlags.configurationSourceList` flag
and related configuration code.

Also delete the following flags:
  -`readLVL1FromJSON`: was only required during the Run-3
  migration while we had to support old and new menus
 - `useRun1CaloEnergyScale`: not used anymore as we don't simulate past
 triggers in this release
 - `doLVL1`: already migrated to new-style `ConfigFlag`
 - `doNavigationSlimming`: migrate remaining code to new-style flag
parent 846f0c75
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
class Bag(object):
def __init__(self,l):
self.allowedValues = l
def __str__(self):
return str(self.allowedValues)
def __repr__(self):
return "%r" % self.allowedValues
def __contains__(self, val):
return True in [ x == val for x in self.allowedValues]
def __eq__(self, arg):
if type(arg)==list or type(arg)==tuple or type(arg)==set:
notContained = [a for a in arg if a not in self]
if len(notContained)==0:
return True
from AthenaCommon.Logging import logging
log = logging.getLogger( 'AllowedList' )
log.error("the element %s is not in the list of allowed values: %s", notContained, self)
return False
return True
class AllowedList(list):
def __init__(self, l):
super(AllowedList,self).__init__([Bag(l)])
......@@ -398,11 +398,11 @@ class HLTTriggerResultGetter(Configured):
if ConfigFlags.Trigger.EDMVersion == 1 or ConfigFlags.Trigger.EDMVersion == 2:
# Run 1, 2 slimming
if TriggerFlags.doNavigationSlimming() and rec.readRDO() and rec.doWriteAOD():
if ConfigFlags.Trigger.doNavigationSlimming and rec.readRDO() and rec.doWriteAOD():
_addSlimmingRun2('StreamAOD', _TriggerESDList ) #Use ESD item list also for AOD!
log.info("configured navigation slimming for AOD output")
if TriggerFlags.doNavigationSlimming() and rec.readRDO() and rec.doWriteESD():
if ConfigFlags.Trigger.doNavigationSlimming and rec.readRDO() and rec.doWriteESD():
_addSlimmingRun2('StreamESD', _TriggerESDList )
log.info("configured navigation slimming for ESD output")
......
......@@ -13,9 +13,6 @@ def createTriggerFlags():
# enables L1 simulation
flags.addFlag('Trigger.doLVL1', lambda prevFlags: prevFlags.Input.isMC)
# need proper documentation
flags.addFlag('Trigger.useRun1CaloEnergyScale', False)
# Run HLT selection algorithms
flags.addFlag('Trigger.doHLT', False)
......@@ -31,9 +28,6 @@ def createTriggerFlags():
# Enable L1Topo simulation to write inputs to txt
flags.addFlag('Trigger.enableL1TopoDump', False)
# Enable usage of new L1 menu
flags.addFlag('Trigger.readLVL1FromJSON', True)
# Enable Run-2 L1Calo simulation and/or decoding (possible even if enablePhase1 is True)
flags.addFlag('Trigger.enableL1CaloLegacy', True)
......
......@@ -48,7 +48,6 @@ class TriggerConfigGetter(Configured):
log.info("globalflags.DataSource : %s", globalflags.DataSource())
log.info("TriggerFlags.configForStartup : %s", TriggerFlags.configForStartup())
log.info("TriggerFlags.dataTakingConditions : %s", TriggerFlags.dataTakingConditions())
log.info("TriggerFlags.configurationSourceList: %s", TriggerFlags.configurationSourceList())
count = len([1 for x in [rec.readRDO(),rec.readESD(),rec.readAOD()] if x ]) #readTAG is only set with another input
if count == 0:
......
......@@ -5,7 +5,6 @@ log = logging.getLogger( 'TriggerJobOpts.TriggerFlags' )
from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
from AthenaCommon.JobProperties import jobproperties # noqa: F401
from TriggerJobOpts.CommonSignatureHelper import AllowedList
from TrigConfigSvc.TrigConfigSvcUtils import getKeysFromNameRelease, getMenuNameFromDB
......@@ -21,23 +20,12 @@ def bool_flag_with_default(name, val):
"StoredValue": val,
})
default_true_flags = [
"doLVL1", # run the LVL1 simulation (set to FALSE to read the LVL1 result from BS file)
"doNavigationSlimming", # Enable the trigger navigation slimming"""
]
default_false_flags = [
"useRun1CaloEnergyScale",
"doTruth",
"doTriggerConfigOnly", # if True only the configuration services should be set, no algorithm """
"readMenuFromTriggerDb", # define the TriggerDb to be the source of the LVL1 and HLT trigger menu
]
for name in default_true_flags:
newFlag = bool_flag_with_default(name, True)
globals()[newFlag.__name__] = newFlag
_flags.append(newFlag)
for name in default_false_flags:
newFlag = bool_flag_with_default(name, False)
globals()[newFlag.__name__] = newFlag
......@@ -51,16 +39,6 @@ class doHLT(JobProperty):
_flags.append(doHLT)
# trigger configuration source list
class configurationSourceList(JobProperty):
""" define where to read trigger configuration from. Allowed values: ['aod','ds']"""
statusOn=True
allowedType=['list']
StoredValue=[]
allowedValues = AllowedList( ['aod','ds'] )
_flags.append(configurationSourceList)
class AODEDMSet(JobProperty):
""" Define which sets of object go to AOD """
statusOn=True
......@@ -367,7 +345,6 @@ def sync_Trigger2Reco():
if globalflags.InputFormat() == 'bytestream':
from AthenaConfiguration.AllConfigFlags import ConfigFlags
ConfigFlags.Trigger.readBS = True
TriggerFlags.doLVL1 = False
TriggerFlags.doHLT = False
del log
......@@ -33,23 +33,7 @@ if rec.doTrigger():
ServiceMgr += ByteStreamAddressProviderSvc()
ConfigFlags.Trigger.readBS = True
tf.doLVL1= False # needed to not rerun the trigger
tf.doHLT= False # needed to not rerun the trigger
if ConfigFlags.Trigger.EDMVersion >= 3:
# for Run 3 we eventually want to disable TrigConfigSvc
tf.configurationSourceList = []
elif ConfigFlags.Trigger.EDMVersion == 1 or ConfigFlags.Trigger.EDMVersion == 2:
# for reconstructing Run 1/2 data we need to run the trigger configuration
# from the Run 1/2 TriggerDB, which is done by the TrigConfigSvc(DSConfigSvc)
tf.configurationSourceList = ['ds']
# this configurations are in the old format
from AthenaConfiguration.AllConfigFlags import ConfigFlags
_log.info("Setting ConfigFlags.Trigger.readLVL1FromJSON to False as we are reconstructing Run %s data",
ConfigFlags.Trigger.EDMVersion)
ConfigFlags.Trigger.readLVL1FromJSON = False
else:
raise RuntimeError("Invalid EDMVersion=%s " % ConfigFlags.Trigger.EDMVersion)
from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
cfg = TriggerConfigGetter()
......
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