Construct Module

The spine.construct module converts model outputs and intermediate reconstruction products into the high-level object hierarchy used throughout SPINE analysis. Although configuration files still use the build: key for backward compatibility, the Python package name is spine.construct.

Data structure construction and analysis object building.

This module handles the construction of high-level analysis data classes from ML reconstruction outputs and provides I/O capabilities for analysis workflows.

Note:

  • Configuration files still use the build: key for backward compatibility, while the Python module is named construct.

Core construction management:

  • BuildManager coordinates object construction, truth matching, and validation.

Constructed object hierarchy:

  • RecoFragment and TruthFragment for fragment-level objects.

  • RecoParticle and TruthParticle for particle-level objects.

  • RecoInteraction and TruthInteraction for event-level hierarchies.

Example

from spine.construct import BuildManager

builder = BuildManager(fragments=True, particles=True, interactions=True)
builder(data)

interaction = data["reco_interactions"][0]
particles = interaction.particles
fragments = particles[0].fragments

This module provides the foundation for all downstream physics analysis by creating well-structured, validated analysis objects with full provenance.

Note

This module was formerly named build and configuration files still use build: for backward compatibility.

Overview

Construction is where sparse predictions become physics objects with relationships and provenance:

  • BuildManager coordinates object construction, truth matching, and validation

  • FragmentBuilder groups low-level outputs into fragment objects

  • ParticleBuilder assembles fragment-level information into particle candidates

  • InteractionBuilder builds event-level interaction hierarchies

This stage sits between model execution and post-processing, and defines the reconstructed and truth object model consumed by downstream analysis tools.

Reference

BuildManager(fragments, particles, interactions)

Manager which constructs data representations based on the chain output.

fragment.FragmentBuilder(mode, units)

Builds reconstructed and truth fragments.

particle.ParticleBuilder(mode, units)

Builds reconstructed and truth particles.

interaction.InteractionBuilder(mode, units)

Builds reconstructed and truth interactions.