ObservableHistograms

class madspace.ObservableHistograms(self: madspace._madspace_py.ObservableHistograms, observables: collections.abc.Sequence[madspace._madspace_py.HistItem])

Bases: FunctionGenerator

Weighted histograms filled during event generation.

Evaluates one Observable per HistItem and accumulates the event weight and its square into a fixed binning [1]. For a fixed number of integrand evaluations these carry smaller statistical uncertainties than histograms filled from unweighted events. On GPUs only the binned data is copied to the host (Sec. 3.2.5 of [1]).

batch is the leading batch dimension. i indexes the histograms. Each histogram has bin_count + 2 entries: one underflow and one overflow bin.

Arguments

  • weight – float, shape (batch,) – the per-event weight.

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

Returns

  • values_i – float, shape (bin_count + 2,) – summed weight per bin.

  • square_values_i – float, shape (bin_count + 2,) – summed squared weight per bin.

References

Parameters:

observables – The histograms to fill.

observables(self: madspace._madspace_py.ObservableHistograms) → list[madspace._madspace_py.HistItem]

The histogram definitions passed to the constructor.