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
  1. Coordinates of the reconstructed interaction vertex

Type:

np.ndarray

Attributes:
crt_ids

Returns the list of CRT hit IDs matched to this interaction.

crt_scores

Returns the list of quality metrics of CRT hits matched to this interaction.

crt_times

Returns the list of CRT hit times matched to this interaction.

depositions_adapt_q_sum

Total deposition value for the entire object in the adapted tensor and in the original units.

depositions_adapt_sum

Total deposition value for the entire object in the adapted tensor.

depositions_g4_sum

Total deposition value for the entire object in the Geant4 tensor.

depositions_q_sum

Total deposition value for the entire object in the original units.

depositions_sum

Total deposition value for the entire object.

enum_attrs

Fetches HDF5-friendly enumerator descriptors for enum-backed fields.

enum_dicts

Fetches the dictionary of enumerated attributes and their enumerator descriptors.

enum_values

Fetches reverse enum lookups from stored values to symbolic names.

field_units

Fetches the documented units for each field.

index_attrs

Return the tuple of index-bearing attributes.

interaction_mode_enum

Interpret the interaction mode under the stored interaction scheme.

interaction_type_enum

Interpret the interaction type under the stored interaction scheme.

is_crt_matched

Checks if any particle in the interaction was matched to a CRT hit.

module_ids

List of modules that contribute to this object.

num_particles

Number of particles that make up this interaction.

num_primary_particles

Number of primary particles associated with this interaction.

particle_counts

Number of particles of each PID species in this interaction.

primary_particle_counts

Number of primary particles of each PID species in this interaction.

primary_particle_ids

List of primary Particle IDs associated with this interaction.

primary_particles

List of primary particles associated with this interaction.

size

Total number of voxels that make up the object.

size_adapt

Total number of voxels that make up the object in the adapted tensor.

size_g4

Total number of voxels that make up the object in the Geant4 tensor.

topology

String 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_x

cathode_offset

creation_process

crt_ids

Returns the list of CRT hit IDs matched to this interaction.

crt_scores

Returns the list of quality metrics of CRT hits matched to this interaction.

crt_times

Returns the list of CRT hit times matched to this interaction.

current_type

depositions_adapt_q_sum

Total deposition value for the entire object in the adapted tensor and in the original units.

depositions_adapt_sum

Total deposition value for the entire object in the adapted tensor.

depositions_g4_sum

Total deposition value for the entire object in the Geant4 tensor.

depositions_q_sum

Total deposition value for the entire object in the original units.

depositions_sum

Total deposition value for the entire object.

distance_travel

energy_init

energy_transfer

enum_attrs

Fetches HDF5-friendly enumerator descriptors for enum-backed fields.

enum_dicts

Fetches the dictionary of enumerated attributes and their enumerator descriptors.

enum_values

Fetches reverse enum lookups from stored values to symbolic names.

field_units

Fetches the documented units for each field.

flash_hypo_pe

flash_total_pe

hadronic_invariant_mass

id

index_attrs

Return the tuple of index-bearing attributes.

inelasticity

interaction_id

interaction_mode

interaction_mode_enum

Interpret the interaction mode under the stored interaction scheme.

interaction_scheme

interaction_type

interaction_type_enum

Interpret the interaction type under the stored interaction scheme.

is_cathode_crosser

is_contained

is_crt_matched

Checks if any particle in the interaction was matched to a CRT hit.

is_fiducial

is_flash_matched

is_matched

is_time_contained

is_truth

lepton_p

lepton_pdg_code

lepton_track_id

mct_index

module_ids

List of modules that contribute to this object.

momentum_transfer

momentum_transfer_mag

nu_id

nucleon

num_particles

Number of particles that make up this interaction.

num_primary_particles

Number of primary particles associated with this interaction.

orig_id

particle_counts

Number of particles of each PID species in this interaction.

pdg_code

primary_particle_counts

Number of primary particles of each PID species in this interaction.

primary_particle_ids

List of primary Particle IDs associated with this interaction.

primary_particles

List of primary particles associated with this interaction.

quark

size

Total number of voxels that make up the object.

size_adapt

Total number of voxels that make up the object in the adapted tensor.

size_g4

Total number of voxels that make up the object in the Geant4 tensor.

t

target

theta

topology

String representing the interaction topology.

track_id

units

particles

reco_vertex

position

momentum

particle_ids

vertex

flash_ids

flash_volume_ids

flash_times

flash_scores

index

orig_index

points

depositions

sources

match_ids

match_overlaps

index_adapt

index_g4

points_adapt

points_g4

depositions_q

depositions_adapt

depositions_adapt_q

depositions_g4

sources_adapt

nu_id: int = -1
particles: list[TruthParticle]
reco_vertex: ndarray
attach_neutrino(neutrino) None[source]

Attach neutrino generator information to this interaction.

Parameters:

neutrino (Neutrino) – Neutrino to fetch the attributes from