Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
KM3BUU
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
simulation
KM3BUU
Commits
aa53bbcd
Commit
aa53bbcd
authored
1 year ago
by
Johannes Schumann
Browse files
Options
Downloads
Patches
Plain Diff
Resolve "Add helicity probability"
parent
2c78f4bf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!79
Resolve "Add helicity probability"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.rst
+1
-0
1 addition, 0 deletions
CHANGELOG.rst
km3buu/output.py
+25
-0
25 additions, 0 deletions
km3buu/output.py
km3buu/tests/test_output.py
+5
-0
5 additions, 0 deletions
km3buu/tests/test_output.py
with
31 additions
and
0 deletions
CHANGELOG.rst
+
1
−
0
View file @
aa53bbcd
Unreleased changes
------------------
* Add field for right handed helicity probability for outgoing lepton in GiBUUOutput
v1.6.1
----------------------------
...
...
This diff is collapsed.
Click to expand it.
km3buu/output.py
+
25
−
0
View file @
aa53bbcd
...
...
@@ -464,6 +464,30 @@ class GiBUUOutput:
y
=
pq
/
pk
return
y
@staticmethod
def
right_helicity_probability
(
roottuple_data
):
"""
Calculate the probability for the outgoing lepton from the neutrino vertex
to have a right handed helicity
Definition: p = ( 1-|p|/(E+m) )/2
Parameters
----------
roottuple_data: awkward.highlevel.Array
"""
sec_lepton_pdgid
=
np
.
sign
(
roottuple_data
.
process_ID
)
*
(
7
+
2
*
roottuple_data
.
flavor_ID
+
np
.
abs
(
roottuple_data
.
process_ID
))
sec_lepton_mass
=
np
.
array
(
[
Particle
.
from_pdgid
(
p
).
mass
*
1e-3
for
p
in
sec_lepton_pdgid
])
total_lepton_P
=
np
.
sqrt
(
roottuple_data
.
lepOut_Px
**
2
+
roottuple_data
.
lepOut_Py
**
2
+
roottuple_data
.
lepOut_Pz
**
2
)
rh_probability
=
0.5
*
(
1
-
total_lepton_P
/
(
roottuple_data
.
lepOut_E
+
sec_lepton_mass
))
return
rh_probability
@property
def
A
(
self
):
grp
=
self
.
jobcard
[
"
target
"
]
...
...
@@ -539,6 +563,7 @@ class GiBUUOutput:
visEfrac
=
visible_energy_fraction
(
ak
.
flatten
(
retval
.
E
),
ak
.
flatten
(
retval
.
barcode
))
retval
[
"
visEfrac
"
]
=
ak
.
unflatten
(
visEfrac
,
counts
)
retval
[
"
rh_prob
"
]
=
GiBUUOutput
.
right_helicity_probability
(
retval
)
return
retval
@property
...
...
This diff is collapsed.
Click to expand it.
km3buu/tests/test_output.py
+
5
−
0
View file @
aa53bbcd
...
...
@@ -106,6 +106,11 @@ class TestGiBUUOutput(unittest.TestCase):
mask
=
self
.
output
.
free_particle_mask
np
.
testing
.
assert_array_equal
(
mask
[
0
],
[
True
,
False
,
True
,
True
,
True
])
def
test_right_handed_helicity
(
self
):
arr
=
self
.
output
.
arrays
np
.
testing
.
assert_array_almost_equal
(
arr
.
rh_prob
[:
3
],
[
4.518065e-05
,
9.428467e-06
,
3.488926e-05
])
@pytest.mark.skipif
(
not
KM3NET_LIB_AVAILABLE
,
reason
=
"
KM3NeT dataformat required
"
)
...
...
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