From bcc7deae028d71df0da163344400c4f6dac21364 Mon Sep 17 00:00:00 2001 From: Nikolai Hartmann Date: Tue, 22 Aug 2023 14:25:51 +0200 Subject: [PATCH] flat calling structure for trackParticle(s) behavior methods --- src/coffea/nanoevents/methods/physlite.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/coffea/nanoevents/methods/physlite.py b/src/coffea/nanoevents/methods/physlite.py index 5b1cbe50b6..72ca50165e 100644 --- a/src/coffea/nanoevents/methods/physlite.py +++ b/src/coffea/nanoevents/methods/physlite.py @@ -204,12 +204,12 @@ def trackParticles(self, _dask_array_=None): @property def trackParticle(self, _dask_array_=None): - if _dask_array_ is not None: - self = _dask_array_ # TODO: is this what i should be doing? - trackParticles = self.trackParticles - return self.trackParticles[ - tuple([slice(None) for i in range(trackParticles.ndim - 1)] + [0]) - ] + trackParticles = _element_link_method( + self, "trackParticleLinks", "GSFTrackParticles", _dask_array_ + ) + # Ellipsis (..., 0) slicing not supported yet by dask_awkward + slicer = tuple([slice(None) for i in range(trackParticles.ndim - 1)] + [0]) + return trackParticles[slicer] @property def caloClusters(self, _dask_array_=None):