Cuts

class madspace.Cuts(*args, **kwargs)

Bases: 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

Overloaded function.

  1. __init__(self: madspace._madspace_py.Cuts, cut_data: collections.abc.Sequence[madspace._madspace_py.CutItem], custom_cut: madspace._madspace_py.CustomFunction | None = None) -> None

Parameters:
  • cut_data – The cut items to apply.

  • custom_cut – Optional user-supplied cut function.

  1. __init__(self: madspace._madspace_py.Cuts, particle_count: typing.SupportsInt, custom_cut: madspace._madspace_py.CustomFunction | None = None) -> None

Build a mask with no cut items.

Parameters:
  • particle_count – Number of external particles.

  • custom_cut – Optional user-supplied cut function.

class CutMode(*args, **kwargs)

Bases: pybind11_object

Members:

any

all

Overloaded function.

  1. __init__(self: madspace._madspace_py.Cuts.CutMode, value: typing.SupportsInt) -> None

  2. __init__(self: madspace._madspace_py.Cuts.CutMode, name: str) -> None

all = <CutMode.all: 1>
any = <CutMode.any: 0>
Cuts.CutMode.name -> str
property value
class PairMassAny

Bases: pybind11_object

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

property min

Lower bound on the invariant mass of the passing pair.

property pairs

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

all = <CutMode.all: 1>
any = <CutMode.any: 0>
dr_min(self: madspace._madspace_py.Cuts) → list[list[float]]

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

eta_max(self: madspace._madspace_py.Cuts) → list[float]

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

m_inv_min(self: madspace._madspace_py.Cuts) → list[list[float]]

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

pair_mass_any_min(self: madspace._madspace_py.Cuts) → list[madspace._madspace_py.Cuts.PairMassAny]

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

pt_min(self: madspace._madspace_py.Cuts) → list[float]

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

sqrt_s_min(self: madspace._madspace_py.Cuts) → float

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