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
c7355747
Commit
c7355747
authored
4 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
More annotations in docs
parent
e384b60f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!47
Resolve "uproot4 integration"
Pipeline
#16350
passed with warnings
4 years ago
Stage: test
Stage: coverage
Stage: doc
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/plot_offline_tracks.py
+43
-15
43 additions, 15 deletions
examples/plot_offline_tracks.py
with
43 additions
and
15 deletions
examples/plot_offline_tracks.py
+
43
−
15
View file @
c7355747
...
...
@@ -25,24 +25,24 @@ f.mc_tracks
# tracks will only return how many sub-branches (corresponding to
# events) were found.
print
(
f
.
tracks
)
f
.
tracks
#####################################################
# same for mc hits
print
(
f
.
mc_tracks
)
f
.
mc_tracks
#####################################################
# Accessing the tracks/mc_tracks keys
# -----------------------------------
# to explore the reconstructed tracks fields:
print
(
f
.
tracks
.
fields
)
f
.
tracks
.
fields
#####################################################
# the same for MC tracks
print
(
f
.
mc_tracks
.
fields
)
f
.
mc_tracks
.
fields
#####################################################
# Accessing tracks data
...
...
@@ -50,9 +50,17 @@ print(f.mc_tracks.fields)
# each field will return a nested `awkward.Array` and load everything into
# memory, so be careful if you are working with larger files.
print
(
f
.
tracks
.
E
)
print
(
f
.
tracks
.
dir_z
)
print
(
f
.
tracks
.
lik
)
f
.
tracks
.
E
######################################################
# The z direction of all reconstructed tracks
f
.
tracks
.
dir_z
######################################################
# The likelihoods
f
.
tracks
.
lik
#####################################################
...
...
@@ -60,22 +68,42 @@ print(f.tracks.lik)
# The following will access all tracks and their fields
# of the third event (0 is the first):
print
(
f
[
2
].
tracks
)
print
(
f
[
2
].
tracks
.
dir_z
)
f
[
2
].
tracks
######################################################
# The z direction of all tracks in the third event:
f
[
2
].
tracks
.
dir_z
#####################################################
# while here, we select the first 3 events. Notice that all fields will return
# nested arrays, as we have seem above where all events were selected.
print
(
f
[:
3
])
print
(
f
[:
3
].
tracks
)
print
(
f
[:
3
].
tracks
.
dir_z
)
f
[:
3
]
######################################################
# All tracks for the first three events
f
[:
3
].
tracks
######################################################
# The z directions of all tracks of the first three events
f
[:
3
].
tracks
.
dir_z
#####################################################
# or events from 3 and 5 (again, 0 indexing):
print
(
f
[
2
:
5
])
print
(
f
[
2
:
5
].
tracks
)
print
(
f
[
2
:
5
].
tracks
.
dir_z
)
f
[
2
:
5
]
######################################################
# the tracks of those events
f
[
2
:
5
].
tracks
######################################################
# and just the z directions of those
f
[
2
:
5
].
tracks
.
dir_z
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