Skip to content
Snippets Groups Projects
Commit 4a12ed9a authored by Gerhard Raven's avatar Gerhard Raven
Browse files

remove unused code

parent 13c91a7c
No related branches found
No related tags found
No related merge requests found
......@@ -466,80 +466,3 @@ def do_unpacking(annsvc,
configurables=configurables,
mc=mc_algs)
return algs
def _get_decoding_dict(json_config):
"""
Extract the HLT ANN dictionary of HLT2/Spruce locations from a .json file.
Args:
json_config (str): path to the .json file containing the HltAnnSvc configuration.
Examples:
1. local path: path/to/json_file
2. eos path: root://eoslhcb.cern.ch//path/to/json_file
Returns:
Dict with all the HLT2/Spruce locations.
"""
cfg = {}
if "root://eoslhcb.cern.ch//" in str(json_config):
with XRootD.client.File() as f:
status, _ = f.open(str(json_config))
if not status.ok:
raise RuntimeError(
f"could not open {json_config}: {status.message}")
status, data = f.read()
if not status.ok:
raise RuntimeError(
f"could not read {json_config}: {status.message}")
cfg = json.loads(data.decode('utf-8'))
elif json_config:
with open(os.path.expandvars(json_config)) as f:
cfg = json.load(f)
# re-format for backwards compatibility
if "HltANNSvc/HltANNSvc" in cfg:
return {
"Hlt2SelectionID": {
v: str(k)
for k, v in cfg["HltANNSvc/HltANNSvc"]["Hlt2SelectionID"].
items()
},
"SpruceSelectionID": {
v: str(k)
for k, v in cfg["HltANNSvc/HltANNSvc"]["SpruceSelectionID"].
items()
},
"PackedObjectLocations": {
v: str(k)
for k, v in cfg["HltANNSvc/HltANNSvc"]
["PackedObjectLocations"].items()
}, ## TODO: strip the "/Event/" prefix...
"PackedObjectTypes": {
str(k): v
for k, v in cfg["HltANNSvc/HltANNSvc"]["PackedObjectTypes"].
items()
}
}
return cfg
def _set_hltAnn_svc(key, json_config):
"""
Configures the Hlt ANN service to read correctly the spruced locations using the HltAnnSvc
configuration of the HLT2 application.
Args:
json_config (str): path to the .json file containing the HltAnnSvc configuration.
Examples:
1. local path: path/to/json_file
2. eos path: root://eoslhcb.cern.ch//path/to/json_file
"""
cfg = _get_decoding_dict(json_config)
config = ComponentConfig()
svc = setup_component("JSONANNSvc/HltANNSvc")
if cfg:
svc.AllowLiteralJSON = True,
svc.Key2JSON = {key, json.dump(cfg)}
config.add(svc)
return config
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