diff --git a/km3io/rootio.py b/km3io/rootio.py index ce03603439fe265ddd0d080a8503601c929602e0..a5e48564cb524652819c7fc08107259c558a681f 100644 --- a/km3io/rootio.py +++ b/km3io/rootio.py @@ -187,6 +187,15 @@ class Branch: self._branch[self._keymap['id']].lazyarray( basketcache=BASKET_CACHE), self._index_chain)) + @property + def is_single(self): + """Returns True when a single branch is selected.""" + if len(self._index_chain) > 0: + if isinstance(self._index_chain[-1], (int, np.int32, np.int64)): + return True + return False + + def __iter__(self): self._iterator_index = 0 return self