spine.construct.particle.ParticleBuilder
- class spine.construct.particle.ParticleBuilder(mode: Literal['reco', 'truth', 'both', 'all'], units: Literal['cm', 'px'])[source]
Builds reconstructed and truth particles.
It takes the raw output of the reconstruction chain, extracts the necessary information and builds
RecoParticleandTruthParticleobjects from it.Methods
__call__(data)Build representations for a batch of data.
build_reco(data)Builds
RecoParticleobjects from the full chain output.build_truth(data)Builds
TruthParticleobjects from the full chain output.check_units(data, key[, entry])Checks that the objects in the list are expressed in the appropriate units.
construct(func, data[, entry])Prepares the input based on the required data and runs constructor.
load_reco(data)Construct
RecoParticleobjects from their stored versions.load_truth(data)Construct
TruthParticleobjects from their stored versions.process(data, mode[, entry])Build representations for a single entry.
- __init__(mode: Literal['reco', 'truth', 'both', 'all'], units: Literal['cm', 'px']) None
Initializes the builder.
- Parameters:
mode (str, default 'both') – Whether to construct reconstructed objects, true objects or both (one of ‘reco’, ‘truth’, ‘both’ or ‘all’)
units (str, default 'cm') – Units in which the position arguments of the constructed objects should be expressed (one of ‘cm’ or ‘px’)
Methods
__init__(mode, units)Initializes the builder.
build_reco(data)Builds
RecoParticleobjects from the full chain output.build_truth(data)Builds
TruthParticleobjects from the full chain output.check_units(data, key[, entry])Checks that the objects in the list are expressed in the appropriate units.
construct(func, data[, entry])Prepares the input based on the required data and runs constructor.
load_reco(data)Construct
RecoParticleobjects from their stored versions.load_truth(data)Construct
TruthParticleobjects from their stored versions.process(data, mode[, entry])Build representations for a single entry.
Attributes
- name: ClassVar[str | None] = 'particle'
- build_reco(data: dict[str, Any]) list[RecoParticle][source]
Builds
RecoParticleobjects from the full chain output.- Parameters:
data (dict) – Dictionary of data products
- build_truth(data: dict[str, Any]) list[TruthParticle][source]
Builds
TruthParticleobjects from the full chain output.- Parameters:
data (dict) – Dictionary of data products
- load_reco(data: dict[str, Any]) list[RecoParticle][source]
Construct
RecoParticleobjects from their stored versions.- Parameters:
data (dict) – Dictionary of data products
- load_truth(data: dict[str, Any]) list[TruthParticle][source]
Construct
TruthParticleobjects from their stored versions.- Parameters:
data (dict) – Dictionary of data products