Data Module
The spine.data module defines the shared data structures used across the SPINE pipeline, from detector-level input records to reconstructed and truth object hierarchies.
Data structures and containers.
This module defines all core data structures used throughout the SPINE package, from low-level detector data to high-level physics objects.
Core namespaces:
larcvfor detector-level and generator-level input objects.outfor high-level reconstructed and truth objects.batchfor batched tensor, edge-index, and index containers.listfor generic list-backed containers.
Key features:
Shared base classes with merged docstrings and validation helpers.
Units metadata through the
field_unitsinterface.Serialization support for I/O and analysis workflows.
Conditional batch helpers when PyTorch is available.
Example
from spine.data import Particle, TensorBatch
particle = Particle(id=0, pid=13, momentum=[1.2, 0.5, 2.1])
batch = TensorBatch(data_list, batch_size=32)
Overview
The canonical namespaces inside spine.data are:
LArCV data structures under
spine.data.larcvfor detector records, generator truth, and metadata imported from LArCV-style sourcesOutput data structures under
spine.data.outfor reconstructed and truth fragments, particles, and interactionsBatch data structures under
spine.data.batchfor tensor, edge-index, and index batching in ML workflowsGeneric list containers under
spine.data.listfor lightweight container utilities
CRT, optical, trigger, run-information, and image-metadata classes are part of the LArCV-facing namespace in SPINE. They are detector or acquisition records, but they are not a separate top-level category outside spine.data.larcv.
LArCV Data Structures
These classes provide the low-level inputs and metadata that enter the reconstruction chain. They live canonically under spine.data.larcv and are re-exported from spine.data for convenience.
|
Particle truth information. |
|
Neutrino truth information. |
|
CRT hit information. |
|
Optical flash information. |
|
Trigger information. |
|
Run information related to a specific event. |
Output Data Structures
These classes represent the high-level object hierarchy produced by construction and refined by post-processing. Each object family has reconstructed and truth variants with shared metadata, units, and enum-aware fields inherited from common bases.
Fragment Objects
Fragments represent clusters of energy depositions that may correspond to intermediate objects in the reconstruction hierarchy.
|
Reconstructed fragment information. |
|
Truth fragment information. |
Particle Objects
Particles represent individual particles with full kinematic and identification information.
|
Reconstructed particle information. |
|
Truth particle information. |
Interaction Objects
Interactions represent complete neutrino interactions with all associated particles.
|
Reconstructed interaction information. |
|
Truth interaction information. |
Batch Data Structures
These containers support model-facing batching and unbatching for tensors, graph edges, and index collections.
|
Batched tensor with the necessary methods to slice it. |
|
Batched edge index with the necessary methods to slice it. |
|
Batched index with the necessary methods to slice it. |
Other Data Structures
Additional generic containers defined directly under spine.data.
|
List with a default object used to type it when it is empty. |