Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review 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
Alessandro Sala
athena
Commits
1c69c993
Verified
Commit
1c69c993
authored
10 months ago
by
Tadej Novak
Browse files
Options
Downloads
Patches
Plain Diff
OverlayMetadata: allow last part of the simulation tag to differ
parent
45ef487d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Simulation/Overlay/OverlayConfiguration/python/OverlayMetadata.py
+21
-2
21 additions, 2 deletions
...on/Overlay/OverlayConfiguration/python/OverlayMetadata.py
with
21 additions
and
2 deletions
Simulation/Overlay/OverlayConfiguration/python/OverlayMetadata.py
+
21
−
2
View file @
1c69c993
...
...
@@ -25,6 +25,23 @@ def _getFileMD(filenames):
return
_fileMetadata
[
filename
]
def
validateGeometryTag
(
logger
,
target
,
value
):
"""
Validate geometry tag so it is the same as target
"""
target_layout
=
target
.
split
(
'
-
'
)
value_layout
=
value
.
split
(
'
-
'
)
if
len
(
target_layout
)
!=
len
(
value_layout
):
return
False
for
p
,
s
in
zip
(
target_layout
[:
-
1
],
value_layout
[:
-
1
]):
if
not
re
.
match
(
p
,
s
):
return
False
if
not
re
.
match
(
target_layout
[
-
1
],
value_layout
[
-
1
]):
logger
.
warning
(
"
Simulation geometry tag mismatch! %s vs %s
"
,
target
,
value
)
return
True
def
overlayInputMetadataCheck
(
flags
,
simDict
,
tagInfoDict
):
"""
Check the metadata for signal HITS or presampled pileup RDO file
"""
logger
.
info
(
"
Checking Overlay configuration against Signal or presampled pileup RDO metadata...
"
)
...
...
@@ -46,7 +63,7 @@ def overlayInputMetadataCheck(flags, simDict, tagInfoDict):
# Check the DetDescrVersion set agrees with that used in the simulation
if
"
SimLayout
"
in
simKeys
:
if
re
.
match
(
simDict
[
"
SimLayout
"
],
flags
.
GeoModel
.
AtlasVersion
):
if
validateGeometryTag
(
logger
,
simDict
[
"
SimLayout
"
],
flags
.
GeoModel
.
AtlasVersion
):
logger
.
debug
(
"
Overlay configuration matches Signal Simulation metadata. [Geomodel.AtlasVersion = %s]
"
,
flags
.
GeoModel
.
AtlasVersion
)
else
:
...
...
@@ -101,7 +118,9 @@ def simulationMetadataCheck(sigdict, pudict):
logger
.
error
(
"
%s key missing from Signal Simulation metadata!
"
,
o
)
raise
AssertionError
(
"
Signal Simulation metadata key not found
"
)
try
:
if
not
isinstance
(
pudict
[
o
],
type
(
sigdict
[
o
])):
if
o
==
"
SimLayout
"
:
# allow last part of the simulation tag to differ
assert
validateGeometryTag
(
logger
,
sigdict
[
o
],
pudict
[
o
])
elif
not
isinstance
(
pudict
[
o
],
type
(
sigdict
[
o
])):
assert
re
.
match
(
str
(
pudict
[
o
]),
str
(
sigdict
[
o
]))
else
:
if
isinstance
(
pudict
[
o
],
str
):
...
...
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