spine.data.larcv.Particle
- class spine.data.larcv.Particle(units: str = 'cm', id: int = -1, parent_id: int = -1, group_id: int = -1, interaction_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 = '', shape: int = -1, 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>)[source]
Particle truth information.
- id
Index of the particle in the list
- Type:
int
- mct_index
Index in the original MCTruth array from whence it came
- Type:
int
- mcst_index
Index in the original MCTrack/MCShower array from whence it came
- Type:
int
- group_id
Index of the group the particle belongs to
- Type:
int
- interaction_id
Index of the interaction the partile belongs to
- Type:
int
- nu_id
Index of the neutrino this particle belongs to
- Type:
int
- interaction_primary
Whether the particle is primary in its interaction or not
- Type:
int
- group_primary
Whether this particle is primary in its group or not
- Type:
int
- parent_id
Index of the parent particle
- Type:
int
- children_id
List of indexes of the children particles
- Type:
np.ndarray
- track_id
Geant4 track ID
- Type:
int
- parent_track_id
Geant4 track ID of the parent particle
- Type:
int
- ancestor_track_id
Geant4 track ID of the ancestor particle
- Type:
int
- shape
Enumerated semantic type of the particle
- Type:
int
- num_voxels
Number of voxels matched to this particle instance
- Type:
int
- energy_init
True initial energy in MeV
- Type:
float
- energy_deposit
Amount of energy matched to this particle instance in MeV
- Type:
float
- distance_travel
True amount of distance traveled by the particle in the active volume
- Type:
float
- creation_process
Creation process
- Type:
str
- parent_creation_process
Creation process of the parent particle
- Type:
str
- ancestor_creation_process
Creation process of the ancestor particle
- Type:
str
- pid
Enumerated particle species type of the particle
- Type:
int
- pdg_code
Particle PDG code
- Type:
int
- parent_pdg_code
Particle PDG code of the parent particle
- Type:
int
- ancestor_pdg_code
Particle PDG code of the ancestor particle
- Type:
int
- t
Particle creation time (ns)
- Type:
float
- end_t
Particle death time (ns)
- Type:
float
- parent_t
Particle creation time of the parent particle (ns)
- Type:
float
- ancestor_t
Particle creation time of the ancestor particle (ns)
- Type:
float
- position
Location of the creation point of the particle
- Type:
np.ndarray
- end_position
Location where the particle stopped
- Type:
np.ndarray
- parent_position
Location of the creation point of the parent particle
- Type:
np.ndarry
- ancestor_position
Location of the creation point of the ancestor particle
- Type:
np.ndarray
- first_step
Location of the first energy deposition of the particle
- Type:
np.ndarray
- last_step
Location of the last energy deposition of the particle
- Type:
np.ndarray
- momentum
3-momentum of the particle at the production point
- Type:
np.ndarray
- end_momentum
3-momentum of the particle at where it stops or exits the detector
- Type:
np.ndarray
- p
Momentum magnitude of the particle at the production point
- Type:
float
- end_p
Momentum magnitude of the particle where it stops or exits the detector
- Type:
float
- mass
Rest mass of the particle in MeV/c^2
- Type:
float
- units
Units in which the position attributes are expressed
- Type:
str
- Attributes:
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.
pComputes the magnitude of the initial momentum.
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.
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__(units: str = 'cm', id: int = -1, parent_id: int = -1, group_id: int = -1, interaction_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 = '', shape: int = -1, 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>) None
Methods
__init__(units, id, parent_id, group_id, ...)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.
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
Computes 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.
Computes the rest mass of the particle from its energy/momentum.
Computes the magnitude of the initial momentum.
- id: int = -1
- parent_id: int = -1
- group_id: int = -1
- interaction_id: int = -1
- nu_id: int = -1
- children_id: ndarray
- 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 = ''
- units: str = 'cm'
- shape: int = -1
- pid: int = -1
- position: ndarray
- end_position: ndarray
- parent_position: ndarray
- ancestor_position: ndarray
- first_step: ndarray
- last_step: ndarray
- momentum: ndarray
- end_momentum: ndarray
- property p: float
Computes the magnitude of the initial momentum.
- Returns:
Norm of the initial momentum vector
- Return type:
float
- property end_p: float
Computes the magnitude of the final momentum.
- Returns:
Norm of the final momentum vector
- Return type:
float
- property mass: float
Computes the rest mass of the particle from its energy/momentum.
- Returns:
Rest mass of the particle in MeV/c^2
- Return type:
float
- classmethod from_larcv(particle) Particle[source]
Builds and returns a Particle object from a LArCV Particle object.
- Parameters:
particle (larcv.Particle) – LArCV-format particle object
- Returns:
Particle object
- Return type: