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
0e7db4cc
Commit
0e7db4cc
authored
5 years ago
by
Johannes Schumann
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bugs and added anticc option
parent
764dffd5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Merge python environment
Pipeline
#9769
passed
5 years ago
Stage: test
Stage: coverage
Stage: doc
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/plot_cc_xsection.py
+9
-6
9 additions, 6 deletions
scripts/plot_cc_xsection.py
with
9 additions
and
6 deletions
scripts/plot_cc_xsection.py
+
9
−
6
View file @
0e7db4cc
...
...
@@ -6,7 +6,7 @@
Generate
Usage:
neutrino_jobcard_generator.py OUTFILE [--threads=<n>] [--verbose]
neutrino_jobcard_generator.py OUTFILE [--threads=<n>] [--verbose]
[--anticc]
neutrino_jobcard_generator.py (-h | --help)
Options:
...
...
@@ -18,7 +18,6 @@ Options:
"""
import
os
import
time
import
click
import
numpy
as
np
import
matplotlib.pyplot
as
plt
from
thepipe.logger
import
get_logger
...
...
@@ -87,7 +86,10 @@ def generate_neutrino_jobcard(process, flavor, energy, target):
return
jc
def
worker
(
energy
):
def
worker
(
energy
,
anti_flag
=
False
):
process
=
"
cc
"
if
anti_flag
:
process
=
"
anticc
"
# create a neutrino jobcard for oxygen
tmpjc
=
generate_neutrino_jobcard
(
"
cc
"
,
"
electron
"
,
energy
,
(
8
,
16
))
datadir
=
TemporaryDirectory
(
dir
=
dirname
(
__file__
),
...
...
@@ -105,12 +107,13 @@ def main():
log
.
setLevel
(
"
INFO
"
)
workers
=
int
(
args
[
"
--threads
"
])
xsections
=
defaultdict
(
list
)
energies
=
np
.
logspace
(
-
1
,
1
,
5
0
)
energies
=
np
.
logspace
(
-
1
,
1
,
6
0
)
tasks
=
{}
with
ThreadPoolExecutor
(
max_workers
=
workers
)
as
executor
:
for
i
,
energy
in
enumerate
(
energies
):
tasks
[
i
]
=
executor
.
submit
(
worker
,
energy
)
tasks
[
i
]
=
executor
.
submit
(
worker
,
energy
,
args
[
"
--anticc
"
]
)
if
args
[
"
--verbose
"
]:
import
click
while
True
:
time
.
sleep
(
1
)
status
=
{
k
:
v
.
done
()
for
k
,
v
in
tasks
.
items
()}
...
...
@@ -126,7 +129,7 @@ def main():
for
k
in
[
'
sum
'
,
'
QE
'
,
'
highRES
'
,
'
DIS
'
,
'
Delta
'
]:
plt
.
plot
(
energies
,
np
.
divide
(
xsections
[
k
],
energies
),
label
=
k
)
plt
.
xlabel
(
"
Energy [GeV]
"
)
plt
.
ylabel
(
"
Crosssection
"
)
plt
.
ylabel
(
r
"
$\nu$
Crosssection
/ E [$10^-38cm^{cm^2}/GeV$]
"
)
plt
.
legend
()
plt
.
xscale
(
"
log
"
)
plt
.
grid
()
...
...
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