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
4e488997
Verified
Commit
4e488997
authored
1 year ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
RBRIterator -> MCEventMatcher
parent
627070cf
No related branches found
Branches containing commit
No related tags found
2 merge requests
!25
MC event matcher
,
!24
RBR iterator
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/KM3io.jl
+1
-1
1 addition, 1 deletion
src/KM3io.jl
src/tools/helpers.jl
+7
-6
7 additions, 6 deletions
src/tools/helpers.jl
test/tools.jl
+2
-2
2 additions, 2 deletions
test/tools.jl
with
10 additions
and
9 deletions
src/KM3io.jl
+
1
−
1
View file @
4e488997
...
...
@@ -56,7 +56,7 @@ export most_frequent, categorize, nthbitset
export
cherenkov
,
CherenkovPhoton
,
azimuth
,
zenith
,
theta
,
phi
export
RBRIterato
r
export
MCEventMatche
r
export
CHClient
,
CHTag
,
subscribe
,
@ip_str
...
...
This diff is collapsed.
Click to expand it.
src/tools/helpers.jl
+
7
−
6
View file @
4e488997
"""
A basic container type to assist run-by-run iteration.
A basic container type to assist the matching of MC events in the offline tree
with the events in the online tree.
"""
# TODO: add tests (need a proper testfile in km3net-testdata)
struct
RBRIterato
r
struct
MCEventMatche
r
f
::
ROOTFile
end
Base
.
length
(
itr
::
RBRIterato
r
)
=
length
(
itr
.
f
.
online
.
events
)
Base
.
lastindex
(
itr
::
RBRIterato
r
)
=
length
(
itr
)
function
Base.getindex
(
itr
::
RBRIterato
r
,
idx
::
Integer
)
Base
.
length
(
itr
::
MCEventMatche
r
)
=
length
(
itr
.
f
.
online
.
events
)
Base
.
lastindex
(
itr
::
MCEventMatche
r
)
=
length
(
itr
)
function
Base.getindex
(
itr
::
MCEventMatche
r
,
idx
::
Integer
)
event
=
itr
.
f
.
online
.
events
[
idx
]
mc_idx
=
event
.
header
.
trigger_counter
+
1
mc_event
=
itr
.
f
.
offline
[
mc_idx
]
(
event
,
mc_event
)
end
function
Base.iterate
(
itr
::
RBRIterato
r
,
state
=
1
)
function
Base.iterate
(
itr
::
MCEventMatche
r
,
state
=
1
)
state
>
length
(
itr
)
&&
return
nothing
(
itr
[
state
],
state
+
1
)
end
This diff is collapsed.
Click to expand it.
test/tools.jl
+
2
−
2
View file @
4e488997
...
...
@@ -311,11 +311,11 @@ end
@testset
"helpers"
begin
f
=
ROOTFile
(
datapath
(
"mupage"
,
"mcv8.1.mupage_tuned_100G.sirene.jterbr00013288.10.root"
))
for
(
event
,
mc_event
)
in
RBRIterato
r
(
f
)
for
(
event
,
mc_event
)
in
MCEventMatche
r
(
f
)
continue
end
rbr
=
RBRIterato
r
(
f
)
rbr
=
MCEventMatche
r
(
f
)
event
,
mc_event
=
rbr
[
1
]
@assert
756
==
length
(
event
.
snapshot_hits
)
@assert
28
==
length
(
event
.
triggered_hits
)
...
...
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