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
989e81b9
Commit
989e81b9
authored
3 years ago
by
Johannes Schumann
Browse files
Options
Downloads
Patches
Plain Diff
Add interpolation for total xsection from binning
parent
101d3a50
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!9
Mean cross section
,
!8
W2list
Pipeline
#19679
passed
3 years ago
Stage: test
Stage: coverage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
km3buu/output.py
+29
-1
29 additions, 1 deletion
km3buu/output.py
with
29 additions
and
1 deletion
km3buu/output.py
+
29
−
1
View file @
989e81b9
...
...
@@ -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
),
20
))
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.
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