Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
geant4-projects
cosmic-rays
Commits
3a0a0ad6
Commit
3a0a0ad6
authored
Jul 30, 2019
by
MARCOS ANTONIO DE OLIVEIRA DEROS
Browse files
now plot neutrinos too
parent
29c9a59f
Changes
1
Hide whitespace changes
Inline
Side-by-side
plot.py
View file @
3a0a0ad6
...
...
@@ -5,6 +5,10 @@ x = []
y_gamma
=
[]
y_mu_minus
=
[]
y_mu_plus
=
[]
y_nu_e
=
[]
y_nu_mu
=
[]
y_anti_nu_e
=
[]
y_anti_nu_mu
=
[]
with
open
(
"gamma.txt"
,
"r"
)
as
csvfile
:
plots
=
csv
.
reader
(
csvfile
,
delimiter
=
" "
)
...
...
@@ -23,8 +27,30 @@ with open("mu-.txt", "r") as csvfile:
for
row
in
plots
:
y_mu_minus
.
append
(
float
(
row
[
0
]))
with
open
(
"nu_e.txt"
,
"r"
)
as
csvfile
:
plots
=
csv
.
reader
(
csvfile
,
delimiter
=
" "
)
for
row
in
plots
:
y_nu_e
.
append
(
float
(
row
[
0
]))
with
open
(
"nu_mu.txt"
,
"r"
)
as
csvfile
:
plots
=
csv
.
reader
(
csvfile
,
delimiter
=
" "
)
for
row
in
plots
:
y_nu_mu
.
append
(
float
(
row
[
0
]))
with
open
(
"anti_nu_e.txt"
,
"r"
)
as
csvfile
:
plots
=
csv
.
reader
(
csvfile
,
delimiter
=
" "
)
for
row
in
plots
:
y_anti_nu_e
.
append
(
float
(
row
[
0
]))
with
open
(
"anti_nu_mu.txt"
,
"r"
)
as
csvfile
:
plots
=
csv
.
reader
(
csvfile
,
delimiter
=
" "
)
for
row
in
plots
:
y_anti_nu_mu
.
append
(
float
(
row
[
0
]))
plt
.
scatter
(
x
,
y_gamma
)
#gamma
plt
.
scatter
(
x
,
y_gamma
,
s
=
20
)
plt
.
title
(
"Geant4 hadronic shower graphs"
)
plt
.
ylabel
(
"Nº gamma"
)
plt
.
xlabel
(
"distance (km)"
)
...
...
@@ -32,14 +58,35 @@ plt.xlim(xmin=0)
plt
.
ylim
(
ymin
=
0
)
plt
.
show
()
line1
=
plt
.
scatter
(
x
,
y_mu_plus
,
c
=
'b'
,
label
=
'1'
)
line2
=
plt
.
scatter
(
x
,
y_mu_minus
,
c
=
'r'
,
label
=
'1'
)
#muons
line1
=
plt
.
scatter
(
x
,
y_mu_plus
,
c
=
'b'
,
label
=
'1'
,
s
=
20
,
marker
=
'^'
)
line2
=
plt
.
scatter
(
x
,
y_mu_minus
,
c
=
'r'
,
label
=
'1'
,
s
=
20
)
plt
.
title
(
"Geant4 hadronic shower graphs"
)
plt
.
ylabel
(
"Nº muons"
)
plt
.
xlabel
(
"distance (km)"
)
plt
.
xlim
(
xmin
=
0
)
plt
.
ylim
(
ymin
=
0
)
plt
.
legend
((
line1
,
line2
),
(
'mu-'
,
'mu+'
))
plt
.
show
()
#neutrinos
line1
=
plt
.
scatter
(
x
,
y_nu_e
,
c
=
'b'
,
label
=
'1'
,
s
=
20
)
line2
=
plt
.
scatter
(
x
,
y_anti_nu_e
,
c
=
'r'
,
label
=
'1'
,
s
=
20
)
plt
.
title
(
"Geant4 hadronic shower graphs"
)
plt
.
ylabel
(
"Nº electron neutrinos"
)
plt
.
xlabel
(
"distance (km)"
)
plt
.
xlim
(
xmin
=
0
)
plt
.
ylim
(
ymin
=
0
)
plt
.
legend
((
line1
,
line2
),
(
'nu_e'
,
'anti_nu_e'
))
plt
.
show
()
line1
=
plt
.
scatter
(
x
,
y_nu_mu
,
c
=
'b'
,
label
=
'1'
,
s
=
20
)
line2
=
plt
.
scatter
(
x
,
y_anti_nu_mu
,
c
=
'r'
,
label
=
'1'
,
s
=
20
,
marker
=
'^'
)
plt
.
title
(
"Geant4 hadronic shower graphs"
)
plt
.
ylabel
(
"Nº muon neutrinos"
)
plt
.
xlabel
(
"distance (km)"
)
plt
.
xlim
(
xmin
=
0
)
plt
.
ylim
(
ymin
=
0
)
plt
.
legend
((
line1
,
line2
),
(
'nu_mu'
,
'anti_nu_mu'
))
plt
.
show
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment