Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Analysis
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
Analysis
Commits
b587b765
Commit
b587b765
authored
2 years ago
by
Jiahui Zhuo
Committed by
Patrick Koppenburg
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix the relation location in MCReconstructed tool
parent
e8d966dc
No related branches found
No related tags found
1 merge request
!924
Fix the relation location in MCReconstructed tool
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Phys/DaVinciMCTools/python/DaVinciMCTools/MCReconstructed.py
+19
-27
19 additions, 27 deletions
Phys/DaVinciMCTools/python/DaVinciMCTools/MCReconstructed.py
with
19 additions
and
27 deletions
Phys/DaVinciMCTools/python/DaVinciMCTools/MCReconstructed.py
+
19
−
27
View file @
b587b765
...
...
@@ -26,12 +26,13 @@ class MCReconstructed:
Args:
mcparticles_input(DataHandle): MCParticle data handle (TES)
relations_locs (list, optional): TES locations to the pre-existing relations (Particle -> MCParticle)
for charged and neutral particles, default = [
"
Relations/ChargedPP2MCP
"
,
"
Relations/NeutralPP2MCP
"
]
relations_charged (str, DataHandle, optional): TES locations to the pre-existing relations (Particle -> MCParticle)
for charged particles, default =
"
Relations/ChargedPP2MCP
"
relations_neutral (str, DataHandle, optional): TES locations to the pre-existing relations (Particle -> MCParticle)
for neutral particles, default =
"
Relations/NeutralPP2MCP
"
use_best_mcmatch (bool, optional): If False, associates reconstructed track
to all the MCParticles rather than the best matched MCParticle, default = False.
process (str, optional): Process type (Hlt2 or Spruce or Turbo), default =
'
Spruce
'
root_in_tes (str, optional): Standard Gaudi Algorithm RootInTES location
output_level (int, optional): Standard Gaudi Algorithm OutputLevel
Example:
...
...
@@ -48,34 +49,25 @@ class MCReconstructed:
def
__init__
(
self
,
mcparticles_input
,
use_best_mcmatch
=
True
,
relations_locs
=
[
"
Relations/ChargedPP2MCP
"
,
"
Relations/NeutralPP2MCP
"
],
relations_charged
=
"
Relations/ChargedPP2MCP
"
,
relations_neutral
=
"
Relations/NeutralPP2MCP
"
,
process
=
'
Spruce
'
,
root_in_tes
=
None
,
output_level
=
INFO
):
if
not
root_in_tes
:
if
process
==
'
Spruce
'
:
root_in_tes
=
'
/Event/Spruce/HLT2
'
elif
process
==
'
Hlt2
'
or
process
==
'
Turbo
'
:
root_in_tes
=
'
/Event/HLT2
'
else
:
raise
ValueError
(
f
"
The specified
'
process
'
{
process
}
is not recognised. Can only be
'
Hlt2
'
or
'
Spruce
'
or
'
Turbo
'
. Please check!
"
)
if
isinstance
(
relations_locs
[
0
],
str
):
if
root_in_tes
:
relations_locs
=
[
f
'
{
root_in_tes
}
/
{
table_loc
}
'
for
table_loc
in
relations_locs
]
ChargedPP2MCP
=
force_location
(
relations_locs
[
0
])
NeutralPP2MCP
=
force_location
(
relations_locs
[
1
])
if
process
==
'
Spruce
'
:
root_in_tes
=
'
/Event/Spruce/HLT2
'
elif
process
==
'
Hlt2
'
or
process
==
'
Turbo
'
:
root_in_tes
=
'
/Event/HLT2
'
else
:
ChargedPP2MCP
=
relations_locs
[
0
]
NeutralPP2MCP
=
relations_locs
[
1
]
raise
ValueError
(
f
"
The specified
'
process
'
{
process
}
is not recognised. Can only be
'
Hlt2
'
or
'
Spruce
'
or
'
Turbo
'
. Please check!
"
)
ChargedPP2MCP
=
force_location
(
f
'
{
root_in_tes
}
/
{
relations_charged
}
'
)
if
isinstance
(
relations_charged
,
str
)
and
root_in_tes
else
relations_charged
NeutralPP2MCP
=
force_location
(
f
'
{
root_in_tes
}
/
{
relations_neutral
}
'
)
if
isinstance
(
relations_neutral
,
str
)
and
root_in_tes
else
relations_neutral
# Save setup
self
.
use_best_mcmatch
=
use_best_mcmatch
...
...
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