9from TriggerMenuMT.TriggerAPI.TriggerInfo
import TriggerInfo, TriggerChain
19def load(centralFile="TriggerMenu/TriggerInfo_20210302.json"):
23 log.info(
"Found json file:"+centralJsonFile)
24 centralJsonFile = os.path.realpath(centralJsonFile)
25 else: log.error(
"Couldn't find central json file")
30 except (json.JSONDecodeError, ValueError):
31 log.info(
"Reading cached information failed")
36 privatedb =
loadJson(privateJsonFile)
38 except (json.JSONDecodeError, ValueError):
39 log.error(
"Error loading the private json file")
58 for key,thedict
in thelist:
60 pk = TriggerPeriod.fromName( pk )
63 triggerinfo.period = TriggerPeriod.fromName( thedict[
"period"] )
65 assert triggerinfo.period==pk, (triggerinfo.period, pk)
66 triggerinfo.totalLB = thedict[
"totalLB"]
67 triggerinfo.totalLBByRun = thedict.get(
"totalLBByRun",{})
68 triggerinfo.triggerChains = []
69 for tc
in thedict[
"triggerChains"]:
70 tc = TriggerChain(tc[
"name"],tc[
"l1seed"],tc[
"livefraction"],tc[
"activeLB"],tc[
"hasRerun"],tc.get(
"activeLBByRun",{}))
71 triggerinfo.triggerChains.append(tc)
72 toret[key] = triggerinfo