Skip to content
Snippets Groups Projects
Commit a62bb8f3 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

TrigConfigSvc: fix broken getKeysFromCool method

parent 158dfd8b
No related branches found
No related tags found
5 merge requests!69091Fix correlated smearing bug in JER in JetUncertainties in 22.0,!58791DataQualityConfigurations: Modify L1Calo config for web display,!51674Fixing hotSpotInHIST for Run3 HIST,!50012RecExConfig: Adjust log message levels from GetRunNumber and GetLBNumber,!47535TriggerJobOpts: cleanup TriggerConfigGetter and flags
This commit is part of merge request !47535. Comments created here will be created in the context of that merge request.
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
from .TrigConfigSvcCfg import getTrigConfigFromFlag, getL1MenuFileName, getHLTMenuFileName, getL1PrescalesSetFileName, getHLTPrescalesSetFileName, getBunchGroupSetFileName, getHLTJobOptionsFileName, getHLTMonitoringFileName from .TrigConfigSvcCfg import getTrigConfigFromFlag, getL1MenuFileName, getHLTMenuFileName, getL1PrescalesSetFileName, getHLTPrescalesSetFileName, getBunchGroupSetFileName, getHLTJobOptionsFileName, getHLTMonitoringFileName
from TrigConfIO.L1TriggerConfigAccess import L1MenuAccess, L1PrescalesSetAccess, BunchGroupSetAccess from TrigConfIO.L1TriggerConfigAccess import L1MenuAccess, L1PrescalesSetAccess, BunchGroupSetAccess
from TrigConfIO.HLTTriggerConfigAccess import HLTMenuAccess, HLTPrescalesSetAccess, HLTJobOptionsAccess, HLTMonitoringAccess from TrigConfIO.HLTTriggerConfigAccess import HLTMenuAccess, HLTPrescalesSetAccess, HLTJobOptionsAccess, HLTMonitoringAccess
from PyUtils.Decorators import memoize from functools import lru_cache
""" """
Access to the trigger configuration in python is provided depending on Access to the trigger configuration in python is provided depending on
...@@ -40,9 +40,11 @@ are then loaded from the DB. ...@@ -40,9 +40,11 @@ are then loaded from the DB.
""" """
@memoize @lru_cache(maxsize=None)
def getKeysFromCool(runNr, lbNr = 0): def getKeysFromCool(runNr, lbNr = 0):
from TrigConfStorage import TriggerCoolUtil """Return dictionary of trigger keys for given run and lumiblock number
"""
from TrigConfStorage.TriggerCoolUtil import TriggerCoolUtil
condb = "CONDBR2" if runNr > 236108 else "COMP200" condb = "CONDBR2" if runNr > 236108 else "COMP200"
db = TriggerCoolUtil.GetConnection(condb) db = TriggerCoolUtil.GetConnection(condb)
run_range = [[runNr,runNr]] run_range = [[runNr,runNr]]
...@@ -64,7 +66,7 @@ def getKeysFromCool(runNr, lbNr = 0): ...@@ -64,7 +66,7 @@ def getKeysFromCool(runNr, lbNr = 0):
dbaliasMapping = { "TRIGGERDBR2R" : "TRIGGERDB", dbaliasMapping = { "TRIGGERDBR2R" : "TRIGGERDB",
"TRIGGERDBV2" : "TRIGGERDB_RUN1" } "TRIGGERDBV2" : "TRIGGERDB_RUN1" }
if d["DB"] in dbaliasMapping: if d["DB"] in dbaliasMapping:
d["DB"] = dbaliasMapping[ db["DB"] ] d["DB"] = dbaliasMapping[ d["DB"] ]
return d return d
...@@ -220,4 +222,4 @@ def getHLTMonitoringAccess( flags = None ): ...@@ -220,4 +222,4 @@ def getHLTMonitoringAccess( flags = None ):
raise NotImplementedError("Python access to the trigger configuration (HLT menu) from in-file metadata not yet implemented") raise NotImplementedError("Python access to the trigger configuration (HLT menu) from in-file metadata not yet implemented")
else: else:
raise RuntimeError("Unknown source of trigger configuration: %s" % tc["SOURCE"]) raise RuntimeError("Unknown source of trigger configuration: %s" % tc["SOURCE"])
return cfg return cfg
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment