Open
Description
Currently, using jet substructure functions that take constituents as input requires the following repetitive pattern:
jetdef = fastjet.JetDefinition(fastjet.antikt_algorithm, 0.8)
jet_cluster = fastjet._pyjet.AwkwardClusterSequence(array, jetdef)
constituents = jet_cluster.constituents()
constituents_cluster = fastjet._pyjet.AwkwardClusterSequence(constituents, jetdef)
result = constituents_cluster.njettiness()
This could be streamlined as follows: (using the example from #336)
In _pyjet.py
:
def constituents(self, min_pt=0, cluster=False):
result = self._internalrep.constituents(min_pt)
if cluster:
return AwkwardClusterSequence(result, self._jetdef)
else:
return result
and then in the user code:
constituents_cluster = jet_cluster.constituents(cluster=True)
result = constituents_cluster.njettiness()
Note from @lgray:
this will require some care with the dask implementation since we have to avoid accidentally sending the client side cluster sequence to a node.
Metadata
Metadata
Assignees
Labels
No labels