spine.construct.BuildManager
- class spine.construct.BuildManager(fragments: bool, particles: bool, interactions: bool, mode: Literal['reco', 'truth', 'both', 'all'] = 'both', units: Literal['cm', 'px'] = 'cm', sources: dict[str, str | tuple[str, ...] | list[str]] | None = None, lite: bool = False)[source]
Manager which constructs data representations based on the chain output.
- Takes care of two scenarios:
Interpret the raw output of the reconstruction chain
Load up existing objects stored as dictionaries
Methods
__call__(data)Build the representations for one entry.
build_sources(data[, entry])Construct the reference coordinate and value tensors used by all the representations built by the module.
load_match_pairs(data, name[, entry])Generate lists of matched object pairs from stored matches.
- __init__(fragments: bool, particles: bool, interactions: bool, mode: Literal['reco', 'truth', 'both', 'all'] = 'both', units: Literal['cm', 'px'] = 'cm', sources: dict[str, str | tuple[str, ...] | list[str]] | None = None, lite: bool = False) None[source]
Initializes the build manager.
- Parameters:
fragments (bool) – Build/load RecoFragment/TruthFragment objects
particles (bool) – Build/load RecoParticle/TruthParticle objects
interactions (bool) – Build/load RecoInteraction/TruthInteraction objects
mode (str, default 'both') – Whether to construct reconstructed objects, true objects or both
sources (Dict[str, str], optional) – Dictionary which maps the necessary data products onto a name in the input/output dictionary of the reconstruction chain.
lite (bool, default False) – If True, the objects being loaded are lite and do not map to long-form attributes. Simply load the matches.
Methods
__init__(fragments, particles, interactions)Initializes the build manager.
build_sources(data[, entry])Construct the reference coordinate and value tensors used by all the representations built by the module.
load_match_pairs(data, name[, entry])Generate lists of matched object pairs from stored matches.
- build_sources(data: dict[str, Any], entry: int | None = None) dict[str, Any][source]
Construct the reference coordinate and value tensors used by all the representations built by the module.
These objects should be stored along with the constructed objects if the objects are to be loaded later on.
- Parameters:
data (dict) – Dictionary of input data and model outputs
entry (int, optional) – Entry number
- static load_match_pairs(data: dict[str, Any], name: str, entry: int | None = None) dict[str, list[Any]][source]
Generate lists of matched object pairs from stored matches.
- Parameters:
data (dict) – Dictionary of input data and model outputs
name (str) – Object type name
entry (int, optional) – Entry number