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
dd2e353d
Commit
dd2e353d
authored
2 years ago
by
Johannes Schumann
Browse files
Options
Downloads
Plain Diff
Merge branch '9-bjorken-y' into 'master'
Resolve "Bjorken Y" Closes
#9
See merge request
!31
parents
f504b379
32ad7d6f
No related branches found
No related tags found
1 merge request
!31
Resolve "Bjorken Y"
Pipeline
#27871
failed
2 years ago
Stage: test
Stage: coverage
Stage: doc
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
km3buu/output.py
+7
-2
7 additions, 2 deletions
km3buu/output.py
km3buu/tests/test_output.py
+7
-3
7 additions, 3 deletions
km3buu/tests/test_output.py
with
14 additions
and
5 deletions
km3buu/output.py
+
7
−
2
View file @
dd2e353d
...
...
@@ -498,14 +498,19 @@ class GiBUUOutput:
def
bjorken_y
(
roottuple_data
):
"""
Calculate Bjorken y scaling variable for the GiBUU events
(Lab. frame)
Definition: y = pq/pk
Parameters
----------
roottuple_data: awkward.highlevel.Array
"""
d
=
roottuple_data
y
=
1
-
np
.
divide
(
np
.
array
(
d
.
lepOut_E
),
np
.
array
(
d
.
lepIn_E
))
q
=
GiBUUOutput
.
_q
(
d
)
pq
=
q
[
0
,
:]
*
d
.
nuc_E
-
q
[
1
,
:]
*
d
.
nuc_Px
-
q
[
2
,
:]
*
d
.
nuc_Py
-
q
[
3
,
:]
*
d
.
nuc_Pz
pk
=
d
.
lepIn_E
*
d
.
nuc_E
-
d
.
lepIn_Px
*
d
.
nuc_Px
-
d
.
lepIn_Py
*
d
.
nuc_Py
-
d
.
lepIn_Pz
*
d
.
nuc_Pz
y
=
pq
/
pk
return
y
@property
...
...
This diff is collapsed.
Click to expand it.
km3buu/tests/test_output.py
+
7
−
3
View file @
dd2e353d
...
...
@@ -37,6 +37,7 @@ except ModuleNotFoundError:
class
TestXSection
(
unittest
.
TestCase
):
def
test_xsection_all
(
self
):
filename
=
join
(
TESTDATA_DIR
,
XSECTION_FILENAMES
[
"
all
"
])
xsection
=
read_nu_abs_xsection
(
filename
)
...
...
@@ -47,6 +48,7 @@ class TestXSection(unittest.TestCase):
class
TestGiBUUOutput
(
unittest
.
TestCase
):
def
setup_class
(
self
):
self
.
output
=
GiBUUOutput
(
TESTDATA_DIR
)
...
...
@@ -91,6 +93,7 @@ class TestGiBUUOutput(unittest.TestCase):
@pytest.mark.skipif
(
not
KM3NET_LIB_AVAILABLE
,
reason
=
"
KM3NeT dataformat required
"
)
class
TestOfflineFile
(
unittest
.
TestCase
):
def
setUp
(
self
):
output
=
GiBUUOutput
(
TESTDATA_DIR
)
datafile
=
NamedTemporaryFile
(
suffix
=
"
.root
"
)
...
...
@@ -133,7 +136,7 @@ class TestOfflineFile(unittest.TestCase):
# Bx
np
.
testing
.
assert_almost_equal
(
evt
.
w2list
[
7
],
0.35479262672400624
)
# By
np
.
testing
.
assert_almost_equal
(
evt
.
w2list
[
8
],
0.8
167222969153614
)
np
.
testing
.
assert_almost_equal
(
evt
.
w2list
[
8
],
0.8
203215908456797
)
# iChannel
np
.
testing
.
assert_equal
(
evt
.
w2list
[
9
],
3
)
# CC/NC
...
...
@@ -145,6 +148,7 @@ class TestOfflineFile(unittest.TestCase):
@pytest.mark.skipif
(
not
KM3NET_LIB_AVAILABLE
,
reason
=
"
KM3NeT dataformat required
"
)
class
TestMultiFileOutput
(
unittest
.
TestCase
):
def
setUp
(
self
):
output
=
GiBUUOutput
(
TESTDATA_DIR
)
datafile
=
NamedTemporaryFile
(
suffix
=
"
.root
"
)
...
...
@@ -190,7 +194,7 @@ class TestMultiFileOutput(unittest.TestCase):
# Bx
np
.
testing
.
assert_almost_equal
(
evt
.
w2list
[
7
],
0.35479262672400624
)
# By
np
.
testing
.
assert_almost_equal
(
evt
.
w2list
[
8
],
0.8
167222969153614
)
np
.
testing
.
assert_almost_equal
(
evt
.
w2list
[
8
],
0.8
203215908456797
)
# iChannel
np
.
testing
.
assert_equal
(
evt
.
w2list
[
9
],
3
)
# CC/NC
...
...
@@ -221,7 +225,7 @@ class TestMultiFileOutput(unittest.TestCase):
# Bx
np
.
testing
.
assert_almost_equal
(
evt
.
w2list
[
7
],
0.35479262672400624
)
# By
np
.
testing
.
assert_almost_equal
(
evt
.
w2list
[
8
],
0.8
167222969153614
)
np
.
testing
.
assert_almost_equal
(
evt
.
w2list
[
8
],
0.8
203215908456797
)
# iChannel
np
.
testing
.
assert_equal
(
evt
.
w2list
[
9
],
3
)
# CC/NC
...
...
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