Utilities
The spine.utils package collects the cross-cutting helpers that support the driver, model, reconstruction, and analysis layers. It includes optional-dependency handling, logging, factories, reconstruction-specific utilities, and numerical helpers that do not belong to a single pipeline stage.
Utility functions and tools used across the SPINE package.
This module contains reusable utility functions organized into several categories:
Core utilities:
conditionalfor optional imports such as ROOT, LArCV, MinkowskiEngine, and PyTorch.factoryandloggerfor application infrastructure.globalsfor deprecated shared-constant compatibility.
Scientific utilities:
clusterandgnnfor clustering and graph operations.particles,pid,tracking, andvertexfor reconstruction helpers.energy_lossandopticalfor detector-physics calculations.
Developer utilities:
docstringfor docstring inheritance.jitfor Numba-backed acceleration.stopwatchfor timing and profiling.unwrapandweightingfor data processing.
Most utilities are designed to be framework-agnostic where possible, with PyTorch-specific functionality clearly separated and conditionally imported.
Core Utilities
Lazy access to optional third-party dependencies. |
|
Docstring inheritance utilities. |
|
Contains functions needed to instantiate a class from a dictionary. |
|
Deprecated compatibility shim for legacy global constants imports. |
|
SPINE logging setup and rank-aware output filtering. |
|
Simple stopwatch class to track execution times of various processes. |
Physics And Reconstruction Utilities
Module of functions that approximate the energy loss of particles through matter. |
|
Functions to find the best overlaps between point sets. |
|
Various metrics used to evaluate clustering. |
|
Defines objects and methods related to optical information. |
|
Particle truth information post-processors. |
|
Module with functions/classes used to identify particle species. |
|
Module which contains utility function to process PPN information. |
|
Module which contains methods to compute class weights. |
Numerical And Graph Utilities
Module with helper functions to run inference on a model configuration. |
|
JIT compilation decorators using Numba for performance optimization. |
|
PyTorch utilities organized by functionality. |