IAP GITLAB

Skip to content
Snippets Groups Projects
Commit af4659cd authored by Marvin Gottowik's avatar Marvin Gottowik
Browse files

Merge branch '714-first_interactions-py-crash' into 'master'

Resolve "first_interactions.py crash"

Closes #714

See merge request !654
parents 39f02fd0 fca1df3c
No related branches found
No related tags found
1 merge request!654Resolve "first_interactions.py crash"
Pipeline #14290 passed
...@@ -461,5 +461,6 @@ python-examples: ...@@ -461,5 +461,6 @@ python-examples:
- cd ${CI_PROJECT_DIR}/python/examples - cd ${CI_PROJECT_DIR}/python/examples
- python3 particle_distribution.py --input-dir $EXAMPLE_SHOWER_DIR - python3 particle_distribution.py --input-dir $EXAMPLE_SHOWER_DIR
- python3 shower_profile.py --input-dir $EXAMPLE_SHOWER_DIR - python3 shower_profile.py --input-dir $EXAMPLE_SHOWER_DIR
- python3 first_interactions.py --input-dir $EXAMPLE_SHOWER_DIR
- export EXAMPLE_RADIO_SHOWER_DIR=${CI_PROJECT_DIR}/build/build_examples/example_outputs/radio_em_shower_outputs - export EXAMPLE_RADIO_SHOWER_DIR=${CI_PROJECT_DIR}/build/build_examples/example_outputs/radio_em_shower_outputs
- python3 radio_emission.py --input-dir $EXAMPLE_RADIO_SHOWER_DIR - python3 radio_emission.py --input-dir $EXAMPLE_RADIO_SHOWER_DIR
...@@ -36,9 +36,6 @@ class FirstInteraction(Particle): ...@@ -36,9 +36,6 @@ class FirstInteraction(Particle):
""" """
Particle.__init__(self, prop_dict) Particle.__init__(self, prop_dict)
# need to define for momentum prop
self.px = self.py = self.pz = None
def __repr__(self) -> str: def __repr__(self) -> str:
""" """
Return a string representation of this class. Return a string representation of this class.
......
...@@ -34,6 +34,7 @@ class Particle(object): ...@@ -34,6 +34,7 @@ class Particle(object):
# need to define for position/direction functions # need to define for position/direction functions
self.x = self.y = self.z = None self.x = self.y = self.z = None
self.nx = self.ny = self.nz = None self.nx = self.ny = self.nz = None
self.px = self.py = self.pz = None
# wrap the files of the dictionary so that there is a property # wrap the files of the dictionary so that there is a property
# assigned to each value, i.e. print(my_primary.pdg) # assigned to each value, i.e. print(my_primary.pdg)
......
...@@ -54,7 +54,6 @@ for ish, sh_id in enumerate(shower_ids): ...@@ -54,7 +54,6 @@ for ish, sh_id in enumerate(shower_ids):
daughters = interactions[interactions["shower"] == sh_id] daughters = interactions[interactions["shower"] == sh_id]
mother = projectiles[ish] mother = projectiles[ish]
norm = np.sqrt(sum(np.array(mother.momentum) ** 2)) # total momentum
print("Plotting shower", sh_id) print("Plotting shower", sh_id)
print(mother) print(mother)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment