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
ALICE-open-data
ALICE Blender animation
Commits
e4f8e7fd
Commit
e4f8e7fd
authored
Nov 01, 2019
by
Breno Rilho Lemos
💬
Browse files
Commit drivers.py before pushing
parent
efe37505
Changes
1
Hide whitespace changes
Inline
Side-by-side
drivers.py
View file @
e4f8e7fd
...
@@ -72,21 +72,21 @@ class dataDriver(animationDriver): # A driver for data from files.
...
@@ -72,21 +72,21 @@ class dataDriver(animationDriver): # A driver for data from files.
# Count number of lines in file = number of particles
# Count number of lines in file = number of particles
detail_file
=
open
(
filename
,
'r'
)
detail_file
=
open
(
filename
,
'r'
)
linecount
=
0
linecount
=
0
for
line
in
open
(
filename
).
readlines
(
):
linecount
+=
1
# File must be in the same directory
for
line
in
open
(
filename
).
readlines
(
):
linecount
+=
1
# File must be in the same directory
# Set number of particles
# Set number of particles
N_particles
=
linecount
N_particles
=
linecount
particles
=
[]
particles
=
[]
lines
=
detail_file
.
readlines
()
lines
=
detail_file
.
readlines
()
#loop over particles and get information from data file
#loop over particles and get information from data file
for
i
in
range
(
0
,
N_particles
):
for
i
in
range
(
0
,
N_particles
):
x
=
lines
[
i
].
split
(
' '
)[
0
]
x
=
lines
[
i
].
split
()[
0
]
y
=
lines
[
i
].
split
(
' '
)[
1
]
y
=
lines
[
i
].
split
()[
1
]
z
=
lines
[
i
].
split
(
' '
)[
2
]
z
=
lines
[
i
].
split
()[
2
]
mass
=
lines
[
i
].
split
(
' '
)[
3
]
mass
=
lines
[
i
].
split
()[
3
]
charge
=
lines
[
i
].
split
(
' '
)[
4
]
charge
=
lines
[
i
].
split
()[
4
]
Px
=
lines
[
i
].
split
(
' '
)[
5
]
Px
=
lines
[
i
].
split
()[
5
]
Py
=
lines
[
i
].
split
(
' '
)[
6
]
Py
=
lines
[
i
].
split
()[
6
]
Pz
=
lines
[
i
].
split
(
' '
)[
7
]
Pz
=
lines
[
i
].
split
()[
7
]
part
=
ParticlePropagator
(
i
,
x
,
y
,
z
,
charge
,
mass
)
part
=
ParticlePropagator
(
i
,
x
,
y
,
z
,
charge
,
mass
)
part
.
SetMagneticField
()
part
.
SetMagneticField
()
part
.
SetProperties
(
Px
,
Py
,
Pz
)
part
.
SetProperties
(
Px
,
Py
,
Pz
)
...
...
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