RectangularBin¶
-
class
remu.binning.
RectangularBin
(**kwargs)[source]¶ Bases:
remu.binning.Bin
A Bin defined by min and max values in all variables.
Parameters: - edges : dict
A dict of
{'varname': (lower_edge, upper_edge)}
- include_lower : bool, optional
Does the bin include the lower edges? Default:
True
- include_upper: bool, optional
Does the bin include the upper edges? Default:
False
-
entries
¶ The number of entries in the bin.
-
event_in_bin
(event)[source]¶ Check whether an event is within all bin edges.
Parameters: - event : dict like
A dictionary (or similar object) with one value of each variable in the binning, e.g.:
{'x': 1.4, 'y': -7.47}
Returns: - bool
Whether or not the variable combination lies within the bin.
-
fill
(weight=1.0)¶ Add the weight(s) to the bin.
Also increases the number of entries and sum of squared weights accordingly.
Parameters: - weight : float or iterable of floats, optional
Weight(s) to be added to the value of the bin.
-
get_center
()[source]¶ Return the bin center coordinates.
Returns: - dict
The center coordinates for each variable.
-
sumw2
¶ The sum of squared weights in the bin.
-
value
¶ The value of the bin.
The sum of weights.