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
Merge requests
!9
Mean cross section
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Mean cross section
xsec-mean
into
master
Overview
0
Commits
2
Pipelines
2
Changes
1
Merged
Johannes Schumann
requested to merge
xsec-mean
into
master
3 years ago
Overview
0
Commits
2
Pipelines
2
Changes
1
Expand
Add interpolation for binned mean cross section.
0
0
Merge request reports
Compare
master
version 1
989e81b9
3 years ago
master (base)
and
latest version
latest version
bd9d32d4
2 commits,
3 years ago
version 1
989e81b9
1 commit,
3 years ago
1 file
+
29
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
km3buu/output.py
+
29
−
1
Options
@@ -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
Loading