afw.common.NJetToPlot#

class afw.common.NJetToPlot[source]#

Bases: ThingToPlot

Plot a the number of jets in each event

__init__()[source]#
Parameters:

title (str) – The title of the overall plot

Methods

__init__()

create_histogram()

Create a histogram for the given thing to plot.

fill_histogram(histogram, events, dataset, ...)

Fill a histogram with a given set of events, post-selection

plot_histogram(histogram, output_file)

Plot a filled histogram to a given file

create_histogram() Hist[source]#

Create a histogram for the given thing to plot.

Returns:

A histogram.

Return type:

hist.Hist

fill_histogram(histogram: Hist, events: Array, dataset: str, weights: Array, **kwargs: dict[Array]) Hist[source]#

Fill a histogram with a given set of events, post-selection

Parameters:
  • events (ak.Array) – Events post-selection

  • dataset (str) – The dataset for which the events belong

  • weights (ak.Array) – A one-dimensional array with the same length as events

Returns:

A histogram with filled data

Return type:

hist.Hist

plot_histogram(histogram: Hist, output_file: str) None[source]#

Plot a filled histogram to a given file

Parameters:
  • histogram (hist.Hist) – The filled histogram to plot.

  • output_file (str) – The output file, given as an absolute path.

  • **kwargs (dict | None) – A set of keyword arguments created in by the analysis config.

Returns:

None