Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
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
atlas
athena
Merge requests
!69808
RecJobTransforms: delete unused legacy RDOFilePeeker
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
RecJobTransforms: delete unused legacy RDOFilePeeker
fwinkl/athena:recjobtrf
into
24.0
Overview
3
Commits
1
Pipelines
1
Changes
1
Merged
Frank Winklmeier
requested to merge
fwinkl/athena:recjobtrf
into
24.0
1 year ago
Overview
3
Commits
1
Pipelines
1
Changes
1
Expand
Delete unused legacy RDO file peeker.
0
0
Merge request reports
Compare
24.0
24.0 (base)
and
latest version
latest version
97722b3c
1 commit,
1 year ago
1 file
+
0
−
114
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Reconstruction/RecJobTransforms/python/RDOFilePeeker.py deleted
100644 → 0
+
0
−
114
Options
from
past.builtins
import
basestring
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
def
RDOFilePeeker
(
runArgs
,
skeletonLog
):
from
PyUtils.MetaReader
import
read_metadata
try
:
input_file
=
runArgs
.
inputRDOFile
[
0
]
metadata_lite
=
read_metadata
(
input_file
)
# Use this only to read the key 'eventTypes', which is promoted in 'lite' mode.
# promote keys stored under input filename key one level up to access them directly
metadata_lite
=
metadata_lite
[
input_file
]
# use the mode 'full' to access all metadata (needed for '/Digitization/Parameters')
metadata
=
read_metadata
(
input_file
,
mode
=
'
full
'
)
# promote keys stored under input filename key one level up to access them directly
metadata
=
metadata
[
input_file
]
except
AssertionError
:
skeletonLog
.
error
(
"
Failed to open input file: %s
"
,
runArgs
.
inputRDOFile
[
0
])
#check eventTypes of input file
if
'
eventTypes
'
in
metadata_lite
:
if
'
IS_SIMULATION
'
not
in
metadata_lite
[
'
eventTypes
'
]:
skeletonLog
.
error
(
'
This input file has incorrect eventTypes: %s
'
,
metadata_lite
[
'
eventTypes
'
])
skeletonLog
.
info
(
'
Please make sure you have set input file metadata correctly.
'
)
skeletonLog
.
info
(
'
Consider using the job transforms for earlier steps if you aren
\'
t already.
'
)
#then exit gracefully
raise
SystemExit
(
"
Input file eventTypes is incorrect, please check your digi, g4sim and evgen jobs.
"
)
else
:
skeletonLog
.
warning
(
'
Could not find
\'
eventTypes
\'
key in MetaReader -> metadata. Unable to that check if eventTypes is correct.
'
)
metadatadict
=
{}
if
'
/Digitization/Parameters
'
in
metadata
:
metadatadict
=
metadata
[
'
/Digitization/Parameters
'
]
if
isinstance
(
metadatadict
,
list
):
skeletonLog
.
warning
(
"
inputfile: %s contained %s sets of Dititization Metadata. Using the final set in the list.
"
,
input_file
,
len
(
metadatadict
))
metadatadict
=
metadatadict
[
-
1
]
##Get IOVDbGlobalTag
if
'
IOVDbGlobalTag
'
not
in
metadatadict
:
try
:
if
metadata
[
'
/TagInfo
'
][
'
IOVDbGlobalTag
'
]
is
not
None
:
metadatadict
[
'
IOVDbGlobalTag
'
]
=
metadata
[
'
/TagInfo
'
][
'
IOVDbGlobalTag
'
]
except
Exception
:
skeletonLog
.
warning
(
"
Failed to find IOVDbGlobalTag.
"
)
else
:
##Patch for older hit files
if
'
DigitizedDetectors
'
not
in
metadatadict
:
metadatadict
[
'
DigitizedDetectors
'
]
=
[
'
pixel
'
,
'
SCT
'
,
'
TRT
'
,
'
BCM
'
,
'
Lucid
'
,
'
LAr
'
,
'
Tile
'
,
'
MDT
'
,
'
CSC
'
,
'
TGC
'
,
'
RPC
'
,
'
Truth
'
]
import
re
from
AthenaCommon.GlobalFlags
import
globalflags
## Configure DetDescrVersion
if
hasattr
(
runArgs
,
"
geometryVersion
"
):
inputGeometryVersion
=
runArgs
.
geometryVersion
if
isinstance
(
inputGeometryVersion
,
basestring
)
and
inputGeometryVersion
.
endswith
(
"
_VALIDATION
"
):
inputGeometryVersion
=
inputGeometryVersion
.
replace
(
"
_VALIDATION
"
,
""
)
if
'
DetDescrVersion
'
in
metadatadict
:
if
not
re
.
match
(
metadatadict
[
'
DetDescrVersion
'
],
inputGeometryVersion
):
skeletonLog
.
warning
(
"
command-line geometryVersion (%s) does not match the value used in the Simulation step (%s) !
"
,
inputGeometryVersion
,
metadatadict
[
'
DetDescrVersion
'
])
globalflags
.
DetDescrVersion
.
set_Value_and_Lock
(
inputGeometryVersion
)
skeletonLog
.
info
(
"
Using geometryVersion from command-line: %s
"
,
globalflags
.
DetDescrVersion
.
get_Value
())
elif
'
DetDescrVersion
'
in
metadatadict
:
globalflags
.
DetDescrVersion
.
set_Value_and_Lock
(
metadatadict
[
'
DetDescrVersion
'
]
)
skeletonLog
.
info
(
"
Using geometryVersion from RDO file metadata %s
"
,
globalflags
.
DetDescrVersion
.
get_Value
())
else
:
raise
SystemExit
(
"
geometryVersion not found in RDO file metadata or on transform command-line!
"
)
## Configure ConditionsTag
if
hasattr
(
runArgs
,
"
conditionsTag
"
):
if
'
IOVDbGlobalTag
'
in
metadatadict
:
if
not
re
.
match
(
metadatadict
[
'
IOVDbGlobalTag
'
],
runArgs
.
conditionsTag
):
skeletonLog
.
warning
(
"
command-line conditionsTag (%s) does not match the value used in the Simulation step (%s) !
"
,
runArgs
.
conditionsTag
,
metadatadict
[
'
IOVDbGlobalTag
'
])
#globalflags.ConditionsTag.set_Value_and_Lock( runArgs.conditionsTag ) ## already done in CommonSkeletonJobOptions.py
skeletonLog
.
info
(
"
Using conditionsTag from command-line: %s
"
,
globalflags
.
ConditionsTag
.
get_Value
())
elif
'
IOVDbGlobalTag
'
in
metadatadict
:
globalflags
.
ConditionsTag
.
set_Value_and_Lock
(
metadatadict
[
'
IOVDbGlobalTag
'
]
)
skeletonLog
.
info
(
"
Using conditionsTag from RDO file metadata %s
"
,
globalflags
.
ConditionsTag
.
get_Value
())
else
:
raise
SystemExit
(
"
conditionsTag not found in RDO file metadata or on transform command-line!
"
)
## Configure DetFlags
if
'
DigitizedDetectors
'
in
metadatadict
:
from
AthenaCommon.DetFlags
import
DetFlags
# by default everything is off
DetFlags
.
all_setOff
()
skeletonLog
.
debug
(
"
Switching on DetFlags for subdetectors which were digitized
"
)
if
isinstance
(
metadatadict
[
'
DigitizedDetectors
'
],
str
):
digitizedDetectors
=
eval
(
metadatadict
[
'
DigitizedDetectors
'
])
# convert from str to list of str
else
:
digitizedDetectors
=
metadatadict
[
'
DigitizedDetectors
'
]
digitizedDetectors
[:]
=
[
x
.
lower
()
if
x
==
'
Pixel
'
else
x
for
x
in
digitizedDetectors
]
# to cope with CA-based inputs where Pixel rather than pixel is used
for
subdet
in
digitizedDetectors
:
cmd
=
'
DetFlags.%s_setOn()
'
%
subdet
skeletonLog
.
debug
(
cmd
)
try
:
exec
(
cmd
)
except
Exception
:
skeletonLog
.
warning
(
'
Failed to switch on subdetector %s
'
,
subdet
)
#hacks to reproduce the sub-set of DetFlags left on by RecExCond/AllDet_detDescr.py
DetFlags
.
simulate
.
all_setOff
()
DetFlags
.
simulateLVL1
.
all_setOff
()
DetFlags
.
digitize
.
all_setOff
()
DetFlags
.
pileup
.
all_setOff
()
DetFlags
.
readRDOBS
.
all_setOff
()
DetFlags
.
readRDOPool
.
all_setOff
()
DetFlags
.
readRIOBS
.
all_setOff
()
DetFlags
.
readRIOPool
.
all_setOff
()
DetFlags
.
makeRIO
.
all_setOff
()
DetFlags
.
writeBS
.
all_setOff
()
DetFlags
.
writeRDOPool
.
all_setOff
()
DetFlags
.
writeRIOPool
.
all_setOff
()
return
Loading