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
3e8c899f
Commit
3e8c899f
authored
Aug 18, 2019
by
MARCOS ANTONIO DE OLIVEIRA DEROS
Browse files
if-clause added
parent
a528218e
Changes
1
Hide whitespace changes
Inline
Side-by-side
plot.py
View file @
3e8c899f
...
...
@@ -10,6 +10,11 @@ y_nu_mu = []
y_anti_nu_e
=
[]
y_anti_nu_mu
=
[]
#choose the graphs you want putting true:
gamma_graph
=
True
mu_graph
=
True
neutrino_graph
=
True
with
open
(
"gamma.txt"
,
"r"
)
as
csvfile
:
plots
=
csv
.
reader
(
csvfile
,
delimiter
=
" "
)
for
row
in
plots
:
...
...
@@ -49,44 +54,46 @@ with open("anti_nu_mu.txt", "r") as csvfile:
#gamma
plt
.
scatter
(
x
,
y_gamma
,
s
=
20
)
plt
.
title
(
"Geant4 hadronic shower graphs"
)
plt
.
ylabel
(
"Nº gamma"
)
plt
.
xlabel
(
"distance (km)"
)
plt
.
xlim
(
xmin
=
0
)
plt
.
ylim
(
ymin
=
0
)
plt
.
show
()
#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
()
if
(
gamma_graph
):
#gamma
plt
.
scatter
(
x
,
y_gamma
,
s
=
20
)
plt
.
title
(
"Geant4 hadronic shower graphs"
)
plt
.
ylabel
(
"Nº gamma"
)
plt
.
xlabel
(
"distance (km)"
)
plt
.
xlim
(
xmin
=
0
)
plt
.
ylim
(
ymin
=
0
)
plt
.
show
()
if
(
mu_graph
):
#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
()
if
(
neutrino_graph
):
#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