Skip to content

Combinations within an array of p4 vectors #107

Answered by jpivarski
srosenzweig09 asked this question in Q&A
Discussion options

You must be logged in to vote

The default axis for ak.combinations is 1 because a typical use-case is lists of particles per event. I don't think that's the data type you're building—since signal consists of records ({"pt": pt, "eta": eta, "phi": phi, "mass": mass}) and not lists of records, axis=1 is beyond the depth of this array.

If I'm interpreting the data type correctly, axis=0 would work for this array, but the idea is not to find all combinations of particles in a single event, it's to find all combinations of particles in all events, with a single function call.

Instead of putting this inside an event loop, collect all your data as lists of vectors in all events (one list per event). Then call ak.combinations

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@srosenzweig09
Comment options

@jpivarski
Comment options

@srosenzweig09
Comment options

@jpivarski
Comment options

@srosenzweig09
Comment options

Answer selected by Saransh-cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants