Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LHCb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LHCb
LHCb
Commits
4a12ed9a
Commit
4a12ed9a
authored
2 years ago
by
Gerhard Raven
Browse files
Options
Downloads
Patches
Plain Diff
remove unused code
parent
13c91a7c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GaudiConf/python/GaudiConf/reading.py
+0
-77
0 additions, 77 deletions
GaudiConf/python/GaudiConf/reading.py
with
0 additions
and
77 deletions
GaudiConf/python/GaudiConf/reading.py
+
0
−
77
View file @
4a12ed9a
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment