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
Compare revisions
1e203885091cfe4ab3b2d809cd0f3b57310489d8 to b1985a6317539fe08926ddfbc986295789770561
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
km3py/km3io
Select target project
No results found
b1985a6317539fe08926ddfbc986295789770561
Select Git revision
Swap
Target
km3py/km3io
Select target project
km3py/km3io
spenamartinez/km3io
2 results
1e203885091cfe4ab3b2d809cd0f3b57310489d8
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
Create a tool to check nanobeacon flag in trigger mask
· ca464566
Manu Le Guirriec
authored
2 years ago
and
Tamas Gal
committed
2 years ago
ca464566
Merge branch 'nanobeacon_trigger' into 'master'
· b1985a63
Tamas Gal
authored
2 years ago
Create a tool to check nanobeacon flag in trigger mask See merge request
!73
b1985a63
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/km3io/tools.py
+11
-0
11 additions, 0 deletions
src/km3io/tools.py
tests/test_tools.py
+11
-0
11 additions, 0 deletions
tests/test_tools.py
with
22 additions
and
0 deletions
src/km3io/tools.py
View file @
b1985a63
...
...
@@ -536,3 +536,14 @@ def is_3dmuon(trigger_mask):
A value or an array of the trigger_mask, either of an event, or a hit.
"""
return
is_bit_set
(
trigger_mask
,
ktrg
.
JTRIGGER3DMUON
)
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
View file @
b1985a63
...
...
@@ -31,6 +31,7 @@ from km3io.tools import (
is_3dshower
,
is_mxshower
,
is_3dmuon
,
is_nanobeacon
,
)
OFFLINE_FILE
=
OfflineReader
(
data_path
(
"
offline/km3net_offline.root
"
))
...
...
@@ -642,3 +643,13 @@ class TestTriggerMaskChecks(unittest.TestCase):
[
False
,
False
,
False
,
True
,
False
,
False
,
True
,
False
,
True
,
True
],
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.