analyzer.modules.common.histogram_builder¶
Attributes¶
Classes¶
Abstract base class for pure result modules. |
|
Abstract base class for all analyzer modules. |
Functions¶
|
Create a histogram from column data and register it in the pipeline. |
Module Contents¶
- class analyzer.modules.common.histogram_builder.HistogramBuilder[source]¶
Bases:
analyzer.core.analysis_modules.PureResultModuleAbstract base class for pure result modules. Subclasses must implement the outputs and run methods.
- columns: list[analyzer.core.columns.Column][source]¶
- axes: list[analyzer.modules.common.axis.Axis][source]¶
- mask_col: analyzer.core.columns.Column | None = None[source]¶
- static transformToFill(fill_data, per_event_value, mask=None)[source]¶
Perform transformations to bring fill data to correct shape
- analyzer.modules.common.histogram_builder.makeHistogram(product_name: str, columns, axes: analyzer.modules.common.axis.Axis | list[analyzer.modules.common.axis.Axis], data, description=None, mask=None)[source]¶
Create a histogram from column data and register it in the pipeline.
This helper function wraps input data into temporary columns, associates them with axes definitions, and builds a histogram that can be added to the module outputs.
Parameters¶
- product_namestr
Name of the histogram/product to create.
- columnslist[Column]
Collection of event data columns where temporary columns will be stored.
- axesAxis or list of Axis
Axis (or axes) definition(s) for the histogram. Must match the dimensionality of data.
- dataarray-like or list of array-like
Data array(s) to histogram. Can be a single array or a list/tuple for multiple dimensions.
- descriptionstr, optional
Optional description for the histogram.
- maskarray-like, optional
Boolean array indicating which entries should be included in the histogram.
Returns¶
- ModuleAddition
Object encapsulating the histogram builder, ready to be added to an analyzer module’s outputs.
Notes¶
Temporary columns are created for each data array to integrate with the pipeline.
If mask is provided, it is stored in a separate column and used by the histogram builder.
- class analyzer.modules.common.histogram_builder.SimpleHistogram[source]¶
Bases:
analyzer.core.analysis_modules.AnalyzerModuleAbstract base class for all analyzer modules. Subclasses must implement the inputs and run methods.
- input_cols: list[analyzer.core.columns.Column][source]¶
- mask_cols: list[analyzer.core.columns.Column] | None = None[source]¶