Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/graphnet/data/dataconverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def _launch_jobs(
self._process_file,
tqdm(input_files, unit=" file(s)", colour="green"),
):
self.debug("processing file.")
pass
self._update_shared_variables(pool)

@final
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Extract the highest energy particle in the event."""

from typing import Dict, Any, TYPE_CHECKING, Tuple, Union, List

from copy import deepcopy

from .i3extractor import I3Extractor
from .utilities.gcd_hull import GCD_hull
Expand Down Expand Up @@ -198,6 +198,8 @@ def get_tracks(
)
MMCTrackList = np.array(MMCTrackList)

assert len(MuonGun_tracks) == len(MMCTrackList), "Length mismatch"

return (
MuonGun_tracks,
MMCTrackList,
Expand Down Expand Up @@ -240,7 +242,7 @@ def get_bundle_HEP(
).T
loc_max = np.argmax(energies)
# Inherit from the highest energy particle
bundle = particles[loc_max]
bundle = deepcopy(particles[loc_max])

intersections = self.hull.surface.intersection(bundle.pos, bundle.dir)

Expand Down Expand Up @@ -271,6 +273,9 @@ def highest_energy_track(
containment = -1

MuonGun_tracks, MMCTrackList = self.get_tracks(frame)
assert len(MuonGun_tracks) == len(
MMCTrackList
), f"MuonGun and MCTracklist have different lengths in {frame['I3EventHeader']}"

energies = np.array([track.energy for track in MuonGun_tracks])

Expand Down Expand Up @@ -308,7 +313,7 @@ def highest_energy_track(
while len(energies) > 0:
loc = np.argmax(energies)
track = MMCTrackList[loc]
track_particle = track_particles[loc]
track_particle = deepcopy(track_particles[loc])
length = lengths[loc]
energies = np.delete(energies, loc)
MMCTrackList = np.delete(MMCTrackList, loc)
Expand Down Expand Up @@ -478,7 +483,7 @@ def highest_energy_starting( # noqa: C901

# Move the particle position to the interaction vertex.
HE_loc = np.argmax(energies)
entry_particle = particles[HE_loc]
entry_particle = deepcopy(particles[HE_loc])
entry_particle.pos = dataclasses.I3Position(
pos[HE_loc][0], pos[HE_loc][1], pos[HE_loc][2]
)
Expand Down
Loading