Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['/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/miniconda3/envs/km3pipe/lib/python3.7/site-packages/IPython/extensions', '/home/zineb/.ipython', '/home/zineb/km3net/km3net/km3io']\n"
]
}
],
"source": [
"# Add file to current python path\n",
"from pathlib import Path\n",
"import sys\n",
"sys.path.append(str(Path.cwd().parent))\n",
"Path.cwd()\n",
"print(sys.path)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"from km3io.DataReader import DataReader\n",
"import uproot"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"file = 'datav6.0test.jchain.aanet.00005972.root'\n",
"data = uproot.open(file)['E']['Evt']['hits']"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"reader = DataReader(file)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<Table [<Row 0> <Row 1> <Row 2> ... <Row 145629> <Row 145630> <Row 145631>] at 0x7f91f0271e90>"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# big lazyarray with ALL file data!\n",
"lazy_data = reader.lazy_data\n",
"lazy_data"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<ChunkedArray [5972 5972 5972 ... 5972 5972 5972] at 0x7f91f004f410>"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# reading all data from a specific branch from events data (data is \n",
"# ordered in the same order as in Aanet event file)\n",
"reader.event_reader('run_id')"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"5972"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# getting the run_id for a specific event (event 5 for example)\n",
"reader.event_reader('run_id')[5]"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "The event key must be one of the following: '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' ",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-8-b734e6d9be61>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# the user is reminded to always specify the \"correct\" event key in the\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0;31m# Aanet event file\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mreader\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mevent_reader\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'whatever'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m~/km3net/km3net/km3io/km3io/DataReader.py\u001b[0m in \u001b[0;36mevent_reader\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m 36\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mevt_key_lazy\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 37\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 38\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mNameError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"The event key must be one of the following: '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' \"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 39\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 40\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_event_keys\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mevt_tree\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mNameError\u001b[0m: The event key must be one of the following: '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' "
]
}
],
"source": [
"# the user is reminded to always specify the \"correct\" event key in the\n",
"# Aanet event file\n",
"reader.event_reader('whatever')"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"218"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# one can check how many hits are in event 5\n",
"reader.event_reader('hits')[5]"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"56"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# one can also check how many tracks are in event 5\n",
"reader.event_reader('trks')[5]"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"#########################################################################\n",
"#\n",
"# Now let's explore in more details the hits:\n",
"#\n",
"#########################################################################"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<ChunkedArray [[806455814 806487219 806487231 ... 809524432 809526097 809544058] [806451572 806451572 806455814 ... 809544058 809544058 809544058] [806451572 806487219 806487219 ... 809526097 809526097 809544058] ... [806451572 806451572 806451572 ... 809526097 809526097 809544058] [806451572 806483369 806483369 ... 809544058 809544058 809544058] [806451572 806451572 806455814 ... 809524432 809544061 809544061]] at 0x7f91f0015850>"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# reading all data from a specific branch in hits data:\n",
"reader.hits_reader('hits.dom_id')"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([806451572, 806451572, 806451572, 806455814, 806455814, 806455814,\n",
" 806455814, 806455814, 806465101, 806465101, 806465101, 806465101,\n",
" 806483369, 806483369, 806483369, 806483369, 806483369, 806487219,\n",
" 806487219, 806487219, 806487226, 806487226, 806487226, 806487226,\n",
" 806487226, 806487226, 806487226, 806487226, 806487226, 806487226,\n",
" 806487226, 806487226, 806487231, 808435278, 808435278, 808435278,\n",
" 808447180, 808447180, 808447180, 808447180, 808447180, 808447180,\n",
" 808447180, 808447180, 808447180, 808451904, 808451904, 808451904,\n",
" 808472260, 808472260, 808472260, 808472260, 808472260, 808472260,\n",
" 808472265, 808472265, 808472265, 808472265, 808488895, 808488895,\n",
" 808488895, 808489014, 808489014, 808489014, 808489014, 808489014,\n",
" 808489014, 808489117, 808489117, 808946818, 808946818, 808946818,\n",
" 808946818, 808949744, 808951460, 808951460, 808956908, 808956908,\n",
" 808959411, 808959411, 808959411, 808959411, 808961448, 808961480,\n",
" 808961504, 808961504, 808961504, 808961504, 808961504, 808961655,\n",
" 808961655, 808961655, 808964815, 808964815, 808964815, 808964815,\n",
" 808964815, 808964852, 808964852, 808964852, 808964883, 808964883,\n",
" 808969857, 808969857, 808969857, 808969857, 808969857, 808969857,\n",
" 808969857, 808972593, 808972593, 808972593, 808972593, 808972593,\n",
" 808972593, 808972593, 808972593, 808972593, 808972598, 808972598,\n",
" 808974758, 808974758, 808974758, 808974758, 808974811, 808974811,\n",
" 808974811, 808974811, 808974811, 808974811, 808974811, 808974811,\n",
" 808974811, 808974811, 808974972, 808974972, 808976377, 808976377,\n",
" 808979729, 808979729, 808979729, 808979729, 808979729, 808979729,\n",
" 808979729, 808979729, 808979729, 808981510, 808981523, 808981523,\n",
" 808981812, 808981812, 808981812, 808981864, 808982005, 808982041,\n",
" 808982041, 808982041, 808982041, 808982041, 808982041, 808982547,\n",
" 808982547, 808982547, 808982547, 808982547, 808982547, 808982547,\n",
" 808982547, 808984711, 808984711, 808984711, 808984711, 808984711,\n",
" 808984711, 808984711, 808984711, 808984711, 808984711, 808984711,\n",
" 808984711, 808984711, 808984711, 808984711, 808984711, 808984711,\n",
" 808984711, 808984711, 808984711, 808984711, 808984711, 809007627,\n",
" 809007627, 809007627, 809007627, 809007627, 809007627, 809007627,\n",
" 809007627, 809007627, 809521500, 809521500, 809521500, 809524432,\n",
" 809524432, 809524432, 809524432, 809524432, 809524432, 809524432,\n",
" 809524432, 809524432, 809524432, 809524432, 809524432, 809526097,\n",
" 809526097, 809544058], dtype=int32)"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# the user can access hits.dom_id data for a specific event (for example \n",
"# event 5)\n",
"reader.hits_reader('hits.dom_id')[5]"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"218"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# We previsouly checked (using reader.event_reader('hits')[5]) that event\n",
"# 5 has 218 hits, now we can see that reader.hits_reader('hits.dom_id')[5]\n",
"# has exaclty 218 dom ids as well! \n",
"len(reader.hits_reader('hits.dom_id')[5])"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"806451572"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# one can access a dom id of the first hit \n",
"reader.hits_reader('hits.dom_id')[5][0]"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "The hits key must be one of the following: 'hits.fUniqueID', 'hits.fBits', 'hits.usr', 'hits.usr_names', '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'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-16-53a843e61284>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# once again, the user is reminded to always use the hits keys stored i Aanet event\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0;31m# file\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mreader\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhits_reader\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'whatever'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m~/km3net/km3net/km3io/km3io/DataReader.py\u001b[0m in \u001b[0;36mhits_reader\u001b[0;34m(self, hits_key)\u001b[0m\n\u001b[1;32m 87\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mhits_key_lazy\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 88\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 89\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mNameError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"The hits key must be one of the following: 'hits.fUniqueID', 'hits.fBits', 'hits.usr', 'hits.usr_names', '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'\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 90\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 91\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mtracks_reader\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtracks_key\u001b[0m \u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mNameError\u001b[0m: The hits key must be one of the following: 'hits.fUniqueID', 'hits.fBits', 'hits.usr', 'hits.usr_names', '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'"
]
}
],
"source": [
"# once again, the user is reminded to always use the hits keys stored i Aanet event\n",
"# file\n",
"reader.hits_reader('whatever')"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
"#########################################################################\n",
"#\n",
"# Now let's explore in more details the tracks:\n",
"#\n",
"#########################################################################"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<ChunkedArray [[-0.9048163793905828 -0.9048163793905828 -0.9048163793905828 ... -0.88545604390297 -0.9350162572437829 -0.7485107718446855] [-0.9254262257092779 -0.9254262257092779 -0.9254262257092779 ... -0.6631226836266504 -0.88545604390297 -0.8229838871876581] [-0.5887857820134094 -0.5887857820134094 -0.5887857820134094 ... -0.4647231989130516 -0.88545604390297 -0.88545604390297] ... [-0.6827714023340542 -0.6827714023340542 -0.6827714023340542 ... -0.9350162572437829 -0.4647231989130516 -0.8229838871876581] [-0.9414587076782783 -0.9414587076782783 -0.9414587076782783 ... -0.9709418276783801 -0.8229838871876581 -0.8229838871876581] [-0.8738359256162922 -0.8738359256162922 -0.8738359256162922 ... -0.8229838871876581 -0.7485107718446855 -0.6631226836266504]] at 0x7f9192b52d50>"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# reading all data from a specific branch in tracks data:\n",
"reader.tracks_reader('trks.dir.z')"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([-0.95646862, -0.95646862, -0.95646862, -0.95676578, -0.95695685,\n",
" -0.95637026, -0.95768896, -0.95888618, -0.95691334, -0.95327743,\n",
" -0.95563316, -0.95785959, -0.95019627, -0.9588535 , -0.95330259,\n",
" -0.95474777, -0.95125599, -0.9489768 , -0.87580863, -0.92460301,\n",
" -0.93501626, -0.97094183, -0.93501626, -0.93501626, -0.93501626,\n",
" -0.88545604, -0.97094183, -0.88545604, -0.93501626, -0.88545604,\n",
" -0.93501626, -0.97094183, -0.88545604, -0.88545604, -0.88545604,\n",
" -0.88545604, -0.82298389, -0.88545604, -0.82298389, -0.88545604,\n",
" -0.82298389, -0.93501626, -0.74851077, -0.93501626, -0.82298389,\n",
" -0.82298389, -0.82298389, -0.56806477, -0.66312268, -0.93501626,\n",
" -0.93501626, -0.74851077, -0.56806477, -0.56806477, -0.88545604,\n",
" -0.97094183])"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# the user can access trks.dir.z data for a specific event (for example \n",
"# event 5)\n",
"reader.tracks_reader('trks.dir.z')[5]"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"56"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# We previsouly checked (using reader.event_reader('trks')[5]) that event\n",
"# 5 has 56 tracks, now we can see that reader.hits_reader('hits.dom_id')[5]\n",
"# has exaclty 56 values of trks.dir.z as well! \n",
"len(reader.tracks_reader('trks.dir.z')[5])"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"-0.9564686180086494"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# one can access the first trks.dir.z from event 5 using \n",
"reader.tracks_reader('trks.dir.z')[5][0]"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "The tracks key must be one the following: 'trks.fUniqueID', 'trks.fBits', 'trks.usr', '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.fitinf', 'trks.hit_ids', 'trks.error_matrix', 'trks.comment'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-24-ba9dff8e27cb>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# once again, the user is reminded to always use the tracks keys stored in Aanet\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0;31m# event file\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mreader\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtracks_reader\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'whatever'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m~/km3net/km3net/km3io/km3io/DataReader.py\u001b[0m in \u001b[0;36mtracks_reader\u001b[0;34m(self, tracks_key)\u001b[0m\n\u001b[1;32m 118\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mtracks_key_lazy\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 119\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 120\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mNameError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"The tracks key must be one the following: 'trks.fUniqueID', 'trks.fBits', 'trks.usr', '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.fitinf', 'trks.hit_ids', 'trks.error_matrix', 'trks.comment'\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 121\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 122\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mNameError\u001b[0m: The tracks key must be one the following: 'trks.fUniqueID', 'trks.fBits', 'trks.usr', '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.fitinf', 'trks.hit_ids', 'trks.error_matrix', 'trks.comment'"
]
}
],
"source": [
"# once again, the user is reminded to always use the tracks keys stored in Aanet\n",
"# event file\n",
"reader.tracks_reader('whatever')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}