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
Compare revisions
9f7505ecddb6f7c8a3d87d421e19bb0d727543a8 to 6d3d0516098c110f0735baba86396e283a491dac
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
simulation/km3buu
Select target project
No results found
6d3d0516098c110f0735baba86396e283a491dac
Select Git revision
Swap
Target
simulation/km3buu
Select target project
simulation/km3buu
1 result
9f7505ecddb6f7c8a3d87d421e19bb0d727543a8
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (4)
Fix test (target A range)
· 101d3a50
Johannes Schumann
authored
3 years ago
101d3a50
Add interpolation for total xsection from binning
· 989e81b9
Johannes Schumann
authored
3 years ago
989e81b9
Use only 15 bins
· bd9d32d4
Johannes Schumann
authored
3 years ago
bd9d32d4
Merge branch 'xsec-mean' into 'master'
· 6d3d0516
Johannes Schumann
authored
3 years ago
Mean cross section See merge request
!9
6d3d0516
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
km3buu/output.py
+29
-1
29 additions, 1 deletion
km3buu/output.py
km3buu/tests/test_jobcard.py
+2
-2
2 additions, 2 deletions
km3buu/tests/test_jobcard.py
with
31 additions
and
3 deletions
km3buu/output.py
View file @
6d3d0516
...
...
@@ -20,7 +20,7 @@ from os.path import isfile, join, abspath
from
tempfile
import
TemporaryDirectory
import
awkward
as
ak
import
uproot
from
scipy.interpolate
import
UnivariateSpline
from
scipy.interpolate
import
UnivariateSpline
,
interp1d
from
scipy.spatial.transform
import
Rotation
import
scipy.constants
as
constants
import
mendeleev
...
...
@@ -208,6 +208,34 @@ class GiBUUOutput:
xsec
=
np
.
divide
(
total_events
*
weights
,
n_files
)
return
xsec
@property
def
mean_xsec
(
self
):
root_tupledata
=
self
.
arrays
energies
=
np
.
array
(
root_tupledata
.
lepIn_E
)
weights
=
self
.
_event_xsec
(
root_tupledata
)
Emin
=
np
.
min
(
energies
)
Emax
=
np
.
max
(
energies
)
xsec
,
energy_bins
=
np
.
histogram
(
energies
,
weights
=
weights
,
bins
=
np
.
logspace
(
np
.
log10
(
Emin
),
np
.
log10
(
Emax
),
15
))
deltaE
=
np
.
mean
(
self
.
flux_data
[
"
energy
"
][
1
:]
-
self
.
flux_data
[
"
energy
"
][:
-
1
])
bin_events
=
np
.
array
([
self
.
flux_interpolation
.
integral
(
energy_bins
[
i
],
energy_bins
[
i
+
1
])
/
deltaE
for
i
in
range
(
len
(
energy_bins
)
-
1
)
])
x
=
(
energy_bins
[
1
:]
+
energy_bins
[:
-
1
])
/
2
y
=
xsec
/
bin_events
/
x
xsec_interp
=
interp1d
(
x
,
y
,
kind
=
"
linear
"
,
fill_value
=
(
y
[
0
],
y
[
-
1
]),
bounds_error
=
False
)
return
lambda
e
:
xsec_interp
(
e
)
*
e
def
w2weights
(
self
,
volume
,
target_density
,
solid_angle
):
"""
Calculate w2weights
...
...
This diff is collapsed.
Click to expand it.
km3buu/tests/test_jobcard.py
View file @
6d3d0516
...
...
@@ -48,8 +48,8 @@ class TestJobcard(unittest.TestCase):
class
TestNeutrinoJobcard
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
test_fluxfile
=
TemporaryFile
()
self
.
test_Z
=
np
.
random
.
randint
(
0
,
100
)
self
.
test_A
=
np
.
random
.
randint
(
0
,
100
)
self
.
test_Z
=
np
.
random
.
randint
(
1
,
100
)
self
.
test_A
=
np
.
random
.
randint
(
self
.
test_Z
,
100
)
self
.
test_energy_min
=
np
.
random
.
uniform
(
0.0
,
100.0
)
self
.
test_energy_max
=
np
.
random
.
uniform
(
self
.
test_energy_min
,
100.0
)
self
.
photon_propagation_flag
=
np
.
random
.
choice
([
True
,
False
])
...
...
This diff is collapsed.
Click to expand it.