ObservableHistograms

class ObservableHistograms : public madspace::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

Public Functions

ObservableHistograms(const std::vector<HistItem> &observables)
Parameters:

observables – The histograms to fill.

inline const std::vector<HistItem> &observables() const

The histogram definitions passed to the constructor.

struct HistItem

One histogram: an Observable and its binning.

Public Members

Observable observable

The observable to bin.

double min

Lower edge of the first bin.

double max

Upper edge of the last bin.

std::size_t bin_count

Number of bins between min and max (excluding under/overflow).