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
1485b4fc
Commit
1485b4fc
authored
5 years ago
by
Zineb Aly
Browse files
Options
Downloads
Patches
Plain Diff
add tracks reco data in recarrays
parent
c216576a
No related branches found
No related tags found
1 merge request
!8
outsource reconstruction data in separate arrays
Pipeline
#7886
failed
5 years ago
Stage: test
Stage: coverage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
km3io/offline.py
+16
-2
16 additions, 2 deletions
km3io/offline.py
with
16 additions
and
2 deletions
km3io/offline.py
+
16
−
2
View file @
1485b4fc
import
uproot
import
numpy
as
np
# 110 MB based on the size of the largest basket found so far in km3net
BASKET_CACHE_SIZE
=
110
*
1024
**
2
...
...
@@ -178,8 +179,8 @@ class OfflineKeys:
'
JSTART_NPE_MIP
'
,
'
JSTART_NPE_MIP_TOTAL
'
,
'
JSTART_LENGTH_METRES
'
,
'
JVETO_NPE
'
,
'
JVETO_NUMBER_OF_HITS
'
,
'
JENERGY_MUON_RANGE_METRES
'
,
'
JENERGY_NOISE_LIKELIHOOD
'
,
'
JENERGY_NDF
'
,
'
JENERGY_NUMBER_OF_HITS
'
,
'
JCOPY_Z_M
'
]
'
JENERGY_NDF
'
,
'
JENERGY_NUMBER_OF_HITS
'
]
# 'JCOPY_Z_M' is the last element, not found in files!
return
self
.
_fit_keys
@property
...
...
@@ -416,6 +417,8 @@ class OfflineReader:
return
self
.
_mc_tracks
class
OfflineEvents
:
"""
wrapper for offline events
"""
def
__init__
(
self
,
keys
,
values
):
...
...
@@ -564,6 +567,7 @@ class OfflineTracks:
"""
self
.
_keys
=
keys
self
.
_values
=
values
self
.
_reco
=
None
if
fit_keys
is
not
None
:
self
.
_fit_keys
=
fit_keys
for
k
,
v
in
zip
(
self
.
_keys
,
self
.
_values
):
...
...
@@ -593,6 +597,16 @@ class OfflineTracks:
return
"
<{}: {} parsed elements>
"
.
format
(
self
.
__class__
.
__name__
,
len
(
self
))
@property
def
reco
(
self
):
if
self
.
_reco
is
None
:
keys
=
"
,
"
.
join
(
self
.
_fit_keys
)
# i[0] is the reco data of the track with the highest likelihood
# 18 is always the position of fit info
fit_data
=
np
.
array
([
i
[
0
]
for
i
in
self
.
_values
[
18
]
if
len
(
i
)
!=
0
])
self
.
_reco
=
np
.
core
.
records
.
fromarrays
(
fit_data
.
transpose
(),
names
=
keys
)
return
self
.
_reco
class
OfflineTrack
:
"""
wrapper for an offline track
"""
...
...
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