Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
km3io
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
km3py
km3io
Commits
f4f48a33
Commit
f4f48a33
authored
2 years ago
by
Tamas Gal
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into 'add_w2lists_def_readout'
# Conflicts: # src/km3io/tools.py
parents
1e203885
b1985a63
No related branches found
No related tags found
1 merge request
!72
add w2lists_def readout
Pipeline
#29106
passed with warnings
2 years ago
Stage: test
Stage: coverage
Stage: doc
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/km3io/tools.py
+10
-0
10 additions, 0 deletions
src/km3io/tools.py
tests/test_tools.py
+11
-0
11 additions, 0 deletions
tests/test_tools.py
with
21 additions
and
0 deletions
src/km3io/tools.py
+
10
−
0
View file @
f4f48a33
...
@@ -556,3 +556,13 @@ def get_w2list_idx(f):
...
@@ -556,3 +556,13 @@ def get_w2list_idx(f):
sim_program
=
f
.
header
.
simul
.
program
.
lower
()
sim_program
=
f
.
header
.
simul
.
program
.
lower
()
return
w2s_idx
.
get
(
sim_program
)
return
w2s_idx
.
get
(
sim_program
)
def
is_nanobeacon
(
trigger_mask
):
"""
Returns True if the trigger mask contains the nano-beacon flag.
Parameters
----------
trigger_mask : int or array(int)
A value or an array of the trigger_mask, either of an event, or a hit.
"""
return
is_bit_set
(
trigger_mask
,
ktrg
.
JTRIGGERNB
)
This diff is collapsed.
Click to expand it.
tests/test_tools.py
+
11
−
0
View file @
f4f48a33
...
@@ -31,6 +31,7 @@ from km3io.tools import (
...
@@ -31,6 +31,7 @@ from km3io.tools import (
is_3dshower
,
is_3dshower
,
is_mxshower
,
is_mxshower
,
is_3dmuon
,
is_3dmuon
,
is_nanobeacon
,
)
)
OFFLINE_FILE
=
OfflineReader
(
data_path
(
"
offline/km3net_offline.root
"
))
OFFLINE_FILE
=
OfflineReader
(
data_path
(
"
offline/km3net_offline.root
"
))
...
@@ -642,3 +643,13 @@ class TestTriggerMaskChecks(unittest.TestCase):
...
@@ -642,3 +643,13 @@ class TestTriggerMaskChecks(unittest.TestCase):
[
False
,
False
,
False
,
True
,
False
,
False
,
True
,
False
,
True
,
True
],
[
False
,
False
,
False
,
True
,
False
,
False
,
True
,
False
,
True
,
True
],
list
(
is_3dmuon
(
GENHEN_OFFLINE_FILE
.
events
.
trigger_mask
)),
list
(
is_3dmuon
(
GENHEN_OFFLINE_FILE
.
events
.
trigger_mask
)),
)
)
def
test_is_nanobeacon
(
self
):
assert
np
.
allclose
(
[
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
],
list
(
is_nanobeacon
(
OFFLINE_FILE
.
events
.
trigger_mask
)),
)
assert
np
.
allclose
(
[
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
],
list
(
is_nanobeacon
(
GENHEN_OFFLINE_FILE
.
events
.
trigger_mask
)),
)
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