Iteration with nested slices not implemented
I want to loop through all events that went through some filters (CutEvts
and ThresholdHits
). The placement of the filters doesn't change the result.
>>> print(f.events.trks.lik[CutEvts][ThresholdHits])
[[215, 215, 215, 215, 215, 215, 215, 215, ... 116, 116, 115, 113, 109, 108, 106]]
>>> print(f.events[CutEvts][ThresholdHits].trks.lik)
[[215, 215, 215, 215, 215, 215, 215, 215, ... 116, 116, 115, 113, 109, 108, 106]]
Now, I want to call:
for evt in f.events[CutEvts][ThresholdHits]:
# something like print(evt.trks.lik)
I get the error NotImplementedError: iteration is currently not supported with nested slices
. A solution would be to use the filters within the for loop, so
for evt in f.events:
# something like print(evt[CutEvts][ThresholdHits].trks.lik)
but this won't work. That is because the filters were calculated using all events as a basis (their length equals amount of events), not a single event.
How could this be resolved?