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
690a2357
Commit
690a2357
authored
3 years ago
by
Nicole Skidmore
Committed by
Rosen Matev
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
reading.py changes to allow MC object reading for sprucing
parent
683fb902
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!3702
merge counter decoder into Louis' original branch
,
!3395
reading.py changes to allow MC object reading for sprucing
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GaudiConf/python/GaudiConf/reading.py
+36
-19
36 additions, 19 deletions
GaudiConf/python/GaudiConf/reading.py
with
36 additions
and
19 deletions
GaudiConf/python/GaudiConf/reading.py
+
36
−
19
View file @
690a2357
...
...
@@ -29,23 +29,26 @@ def mc_unpackers(process='Hlt2', filtered_mc=True, configurables=True):
This must run BEFORE unpackers!!!.
Args:
process (str):
'
Hlt2
'
(or, in the future,
'
Spruce
'
)
.
process (str):
'
Turbo
'
,
'
Spruce
'
or
'
Hlt2
'
.
filtered_mc (bool): If True, assume Moore saved only a filtered
subset of the input MC objects.
configurables (bool): set to False to use PyConf Algorithm.
"""
assert
process
==
"
Hlt2
"
or
process
==
"
Turbo
"
or
process
==
"
Spruce
"
,
'
MC unpacker helper only accepts Turbo, Spruce or Hlt2 process
es
'
assert
process
==
"
Hlt2
"
or
process
==
"
Turbo
"
or
process
==
"
Spruce
"
,
'
MC unpacker helper only accepts Turbo, Spruce or Hlt2 process
'
mc_prefix
=
'
/Event/HLT2
'
if
filtered_mc
else
"
/Event
"
if
process
==
"
Spruce
"
:
mc_prefix
=
'
/Event/Spruce/HLT2
'
if
configurables
:
from
Configurables
import
UnpackMCParticle
,
UnpackMCVertex
unpack_mcp
=
UnpackMCParticle
(
InputName
=
os
.
path
.
join
(
mc_prefix
,
"
pSim/MCParticles
"
),
OutputName
=
os
.
path
.
join
(
mc_prefix
,
"
MC/Particles
"
),
)
OutputName
=
os
.
path
.
join
(
mc_prefix
,
"
MC/Particles
"
))
unpack_mcv
=
UnpackMCVertex
(
InputName
=
os
.
path
.
join
(
mc_prefix
,
"
pSim/MCVertices
"
),
OutputName
=
os
.
path
.
join
(
mc_prefix
,
"
MC/Vertices
"
),
)
OutputName
=
os
.
path
.
join
(
mc_prefix
,
"
MC/Vertices
"
))
else
:
from
PyConf.application
import
make_data_with_FetchDataFromFile
from
PyConf.Algorithms
import
UnpackMCParticle
,
UnpackMCVertex
...
...
@@ -73,7 +76,7 @@ def unpack_rawevent(bank_types=["DstData", "HltDecReports"],
stream
=
"
default
"
,
raw_event_format
=
0.3
,
configurables
=
True
,
O
utput
L
evel
=
4
):
o
utput
_l
evel
=
4
):
"""
Return RawBank:Views of banks in RawEvent.
Args:
...
...
@@ -82,6 +85,8 @@ def unpack_rawevent(bank_types=["DstData", "HltDecReports"],
stream (str): needed post-sprucing as RawEvent is then dependent on stream name
- drives `RawEventLocation` only.
raw_event_format (float):
configurables (bool): set to False to use PyConf Algorithm.
output_level (int): Level of verbosity 1-8.
"""
assert
process
==
"
Spruce
"
or
process
==
"
Turbo
"
or
process
==
"
Hlt2
"
,
'
Unpacking helper only accepts Turbo, Spruce or Hlt2 processes
'
if
process
==
"
Spruce
"
or
process
==
"
Turbo
"
:
...
...
@@ -100,14 +105,14 @@ def unpack_rawevent(bank_types=["DstData", "HltDecReports"],
'
/Event/DAQ/RawBanks/%s
'
%
(
rb
)
for
rb
in
bank_types
],
RawEventLocation
=
bank_location
,
OutputLevel
=
O
utput
L
evel
)
OutputLevel
=
o
utput
_l
evel
)
return
unpackrawevent
def
unpackers
(
process
=
'
Hlt2
'
,
data_type
=
'
Upgrade
'
,
configurables
=
True
,
O
utput
L
evel
=
4
):
o
utput
_l
evel
=
4
):
"""
Return a list of unpackers for reading reconstructed objects.
This must run AFTER mc_unpackers if MC data!!!.
...
...
@@ -115,6 +120,8 @@ def unpackers(process='Hlt2',
Args:
process (str):
'
Turbo
'
or
'
Spruce
'
or
'
Hlt2
'
.
data_type (str): The data type to configure PersistRecoPacking
configurables (bool): set to False to use PyConf Algorithm.
output_level (int): Level of verbosity 1-8.
"""
assert
process
==
"
Spruce
"
or
process
==
"
Turbo
"
or
process
==
"
Hlt2
"
,
'
Unpacking helper only accepts Turbo, Spruce or Hlt2 processes
'
if
configurables
:
...
...
@@ -129,9 +136,9 @@ def unpackers(process='Hlt2',
RECO_ROOT
=
PANDV_ROOT
prpacking
=
PersistRecoPacking
(
stream
=
RECO_ROOT
,
data_type
=
data_type
)
unpack_persistreco
=
prpacking
.
unpackers
(
configurables
=
configurables
,
output_level
=
O
utput
L
evel
)
configurables
=
configurables
,
output_level
=
o
utput
_l
evel
)
unpack_psandvs
=
UnpackParticlesAndVertices
(
InputStream
=
PANDV_ROOT
,
OutputLevel
=
O
utput
L
evel
)
InputStream
=
PANDV_ROOT
,
OutputLevel
=
o
utput
_l
evel
)
return
unpack_persistreco
+
[
unpack_psandvs
]
...
...
@@ -139,8 +146,9 @@ def decoder(process='Hlt2',
stream
=
"
default
"
,
raw_event_format
=
0.3
,
data_type
=
'
Upgrade
'
,
annsvc_name
=
'
HltANNSvc
'
,
configurables
=
True
,
O
utput
L
evel
=
4
):
o
utput
_l
evel
=
4
):
"""
Return a DstData raw bank decoder.
Args:
...
...
@@ -149,6 +157,9 @@ def decoder(process='Hlt2',
- drives `RawEventLocation` only.
raw_event_format (float):
data_type (str): The data type to configure PersistRecoPacking.
annsvc_name (str): Name of ANNSvc to read data.
configurables (bool): set to False to use PyConf Algorithm.
output_level (int): Level of verbosity 1-8.
"""
assert
process
==
"
Spruce
"
or
process
==
"
Turbo
"
or
process
==
"
Hlt2
"
,
'
Unpacking helper only accepts Turbo, Spruce or Hlt2 processes
'
if
process
==
"
Spruce
"
:
...
...
@@ -173,7 +184,8 @@ def decoder(process='Hlt2',
decode_packeddata
=
HltPackedDataDecoder
(
RawEventLocations
=
[
bank_location
],
ContainerMap
=
container_map
,
OutputLevel
=
OutputLevel
)
ANNSvc
=
annsvc_name
,
OutputLevel
=
output_level
)
return
decode_packeddata
...
...
@@ -182,14 +194,17 @@ def hlt2_decisions(process='Hlt2',
output_loc
=
"
/Event/Hlt/DecReports
"
,
raw_event_format
=
0.3
,
configurables
=
True
,
O
utput
L
evel
=
4
):
o
utput
_l
evel
=
4
):
"""
Return a HltDecReportsDecoder instance for HLT2 decisions.
Args:
process (str):
'
Turbo
'
or
'
Spruce
'
or
'
Hlt2
'
- serves to determine `RawEventLocation` only.
stream (str): needed post-sprucing as RawEvent is then dependent on stream name
- drives `RawEventLocation` only.
output_loc (str): TES location to put decoded DecReports.
raw_event_format (float):
configurables (bool): set to False to use PyConf Algorithm.
output_level (int): Level of verbosity 1-8.
"""
assert
process
==
"
Spruce
"
or
process
==
"
Turbo
"
or
process
==
"
Hlt2
"
,
'
Unpacking helper only accepts Turbo, Spruce or Hlt2 processes
'
...
...
@@ -206,7 +221,7 @@ def hlt2_decisions(process='Hlt2',
SourceID
=
'
Hlt2
'
,
RawEventLocations
=
bank_location
.
location
,
OutputHltDecReportsLocation
=
output_loc
,
OutputLevel
=
O
utput
L
evel
)
OutputLevel
=
o
utput
_l
evel
)
else
:
from
PyConf.Algorithms
import
HltDecReportsDecoder
...
...
@@ -217,7 +232,7 @@ def hlt2_decisions(process='Hlt2',
outputs
=
{
'
OutputHltDecReportsLocation
'
:
force_location
(
output_loc
)
},
OutputLevel
=
O
utput
L
evel
)
OutputLevel
=
o
utput
_l
evel
)
return
decode_hlt2
...
...
@@ -225,13 +240,15 @@ def hlt2_decisions(process='Hlt2',
def
spruce_decisions
(
process
=
"
Spruce
"
,
stream
=
"
default
"
,
configurables
=
True
,
O
utput
L
evel
=
4
):
o
utput
_l
evel
=
4
):
"""
Return a HltDecReportsDecoder instance for Sprucing decisions.
Args:
process (str):
'
Turbo
'
or
'
Spruce
'
- serves to determine `RawEventLocation` only.
stream (str): needed post-sprucing as RawEvent is then dependent on stream name
- drives `RawEventLocation` only.
configurables (bool): set to False to use PyConf Algorithm.
output_level (int): Level of verbosity 1-8.
"""
assert
process
==
"
Spruce
"
or
process
==
"
Turbo
"
,
'
Can only ask for sprucing decisions if post - sprucing
'
bank_location
=
make_data_with_FetchDataFromFile
(
stream
)
...
...
@@ -244,7 +261,7 @@ def spruce_decisions(process="Spruce",
SourceID
=
'
Spruce
'
,
RawEventLocations
=
bank_location
.
location
,
OutputHltDecReportsLocation
=
output_loc
,
OutputLevel
=
O
utput
L
evel
)
OutputLevel
=
o
utput
_l
evel
)
else
:
from
PyConf.Algorithms
import
HltDecReportsDecoder
...
...
@@ -256,7 +273,7 @@ def spruce_decisions(process="Spruce",
outputs
=
{
'
OutputHltDecReportsLocation
'
:
force_location
(
output_loc
)
},
OutputLevel
=
O
utput
L
evel
)
OutputLevel
=
o
utput
_l
evel
)
return
decode_spruce
...
...
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