afw.common.DileptonMassToPlot#
- class afw.common.DileptonMassToPlot(title: str, first_lepton_name: str, first_lepton_index: int, second_lepton_name: str, second_lepton_index: int)[source]#
Bases:
ThingToPlotPlot the dilepton mass of two leptons. The order doesn’t matter due to the cos and cosh functions being even.
No check is done to ensure the given lepton is present. Non-present leptons will result in a crash.
- __init__(title: str, first_lepton_name: str, first_lepton_index: int, second_lepton_name: str, second_lepton_index: int)[source]#
- Parameters:
title (
str) – The title of the overall plot.first_lepton_name (
str) – The name of the first lepton. This should match a key in events.first_lepton_index (
int) – The index of the first lepton.second_lepton_name (
str) – The name of the second lepton. This should match a key in events.second_lepton_index (
int) – The index of the second lepton.
Methods
__init__(title, first_lepton_name, ...)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
- 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