|
| __evtNumList |
| the number of events so we expect the event numbers 0..(evtNumList-1)
|
|
| __evtNumbers |
| event numbers we actually saw
|
|
Class to check that we see all events we expect exactly once and nothing else
Definition at line 20 of file parallel_processing.py.
◆ __init__()
def __init__ |
( |
|
self, |
|
|
|
evtNumList |
|
) |
| |
Remember number of events to process
Definition at line 23 of file parallel_processing.py.
23 def __init__(self, evtNumList):
24 """Remember number of events to process"""
25 super().__init__()
26
27 self.__evtNumList = evtNumList
28
29 self.__evtNumbers = []
30
◆ event()
Accumulate all event numbers we see
Definition at line 31 of file parallel_processing.py.
31 def event(self):
32 """Accumulate all event numbers we see"""
34 self.__evtNumbers.append(evtNr)
35
a (simplified) python wrapper for StoreObjPtr.
◆ terminate()
Check if event numbers are as they should be
Definition at line 36 of file parallel_processing.py.
36 def terminate(self):
37 """Check if event numbers are as they should be"""
38 seen = self.__evtNumbers
39 should = list(range(1, self.__evtNumList + 1))
40 all_numbers = sorted(set(seen) | set(should))
41 all_ok = True
42 for evtNr in all_numbers:
43 c = seen.count(evtNr)
44 if not (evtNr in should and c == 1):
45 basf2.B2ERROR(f"event number {evtNr} seen {c} times")
46 all_ok = False
47 if not all_ok:
48 basf2.B2FATAL("Missing/extra events")
49
50
◆ __evtNumbers
◆ __evtNumList
the number of events so we expect the event numbers 0..(evtNumList-1)
Definition at line 27 of file parallel_processing.py.
The documentation for this class was generated from the following file: