Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DaVinci
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
DaVinci
Commits
d39f23c5
Commit
d39f23c5
authored
3 years ago
by
Davide Fazzini
Committed by
Eduardo Rodrigues
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Removing set_hltAnn_svc function from DaVinci.algorithms
parent
68f949aa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!1103
Draft: Add AnalysisHelpers to DaVinci Stack
,
!630
Removing set_hltAnn_svc function from DaVinci.algorithms
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Phys/DaVinci/python/DaVinci/ConfigurationUpgrade.py
+3
-2
3 additions, 2 deletions
Phys/DaVinci/python/DaVinci/ConfigurationUpgrade.py
Phys/DaVinci/python/DaVinci/algorithms.py
+2
-71
2 additions, 71 deletions
Phys/DaVinci/python/DaVinci/algorithms.py
with
5 additions
and
73 deletions
Phys/DaVinci/python/DaVinci/ConfigurationUpgrade.py
+
3
−
2
View file @
d39f23c5
...
...
@@ -13,10 +13,11 @@ High level configuration tools for DaVinci.
"""
from
PyConf.application
import
ComponentConfig
,
configure
,
configure_input
from
PyConf.Algorithms
import
EventAccounting
from
GaudiConf
import
reading
from
DaVinci.configOptions
import
(
check_options
,
set_job_options
,
set_args_options
,
set_input_file_options
)
from
DaVinci.algorithms
import
(
setup_algorithms
,
define_fsr_writer
,
set_hltAnn_svc
,
apply_filters_and_unpacking
)
apply_filters_and_unpacking
)
from
DaVinci.config
import
davinci_control_flow
,
prepare_davinci_nodes
...
...
@@ -95,7 +96,7 @@ def add_davinci_configurables(options):
config
=
configure_input
(
options
)
if
options
.
annsvc_config
:
set_hltAnn_svc
(
config
,
options
.
annsvc_config
)
config
.
update
(
reading
.
set_hltAnn_svc
(
options
.
annsvc_config
)
)
dvMainFlow
.
update
(
apply_filters_and_unpacking
(
options
,
userAlgs
,
unpack_only_mc
))
...
...
This diff is collapsed.
Click to expand it.
Phys/DaVinci/python/DaVinci/algorithms.py
+
2
−
71
View file @
d39f23c5
...
...
@@ -9,9 +9,8 @@
# or submit itself to any jurisdiction. #
###############################################################################
import
os
,
sys
,
importlib
,
json
,
XRootD
.
client
import
os
,
sys
,
importlib
from
GaudiKernel.ProcessJobOptions
import
importOptions
from
PyConf.components
import
setup_component
from
PyConf.Algorithms
import
(
LoKi__HDRFilter
as
HDRFilter
,
LoKi__VoidFilter
as
VoidFilter
)
from
DaVinci.configOptions
import
get_option_value
...
...
@@ -266,9 +265,7 @@ def unpack_locations(options, unpack_only_mc):
if
unpack_only_mc
:
reading_algs
+=
reading
.
mc_unpackers
(
process
=
process
,
filtered_mc
=
False
,
configurables
=
False
)
process
=
process
,
filtered_mc
=
False
,
configurables
=
False
)
else
:
reading_algs
+=
[
unpack_raw_event
,
...
...
@@ -316,72 +313,6 @@ def get_hlt_reports(options, source=''):
return
dec_reports
def
get_hltAnn_dict
(
annsvc_config
):
"""
Extracts Hlt ANN dictionary from the given location.
Args:
- annsvc_config: path to the .json file containing the HltAnnSvc configuration
Returns:
- Dict with all the HLT2 locations.
"""
tck
=
{}
if
"
root://eoslhcb.cern.ch//
"
in
annsvc_config
:
with
XRootD
.
client
.
File
()
as
f
:
status
,
_
=
f
.
open
(
annsvc_config
)
if
not
status
.
ok
:
raise
RuntimeError
(
f
"
could not open
{
annsvc_config
}
:
{
status
.
message
}
"
)
status
,
data
=
f
.
read
()
if
not
status
.
ok
:
raise
RuntimeError
(
f
"
could not read
{
annsvc_config
}
:
{
status
.
message
}
"
)
tck
=
json
.
loads
(
data
.
decode
(
'
utf-8
'
))
elif
annsvc_config
:
with
open
(
os
.
path
.
expandvars
(
annsvc_config
))
as
f
:
tck
=
json
.
load
(
f
)
return
tck
def
set_hltAnn_svc
(
config
,
annsvc_config
):
"""
Configures the Hlt ANN service to read correctly the spruced locations using the HltAnnSvc
configuration of the HLT2 application.
Args:
- config: dict of configured Configurable instances.
- annsvc_config: path to the .json file containing the HltAnnSvc configuration.
"""
tck
=
get_hltAnn_dict
(
annsvc_config
)
if
tck
:
ann_config
=
tck
[
"
HltANNSvc/HltANNSvc
"
]
hlt2_sel_ids
=
{
str
(
k
):
v
for
k
,
v
in
ann_config
[
"
Hlt2SelectionID
"
].
items
()
}
spruce_sel_ids
=
{
str
(
k
):
v
for
k
,
v
in
ann_config
[
"
SpruceSelectionID
"
].
items
()
}
packed_object_locs
=
{
str
(
k
):
v
for
k
,
v
in
ann_config
[
"
PackedObjectLocations
"
].
items
()
}
if
config
:
config
.
add
(
setup_component
(
"
HltANNSvc
"
,
Hlt2SelectionID
=
hlt2_sel_ids
,
SpruceSelectionID
=
spruce_sel_ids
,
PackedObjectLocations
=
packed_object_locs
))
else
:
config
.
add
(
setup_component
(
"
HltANNSvc
"
))
def
ConfiguredFuntuple
(
config
):
"""
Function for the FunTuple configuration and instantiation of the related HDR filter.
...
...
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