Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
KM3io.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
common
KM3io.jl
Commits
ed89063c
Commit
ed89063c
authored
1 year ago
by
Tamas Gal
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix-laziness' into 'main'
Fix lazyness of event and summaryslice containers See merge request
!29
parents
cf6b9df0
a573c00c
No related branches found
Branches containing commit
No related tags found
1 merge request
!29
Fix lazyness of event and summaryslice containers
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/root/online.jl
+16
-5
16 additions, 5 deletions
src/root/online.jl
with
16 additions
and
5 deletions
src/root/online.jl
+
16
−
5
View file @
ed89063c
...
...
@@ -45,9 +45,16 @@ function Base.show(io::IO, e::DAQEvent)
end
struct
EventContainer
headers
::
Vector
{
EventHeader
}
snapshot_hits
::
Vector
{
Vector
{
SnapshotHit
}}
triggered_hits
::
Vector
{
Vector
{
TriggeredHit
}}
# For performance reasons we use the lazy types of UnROOT,
# otherwise we have no laziness ;) We could also parametrise,
# just like with SummarysliceContainer.
headers
::
UnROOT
.
LazyBranch
{
EventHeader
,
UnROOT
.
Nojagg
,
Vector
{
EventHeader
}}
snapshot_hits
::
UnROOT
.
LazyBranch
{
Vector
{
SnapshotHit
},
UnROOT
.
Nojagg
,
Vector
{
Vector
{
SnapshotHit
}}}
triggered_hits
::
UnROOT
.
LazyBranch
{
Vector
{
TriggeredHit
},
UnROOT
.
Nojagg
,
Vector
{
Vector
{
TriggeredHit
}}}
# These were the original fields:
# headers::Vector{EventHeader}
# snapshot_hits::Vector{Vector{SnapshotHit}}
# triggered_hits::Vector{Vector{TriggeredHit}}
end
Base
.
getindex
(
c
::
EventContainer
,
idx
::
Integer
)
=
DAQEvent
(
c
.
headers
[
idx
],
c
.
snapshot_hits
[
idx
],
c
.
triggered_hits
[
idx
])
Base
.
getindex
(
c
::
EventContainer
,
r
::
UnitRange
)
=
[
c
[
idx
]
for
idx
∈
r
]
...
...
@@ -107,8 +114,12 @@ struct Summaryslice
frames
::
Vector
{
SummaryFrame
}
end
struct
SummarysliceContainer
headers
::
Vector
{
SummarysliceHeader
}
summaryslices
::
Vector
{
Vector
{
SummaryFrame
}}
# For performance reasons we use directly the lazy types of UnROOT
# We could also parametrise it.
# Originally this was headers::Vector{SummarysliceHeader} and
# summaryslices::Vector{Vector{SummaryFrame}}
headers
::
UnROOT
.
LazyBranch
{
SummarysliceHeader
,
UnROOT
.
Nojagg
,
Vector
{
SummarysliceHeader
}}
summaryslices
::
UnROOT
.
LazyBranch
{
Vector
{
SummaryFrame
},
UnROOT
.
Nojagg
,
Vector
{
Vector
{
SummaryFrame
}}}
end
Base
.
getindex
(
c
::
SummarysliceContainer
,
idx
::
Integer
)
=
Summaryslice
(
c
.
headers
[
idx
],
c
.
summaryslices
[
idx
])
...
...
This diff is collapsed.
Click to expand it.
Tamas Gal
@tgal
mentioned in commit
6139491c
·
1 year ago
mentioned in commit
6139491c
mentioned in commit 6139491c7549754b7fef8b948d1374dc045b679d
Toggle commit list
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