-
Notifications
You must be signed in to change notification settings - Fork 18
/
index.html
126 lines (113 loc) · 45.7 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>APIs · UnROOT.jl</title><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">UnROOT.jl</a></span></div><form class="docs-search" action="../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../">Introduction</a></li><li><a class="tocitem" href="../exampleusage/">Example Usage</a></li><li><a class="tocitem" href="../performancetips/">Performance Tips</a></li><li><span class="tocitem">Advanced Usage</span><ul><li><a class="tocitem" href="../advanced/custom_branch/">Parse Custom Branch</a></li><li><a class="tocitem" href="../advanced/reduce_latency/">Reduce startup latency</a></li></ul></li><li><a class="tocitem" href="../devdocs/">For Contributors</a></li><li class="is-active"><a class="tocitem" href>APIs</a><ul class="internal"><li><a class="tocitem" href="#Commonly-used"><span>Commonly used</span></a></li><li><a class="tocitem" href="#More-Internal"><span>More Internal</span></a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>APIs</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>APIs</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/JuliaHEP/UnROOT.jl/blob/master/docs/src/internalapis.md#L" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h2 id="Commonly-used"><a class="docs-heading-anchor" href="#Commonly-used">Commonly used</a><a id="Commonly-used-1"></a><a class="docs-heading-anchor-permalink" href="#Commonly-used" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-binding" id="UnROOT.LazyBranch" href="#UnROOT.LazyBranch"><code>UnROOT.LazyBranch</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">LazyBranch(f::ROOTFile, branch)</code></pre><p>Construct an accessor for a given branch such that <code>BA[idx]</code> and or <code>BA[1:20]</code> is type-stable. And memory footprint is a single basket (<1MB usually). You can also iterate or map over it. If you want a concrete <code>Vector</code>, simply <code>collect()</code> the LazyBranch.</p><p><strong>Example</strong></p><pre><code class="language-julia hljs">julia> rf = ROOTFile("./test/samples/tree_with_large_array.root");
julia> b = rf["t1/int32_array"];
julia> ab = UnROOT.LazyBranch(rf, b);
julia> for entry in ab
@show entry
break
end
entry = 0
julia> ab[begin:end]
0
1
...</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/iteration.jl#LL79-L106">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.LazyTree-Tuple{ROOTFile, AbstractString, Any}" href="#UnROOT.LazyTree-Tuple{ROOTFile, AbstractString, Any}"><code>UnROOT.LazyTree</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">LazyTree(f::ROOTFile, s::AbstractString, branche::Union{AbstractString, Regex})
LazyTree(f::ROOTFile, s::AbstractString, branches::Vector{Union{AbstractString, Regex}})</code></pre><p>Constructor for <code>LazyTree</code>, which is close to an <code>DataFrame</code> (interface wise), and a lazy Table (speed wise). Looping over a <code>LazyTree</code> is fast and type stable. Internally, <code>LazyTree</code> contains a typed table whose branch are <a href="#UnROOT.LazyBranch"><code>LazyBranch</code></a>. This means that at any given time only <code>N</code> baskets are cached, where <code>N</code> is the number of branches.</p><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>Accessing with <code>[start:stop]</code> will return a <code>LazyTree</code> with concrete internal table.</p></div></div><div class="admonition is-warning"><header class="admonition-header">Warning</header><div class="admonition-body"><p>Split branches are re-named, and the exact renaming may change. See <a href="https://github.com/JuliaHEP/UnROOT.jl/pull/156">Issue 156</a> for context.</p></div></div><p><strong>Example</strong></p><pre><code class="language-julia hljs">julia> mytree = LazyTree(f, "Events", ["Electron_dxy", "nMuon", r"Muon_(pt|eta)$"])
Row │ Electron_dxy nMuon Muon_eta Muon_pt
│ Vector{Float32} UInt32 Vector{Float32} Vector{Float32}
─────┼───────────────────────────────────────────────────────────
1 │ [0.000371] 0 [] []
2 │ [-0.00982] 2 [0.53, 0.229] [19.9, 15.3]
3 │ [] 0 [] []
4 │ [-0.00157] 0 [] []
⋮ │ ⋮ ⋮ ⋮ ⋮</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/iteration.jl#LL360-L388">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.LazyTree-Tuple{ROOTFile, UnROOT.TTree, Any, Any}" href="#UnROOT.LazyTree-Tuple{ROOTFile, UnROOT.TTree, Any, Any}"><code>UnROOT.LazyTree</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">function LazyTree(f::ROOTFile, tree::TTree, treepath, branches)</code></pre><p>Creates a lazy tree object of the selected branches only. <code>branches</code> is vector of <code>String</code>, <code>Regex</code> or <code>Pair{Regex, SubstitutionString}</code>, where the first item is the regex selector and the second item the rename pattern.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/iteration.jl#LL420-L427">source</a></section></article><h2 id="More-Internal"><a class="docs-heading-anchor" href="#More-Internal">More Internal</a><a id="More-Internal-1"></a><a class="docs-heading-anchor-permalink" href="#More-Internal" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-binding" id="UnROOT.HEAD_BUFFER_SIZE" href="#UnROOT.HEAD_BUFFER_SIZE"><code>UnROOT.HEAD_BUFFER_SIZE</code></a> — <span class="docstring-category">Constant</span></header><section><div><pre><code class="language-julia hljs">ROOTFile(filename::AbstractString; customstructs = Dict("TLorentzVector" => LorentzVector{Float64}))</code></pre><p><code>ROOTFile</code>'s constructor from a file. The <code>customstructs</code> dictionary can be used to pass user-defined struct as value and its corresponding <code>fClassName</code> (in Branch) as key such that <code>UnROOT</code> will know to intepret them, see <a href="#UnROOT.interped_data-Tuple{Any, Any, Type{Bool}, Type{UnROOT.Nojagg}}"><code>interped_data</code></a>.</p><p>See also: <a href="#UnROOT.LazyTree-Tuple{ROOTFile, AbstractString, Any}"><code>LazyTree</code></a>, <a href="#UnROOT.LazyBranch"><code>LazyBranch</code></a></p><p><strong>Example</strong></p><pre><code class="language-julia hljs">julia> f = ROOTFile("test/samples/NanoAODv5_sample.root")
ROOTFile with 2 entries and 21 streamers.
test/samples/NanoAODv5_sample.root
└─ Events
├─ "run"
├─ "luminosityBlock"
├─ "event"
├─ "HTXS_Higgs_pt"
├─ "HTXS_Higgs_y"
└─ "⋮"</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/root.jl#LL38-L60">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.Cursor" href="#UnROOT.Cursor"><code>UnROOT.Cursor</code></a> — <span class="docstring-category">Type</span></header><section><div><p>The <code>Cursor</code> type is embeded into Branches of a TTree such that when we need to read the content of a Branch, we don't need to go through the Directory and find the TKey and then seek to where the Branch is.</p><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>The <code>io</code> inside a <code>Cursor</code> is in fact only a buffer, it is NOT a <code>io</code> that refers to the whole file's stream.</p></div></div></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/io.jl#LL1-L9">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.LeafField" href="#UnROOT.LeafField"><code>UnROOT.LeafField</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct LeafField{T}
content_col_idx::Int
type::Int
nbits::Int
end</code></pre><p>Base case of field nesting, this links to a column in the RNTuple by 0-based index. <code>T</code> is the <code>eltype</code> of this field which mostly uses Julia native types except for <code>Switch</code>.</p><p>The <code>type</code> field is the RNTuple spec type number, used to record split encoding.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/RNTuple/fieldcolumn_schema.jl#LL28-L40">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.OffsetBuffer" href="#UnROOT.OffsetBuffer"><code>UnROOT.OffsetBuffer</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">OffsetBuffer</code></pre><p>Works with seek, position of the original file. Think of it as a view of IOStream that can be indexed with original positions.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/UnROOT.jl#LL22-L27">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.Preamble-Union{Tuple{T}, Tuple{Any, Type{T}}} where T" href="#UnROOT.Preamble-Union{Tuple{T}, Tuple{Any, Type{T}}} where T"><code>UnROOT.Preamble</code></a> — <span class="docstring-category">Method</span></header><section><div><p>Reads the preamble of an object.</p><p>The cursor will be put into the right place depending on the data.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/io.jl#LL90-L94">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.RNTuple" href="#UnROOT.RNTuple"><code>UnROOT.RNTuple</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">RNTuple</code></pre><p>This is the struct for holding all metadata (schema) needed to completely describe and RNTuple from ROOT, just like <code>TTree</code>, to obtain a table-like data object, you need to use <code>LazyTree</code> explicitly:</p><p><strong>Example</strong></p><pre><code class="language-julia hljs">julia> f = ROOTFile("./test/samples/RNTuple/test_ntuple_stl_containers.root");
julia> f["ntuple"]
UnROOT.RNTuple:
header:
name: "ntuple"
ntuple_description: ""
writer_identifier: "ROOT v6.29/01"
schema:
RNTupleSchema with 13 top fields
├─ :lorentz_vector ⇒ Struct
├─ :vector_tuple_int32_string ⇒ Vector
├─ :string ⇒ String
├─ :vector_string ⇒ Vector
...
..
.
julia> LazyTree(f, "ntuple")
Row │ string vector_int32 array_float vector_vector_i vector_string vector_vector_s variant_int32_s vector_variant_ ⋯
│ String Vector{Int32} StaticArraysCor Vector{Vector{I Vector{String} Vector{Vector{S Union{Int32, St Vector{Union{In ⋯
─────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ one [1] [1.0, 1.0, 1.0] Vector{Int32}[Int3 ["one"] [["one"]] 1 Union{Int64, Strin ⋯
2 │ two [1, 2] [2.0, 2.0, 2.0] Vector{Int32}[Int3 ["one", "two"] [["one"], ["two"]] two Union{Int64, Strin ⋯
3 │ three [1, 2, 3] [3.0, 3.0, 3.0] Vector{Int32}[Int3 ["one", "two", "th [["one"], ["two"], three Union{Int64, Strin ⋯
4 │ four [1, 2, 3, 4] [4.0, 4.0, 4.0] Vector{Int32}[Int3 ["one", "two", "th [["one"], ["two"], 4 Union{Int64, Strin ⋯
5 │ five [1, 2, 3, 4, 5] [5.0, 5.0, 5.0] Vector{Int32}[Int3 ["one", "two", "th [["one"], ["two"], 5 Union{Int64, Strin ⋯
5 columns omitted</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/RNTuple/highlevel.jl#LL121-L160">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.RNTupleCardinality" href="#UnROOT.RNTupleCardinality"><code>UnROOT.RNTupleCardinality</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct RNTupleCardinality{T}
content_col_idx::Int
nbits::Int
end</code></pre><p>Special field. The cardinality is basically a counter, but the data column is a leaf column of Index32 or Index64. To get a number from Cardinality, one needs to compute <code>ary[i] - ary[i-1]</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/RNTuple/fieldcolumn_schema.jl#LL47-L56">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.RNTupleField" href="#UnROOT.RNTupleField"><code>UnROOT.RNTupleField</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">mutable struct RNTupleField{R, F, O, E} <: AbstractVector{E}</code></pre><p>Not a counterpart of RNTuple field in ROOT. This is a user-facing Julia-only construct like <code>LazyBranch</code> that is meant to act like a lazy <code>AbstractVector</code> backed with file IO source and a schema field from <code>RNTuple.schema</code>.</p><ul><li><code>R</code> is the type of parent <code>RNTuple</code></li><li><code>F</code> is the type of the field in the schema</li><li>'O' is the type of output when you read a cluster-worth of data</li><li>'E' is the element type of <code>O</code> (i.e. what you get for each event (row) in iteration)</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/RNTuple/highlevel.jl#LL1-L12">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.RNTupleSchema" href="#UnROOT.RNTupleSchema"><code>UnROOT.RNTupleSchema</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct RNTupleSchema</code></pre><p>A wrapper struct for <code>print_tree</code> implementation of the schema display.</p><p><strong>Example</strong></p><pre><code class="language-julia hljs">julia> f = ROOTFile("./test/samples/RNTuple/test_ntuple_stl_containers.root");
julia> f["ntuple"].schema
RNTupleSchema with 13 top fields
├─ :lorentz_vector ⇒ Struct
│ ├─ :pt ⇒ Leaf{Float32}(col=26)
│ ├─ :eta ⇒ Leaf{Float32}(col=27)
│ ├─ :phi ⇒ Leaf{Float32}(col=28)
│ └─ :mass ⇒ Leaf{Float32}(col=29)
├─ :vector_tuple_int32_string ⇒ Vector
│ ├─ :offset ⇒ Leaf{Int32}(col=9)
│ └─ :content ⇒ Struct
│ ├─ :_1 ⇒ String
│ │ ├─ :offset ⇒ Leaf{Int32}(col=37)
│ │ └─ :content ⇒ Leaf{Char}(col=38)
│ └─ :_0 ⇒ Leaf{Int32}(col=36)
├─ :string ⇒ String
│ ├─ :offset ⇒ Leaf{Int32}(col=1)
│ └─ :content ⇒ Leaf{Char}(col=2)
├─ :vector_string ⇒ Vector
│ ├─ :offset ⇒ Leaf{Int32}(col=5)
│ └─ :content ⇒ String
│ ├─ :offset ⇒ Leaf{Int32}(col=13)
│ └─ :content ⇒ Leaf{Char}(col=14)
...
..
.</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/RNTuple/highlevel.jl#LL45-L80">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.StdArrayField" href="#UnROOT.StdArrayField"><code>UnROOT.StdArrayField</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">StdArrayField<N, T></code></pre><p>Special base-case field for a leaf field representing <code>std::array<T, N></code>. This is because RNTuple would serialize it as a leaf field but with <code>flags == 0x0001</code> in the field description. In total, there are two field descriptions associlated with <code>array<></code>, one for meta-data (the <code>N</code>), the other one for the actual data.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/RNTuple/fieldcolumn_schema.jl#LL3-L10">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.Streamers-Tuple{Any}" href="#UnROOT.Streamers-Tuple{Any}"><code>UnROOT.Streamers</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">function Streamers(io)</code></pre><p>Reads all the streamers from the ROOT source.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/streamers.jl#LL66-L70">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.StringField" href="#UnROOT.StringField"><code>UnROOT.StringField</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">StringField</code></pre><p>Special base-case field for String leaf field. This is because RNTuple splits a leaf String field into two columns (instead of split in field records). So we need an offset column and a content column (that contains <code>Char</code>s).</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/RNTuple/fieldcolumn_schema.jl#LL16-L22">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT._field_output_type-Tuple{}" href="#UnROOT._field_output_type-Tuple{}"><code>UnROOT._field_output_type</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">_field_output_type(::Type{F}) where F</code></pre><p>This is function is used in two ways:</p><ul><li>provide a output type prediction for each "field" in RNTuple so we can</li></ul><p>achieve type stability</p><ul><li>it's also used to enforce the type stability in <a href="#UnROOT.read_field-Tuple{}"><code>read_field</code></a>:</li></ul><pre><code class="nohighlight hljs"> # this is basically a type assertion for `res`
return res::_field_output_type(field)</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/RNTuple/fieldcolumn_reading.jl#LL1-L14">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT._rntuple_clusterrange-Tuple{UnROOT.ClusterSummary}" href="#UnROOT._rntuple_clusterrange-Tuple{UnROOT.ClusterSummary}"><code>UnROOT._rntuple_clusterrange</code></a> — <span class="docstring-category">Method</span></header><section><div><p>The event number range a given cluster covers, in Julia's index</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/RNTuple/highlevel.jl#LL31-L33">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.array-Tuple{ROOTFile, AbstractString}" href="#UnROOT.array-Tuple{ROOTFile, AbstractString}"><code>UnROOT.array</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">array(f::ROOTFile, path; raw=false)</code></pre><p>Reads an array from a branch. Set <code>raw=true</code> to return raw data and correct offsets.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/iteration.jl#LL15-L19">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.arrays-Tuple{ROOTFile, Any}" href="#UnROOT.arrays-Tuple{ROOTFile, Any}"><code>UnROOT.arrays</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">arrays(f::ROOTFile, treename)</code></pre><p>Reads all branches from a tree.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/iteration.jl#LL1-L5">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.auto_T_JaggT-Tuple{ROOTFile, Any}" href="#UnROOT.auto_T_JaggT-Tuple{ROOTFile, Any}"><code>UnROOT.auto_T_JaggT</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">auto_T_JaggT(f::ROOTFile, branch; customstructs::Dict{String, Type})</code></pre><p>Given a file and branch, automatically return (eltype, Jaggtype). This function is aware of custom structs that are carried with the parent <code>ROOTFile</code>.</p><p>This is also where you may want to "redirect" classname -> Julia struct name, for example <code>"TLorentzVector" => LorentzVector</code> here and you can focus on <code>LorentzVectors.LorentzVector</code> methods from here on.</p><p>See also: <a href="@ref"><code>ROOTFile</code></a>, <a href="#UnROOT.interped_data-Tuple{Any, Any, Type{Bool}, Type{UnROOT.Nojagg}}"><code>interped_data</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/root.jl#LL340-L351">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.basketarray-Tuple{ROOTFile, AbstractString, Any}" href="#UnROOT.basketarray-Tuple{ROOTFile, AbstractString, Any}"><code>UnROOT.basketarray</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">basketarray(f::ROOTFile, path::AbstractString, ith)
basketarray(f::ROOTFile, branch::Union{TBranch, TBranchElement}, ith)
basketarray(lb::LazyBranch, ith)</code></pre><p>Reads actual data from ith basket of a branch. This function first calls <a href="#UnROOT.readbasket-Tuple{ROOTFile, Any, Any}"><code>readbasket</code></a> to obtain raw bytes and offsets of a basket, then calls <a href="#UnROOT.auto_T_JaggT-Tuple{ROOTFile, Any}"><code>auto_T_JaggT</code></a> followed by <a href="#UnROOT.interped_data-Tuple{Any, Any, Type{Bool}, Type{UnROOT.Nojagg}}"><code>interped_data</code></a> to translate raw bytes into actual data.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/iteration.jl#LL38-L46">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.basketarray_iter-Tuple{ROOTFile, Any}" href="#UnROOT.basketarray_iter-Tuple{ROOTFile, Any}"><code>UnROOT.basketarray_iter</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">basketarray_iter(f::ROOTFile, branch::Union{TBranch, TBranchElement})
basketarray_iter(lb::LazyBranch)</code></pre><p>Returns a <code>Base.Generator</code> yielding the output of <code>basketarray()</code> for all baskets.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/iteration.jl#LL67-L72">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.chaintrees-Tuple{Any}" href="#UnROOT.chaintrees-Tuple{Any}"><code>UnROOT.chaintrees</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">chaintrees(ts)</code></pre><p>Chain a collection of <code>LazyTree</code>s together to form a larger tree, every tree should have identical branch names and types, we're not trying to re-implement SQL here.</p><p><strong>Example</strong></p><pre><code class="language-julia hljs">julia> typeof(tree)
LazyTree with 1 branches:
a
julia> tree2 = UnROOT.chaintrees([tree,tree]);
julia> eltype(tree.a) == eltype(tree2.a)
true
julia> length(tree)
100
julia> length(tree2)
200
julia> eltype(tree)
UnROOT.LazyEvent{NamedTuple{(:a,), Tuple{LazyBranch{Int32, UnROOT.Nojagg, Vector{Int32}}}}}
julia> eltype(tree2)
UnROOT.LazyEvent{NamedTuple{(:a,), Tuple{SentinelArrays.ChainedVector{Int32, LazyBranch{Int32, UnROOT.Nojagg, Vector{Int32}}}}}}</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/iteration.jl#LL305-L335">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.compressed_datastream-Tuple{Any, Any}" href="#UnROOT.compressed_datastream-Tuple{Any, Any}"><code>UnROOT.compressed_datastream</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">compressed_datastream(io, tkey)</code></pre><p>Extract all [compressionheader][rawbytes] from a <code>TKey</code>. This is an isolated function because we want to compartmentalize disk I/O as much as possible.</p><p>See also: <a href="#UnROOT.decompress_datastreambytes-Tuple{Any, Any}"><code>decompress_datastreambytes</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/types.jl#LL117-L124">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.decompress_datastreambytes-Tuple{Any, Any}" href="#UnROOT.decompress_datastreambytes-Tuple{Any, Any}"><code>UnROOT.decompress_datastreambytes</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">decompress_datastreambytes(compbytes, tkey)</code></pre><p>Process the compressed bytes <code>compbytes</code> which was read out by <code>compressed_datastream</code> and pointed to from <code>tkey</code>. This function simply return uncompressed bytes according to the compression algorithm detected (or the lack of).</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/types.jl#LL135-L141">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.endcheck-Union{Tuple{T}, Tuple{Any, T}} where T<:UnROOT.Preamble" href="#UnROOT.endcheck-Union{Tuple{T}, Tuple{Any, T}} where T<:UnROOT.Preamble"><code>UnROOT.endcheck</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">function endcheck(io, preamble::Preamble)</code></pre><p>Checks if everything went well after parsing a TOBject. Used in conjuction with <code>Preamble</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/io.jl#LL130-L135">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.interped_data-Tuple{Any, Any, Type{Bool}, Type{UnROOT.Nojagg}}" href="#UnROOT.interped_data-Tuple{Any, Any, Type{Bool}, Type{UnROOT.Nojagg}}"><code>UnROOT.interped_data</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">interped_data(rawdata, rawoffsets, ::Type{T}, ::Type{J}) where {T, J<:JaggType}</code></pre><p>The function thats interpret raw bytes (from a basket) into corresponding Julia data, based on type <code>T</code> and jagg type <code>J</code>.</p><p>In order to retrieve data from custom branches, user should defined more speialized method of this function with specific <code>T</code> and <code>J</code>. See <code>TLorentzVector</code> example.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/root.jl#LL233-L241">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.interped_data-Tuple{Any, Any, Type{Vector{LorentzVectors.LorentzVector{Float64}}}, Type{UnROOT.Offsetjagg}}" href="#UnROOT.interped_data-Tuple{Any, Any, Type{Vector{LorentzVectors.LorentzVector{Float64}}}, Type{UnROOT.Offsetjagg}}"><code>UnROOT.interped_data</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">interped_data(rawdata, rawoffsets, ::Type{Vector{LorentzVector{Float64}}}, ::Type{Offsetjagg})</code></pre><p>The <code>interped_data</code> method specialized for <code>LorentzVector</code>. This method will get called by <a href="#UnROOT.basketarray-Tuple{ROOTFile, AbstractString, Any}"><code>basketarray</code></a> instead of the default method for <code>TLorentzVector</code> branch.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/custom.jl#LL107-L112">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.parseTH-Tuple{Dict{Symbol, Any}}" href="#UnROOT.parseTH-Tuple{Dict{Symbol, Any}}"><code>UnROOT.parseTH</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">parseTH(th::Dict{Symbol, Any})</code></pre><p>Parse the output of <a href="@ref"><code>TH</code></a> into a tuple of <code>counts</code>, <code>edges</code>, and <code>sumw2</code>. A <code>StatsBase.Histogram</code> can then be constructed with <code>Histogram(edges, counts)</code>. TH1 and TH2 inputs are supported.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/utils.jl#LL88-L94">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.parsetobject-Tuple{Any, Union{UnROOT.TKey32, UnROOT.TKey64}, Any}" href="#UnROOT.parsetobject-Tuple{Any, Union{UnROOT.TKey32, UnROOT.TKey64}, Any}"><code>UnROOT.parsetobject</code></a> — <span class="docstring-category">Method</span></header><section><div><p>Direct parsing of streamed objects which are not sitting on branches. This function needs to be rewritten, so that it can create proper types of TObject inherited data (like <code>TVectorT<*></code>).</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/bootstrap.jl#LL1015-L1020">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.read_field-Tuple{}" href="#UnROOT.read_field-Tuple{}"><code>UnROOT.read_field</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">read_field(io, field::F, page_list) where F</code></pre><p>Read a field from the <code>io</code> stream. The <code>page_list</code> is a list of PageLinks for the current cluster group. The type stability is achieved by type asserting based on type <code>F</code> via <a href="#UnROOT._field_output_type-Tuple{}"><code>_field_output_type</code></a> function.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/RNTuple/fieldcolumn_reading.jl#LL17-L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.read_field-Union{Tuple{T}, Tuple{N}, Tuple{Any, UnROOT.StructField{N, T}, Any}} where {N, T}" href="#UnROOT.read_field-Union{Tuple{T}, Tuple{N}, Tuple{Any, UnROOT.StructField{N, T}, Any}} where {N, T}"><code>UnROOT.read_field</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">read_field(io, field::StructField{N, T}, page_list) where {N, T}</code></pre><p>Since each field of the struct is stored in a separate field of the RNTuple, this function returns a <code>StructArray</code> to maximize efficiency.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/RNTuple/fieldcolumn_reading.jl#LL126-L131">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.read_pagedesc-Tuple{Any, Vector{UnROOT.PageDescription}, Integer}" href="#UnROOT.read_pagedesc-Tuple{Any, Vector{UnROOT.PageDescription}, Integer}"><code>UnROOT.read_pagedesc</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">read_pagedesc(io, pagedesc::Vector{PageDescription}, nbits::Integer)</code></pre><p>Read the decompressed raw bytes given a Page Description. The <code>nbits</code> need to be provided according to the element type of the column since <code>pagedesc</code> only contains <code>num_elements</code> information.</p><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>Boolean values are always stored as bit in RNTuple, so <code>nbits = 1</code>.</p></div></div></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/RNTuple/footer.jl#LL71-L81">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.readbasket-Tuple{ROOTFile, Any, Any}" href="#UnROOT.readbasket-Tuple{ROOTFile, Any, Any}"><code>UnROOT.readbasket</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">readbasket(f::ROOTFile, branch, ith)
readbasketseek(f::ROOTFile, branch::Union{TBranch, TBranchElement}, seek_pos::Int, nbytes)</code></pre><p>The fundamental building block of reading read data from a .root file. Read read one basket's raw bytes and offsets at a time. These raw bytes and offsets then (potentially) get processed by <a href="#UnROOT.interped_data-Tuple{Any, Any, Type{Bool}, Type{UnROOT.Nojagg}}"><code>interped_data</code></a>.</p><p>See also: <a href="#UnROOT.auto_T_JaggT-Tuple{ROOTFile, Any}"><code>auto_T_JaggT</code></a>, <a href="#UnROOT.basketarray-Tuple{ROOTFile, AbstractString, Any}"><code>basketarray</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/root.jl#LL506-L515">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.readobjany!-Tuple{Any, Union{UnROOT.TKey32, UnROOT.TKey64}, Any}" href="#UnROOT.readobjany!-Tuple{Any, Union{UnROOT.TKey32, UnROOT.TKey64}, Any}"><code>UnROOT.readobjany!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">function readobjany!(io, tkey::TKey, refs)</code></pre><p>The main entrypoint where streamers are parsed and cached for later use. The <code>refs</code> dictionary holds the streamers or parsed data which are reused when already available.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/streamers.jl#LL190-L196">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.skiptobj-Tuple{Any}" href="#UnROOT.skiptobj-Tuple{Any}"><code>UnROOT.skiptobj</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">function skiptobj(io)</code></pre><p>Skips a TOBject.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/io.jl#LL113-L117">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.splitup-Tuple{Vector{UInt8}, Any, Type}" href="#UnROOT.splitup-Tuple{Vector{UInt8}, Any, Type}"><code>UnROOT.splitup</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">splitup(data::Vector{UInt8}, offsets, T::Type; skipbytes=0)</code></pre><p>Given the <code>offsets</code> and <code>data</code> return by <code>array(...; raw = true)</code>, reconstructed the actual array (with custome struct, can be jagged as well).</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/custom.jl#LL1-L6">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.topological_sort-Tuple{Any}" href="#UnROOT.topological_sort-Tuple{Any}"><code>UnROOT.topological_sort</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">function topological_sort(streamer_infos)</code></pre><p>Sort the streamers with respect to their dependencies and keep only those which are not defined already.</p><p>The implementation is based on https://stackoverflow.com/a/11564769/1623645</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/streamers.jl#LL145-L152">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.unpack-Tuple{UnROOT.CompressionHeader}" href="#UnROOT.unpack-Tuple{UnROOT.CompressionHeader}"><code>UnROOT.unpack</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">unpack(x::CompressionHeader)</code></pre><p>Return the following information:</p><ul><li>Name of compression algorithm</li><li>Level of the compression</li><li>compressedbytes and uncompressedbytes according to <a href="https://github.com/scikit-hep/uproot3/blob/54f5151fb7c686c3a161fbe44b9f299e482f346b/uproot3/source/compressed.py#L132">uproot3</a></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/utils.jl#LL35-L42">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.@SimpleStruct-Tuple{Any}" href="#UnROOT.@SimpleStruct-Tuple{Any}"><code>UnROOT.@SimpleStruct</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">macro SimpleStruct</code></pre><p>Define reading method on the fly for <code>_rntuple_read</code></p><p><strong>Example</strong></p><pre><code class="nohighlight hljs">julia> @SimpleStruct struct Locator
num_bytes::Int32
offset::UInt64
end</code></pre><p>would automatically define the following reading method:</p><pre><code class="nohighlight hljs">function _rntuple_read(io, ::Type{Locator})
num_bytes = _rntuple_read(io, Int32)
offset = _rntuple_read(io, UInt64)
Locator(num_bytes, offset)
end</code></pre><p>Notice <code>_rntuple_read</code> falls back to <code>read</code> for all types that are not defined by us.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/RNTuple/bootstrap.jl#LL90-L112">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="UnROOT.@stack-Tuple{Any, Vararg{Any, N} where N}" href="#UnROOT.@stack-Tuple{Any, Vararg{Any, N} where N}"><code>UnROOT.@stack</code></a> — <span class="docstring-category">Macro</span></header><section><div><pre><code class="language-julia hljs">macro stack(into, structs...)</code></pre><p>Stack the fields of multiple structs and create a new one. The first argument is the name of the new struct followed by the ones to be stacked. Parametric types are not supported and the fieldnames needs to be unique.</p><p>Example:</p><pre><code class="nohighlight hljs">@stack Baz Foo Bar</code></pre><p>Creates <code>Baz</code> with the concatenated fields of <code>Foo</code> and <code>Bar</code></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaHEP/UnROOT.jl/blob/aaae1dfe041114998a686498dfaf9d5697809811/src/utils.jl#LL1-L15">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../devdocs/">« For Contributors</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.24 on <span class="colophon-date" title="Tuesday 25 April 2023 10:41">Tuesday 25 April 2023</span>. Using Julia version 1.6.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>