spine.data.larcv.Flash

class spine.data.larcv.Flash(units: str = 'cm', id: int = -1, volume_id: int = -1, frame: int = -1, on_beam_time: int = -1, in_beam_frame: bool = False, time: float = nan, time_width: float = nan, time_abs: float = nan, total_pe: float = nan, fast_to_total: float = nan, pe_per_ch: ndarray = <factory>, center: ndarray = <factory>, width: ndarray = <factory>)[source]

Optical flash information.

id

Index of the flash in the list

Type:

int

volume_id

Index of the optical volume in which the flash was recorded

Type:

int

time

Time with respect to the trigger in microseconds

Type:

float

time_width

Width of the flash in microseconds

Type:

float

time_abs

Time in units of PMT readout clock

Type:

float

frame

Frame number

Type:

int

on_beam_time

Whether the flash time is consistent with the beam window (inheriting typing from LArCV, so int instead of bool)

Type:

int

in_beam_frame

Whether the flash is in the beam frame

Type:

bool

total_pe

Total number of PE in the flash

Type:

float

fast_to_total

Fraction of the total PE contributed by the fast component

Type:

float

pe_per_ch
  1. Fixed-length array of the number of PE per optical detector

Type:

np.ndarray

center

Barycenter of the flash in detector coordinates

Type:

np.ndarray

width

Spatial width of the flash in detector coordinates

Type:

np.ndarray

units

Units in which the position coordinates are expressed

Type:

str

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

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

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

merge(other)

Merge another flash into this one.

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, volume_id: int = -1, frame: int = -1, on_beam_time: int = -1, in_beam_frame: bool = False, time: float = nan, time_width: float = nan, time_abs: float = nan, total_pe: float = nan, fast_to_total: float = nan, pe_per_ch: ndarray = <factory>, center: ndarray = <factory>, width: ndarray = <factory>) None

Methods

__init__(units, id, volume_id, frame, ...)

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

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

merge(other)

Merge another flash into this one.

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

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.

fast_to_total

field_units

Fetches the documented units for each field.

frame

id

in_beam_frame

index_attrs

Return the tuple of index-bearing attributes.

on_beam_time

time

time_abs

time_width

total_pe

units

volume_id

pe_per_ch

center

width

id: int = -1
volume_id: int = -1
frame: int = -1
on_beam_time: int = -1
in_beam_frame: bool = False
time: float = nan
time_width: float = nan
time_abs: float = nan
total_pe: float = nan
fast_to_total: float = nan
units: str = 'cm'
pe_per_ch: ndarray
center: ndarray
width: ndarray
classmethod from_larcv(flash) Flash[source]

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

Parameters:

flash (larcv.Flash) – LArCV-format optical flash

Returns:

Flash object

Return type:

Flash

merge(other: Flash) None[source]

Merge another flash into this one.

The merge works as follows:

  • The earlier flash takes precedence for timing-related information.

  • The combined centroid is computed as the weighted average of the two existing centroids.

  • The PE values from each light collection system are added together.

Parameters:

other (Flash) – Flash to merge into this one