Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
km3io
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
km3py
km3io
Commits
0861ae5a
Commit
0861ae5a
authored
4 years ago
by
Zineb Aly
Browse files
Options
Downloads
Patches
Plain Diff
add default best track
parent
97e65a40
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
km3io/offline.py
+17
-2
17 additions, 2 deletions
km3io/offline.py
with
17 additions
and
2 deletions
km3io/offline.py
+
17
−
2
View file @
0861ae5a
...
...
@@ -4,7 +4,7 @@ import warnings
import
numba
as
nb
import
awkward1
as
ak1
from
.definitions
import
mc_header
,
fitparameters
from
.definitions
import
mc_header
,
fitparameters
,
reconstruction
from
.tools
import
cached_property
,
to_num
,
unfold_indices
from
.rootio
import
Branch
,
BranchMapper
...
...
@@ -21,6 +21,18 @@ def _nested_mapper(key):
return
'
_
'
.
join
(
key
.
split
(
'
.
'
)[
1
:])
def
rec_types
():
"""
name of the reconstruction type as defined in the official
KM3NeT-Dataformat.
Returns
-------
dict_keys
reconstruction types.
"""
return
reconstruction
.
keys
()
def
fitinf
(
fitparam
,
tracks
):
"""
Access fit parameters in tracks.fitinf.
...
...
@@ -140,7 +152,7 @@ def mask(rec_stages, stages):
return
builder
.
snapshot
()
==
1
def
best_track
(
tracks
,
strategy
=
"
first
"
,
rec_stages
=
None
):
def
best_track
(
tracks
,
strategy
=
"
first
"
,
rec_type
=
None
,
rec_stages
=
None
):
"""
best track selection based on different strategies
Parameters
...
...
@@ -154,6 +166,9 @@ def best_track(tracks, strategy="first", rec_stages=None):
return
tracks
[:,
0
]
if
strategy
==
"
rec_stages
"
and
rec_stages
is
not
None
:
return
tracks
[
mask
(
tracks
.
rec_stages
,
rec_stages
)]
if
strategy
==
"
default
"
and
rec_type
is
not
None
:
return
tracks
[
tracks
.
rec_type
==
reconstruction
[
rec_type
]][
tracks
.
lik
==
ak1
.
max
(
tracks
.
lik
,
axis
=
1
)][:,
0
]
EVENTS_MAP
=
BranchMapper
(
name
=
"
events
"
,
...
...
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