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
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
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_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.
end_dirConverts the final momentum to a direction vector.
end_pComputes the magnitude of the final momentum.
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.
massComputes the rest mass of the particle from its energy/momentum.
module_idsList of modules that contribute to this object.
pComputes the magnitude of the initial momentum.
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.
start_dirConverts 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_processancestor_pdg_codeancestor_tancestor_track_idcathode_offsetcreation_processdepositions_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_travelConverts the final momentum to a direction vector.
end_pComputes the magnitude of the final momentum.
end_tenergy_depositenergy_initenum_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.
group_idgroup_primaryidindex_attrsReturn the tuple of index-bearing attributes.
interaction_idinteraction_primaryis_cathode_crosseris_containedis_matchedis_primaryis_time_containedis_truthlengthmassComputes the rest mass of the particle from its energy/momentum.
mcst_indexmct_indexmodule_idsList of modules that contribute to this object.
nu_idnum_voxelsorig_idpComputes the magnitude of the initial momentum.
parent_creation_processparent_idparent_pdg_codeparent_tparent_track_idparticle_idpdg_codepidshapesizeTotal 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.
Converts the initial momentum to a direction vector.
ttrack_idunitschildren_idpositionend_positionparent_positionancestor_positionfirst_steplast_stepmomentumend_momentumstart_pointend_pointindexorig_indexpointsdepositionssourcesmatch_idsmatch_overlapsindex_adaptindex_g4points_adaptpoints_g4depositions_qdepositions_adaptdepositions_adapt_qdepositions_g4sources_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:
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:
End direction vector
- Return type:
np.ndarray