46def modifyConfigForP1(json_file, db_file):
47 """ modifies a number of job properties to run from the TriggerDB and writes out modified JSON
48 """
49 from AthenaCommon.Logging import logging
50 log = logging.getLogger("JsonUtils")
51
52 with open(json_file, 'r') as f:
53 jocat = json.load(f)
54 properties = jocat['properties']
55
56 def mod(props, alg, prop, fnc):
57 if alg not in props:
58 log.warning("Asked to modify property of %s but it does not exist", alg)
59 return
60
61 origVal = props[alg].
get(prop,
"")
62 props[alg][prop] = fnc(origVal)
63
64
65
66 mod( properties, "LVL1ConfigSvc", "InputType", lambda x : "DB" )
67 mod( properties, "HLTConfigSvc", "InputType", lambda x : "DB" )
68 mod( properties, "HLTPrescaleCondAlg", "Source", lambda x : "COOL" )
69 mod( properties, "HLTPrescaleCondAlg", "TriggerDB", lambda x : "JOSVC" )
70
71 mod( properties, "LVL1ConfigSvc", "HLTJsonFileName", lambda x : "None" )
72 mod( properties, "LVL1ConfigSvc", "L1JsonFileName", lambda x : "None" )
73 mod( properties, "TrigConf__BunchGroupCondAlg", "Filename", lambda x : "None" )
74 mod( properties, "HLTConfigSvc", "HLTJsonFileName", lambda x : "None" )
75 mod( properties, "HLTConfigSvc", "L1JsonFileName", lambda x : "None" )
76 mod( properties, "HLTConfigSvc", "MonitoringJsonFileName", lambda x : "None" )
77 mod( properties, "HLTPrescaleCondAlg", "Filename", lambda x : "None" )
78
79 with open(db_file,'w') as f:
80 json.dump(jocat, f, indent=4, sort_keys=True, ensure_ascii=True)
81
82
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)