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
8caed419
Commit
8caed419
authored
1 year ago
by
Tamas Gal
Browse files
Options
Downloads
Plain Diff
Merge branch 'mceventmatcher' into 'main'
MC event matcher See merge request
!25
parents
eb03033d
4e488997
No related branches found
No related tags found
1 merge request
!25
MC event matcher
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Project.toml
+1
-1
1 addition, 1 deletion
Project.toml
src/KM3io.jl
+3
-0
3 additions, 0 deletions
src/KM3io.jl
src/tools/helpers.jl
+20
-0
20 additions, 0 deletions
src/tools/helpers.jl
test/tools.jl
+20
-0
20 additions, 0 deletions
test/tools.jl
with
44 additions
and
1 deletion
Project.toml
+
1
−
1
View file @
8caed419
name
=
"KM3io"
uuid
=
"2cab5852-6f21-4982-99b0-6a4792870cfb"
authors
=
[
"Tamas Gal"
,
"Johannes Schumann"
]
version
=
"0.16.
1
"
version
=
"0.16.
2
"
[deps]
Dates
=
"ade2ca70-3891-5945-98fb-dc099432e06a"
...
...
This diff is collapsed.
Click to expand it.
src/KM3io.jl
+
3
−
0
View file @
8caed419
...
...
@@ -56,6 +56,8 @@ export most_frequent, categorize, nthbitset
export
cherenkov
,
CherenkovPhoton
,
azimuth
,
zenith
,
theta
,
phi
export
MCEventMatcher
export
CHClient
,
CHTag
,
subscribe
,
@ip_str
@template
(
FUNCTIONS
,
METHODS
,
MACROS
)
=
...
...
@@ -100,6 +102,7 @@ include("tools/general.jl")
include
(
"tools/daq.jl"
)
include
(
"tools/trigger.jl"
)
include
(
"tools/reconstruction.jl"
)
include
(
"tools/helpers.jl"
)
include
(
"physics.jl"
)
...
...
This diff is collapsed.
Click to expand it.
src/tools/helpers.jl
0 → 100644
+
20
−
0
View file @
8caed419
"""
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
MCEventMatcher
f
::
ROOTFile
end
Base
.
length
(
itr
::
MCEventMatcher
)
=
length
(
itr
.
f
.
online
.
events
)
Base
.
lastindex
(
itr
::
MCEventMatcher
)
=
length
(
itr
)
function
Base.getindex
(
itr
::
MCEventMatcher
,
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
::
MCEventMatcher
,
state
=
1
)
state
>
length
(
itr
)
&&
return
nothing
(
itr
[
state
],
state
+
1
)
end
This diff is collapsed.
Click to expand it.
test/tools.jl
+
20
−
0
View file @
8caed419
...
...
@@ -307,3 +307,23 @@ end
close
(
f
)
end
@testset
"helpers"
begin
f
=
ROOTFile
(
datapath
(
"mupage"
,
"mcv8.1.mupage_tuned_100G.sirene.jterbr00013288.10.root"
))
for
(
event
,
mc_event
)
in
MCEventMatcher
(
f
)
continue
end
rbr
=
MCEventMatcher
(
f
)
event
,
mc_event
=
rbr
[
1
]
@assert
756
==
length
(
event
.
snapshot_hits
)
@assert
28
==
length
(
event
.
triggered_hits
)
@assert
94
==
length
(
mc_event
.
mc_hits
)
@assert
2
==
length
(
mc_event
.
mc_trks
)
event
,
mc_event
=
rbr
[
end
]
@assert
707
==
length
(
event
.
snapshot_hits
)
@assert
27
==
length
(
event
.
triggered_hits
)
@assert
111
==
length
(
mc_event
.
mc_hits
)
@assert
4
==
length
(
mc_event
.
mc_trks
)
end
This diff is collapsed.
Click to expand it.
Tamas Gal
@tgal
mentioned in commit
f649a05a
·
1 year ago
mentioned in commit
f649a05a
mentioned in commit f649a05a1ed1613ee6d3743912da3686b43c4288
Toggle commit list
Tamas Gal
@tgal
mentioned in commit
0cbece9a
·
1 year ago
mentioned in commit
0cbece9a
mentioned in commit 0cbece9aea26771fe12b88164622adcaaed46c14
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