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
da396ce0
Commit
da396ce0
authored
4 years ago
by
Zineb Aly
Browse files
Options
Downloads
Patches
Plain Diff
correct is_CC to account for USR._data
parent
f3c33c5d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
km3io/tools.py
+16
-4
16 additions, 4 deletions
km3io/tools.py
with
16 additions
and
4 deletions
km3io/tools.py
+
16
−
4
View file @
da396ce0
...
@@ -769,6 +769,16 @@ def is_CC(fobj):
...
@@ -769,6 +769,16 @@ def is_CC(fobj):
"""
Determin if an event (or events) are a result of a Charged Curent interaction (CC)
"""
Determin if an event (or events) are a result of a Charged Curent interaction (CC)
or a Neutral Curent interaction (NC).
or a Neutral Curent interaction (NC).
According to: https://wiki.km3net.de/index.php/Simulations/The_gSeaGen_code#Physics_event_entries
the interaction types are defined as follow:
INTER Interaction type
1 EM
2 Weak[CC]
3 Weak[NC]
4 Weak[CC+NC+interference]
5 NucleonDecay
Parameters
Parameters
----------
----------
fobj : km3io.offline.OfflineReader
fobj : km3io.offline.OfflineReader
...
@@ -779,14 +789,16 @@ def is_CC(fobj):
...
@@ -779,14 +789,16 @@ def is_CC(fobj):
len_w2lists
=
ak1
.
num
(
w2list
,
axis
=
1
)
len_w2lists
=
ak1
.
num
(
w2list
,
axis
=
1
)
if
all
(
len_w2lists
<=
7
):
# old nu file have w2list of len 7.
if
all
(
len_w2lists
<=
7
):
# old nu file have w2list of len 7.
usr
=
fobj
.
events
.
mc_tracks
.
usr_names
usr_names
=
fobj
.
events
.
mc_tracks
.
usr_names
cc_flag
=
usr
[:,
0
][:,
3
]
usr_data
=
fobj
.
events
.
mc_tracks
.
usr
out
=
cc_flag
==
b
"
cc
"
# not very reliable, found NC files with cc flag!
mask_cc_flag
=
(
usr_names
[:,
0
]
==
b
"
cc
"
)
inter_ID
=
usr_data
[:,
0
][
mask_cc_flag
]
out
=
ak1
.
flatten
(
inter_ID
==
2
)
# 2 is the interaction ID for CC.
else
:
else
:
if
"
gseagen
"
in
program
.
lower
():
if
"
gseagen
"
in
program
.
lower
():
cc_flag
=
w2list
[:,
kw2gsg
.
W2LIST_GSEAGEN_CC
]
cc_flag
=
w2list
[:,
kw2gsg
.
W2LIST_GSEAGEN_CC
]
out
=
cc_flag
>
0
out
=
cc_flag
>
0
# to be tested with a newly generated nu file.
if
"
genhen
"
in
program
.
lower
():
if
"
genhen
"
in
program
.
lower
():
cc_flag
=
w2list
[:,
kw2gen
.
W2LIST_GENHEN_CC
]
cc_flag
=
w2list
[:,
kw2gen
.
W2LIST_GENHEN_CC
]
out
=
cc_flag
>
0
out
=
cc_flag
>
0
...
...
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