spine.data.out.TruthInteraction
- class spine.data.out.TruthInteraction(orig_id: int = -1, is_truth: bool = True, index_adapt: ndarray = <factory>, index_g4: ndarray = <factory>, points_adapt: ndarray = <factory>, points_g4: ndarray = <factory>, depositions_q: ndarray = <factory>, depositions_adapt: ndarray = <factory>, depositions_adapt_q: ndarray = <factory>, depositions_g4: ndarray = <factory>, sources_adapt: ndarray = <factory>, units: str = 'cm', id: int = -1, is_contained: bool = False, is_time_contained: bool = False, is_cathode_crosser: bool = False, is_matched: bool = False, cathode_offset: float = nan, index: ndarray = <factory>, orig_index: ndarray = <factory>, points: ndarray = <factory>, depositions: ndarray = <factory>, sources: ndarray = <factory>, match_ids: ndarray = <factory>, match_overlaps: ndarray = <factory>, is_fiducial: bool = False, is_flash_matched: bool = False, flash_total_pe: float = nan, flash_hypo_pe: float = nan, particles: list[TruthParticle] = <factory>, particle_ids: ndarray = <factory>, vertex: ndarray = <factory>, flash_ids: ndarray = <factory>, flash_volume_ids: ndarray = <factory>, flash_times: ndarray = <factory>, flash_scores: ndarray = <factory>, interaction_id: int = -1, current_type: int = -1, interaction_scheme: int = -1, interaction_mode: int = -1, interaction_type: int = -1, mct_index: int = -1, track_id: int = -1, lepton_track_id: int = -1, pdg_code: int = -1, lepton_pdg_code: int = -1, target: int = -1, nucleon: int = -1, quark: int = -1, energy_init: float = nan, hadronic_invariant_mass: float = nan, momentum_transfer: float = nan, momentum_transfer_mag: float = nan, energy_transfer: float = nan, lepton_p: float = nan, distance_travel: float = nan, t: float = nan, theta: float = nan, bjorken_x: float = nan, inelasticity: float = nan, creation_process: str = '', position: ndarray = <factory>, momentum: ndarray = <factory>, nu_id: int = -1, reco_vertex: ndarray = <factory>)[source]
Truth interaction information.
This inherits all of the attributes of
Interaction, which contains the G4 truth information for the interaction.- particles
List of particles that make up the interaction
- Type:
List[TruthParticle]
- nu_id
Index of the neutrino matched to this interaction
- Type:
int
- reco_vertex
Coordinates of the reconstructed interaction vertex
- Type:
np.ndarray
- Attributes:
crt_idsReturns the list of CRT hit IDs matched to this interaction.
crt_scoresReturns the list of quality metrics of CRT hits matched to this interaction.
crt_timesReturns the list of CRT hit times matched to this interaction.
depositions_adapt_q_sumTotal deposition value for the entire object in the adapted tensor and in the original units.
depositions_adapt_sumTotal deposition value for the entire object in the adapted tensor.
depositions_g4_sumTotal deposition value for the entire object in the Geant4 tensor.
depositions_q_sumTotal deposition value for the entire object in the original units.
depositions_sumTotal deposition value for the entire object.
enum_attrsFetches HDF5-friendly enumerator descriptors for enum-backed fields.
enum_dictsFetches the dictionary of enumerated attributes and their enumerator descriptors.
enum_valuesFetches reverse enum lookups from stored values to symbolic names.
field_unitsFetches the documented units for each field.
index_attrsReturn the tuple of index-bearing attributes.
interaction_mode_enumInterpret the interaction mode under the stored interaction scheme.
interaction_type_enumInterpret the interaction type under the stored interaction scheme.
is_crt_matchedChecks if any particle in the interaction was matched to a CRT hit.
module_idsList of modules that contribute to this object.
num_particlesNumber of particles that make up this interaction.
num_primary_particlesNumber of primary particles associated with this interaction.
particle_countsNumber of particles of each PID species in this interaction.
primary_particle_countsNumber of primary particles of each PID species in this interaction.
primary_particle_idsList of primary Particle IDs associated with this interaction.
primary_particlesList of primary particles associated with this interaction.
sizeTotal number of voxels that make up the object.
size_adaptTotal number of voxels that make up the object in the adapted tensor.
size_g4Total number of voxels that make up the object in the Geant4 tensor.
topologyString representing the interaction topology.
Methods
as_dict([lite, include_derived])Returns the data class as dictionary of (key, value) pairs.
attach_neutrino(neutrino)Attach neutrino generator information to this interaction.
attr_names([include_derived, ...])Return the names of valid attributes on this data class.
from_dict(cls_dict)Builds and returns an object of the class from a dictionary of attributes.
from_larcv(neutrino[, interaction_scheme])Builds and returns a Neutrino object from a LArCV Neutrino object.
from_particles(particles)Builds an Interaction instance from its constituent Particle objects.
reset_cathode_crosser()Resets the cathode crossing information for the object.
reset_flash_match()Reset all the flash matching attributes.
reset_match()Resets the reco/truth matching information for the object.
scalar_dict([attrs, lengths, lite])Returns the data class attributes as a dictionary of scalars.
set_precision([precision])Casts all the vector attributes to a different precision.
shift_indexes(shifts)Apply offsets to index attributes in place.
to_cm(meta)Converts the coordinates of the positional attributes to cm in place.
to_px(meta)Converts the coordinates of the positional attributes to pixel in place.
value_with_units(attr)Fetch an attribute value with its documented units.
- __init__(orig_id: int = -1, is_truth: bool = True, index_adapt: ndarray = <factory>, index_g4: ndarray = <factory>, points_adapt: ndarray = <factory>, points_g4: ndarray = <factory>, depositions_q: ndarray = <factory>, depositions_adapt: ndarray = <factory>, depositions_adapt_q: ndarray = <factory>, depositions_g4: ndarray = <factory>, sources_adapt: ndarray = <factory>, units: str = 'cm', id: int = -1, is_contained: bool = False, is_time_contained: bool = False, is_cathode_crosser: bool = False, is_matched: bool = False, cathode_offset: float = nan, index: ndarray = <factory>, orig_index: ndarray = <factory>, points: ndarray = <factory>, depositions: ndarray = <factory>, sources: ndarray = <factory>, match_ids: ndarray = <factory>, match_overlaps: ndarray = <factory>, is_fiducial: bool = False, is_flash_matched: bool = False, flash_total_pe: float = nan, flash_hypo_pe: float = nan, particles: list[TruthParticle] = <factory>, particle_ids: ndarray = <factory>, vertex: ndarray = <factory>, flash_ids: ndarray = <factory>, flash_volume_ids: ndarray = <factory>, flash_times: ndarray = <factory>, flash_scores: ndarray = <factory>, interaction_id: int = -1, current_type: int = -1, interaction_scheme: int = -1, interaction_mode: int = -1, interaction_type: int = -1, mct_index: int = -1, track_id: int = -1, lepton_track_id: int = -1, pdg_code: int = -1, lepton_pdg_code: int = -1, target: int = -1, nucleon: int = -1, quark: int = -1, energy_init: float = nan, hadronic_invariant_mass: float = nan, momentum_transfer: float = nan, momentum_transfer_mag: float = nan, energy_transfer: float = nan, lepton_p: float = nan, distance_travel: float = nan, t: float = nan, theta: float = nan, bjorken_x: float = nan, inelasticity: float = nan, creation_process: str = '', position: ndarray = <factory>, momentum: ndarray = <factory>, nu_id: int = -1, reco_vertex: ndarray = <factory>) None
Methods
__init__(orig_id, is_truth, index_adapt, ...)as_dict([lite, include_derived])Returns the data class as dictionary of (key, value) pairs.
attach_neutrino(neutrino)Attach neutrino generator information to this interaction.
attr_names([include_derived, ...])Return the names of valid attributes on this data class.
from_dict(cls_dict)Builds and returns an object of the class from a dictionary of attributes.
from_larcv(neutrino[, interaction_scheme])Builds and returns a Neutrino object from a LArCV Neutrino object.
from_particles(particles)Builds an Interaction instance from its constituent Particle objects.
reset_cathode_crosser()Resets the cathode crossing information for the object.
reset_flash_match()Reset all the flash matching attributes.
reset_match()Resets the reco/truth matching information for the object.
scalar_dict([attrs, lengths, lite])Returns the data class attributes as a dictionary of scalars.
set_precision([precision])Casts all the vector attributes to a different precision.
shift_indexes(shifts)Apply offsets to index attributes in place.
to_cm(meta)Converts the coordinates of the positional attributes to cm in place.
to_px(meta)Converts the coordinates of the positional attributes to pixel in place.
value_with_units(attr)Fetch an attribute value with its documented units.
Attributes
bjorken_xcathode_offsetcreation_processcrt_idsReturns the list of CRT hit IDs matched to this interaction.
crt_scoresReturns the list of quality metrics of CRT hits matched to this interaction.
crt_timesReturns the list of CRT hit times matched to this interaction.
current_typedepositions_adapt_q_sumTotal deposition value for the entire object in the adapted tensor and in the original units.
depositions_adapt_sumTotal deposition value for the entire object in the adapted tensor.
depositions_g4_sumTotal deposition value for the entire object in the Geant4 tensor.
depositions_q_sumTotal deposition value for the entire object in the original units.
depositions_sumTotal deposition value for the entire object.
distance_travelenergy_initenergy_transferenum_attrsFetches HDF5-friendly enumerator descriptors for enum-backed fields.
enum_dictsFetches the dictionary of enumerated attributes and their enumerator descriptors.
enum_valuesFetches reverse enum lookups from stored values to symbolic names.
field_unitsFetches the documented units for each field.
flash_hypo_peflash_total_pehadronic_invariant_massidindex_attrsReturn the tuple of index-bearing attributes.
inelasticityinteraction_idinteraction_modeinteraction_mode_enumInterpret the interaction mode under the stored interaction scheme.
interaction_schemeinteraction_typeinteraction_type_enumInterpret the interaction type under the stored interaction scheme.
is_cathode_crosseris_containedis_crt_matchedChecks if any particle in the interaction was matched to a CRT hit.
is_fiducialis_flash_matchedis_matchedis_time_containedis_truthlepton_plepton_pdg_codelepton_track_idmct_indexmodule_idsList of modules that contribute to this object.
momentum_transfermomentum_transfer_magnucleonnum_particlesNumber of particles that make up this interaction.
num_primary_particlesNumber of primary particles associated with this interaction.
orig_idparticle_countsNumber of particles of each PID species in this interaction.
pdg_codeprimary_particle_countsNumber of primary particles of each PID species in this interaction.
primary_particle_idsList of primary Particle IDs associated with this interaction.
primary_particlesList of primary particles associated with this interaction.
quarksizeTotal number of voxels that make up the object.
size_adaptTotal number of voxels that make up the object in the adapted tensor.
size_g4Total number of voxels that make up the object in the Geant4 tensor.
ttargetthetatopologyString representing the interaction topology.
track_idunitspositionmomentumparticle_idsvertexflash_idsflash_volume_idsflash_timesflash_scoresindexorig_indexpointsdepositionssourcesmatch_idsmatch_overlapsindex_adaptindex_g4points_adaptpoints_g4depositions_qdepositions_adaptdepositions_adapt_qdepositions_g4sources_adapt- nu_id: int = -1
- particles: list[TruthParticle]
- reco_vertex: ndarray