Commit 86c3bb9a authored by Stewart Martin-Haugh's avatar Stewart Martin-Haugh Committed by Adam Edward Barton
Browse files

Fix configuration of LVL1/HLTConfigSvc

parent 203ad105
......@@ -1243,7 +1243,8 @@ def appendCAtoAthena(ca):
if instance not in ServiceMgr:
ServiceMgr += instance
for svcName in ca._servicesToCreate:
theApp.CreateSvc += [svcName]
if svcName not in theApp.CreateSvc:
theApp.CreateSvc += [svcName]
if len(ca._conditionsAlgs) != 0:
for comp in ca._conditionsAlgs:
......
......@@ -262,10 +262,10 @@ def hlt_result_cfg(flags, hypo_algs):
acc = ComponentAccumulator()
# Give the menu json name to HLTConfigSvc
from TrigConfigSvc.TrigConfigSvcCfg import getHLTConfigSvc
hltConfigSvc = getHLTConfigSvc(flags)
hltConfigSvc.JsonFileName = menu_json
acc.addService(hltConfigSvc)
from TrigConfigSvc.TrigConfigSvcCfg import HLTConfigSvcCfg
hltConfigSvcCfg = HLTConfigSvcCfg(flags)
hltConfigSvcCfg.getService("HLTConfigSvc").JsonFileName = menu_json
acc.merge(hltConfigSvcCfg)
# Tool adding stream tags to HLT result
stmaker = StreamTagMakerToolCfg()
......
......@@ -180,12 +180,10 @@ def _generateL1Menu(triggerMenuSetup, fileName, bgsFileName):
return outfile, bgsOutFile
# configuration of L1ConfigSvc
# provide L1 config service in new JO
@AccumulatorCache
def getL1ConfigSvc( flags ):
# generate menu file (this only happens if we read from FILE)
generatedFile, generatedBgsFile = generateL1Menu( flags )
def L1ConfigSvcCfg( flags ):
acc = ComponentAccumulator()
cfg = getTrigConfigFromFlag( flags )
log.info( "Configure LVL1ConfigSvc" )
......@@ -207,6 +205,7 @@ def getL1ConfigSvc( flags ):
l1ConfigSvc.XMLMenuFile = l1XMLFile
log.info( "For run 2 style menu access configured LVL1ConfigSvc with input file : %s", l1XMLFile )
# Run 3 configuration
generatedFile, generatedBgsFile = generateL1Menu( flags )
l1ConfigSvc.InputType = "file"
l1ConfigSvc.JsonFileName = generatedFile
l1ConfigSvc.JsonFileNameBGS = generatedBgsFile
......@@ -220,12 +219,13 @@ def getL1ConfigSvc( flags ):
l1ConfigSvc.BGSK = cfg["BGSK"]
log.info( "For run 3 style menu access configured LVL1ConfigSvc with InputType='DB', SMK %d, and BGSK %d", cfg['SMK'], cfg['BGSK'] )
return l1ConfigSvc
acc.addService( l1ConfigSvc, create=True )
return acc
# configuration of HLTConfigSvc
# provide HLT config service in new JO
@AccumulatorCache
def getHLTConfigSvc( flags ):
def HLTConfigSvcCfg( flags ):
acc = ComponentAccumulator()
cfg = getTrigConfigFromFlag( flags )
log.info( "Configure HLTConfigSvc" )
......@@ -249,30 +249,15 @@ def getHLTConfigSvc( flags ):
hltConfigSvc.TriggerDB = cfg["DBCONN"]
hltConfigSvc.SMK = cfg["SMK"]
log.info( "For run 3 style menu access configured HLTConfigSvc with InputType='DB' and SMK %d", cfg['SMK'] )
return hltConfigSvc
# provide L1 config service in new JO
def L1ConfigSvcCfg( flags ):
acc = ComponentAccumulator()
l1ConfigSvc = getL1ConfigSvc( flags )
acc.addService( l1ConfigSvc, create=True )
return acc
# provide HLT config service in new JO
def HLTConfigSvcCfg( flags ):
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
acc = ComponentAccumulator()
acc.addService( getHLTConfigSvc( flags ), create=True )
acc.addService( hltConfigSvc, create=True )
return acc
# provide both services in new JO
def TrigConfigSvcCfg( flags ):
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
acc = ComponentAccumulator()
acc.addService( getL1ConfigSvc( flags ), create=True )
acc.addService( getHLTConfigSvc( flags ), create=True )
acc.merge( L1ConfigSvcCfg( flags ) )
acc.merge( HLTConfigSvcCfg( flags ) )
return acc
def L1PrescaleCondAlgCfg( flags ):
......
......@@ -40,16 +40,16 @@ for option in defaultOptions:
else:
log.info(' %20s = (Default) %s' % (option, getattr(opt, option)))
from TrigConfigSvc.TrigConfigSvcCfg import getHLTConfigSvc, getL1ConfigSvc
from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg,HLTConfigSvcCfg
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
from AthenaConfiguration.ComponentAccumulator import conf2toConfigurable
from AthenaConfiguration.ComponentAccumulator import CAtoGlobalWrapper
from AthenaConfiguration.AllConfigFlags import ConfigFlags
ConfigFlags.Trigger.triggerMenuSetup = TriggerFlags.triggerMenuSetup= 'LS2_v1'
ConfigFlags.Trigger.generateMenuDiagnostics = True
svcMgr += conf2toConfigurable( getHLTConfigSvc(ConfigFlags))
svcMgr += conf2toConfigurable( getL1ConfigSvc(ConfigFlags))
CAtoGlobalWrapper(L1ConfigSvcCfg,ConfigFlags)
CAtoGlobalWrapper(HLTConfigSvcCfg,ConfigFlags)
topSequence = AlgSequence()
......
......@@ -49,9 +49,9 @@ DetFlags.detdescr.Calo_setOn()
include("RecExCond/AllDet_detDescr.py")
# menu with default configuration for testing
from TrigConfigSvc.TrigConfigSvcCfg import getL1ConfigSvc
from AthenaConfiguration.AllConfigFlags import ConfigFlags
svcMgr += getL1ConfigSvc(ConfigFlags)
from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg
CAtoGlobalWrapper(L1ConfigSvcCfg,ConfigFlags)
svcMgr += CfgMgr.THistSvc()
#svcMgr.THistSvc.Output += ["ISO DATAFILE='tobIso.root' OPT='RECREATE'"]
......@@ -62,4 +62,4 @@ log.info("Scheduling eFEXDriver")
athAlgSeq += CfgMgr.LVL1__eFEXDriver('MyeFEXDriver')
athAlgSeq += CfgMgr.LVL1__eFEXNtupleWriter('MyeFEXNtupleWriter')
log.info("==========================================================")
#######################################################
\ No newline at end of file
#######################################################
......@@ -49,9 +49,9 @@ DetFlags.detdescr.Calo_setOn()
include("RecExCond/AllDet_detDescr.py")
# menu with default configuration for testing
from TrigConfigSvc.TrigConfigSvcCfg import getL1ConfigSvc
from AthenaConfiguration.AllConfigFlags import ConfigFlags
svcMgr += getL1ConfigSvc(ConfigFlags)
from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg
CAtoGlobalWrapper(L1ConfigSvcCfg,ConfigFlags)
svcMgr += CfgMgr.THistSvc()
svcMgr.THistSvc.Output += ["ANALYSIS DATAFILE='myfile_jfex.root' OPT='RECREATE'"]
......
......@@ -9,7 +9,7 @@ from AthenaCommon.Logging import logging
from AthenaCommon.CFElements import seqAND
from AthenaCommon import CfgMgr
def Lvl1SimulationSequence_Common( ConfigFlags ):
def Lvl1SimulationSequence( ConfigFlags ):
"""
Configure L1 simulation for Athena MT data jobs on MC or data (data only with rerun L1)
"""
......@@ -189,28 +189,6 @@ def Lvl1SimulationSequence_Common( ConfigFlags ):
l1SimSeq += [subSystemSimSeq]
return l1SimSeq
def Lvl1SimulationSequence( ConfigFlags ):
"""
Configure L1 simulation for Athena MT jobs
"""
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
from TriggerJobOpts.TriggerFlags import TriggerFlags
from AthenaConfiguration.ComponentAccumulator import conf2toConfigurable
from TrigConfigSvc.TrigConfigSvcCfg import getL1ConfigSvc
# this configuration of the LVL1ConfigSvc is only temporary
TriggerFlags.readLVL1configFromXML = True
TriggerFlags.outputLVL1configFile = None
svcMgr += conf2toConfigurable(getL1ConfigSvc(ConfigFlags))
l1SimSeq = Lvl1SimulationSequence_Common( ConfigFlags )
return l1SimSeq
def Lvl1SimulationCfg(flags):
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
acc = ComponentAccumulator()
......
......@@ -228,10 +228,11 @@ class TriggerConfigGetter(Configured):
svcMgr += TrigConf__xAODConfigSvc('xAODConfigSvc')
else: # Does not have xAODMeta
# Run-3 Trigger Configuration Services (just producing menu data)
from TrigConfigSvc.TrigConfigSvcCfg import getL1ConfigSvc, getHLTConfigSvc
from AthenaConfiguration.ComponentAccumulator import CAtoGlobalWrapper
from TrigConfigSvc.TrigConfigSvcConfig import TrigConfigSvc
svcMgr += getL1ConfigSvc(ConfigFlags)
svcMgr += getHLTConfigSvc(ConfigFlags)
from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg,HLTConfigSvcCfg
CAtoGlobalWrapper(L1ConfigSvcCfg,ConfigFlags)
CAtoGlobalWrapper(HLTConfigSvcCfg,ConfigFlags)
svcMgr += TrigConfigSvc("TrigConfigSvc")
svcMgr.TrigConfigSvc.UseNewConfig = True
......
......@@ -75,7 +75,7 @@ class opt:
################################################################################
from TriggerJobOpts.TriggerFlags import TriggerFlags
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from AthenaConfiguration.ComponentAccumulator import CAtoGlobalWrapper, conf2toConfigurable
from AthenaConfiguration.ComponentAccumulator import CAtoGlobalWrapper
from AthenaCommon.AppMgr import theApp, ServiceMgr as svcMgr
from AthenaCommon.Include import include
from AthenaCommon.Logging import logging
......@@ -524,8 +524,8 @@ if not opt.createHLTMenuExternally:
from TrigConfigSvc.TrigConfigSvcCfg import getHLTConfigSvc
svcMgr += conf2toConfigurable( getHLTConfigSvc(ConfigFlags) )
from TrigConfigSvc.TrigConfigSvcCfg import HLTConfigSvcCfg
CAtoGlobalWrapper(HLTConfigSvcCfg,ConfigFlags)
# ---------------------------------------------------------------
# Tell the SGInputLoader about L1 and HLT menu in the DetectorStore
......
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