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
24ac1230
Commit
24ac1230
authored
5 years ago
by
Zineb Aly
Browse files
Options
Downloads
Patches
Plain Diff
add notebook tutorials
parent
5d0303d7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#7648
passed with warnings
5 years ago
Stage: test
Stage: coverage
Stage: doc
Stage: deploy
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
km3io/aanet.py
+5
-5
5 additions, 5 deletions
km3io/aanet.py
notebooks/OfflineReader_tutorial.ipynb
+830
-0
830 additions, 0 deletions
notebooks/OfflineReader_tutorial.ipynb
notebooks/Reader_tutorial.ipynb
+29
-145
29 additions, 145 deletions
notebooks/Reader_tutorial.ipynb
with
864 additions
and
150 deletions
km3io/aanet.py
+
5
−
5
View file @
24ac1230
...
...
@@ -550,14 +550,14 @@ class OfflineHit:
class
OfflineTracks
:
"""
wrapper for offline tracks
"""
def
__init__
(
self
,
keys
,
values
,
fit_keys
=
None
):
"""
Summary
"""
wrapper for offline tracks
Parameters
----------
keys :
TYPE
Description
values :
TYPE
Description
keys :
list of str
list of cropped tracks keys.
values :
list of arrays
list of arrays containting tracks data.
fit_keys : None, optional
list of tracks fit information (not yet outsourced in offline
files).
...
...
This diff is collapsed.
Click to expand it.
notebooks/OfflineReader_tutorial.ipynb
0 → 100644
+
830
−
0
View file @
24ac1230
This diff is collapsed.
Click to expand it.
notebooks/
Aanet
Reader_tutorial.ipynb
→
notebooks/Reader_tutorial.ipynb
+
29
−
145
View file @
24ac1230
...
...
@@ -28,7 +28,7 @@
"metadata": {},
"outputs": [],
"source": [
"from km3io import
Aanet
Reader"
"from km3io
.aanet
import Reader"
]
},
{
...
...
@@ -44,7 +44,7 @@
},
{
"cell_type": "code",
"execution_count":
12
,
"execution_count":
4
,
"metadata": {
"scrolled": true
},
...
...
@@ -52,130 +52,16 @@
{
"data": {
"text/plain": [
"Events keys are:\n",
"\tid\n",
"\tdet_id\n",
"\tmc_id\n",
"\trun_id\n",
"\tmc_run_id\n",
"\tframe_index\n",
"\ttrigger_mask\n",
"\ttrigger_counter\n",
"\toverlays\n",
"\thits\n",
"\ttrks\n",
"\tw\n",
"\tw2list\n",
"\tw3list\n",
"\tmc_t\n",
"\tmc_hits\n",
"\tmc_trks\n",
"\tcomment\n",
"\tindex\n",
"\tflags\n",
"\tt.fSec\n",
"\tt.fNanoSec\n",
"Hits keys are:\n",
"\thits.id\n",
"\thits.dom_id\n",
"\thits.channel_id\n",
"\thits.tdc\n",
"\thits.tot\n",
"\thits.trig\n",
"\thits.pmt_id\n",
"\thits.t\n",
"\thits.a\n",
"\thits.pos.x\n",
"\thits.pos.y\n",
"\thits.pos.z\n",
"\thits.dir.x\n",
"\thits.dir.y\n",
"\thits.dir.z\n",
"\thits.pure_t\n",
"\thits.pure_a\n",
"\thits.type\n",
"\thits.origin\n",
"\thits.pattern_flags\n",
"Tracks keys are:\n",
"\ttrks.fUniqueID\n",
"\ttrks.fBits\n",
"\ttrks.usr_data\n",
"\ttrks.usr_names\n",
"\ttrks.id\n",
"\ttrks.pos.x\n",
"\ttrks.pos.y\n",
"\ttrks.pos.z\n",
"\ttrks.dir.x\n",
"\ttrks.dir.y\n",
"\ttrks.dir.z\n",
"\ttrks.t\n",
"\ttrks.E\n",
"\ttrks.len\n",
"\ttrks.lik\n",
"\ttrks.type\n",
"\ttrks.rec_type\n",
"\ttrks.rec_stages\n",
"\ttrks.status\n",
"\ttrks.mother_id\n",
"\ttrks.fitinf\n",
"\ttrks.hit_ids\n",
"\ttrks.error_matrix\n",
"\ttrks.comment\n",
"Mc hits keys are:\n",
"\tmc_hits.id\n",
"\tmc_hits.dom_id\n",
"\tmc_hits.channel_id\n",
"\tmc_hits.tdc\n",
"\tmc_hits.tot\n",
"\tmc_hits.trig\n",
"\tmc_hits.pmt_id\n",
"\tmc_hits.t\n",
"\tmc_hits.a\n",
"\tmc_hits.pos.x\n",
"\tmc_hits.pos.y\n",
"\tmc_hits.pos.z\n",
"\tmc_hits.dir.x\n",
"\tmc_hits.dir.y\n",
"\tmc_hits.dir.z\n",
"\tmc_hits.pure_t\n",
"\tmc_hits.pure_a\n",
"\tmc_hits.type\n",
"\tmc_hits.origin\n",
"\tmc_hits.pattern_flags\n",
"Mc tracks keys are:\n",
"\tmc_trks.fUniqueID\n",
"\tmc_trks.fBits\n",
"\tmc_trks.usr_data\n",
"\tmc_trks.usr_names\n",
"\tmc_trks.id\n",
"\tmc_trks.pos.x\n",
"\tmc_trks.pos.y\n",
"\tmc_trks.pos.z\n",
"\tmc_trks.dir.x\n",
"\tmc_trks.dir.y\n",
"\tmc_trks.dir.z\n",
"\tmc_trks.t\n",
"\tmc_trks.E\n",
"\tmc_trks.len\n",
"\tmc_trks.lik\n",
"\tmc_trks.type\n",
"\tmc_trks.rec_type\n",
"\tmc_trks.rec_stages\n",
"\tmc_trks.status\n",
"\tmc_trks.mother_id\n",
"\tmc_trks.fitinf\n",
"\tmc_trks.hit_ids\n",
"\tmc_trks.error_matrix\n",
"\tmc_trks.comment"
"<Reader: 10 entries>"
]
},
"execution_count":
12
,
"execution_count":
4
,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"reader =
Aanet
Reader(aanet_file)\n",
"reader = Reader(aanet_file)\n",
"reader"
]
},
...
...
@@ -189,8 +75,6 @@
"text/plain": [
"['trks.fUniqueID',\n",
" 'trks.fBits',\n",
" 'trks.usr_data',\n",
" 'trks.usr_names',\n",
" 'trks.id',\n",
" 'trks.pos.x',\n",
" 'trks.pos.y',\n",
...
...
@@ -219,7 +103,7 @@
}
],
"source": [
"reader.tracks_keys"
"reader.
keys.
tracks_keys"
]
},
{
...
...
@@ -230,7 +114,7 @@
{
"data": {
"text/plain": [
"<Table [<Row 0> <Row 1> <Row 2> ... <Row 7> <Row 8> <Row 9>] at 0x7f
83f9d62c1
0>"
"<Table [<Row 0> <Row 1> <Row 2> ... <Row 7> <Row 8> <Row 9>] at 0x7f
ed2d98a75
0>"
]
},
"execution_count": 6,
...
...
@@ -240,7 +124,7 @@
],
"source": [
"# big lazyarray with ALL file data!\n",
"lazy_data = reader._
lazy_
data\n",
"lazy_data = reader._data\n",
"lazy_data"
]
},
...
...
@@ -252,7 +136,7 @@
{
"data": {
"text/plain": [
"<ChunkedArray [5971 5971 5971 ... 5971 5971 5971] at 0x7f
83f9d2cd
d0>"
"<ChunkedArray [5971 5971 5971 ... 5971 5971 5971] at 0x7f
ed2d91f9
d0>"
]
},
"execution_count": 7,
...
...
@@ -309,7 +193,7 @@
},
{
"cell_type": "code",
"execution_count": 1
5
,
"execution_count": 1
0
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -330,16 +214,16 @@
},
{
"cell_type": "code",
"execution_count": 1
4
,
"execution_count": 1
1
,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<ChunkedArray [[806451572 806451572 806451572 ... 809544061 809544061 809544061] [806451572 806451572 806451572 ... 809524432 809526097 809544061] [806451572 806451572 806451572 ... 809544061 809544061 809544061] ... [806451572 806455814 806465101 ... 809526097 809544058 809544061] [806455814 806455814 806455814 ... 809544061 809544061 809544061] [806455814 806455814 806455814 ... 809544058 809544058 809544061]] at 0x7f
83f9a1389
0>"
"<ChunkedArray [[806451572 806451572 806451572 ... 809544061 809544061 809544061] [806451572 806451572 806451572 ... 809524432 809526097 809544061] [806451572 806451572 806451572 ... 809544061 809544061 809544061] ... [806451572 806455814 806465101 ... 809526097 809544058 809544061] [806455814 806455814 806455814 ... 809544061 809544061 809544061] [806455814 806455814 806455814 ... 809544058 809544058 809544061]] at 0x7f
ed2d8af45
0>"
]
},
"execution_count": 1
4
,
"execution_count": 1
1
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -352,7 +236,7 @@
},
{
"cell_type": "code",
"execution_count": 1
6
,
"execution_count": 1
2
,
"metadata": {},
"outputs": [
{
...
...
@@ -371,7 +255,7 @@
" dtype=int32)"
]
},
"execution_count": 1
6
,
"execution_count": 1
2
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -384,7 +268,7 @@
},
{
"cell_type": "code",
"execution_count": 1
7
,
"execution_count": 1
3
,
"metadata": {},
"outputs": [
{
...
...
@@ -393,7 +277,7 @@
"60"
]
},
"execution_count": 1
7
,
"execution_count": 1
3
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -407,7 +291,7 @@
},
{
"cell_type": "code",
"execution_count": 1
8
,
"execution_count": 1
4
,
"metadata": {},
"outputs": [
{
...
...
@@ -416,7 +300,7 @@
"806455814"
]
},
"execution_count": 1
8
,
"execution_count": 1
4
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -435,16 +319,16 @@
},
{
"cell_type": "code",
"execution_count": 1
9
,
"execution_count": 1
5
,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<ChunkedArray [[-0.872885221293917 -0.872885221293917 -0.872885221293917 ... -0.6631226836266504 -0.5680647731737454 -0.5680647731737454] [-0.8351996698137462 -0.8351996698137462 -0.8351996698137462 ... -0.7485107718446855 -0.8229838871876581 -0.239315690284641] [-0.989148723802379 -0.989148723802379 -0.989148723802379 ... -0.9350162572437829 -0.88545604390297 -0.88545604390297] ... [-0.5704611045902105 -0.5704611045902105 -0.5704611045902105 ... -0.9350162572437829 -0.4647231989130516 -0.4647231989130516] [-0.9779941383490359 -0.9779941383490359 -0.9779941383490359 ... -0.88545604390297 -0.88545604390297 -0.8229838871876581] [-0.7396916780974963 -0.7396916780974963 -0.7396916780974963 ... -0.6631226836266504 -0.7485107718446855 -0.7485107718446855]] at 0x7f
83f9b65f9
0>"
"<ChunkedArray [[-0.872885221293917 -0.872885221293917 -0.872885221293917 ... -0.6631226836266504 -0.5680647731737454 -0.5680647731737454] [-0.8351996698137462 -0.8351996698137462 -0.8351996698137462 ... -0.7485107718446855 -0.8229838871876581 -0.239315690284641] [-0.989148723802379 -0.989148723802379 -0.989148723802379 ... -0.9350162572437829 -0.88545604390297 -0.88545604390297] ... [-0.5704611045902105 -0.5704611045902105 -0.5704611045902105 ... -0.9350162572437829 -0.4647231989130516 -0.4647231989130516] [-0.9779941383490359 -0.9779941383490359 -0.9779941383490359 ... -0.88545604390297 -0.88545604390297 -0.8229838871876581] [-0.7396916780974963 -0.7396916780974963 -0.7396916780974963 ... -0.6631226836266504 -0.7485107718446855 -0.7485107718446855]] at 0x7f
ed2d8b885
0>"
]
},
"execution_count": 1
9
,
"execution_count": 1
5
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -456,7 +340,7 @@
},
{
"cell_type": "code",
"execution_count":
20
,
"execution_count":
16
,
"metadata": {},
"outputs": [
{
...
...
@@ -476,7 +360,7 @@
" -0.97094183])"
]
},
"execution_count":
20
,
"execution_count":
16
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -489,7 +373,7 @@
},
{
"cell_type": "code",
"execution_count":
2
1,
"execution_count": 1
7
,
"metadata": {},
"outputs": [
{
...
...
@@ -498,7 +382,7 @@
"56"
]
},
"execution_count":
2
1,
"execution_count": 1
7
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -512,7 +396,7 @@
},
{
"cell_type": "code",
"execution_count":
22
,
"execution_count":
18
,
"metadata": {},
"outputs": [
{
...
...
@@ -521,7 +405,7 @@
"-0.6024604933159441"
]
},
"execution_count":
22
,
"execution_count":
18
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -552,5 +436,5 @@
}
},
"nbformat": 4,
"nbformat_minor":
2
"nbformat_minor":
4
}
%% Cell type:code id: tags:
```
python
# Add file to current python path
from
pathlib
import
Path
import
sys
sys
.
path
.
append
(
str
(
Path
.
cwd
().
parent
))
Path
.
cwd
()
print
(
sys
.
path
)
```
%% Output
['/home/zineb/km3net/km3net/km3io/notebooks', '/home/zineb/miniconda3/envs/km3pipe/lib/python37.zip', '/home/zineb/miniconda3/envs/km3pipe/lib/python3.7', '/home/zineb/miniconda3/envs/km3pipe/lib/python3.7/lib-dynload', '', '/home/zineb/miniconda3/envs/km3pipe/lib/python3.7/site-packages', '/home/zineb/km3net/km3net/km3io', '/home/zineb/miniconda3/envs/km3pipe/lib/python3.7/site-packages/IPython/extensions', '/home/zineb/.ipython', '/home/zineb/km3net/km3net/km3io']
%% Cell type:code id: tags:
```
python
from
km3io
import
Aanet
Reader
from
km3io
.aanet
import
Reader
```
%% Cell type:code id: tags:
```
python
# test samples directory - aanet test file
files_path
=
Path
.
cwd
().
parent
/
'
tests/samples
'
aanet_file
=
files_path
/
'
aanet_v2.0.0.root
'
```
%% Cell type:code id: tags:
```
python
reader
=
Aanet
Reader
(
aanet_file
)
reader
=
Reader
(
aanet_file
)
reader
```
%% Output
Events keys are:
id
det_id
mc_id
run_id
mc_run_id
frame_index
trigger_mask
trigger_counter
overlays
hits
trks
w
w2list
w3list
mc_t
mc_hits
mc_trks
comment
index
flags
t.fSec
t.fNanoSec
Hits keys are:
hits.id
hits.dom_id
hits.channel_id
hits.tdc
hits.tot
hits.trig
hits.pmt_id
hits.t
hits.a
hits.pos.x
hits.pos.y
hits.pos.z
hits.dir.x
hits.dir.y
hits.dir.z
hits.pure_t
hits.pure_a
hits.type
hits.origin
hits.pattern_flags
Tracks keys are:
trks.fUniqueID
trks.fBits
trks.usr_data
trks.usr_names
trks.id
trks.pos.x
trks.pos.y
trks.pos.z
trks.dir.x
trks.dir.y
trks.dir.z
trks.t
trks.E
trks.len
trks.lik
trks.type
trks.rec_type
trks.rec_stages
trks.status
trks.mother_id
trks.fitinf
trks.hit_ids
trks.error_matrix
trks.comment
Mc hits keys are:
mc_hits.id
mc_hits.dom_id
mc_hits.channel_id
mc_hits.tdc
mc_hits.tot
mc_hits.trig
mc_hits.pmt_id
mc_hits.t
mc_hits.a
mc_hits.pos.x
mc_hits.pos.y
mc_hits.pos.z
mc_hits.dir.x
mc_hits.dir.y
mc_hits.dir.z
mc_hits.pure_t
mc_hits.pure_a
mc_hits.type
mc_hits.origin
mc_hits.pattern_flags
Mc tracks keys are:
mc_trks.fUniqueID
mc_trks.fBits
mc_trks.usr_data
mc_trks.usr_names
mc_trks.id
mc_trks.pos.x
mc_trks.pos.y
mc_trks.pos.z
mc_trks.dir.x
mc_trks.dir.y
mc_trks.dir.z
mc_trks.t
mc_trks.E
mc_trks.len
mc_trks.lik
mc_trks.type
mc_trks.rec_type
mc_trks.rec_stages
mc_trks.status
mc_trks.mother_id
mc_trks.fitinf
mc_trks.hit_ids
mc_trks.error_matrix
mc_trks.comment
<Reader: 10 entries>
%% Cell type:code id: tags:
```
python
reader
.
tracks_keys
reader
.
keys
.
tracks_keys
```
%% Output
['trks.fUniqueID',
'trks.fBits',
'trks.usr_data',
'trks.usr_names',
'trks.id',
'trks.pos.x',
'trks.pos.y',
'trks.pos.z',
'trks.dir.x',
'trks.dir.y',
'trks.dir.z',
'trks.t',
'trks.E',
'trks.len',
'trks.lik',
'trks.type',
'trks.rec_type',
'trks.rec_stages',
'trks.status',
'trks.mother_id',
'trks.fitinf',
'trks.hit_ids',
'trks.error_matrix',
'trks.comment']
%% Cell type:code id: tags:
```
python
# big lazyarray with ALL file data!
lazy_data
=
reader
.
_
lazy_
data
lazy_data
=
reader
.
_data
lazy_data
```
%% Output
<Table [<Row 0> <Row 1> <Row 2> ... <Row 7> <Row 8> <Row 9>] at 0x7f
83f9d62c1
0>
<Table [<Row 0> <Row 1> <Row 2> ... <Row 7> <Row 8> <Row 9>] at 0x7f
ed2d98a75
0>
%% Cell type:code id: tags:
```
python
# getting the run_id for a specific event (event 5 for example)
reader
[
'
run_id
'
]
```
%% Output
<ChunkedArray [5971 5971 5971 ... 5971 5971 5971] at 0x7f
83f9d2cd
d0>
<ChunkedArray [5971 5971 5971 ... 5971 5971 5971] at 0x7f
ed2d91f9
d0>
%% Cell type:code id: tags:
```
python
# one can check how many hits are in event 5
reader
[
5
][
'
hits
'
]
```
%% Output
60
%% Cell type:code id: tags:
```
python
# one can also check how many tracks are in event 5
reader
[
5
][
'
trks
'
]
```
%% Output
56
%% Cell type:code id: tags:
```
python
# # the user is reminded to always specify the "correct" event/hits/tracks
# # key in the Aanet event file
# try:
# reader['whatever']
# except KeyError as e:
# print(e)
```
%% Cell type:markdown id: tags:
# Now let's explore in more details the hits:
%% Cell type:code id: tags:
```
python
# reading all data from a specific branch in hits data: for example
# 'hits.dom_id'
reader
[
'
hits.dom_id
'
]
```
%% Output
<ChunkedArray [[806451572 806451572 806451572 ... 809544061 809544061 809544061] [806451572 806451572 806451572 ... 809524432 809526097 809544061] [806451572 806451572 806451572 ... 809544061 809544061 809544061] ... [806451572 806455814 806465101 ... 809526097 809544058 809544061] [806455814 806455814 806455814 ... 809544061 809544061 809544061] [806455814 806455814 806455814 ... 809544058 809544058 809544061]] at 0x7f
83f9a1389
0>
<ChunkedArray [[806451572 806451572 806451572 ... 809544061 809544061 809544061] [806451572 806451572 806451572 ... 809524432 809526097 809544061] [806451572 806451572 806451572 ... 809544061 809544061 809544061] ... [806451572 806455814 806465101 ... 809526097 809544058 809544061] [806455814 806455814 806455814 ... 809544061 809544061 809544061] [806455814 806455814 806455814 ... 809544058 809544058 809544061]] at 0x7f
ed2d8af45
0>
%% Cell type:code id: tags:
```
python
# the user can access hits.dom_id data for a specific event (for example
# event 5)
reader
[
'
hits.dom_id
'
][
5
]
```
%% Output
array([806455814, 806487219, 806487219, 806487219, 806487226, 808432835,
808432835, 808432835, 808432835, 808432835, 808432835, 808432835,
808451904, 808451904, 808451907, 808451907, 808469129, 808469129,
808469129, 808493910, 808949744, 808949744, 808951460, 808951460,
808956908, 808961655, 808964908, 808969848, 808969857, 808972593,
808972593, 808972598, 808972598, 808972698, 808972698, 808974758,
808974811, 808976377, 808981510, 808981523, 808981812, 808982005,
808982005, 808982018, 808982077, 808982077, 808982547, 809007627,
809521500, 809521500, 809521500, 809524432, 809526097, 809526097,
809526097, 809526097, 809526097, 809526097, 809526097, 809544058],
dtype=int32)
%% Cell type:code id: tags:
```
python
# We previsouly checked (using reader[5]['hits']) that event
# 5 has 60 hits, now we can see that reader['hits.dom_id'][5]
# has exaclty 60 dom ids as well!
len
(
reader
[
'
hits.dom_id
'
][
5
])
```
%% Output
60
%% Cell type:code id: tags:
```
python
# one can access a dom id of the first hit
reader
[
'
hits.dom_id
'
][
5
][
0
]
```
%% Output
806455814
%% Cell type:markdown id: tags:
# Now let's explore in more details the tracks:
%% Cell type:code id: tags:
```
python
# reading all data from a specific branch in tracks data:
reader
[
'
trks.dir.z
'
]
```
%% Output
<ChunkedArray [[-0.872885221293917 -0.872885221293917 -0.872885221293917 ... -0.6631226836266504 -0.5680647731737454 -0.5680647731737454] [-0.8351996698137462 -0.8351996698137462 -0.8351996698137462 ... -0.7485107718446855 -0.8229838871876581 -0.239315690284641] [-0.989148723802379 -0.989148723802379 -0.989148723802379 ... -0.9350162572437829 -0.88545604390297 -0.88545604390297] ... [-0.5704611045902105 -0.5704611045902105 -0.5704611045902105 ... -0.9350162572437829 -0.4647231989130516 -0.4647231989130516] [-0.9779941383490359 -0.9779941383490359 -0.9779941383490359 ... -0.88545604390297 -0.88545604390297 -0.8229838871876581] [-0.7396916780974963 -0.7396916780974963 -0.7396916780974963 ... -0.6631226836266504 -0.7485107718446855 -0.7485107718446855]] at 0x7f
83f9b65f9
0>
<ChunkedArray [[-0.872885221293917 -0.872885221293917 -0.872885221293917 ... -0.6631226836266504 -0.5680647731737454 -0.5680647731737454] [-0.8351996698137462 -0.8351996698137462 -0.8351996698137462 ... -0.7485107718446855 -0.8229838871876581 -0.239315690284641] [-0.989148723802379 -0.989148723802379 -0.989148723802379 ... -0.9350162572437829 -0.88545604390297 -0.88545604390297] ... [-0.5704611045902105 -0.5704611045902105 -0.5704611045902105 ... -0.9350162572437829 -0.4647231989130516 -0.4647231989130516] [-0.9779941383490359 -0.9779941383490359 -0.9779941383490359 ... -0.88545604390297 -0.88545604390297 -0.8229838871876581] [-0.7396916780974963 -0.7396916780974963 -0.7396916780974963 ... -0.6631226836266504 -0.7485107718446855 -0.7485107718446855]] at 0x7f
ed2d8b885
0>
%% Cell type:code id: tags:
```
python
# the user can access trks.dir.z data for a specific event (for example
# event 5)
reader
[
'
trks.dir.z
'
][
5
]
```
%% Output
array([-0.60246049, -0.60246049, -0.60246049, -0.51420541, -0.5475772 ,
-0.5772408 , -0.56068238, -0.64907684, -0.67781799, -0.66565114,
-0.63014839, -0.64566464, -0.62691012, -0.58465493, -0.59287533,
-0.63655091, -0.63771247, -0.73446841, -0.7456636 , -0.70941246,
-0.66312268, -0.66312268, -0.56806477, -0.56806477, -0.66312268,
-0.66312268, -0.74851077, -0.74851077, -0.66312268, -0.74851077,
-0.56806477, -0.74851077, -0.66312268, -0.74851077, -0.56806477,
-0.66312268, -0.56806477, -0.66312268, -0.56806477, -0.56806477,
-0.66312268, -0.74851077, -0.66312268, -0.93501626, -0.56806477,
-0.74851077, -0.66312268, -0.56806477, -0.82298389, -0.74851077,
-0.66312268, -0.56806477, -0.82298389, -0.56806477, -0.66312268,
-0.97094183])
%% Cell type:code id: tags:
```
python
# We previsouly checked (using reader[5]['trks']) that event
# 5 has 56 tracks, now we can see that reader['trks.dir.z'][5]
# has exaclty 56 values of trks.dir.z as well!
len
(
reader
[
'
trks.dir.z
'
][
5
])
```
%% Output
56
%% Cell type:code id: tags:
```
python
# one can access the first trks.dir.z from event 5 using
reader
[
'
trks.dir.z
'
][
5
][
0
]
```
%% Output
-0.6024604933159441
...
...
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