spine.data.out.TruthFragment

class spine.data.out.TruthFragment(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>, particle_id: int = -1, interaction_id: int = -1, is_primary: bool = False, length: float = nan, shape: int = -1, start_point: ndarray = <factory>, end_point: ndarray = <factory>, parent_id: int = -1, group_id: int = -1, nu_id: int = -1, children_id: ndarray = <factory>, mct_index: int = -1, mcst_index: int = -1, group_primary: int = -1, interaction_primary: int = -1, track_id: int = -1, parent_track_id: int = -1, ancestor_track_id: int = -1, pdg_code: int = -1, parent_pdg_code: int = -1, ancestor_pdg_code: int = -1, num_voxels: int = -1, t: float = nan, end_t: float = nan, parent_t: float = nan, ancestor_t: float = nan, energy_init: float = nan, energy_deposit: float = nan, distance_travel: float = nan, creation_process: str = '', parent_creation_process: str = '', ancestor_creation_process: str = '', pid: int = -1, position: ndarray = <factory>, end_position: ndarray = <factory>, parent_position: ndarray = <factory>, ancestor_position: ndarray = <factory>, first_step: ndarray = <factory>, last_step: ndarray = <factory>, momentum: ndarray = <factory>, end_momentum: ndarray = <factory>, orig_interaction_id: int = -1, orig_parent_id: int = -1, orig_group_id: int = -1, orig_children_id: ndarray = <factory>, children_counts: ndarray = <factory>, reco_start_dir: ndarray = <factory>, reco_end_dir: ndarray = <factory>)[source]

Truth fragment information.

This inherits all of the attributes of Particle, which contains the G4 truth information for the fragment.

orig_interaction_id

Unaltered index of the interaction in the original MC particle list

Type:

int

orig_parent_id

Unaltered index of the particle parent in the original MC particle list

Type:

int

orig_group_id

Unaltered index of the particle group in the original MC particle list

Type:

int

orig_children_id

Unaltered list of the particle children in the original MC particle list

Type:

np.ndarray

children_counts
  1. Number of truth child fragment of each shape

Type:

np.ndarray

reco_length

Reconstructed length of the fragment (only assigned to track objects)

Type:

float

reco_start_dir
  1. Particle direction estimate w.r.t. the start point

Type:

np.ndarray

reco_end_dir

(3) Particle direction estimate w.r.t. the end point (only assigned to track objects)

Type:

np.ndarray

Attributes:
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.

end_dir

Converts the final momentum to a direction vector.

end_p

Computes the magnitude of the final momentum.

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.

mass

Computes the rest mass of the particle from its energy/momentum.

module_ids

List of modules that contribute to this object.

p

Computes the magnitude of the initial momentum.

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.

start_dir

Converts the initial momentum to a direction vector.

Methods

as_dict([lite, include_derived])

Returns the data class as dictionary of (key, value) pairs.

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(particle)

Builds and returns a Particle object from a LArCV Particle object.

reset_cathode_crosser()

Resets the cathode crossing information for the object.

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>, particle_id: int = -1, interaction_id: int = -1, is_primary: bool = False, length: float = nan, shape: int = -1, start_point: ndarray = <factory>, end_point: ndarray = <factory>, parent_id: int = -1, group_id: int = -1, nu_id: int = -1, children_id: ndarray = <factory>, mct_index: int = -1, mcst_index: int = -1, group_primary: int = -1, interaction_primary: int = -1, track_id: int = -1, parent_track_id: int = -1, ancestor_track_id: int = -1, pdg_code: int = -1, parent_pdg_code: int = -1, ancestor_pdg_code: int = -1, num_voxels: int = -1, t: float = nan, end_t: float = nan, parent_t: float = nan, ancestor_t: float = nan, energy_init: float = nan, energy_deposit: float = nan, distance_travel: float = nan, creation_process: str = '', parent_creation_process: str = '', ancestor_creation_process: str = '', pid: int = -1, position: ndarray = <factory>, end_position: ndarray = <factory>, parent_position: ndarray = <factory>, ancestor_position: ndarray = <factory>, first_step: ndarray = <factory>, last_step: ndarray = <factory>, momentum: ndarray = <factory>, end_momentum: ndarray = <factory>, orig_interaction_id: int = -1, orig_parent_id: int = -1, orig_group_id: int = -1, orig_children_id: ndarray = <factory>, children_counts: ndarray = <factory>, reco_start_dir: ndarray = <factory>, reco_end_dir: 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.

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(particle)

Builds and returns a Particle object from a LArCV Particle object.

reset_cathode_crosser()

Resets the cathode crossing information for the object.

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

ancestor_creation_process

ancestor_pdg_code

ancestor_t

ancestor_track_id

cathode_offset

creation_process

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

end_dir

Converts the final momentum to a direction vector.

end_p

Computes the magnitude of the final momentum.

end_t

energy_deposit

energy_init

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.

group_id

group_primary

id

index_attrs

Return the tuple of index-bearing attributes.

interaction_id

interaction_primary

is_cathode_crosser

is_contained

is_matched

is_primary

is_time_contained

is_truth

length

mass

Computes the rest mass of the particle from its energy/momentum.

mcst_index

mct_index

module_ids

List of modules that contribute to this object.

nu_id

num_voxels

orig_group_id

orig_id

orig_interaction_id

orig_parent_id

p

Computes the magnitude of the initial momentum.

parent_creation_process

parent_id

parent_pdg_code

parent_t

parent_track_id

particle_id

pdg_code

pid

shape

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.

start_dir

Converts the initial momentum to a direction vector.

t

track_id

units

orig_children_id

children_counts

reco_start_dir

reco_end_dir

children_id

position

end_position

parent_position

ancestor_position

first_step

last_step

momentum

end_momentum

start_point

end_point

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

orig_interaction_id: int = -1
orig_parent_id: int = -1
orig_group_id: int = -1
orig_children_id: ndarray
children_counts: ndarray
reco_start_dir: ndarray
reco_end_dir: ndarray
property start_dir: ndarray

Converts the initial momentum to a direction vector.

Returns:

  1. Start direction vector

Return type:

np.ndarray

property end_dir: ndarray

Converts the final momentum to a direction vector.

Note that if a particle stops, this is unreliable as an estimate of the direction of the particle before it stops.

Returns:

  1. End direction vector

Return type:

np.ndarray