Cuts

class Cuts : public madspace::FunctionGenerator

Fiducial phase-space cuts, as a compute-graph acceptance mask.

Builds a per-event mask (1 for events passing every cut, 0 otherwise) from a list of cut items [1]. Each item evaluates one Observable for its particle selection and requires the result to lie in [min, max]. When the selection yields several values, CutMode decides whether all or any of them must pass. See Sec. 3.2.4 of [1]. An optional CustomFunction of type CustomFunction::cut multiplies its value into the mask.

The accessors re-expose the active lower bounds in the layout the phase-space mappings consume. pt_min() and eta_max() are indexed by outgoing particle, with index 0 the first outgoing particle and the two beams excluded. m_inv_min() and dr_min() are symmetric n_out * n_out matrices indexed by outgoing-particle pair. A bound of 0, or infinity for eta_max(), means the cut is inactive. Only bounds that every selected object must satisfy are reported: an ordered selection (a rank, not a particle) or a CutMode::any cut over several objects stays a filter.

batch is the leading batch dimension. n_particles counts the incoming and outgoing particles.

Arguments

  • momenta – float, shape (batch, n_particles, 4) – the event momenta.

Returns

  • mask – float, shape (batch,) – 1 if every cut is satisfied, else 0.

References

Public Types

enum CutMode

Whether all or at least one of a multi-object selection must pass.

Values:

enumerator any
enumerator all

Public Functions

Cuts(const std::vector<CutItem> &cut_data, const std::optional<CustomFunction> &custom_cut = std::nullopt)
Parameters:
  • cut_data – The cut items to apply.

  • custom_cut – Optional user-supplied cut function.

Cuts(std::size_t particle_count, const std::optional<CustomFunction> &custom_cut = std::nullopt)

Build a mask with no cut items.

Parameters:
  • particle_count – Number of external particles.

  • custom_cut – Optional user-supplied cut function.

double sqrt_s_min() const

Largest required partonic center-of-mass energy, or 0 if unconstrained.

std::vector<double> eta_max() const

Per-outgoing-particle maximum pseudorapidity (infinity where inactive).

std::vector<double> pt_min() const

Per-outgoing-particle minimum transverse momentum (0 where inactive).

std::vector<std::vector<double>> m_inv_min() const

Symmetric matrix of minimum pair invariant masses (0 where inactive).

std::vector<std::vector<double>> dr_min() const

Symmetric matrix of minimum pair delta_r separations (0 where inactive).

std::vector<PairMassAny> pair_mass_any_min() const

The CutMode::any pair mass cuts over several pairs, which bound no pair in particular and are therefore absent from m_inv_min().

struct CutItem

One entry in a Cuts list: an Observable and its allowed range.

Public Members

Observable observable

The observable to test.

double min

Lower bound (default: none).

double max

Upper bound (default: none).

CutMode mode

Whether all or any selected objects must satisfy the bound.

struct PairMassAny

A pair mass cut with CutMode::any over several pairs: at least one of pairs (outgoing indices, beams excluded) has invariant mass >= min.

Public Members

std::vector<std::pair<std::size_t, std::size_t>> pairs

The pairs, as outgoing indices; one of them has to pass.

double min

Lower bound on the invariant mass of the passing pair.