Skip to content

SoftKiller should return PseudoJets with the correct cluster_hist_index #191

@graeme-a-stewart

Description

@graeme-a-stewart

Currently SoftKiller is copying out PseudoJet objects verbatim using filter:

reduced_event = filter(jet -> pt2(jet) >= pt2cut, event)

There are two issues here:

  1. This is quite expensive, but at the moment I don't see a way to get around this: we need a real vector of clusters to then initiate jet reconstruction, which will be the next step in the chain (if we were to return, e.g., references, then we'd need to construct the clusters vector at a later stage anyway), so we're just paying a necessary cost up-front that needs to be paid.
  2. The cluster_hist_index values are wrong, because they come from the cluster order as read from read_final_state_particles.

The consequence of 2 is that the user needs to recreate the reduced_event again with the correct sequential values for the cluster_hist_index. e.g. as done here:

new_pseudo_jet = PseudoJet(JetReconstruction.px(pseudo_jet),
JetReconstruction.py(pseudo_jet),
JetReconstruction.pz(pseudo_jet),
JetReconstruction.energy(pseudo_jet);
cluster_hist_index = i)
).

This also means that the example given in the documentation is wrong as the reconstruction will crash when the @assert which checks for sequential cluster_hist_index will fail.

So we're paying the price of two copies, when we only really need one.

So, I propose that instead of using filter we loop over the event's clusters and create new clusters, with the correct linear ordering for cluster_hist_index.

N.B. for reasons of efficiency it is important to use the fully specified constructor for PseudoJet, e.g.,

new_cluster = PseudoJet(c.px, c.py, cpz, c.E, the_new_cluster_hist_index, c. _pt2, c._inv_pt2, c._rap, c._phi)

This will avoid the expensive recalculation of the internally cached values.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions