spine.data.larcv.Neutrino

class spine.data.larcv.Neutrino(units: str = 'cm', id: int = -1, 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>)[source]

Neutrino truth information.

id

Index of the neutrino in the list

Type:

int

interaction_id

Index of the neutrino at the generator stage (e.g. Genie)

Type:

int

mct_index

Index in the original MCTruth array from whence it came

Type:

int

track_id

Geant4 track ID of the neutrino

Type:

int

lepton_track_id

Geant4 track ID of the lepton (if CC)

Type:

int

pdg_code

PDG code of the neutrino

Type:

int

lepton_pdg_code

PDG code of the outgoing lepton

Type:

int

current_type

Enumerated current type of the neutrino interaction

Type:

int

interaction_scheme

Enumerated scheme used to interpret the interaction mode/type codes

Type:

int

interaction_mode

Source-native neutrino interaction mode code

Type:

int

interaction_type

Source-native neutrino interaction type code

Type:

int

target

PDG code of the target object

Type:

int

nucleon

PDG code of the target nucleon (if QE)

Type:

int

quark

PDG code of the target quark (if DIS)

Type:

int

energy_init

Energy of the neutrino at its interaction point in GeV

Type:

float

hadronic_invariant_mass

Hadronic invariant mass (W) in GeV/c^2

Type:

float

bjorken_x

Bjorken scaling factor (x)

Type:

float

inelasticity

Inelasticity (y)

Type:

float

momentum_transfer

Squared momentum transfer (Q^2) in (GeV/c)^2

Type:

float

momentum_transfer_mag

Magnitude of the momentum transfer (Q3) in GeV/c

Type:

float

energy_transfer

Energy transfer (Q0) in GeV

Type:

float

lepton_p

Absolute momentum of the lepton

Type:

float

distance_travel

True amount of distance traveled by the neutrino before interacting

Type:

float

theta

Angle between incoming and outgoing leptons in radians

Type:

float

t

Interaction time (ns)

Type:

float

creation_process

Creation process of the neutrino

Type:

str

position

Location of the neutrino interaction

Type:

np.ndarray

momentum

3-momentum of the neutrino at its interaction point

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.

interaction_mode_enum

Interpret the interaction mode under the stored interaction scheme.

interaction_type_enum

Interpret the interaction type under the stored interaction scheme.

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(neutrino[, interaction_scheme])

Builds and returns a Neutrino object from a LArCV Neutrino 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, 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>) None

Methods

__init__(units, id, interaction_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(neutrino[, interaction_scheme])

Builds and returns a Neutrino object from a LArCV Neutrino 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

creation_process

current_type

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.

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.

lepton_p

lepton_pdg_code

lepton_track_id

mct_index

momentum_transfer

momentum_transfer_mag

nucleon

pdg_code

quark

t

target

theta

track_id

units

position

momentum

id: int = -1
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 = ''
units: str = 'cm'
position: ndarray
momentum: ndarray
property interaction_mode_enum: LArSoftNuInteractionType | GenieNuInteractionType | None

Interpret the interaction mode under the stored interaction scheme.

property interaction_type_enum: LArSoftNuInteractionType | GenieNuInteractionType | None

Interpret the interaction type under the stored interaction scheme.

classmethod from_larcv(neutrino, interaction_scheme: int = NuInteractionScheme.LARSOFT) Neutrino[source]

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

Parameters:
  • neutrino (larcv.Neutrino) – LArCV-format neutrino object

  • interaction_scheme (int, default LARSOFT) – Convention used to interpret the interaction mode/type codes.

Returns:

Neutrino object

Return type:

Neutrino