EventHistograms¶
-
class EventHistograms¶
Histograms of the final (unweighted) event sample.
Filled at combine time with the nominal weight and every SystematicsCalculator variation weight, so that each observable carries its scale envelope and PDF uncertainty band alongside its central value.
Public Functions
-
EventHistograms(ContextPtr context, const std::vector<EventHistogramSpec> &specs, const std::vector<std::optional<SubprocessObservables>> &observables, double reference_weight = 0.)¶
- Parameters:
context – Context the per-subprocess observable runtimes are built on.
specs – The histograms to fill.
observables –
observables[subprocess]evaluates the histogrammed observables, in the order of the specs that are not EventHistogramSpec::from_weight, for that (unmerged) subprocess’s events; anulloptentry skips the subprocess.reference_weight – What a EventHistogramSpec::from_weight histogram divides the event weight by, so that its axis does not depend on the size of the cross section: pass the cross section (the mean event weight) and a fully unweighted sample is a spike at
Zero or non-finite means the raw weight.
-
inline const std::vector<EventHistogramSpec> &specs() const¶
The histogram definitions passed to the constructor.
-
inline std::size_t weight_count() const¶
Number of weight columns each histogram carries (nominal plus every systematic variation).
-
void fill(EventBuffer &buffer, const std::vector<double> &syst_weights, std::size_t weight_count)¶
Fill from a batch of combined events.
syst_weightsholdsweight_countvariation weights per event (row-major), as computed by SystematicsCalculator. Column 0 of the histograms is the nominal weight. Thread-safe.
-
nlohmann::json to_json(const SystematicsCalculator *systematics = nullptr) const¶
Bin contents normalized to cross sections (summing over bins gives the cross section of the corresponding weight); with
systematics, the scale envelope and the PDF uncertainty bands are added per bin.
-
EventHistograms(ContextPtr context, const std::vector<EventHistogramSpec> &specs, const std::vector<std::optional<SubprocessObservables>> &observables, double reference_weight = 0.)¶