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
ac6e0c1e
Commit
ac6e0c1e
authored
4 years ago
by
Zineb Aly
Browse files
Options
Downloads
Patches
Plain Diff
add docs
parent
36e43853
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#10811
failed
4 years ago
Stage: test
Stage: coverage
Stage: doc
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
km3io/offline.py
+28
-0
28 additions, 0 deletions
km3io/offline.py
with
28 additions
and
0 deletions
km3io/offline.py
+
28
−
0
View file @
ac6e0c1e
...
@@ -87,6 +87,19 @@ def count_nested(Array, axis=0):
...
@@ -87,6 +87,19 @@ def count_nested(Array, axis=0):
@nb.jit
(
nopython
=
True
)
@nb.jit
(
nopython
=
True
)
def
_find
(
rec_stages
,
stages
,
builder
):
def
_find
(
rec_stages
,
stages
,
builder
):
"""
construct an awkward1 array with the same structure as tracks.rec_stages.
When stages are found, the Array is filled with value 1, otherwise it is filled
with value 0.
Parameters
----------
rec_stages : awkward1 Array
tracks.rec_stages .
stages : awkward1 Array
reconstruction stages of interest.
builder : awkward1.highlevel.ArrayBuilder
awkward1 Array builder.
"""
for
s
in
rec_stages
:
for
s
in
rec_stages
:
builder
.
begin_list
()
builder
.
begin_list
()
for
i
in
s
:
for
i
in
s
:
...
@@ -106,6 +119,21 @@ def _find(rec_stages, stages, builder):
...
@@ -106,6 +119,21 @@ def _find(rec_stages, stages, builder):
def
mask
(
rec_stages
,
stages
):
def
mask
(
rec_stages
,
stages
):
"""
create a mask on tracks.rec_stages .
Parameters
----------
rec_stages : awkward1 Array
tracks.rec_stages .
stages : list
reconstruction stages of interest.
Returns
-------
awkward1 Array
an awkward1 Array mask where True corresponds to the positions
where stages were found. False otherwise.
"""
builder
=
ak1
.
ArrayBuilder
()
builder
=
ak1
.
ArrayBuilder
()
_find
(
rec_stages
,
ak1
.
Array
(
stages
),
builder
)
_find
(
rec_stages
,
ak1
.
Array
(
stages
),
builder
)
return
builder
.
snapshot
()
==
1
return
builder
.
snapshot
()
==
1
...
...
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