Skip to content

Commit

Permalink
make the EventSeeker work again using: self._next_header_pos
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Neise committed Jan 31, 2019
1 parent da1ffbe commit a1bcb83
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions eventio/simtel/simtelfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ def __init__(self, path, allowed_telescopes=None):
while self.current_mc_shower is None:
self.next_low_level()

self._first_event_byte = self.tell()

def __iter__(self):
return self.iter_array_events()

Expand Down Expand Up @@ -146,6 +148,7 @@ def next_low_level(self):
)

def iter_mc_events(self):
self._next_header_pos = self._first_event_byte
while True:
try:
next_event = self.try_build_mc_event()
Expand All @@ -166,6 +169,7 @@ def try_build_mc_event(self):
return event_data

def iter_array_events(self):
self._next_header_pos = self._first_event_byte
while True:
try:
next_event = self.try_build_event()
Expand Down

0 comments on commit a1bcb83

Please sign in to comment.