Skip to content
Snippets Groups Projects
Verified Commit 589cc961 authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Update docs on online stuff

parent 84e4fbbc
No related branches found
No related tags found
1 merge request!68Rewrite the online module
Pipeline #25154 failed
......@@ -40,29 +40,35 @@ print(f.events[0].snapshot_hits.tot)
# Reading SummarySlices
# ---------------------
# The following example shows how to access summary slices, in particular the DOM
# IDs of the slice with the index 0:
# IDs of the slice with the index 0.
# The current implementation of the summaryslice I/O uses a chunked reading for
# better performance, which means that when you iterate through the `.slices`,
# you'll get chunks of summaryslices in each iteration instead of a single one.
#
# In the example below, we simulate a single iteration by using the `break`
# keyword and then use the data which has been "pulled out" of the ROOT file.
dom_ids = f.summaryslices.slices[0].dom_id
print(dom_ids)
for chunk in f.summaryslices.slices:
break
#####################################################
# The .dtype attribute (or in general, <TAB> completion) is useful to find out
# more about the field structure:
# `chunk` now contains the first set of summaryslices so `chunk.slice[0]` refers
# to the first summaryslice in the ROOT file. To access e.g. the DOM IDs, use
# the `.dom_id` attribute
dom_ids = chunk.slices[0].dom_id
print(f.summaryslices.headers.dtype)
print(dom_ids)
#####################################################
# To read the frame index:
# The .type attribute (or in general, <TAB> completion) is useful to find out
# more about the field structure:
print(f.summaryslices.headers.frame_index)
print(chunks.slices.type)
#####################################################
# The resulting array is a ChunkedArray which is an extended version of a
# numpy array and behaves like one.
# Similar to the summaryslice data, the headers can be accessed the same way
# To read the frame index of all summaryslices in the obtained chunk:
#####################################################
# Reading TimeSlices
# ------------------
# To be continued.
#
print(chunk.headers.frame_index)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment