km3pipe.mc

Monte Carlo related things.

Module Contents

Functions

geant2pdg(geant_code) Convert GEANT particle ID to PDG
pdg2name(pdg_id) Convert PDG ID to human readable names
name2pdg(name)
most_energetic(df) Grab most energetic particle from mc_tracks dataframe.
leading_particle(df) Grab leading particle (neutrino, most energetic bundle muon).
get_flavor(pdg_types) Build a ‘flavor’ from the ‘type’ column.
_p_eq_nu(pdg_type)
_p_eq_mu(pdg_type)
is_neutrino(pdg_types) flavor string -> is_neutrino
is_muon(pdg_types) flavor string -> is_neutrino
km3pipe.mc.log[source]
km3pipe.mc.geant2pdg(geant_code)[source]

Convert GEANT particle ID to PDG

km3pipe.mc.pdg2name(pdg_id)[source]

Convert PDG ID to human readable names

km3pipe.mc.name2pdg(name)[source]
km3pipe.mc.most_energetic(df)[source]

Grab most energetic particle from mc_tracks dataframe.

km3pipe.mc.leading_particle(df)[source]

Grab leading particle (neutrino, most energetic bundle muon).

Note: selecting the most energetic mc particle does not always select the neutrino! In some sub-percent cases, the post-interaction secondaries can have more energy than the incoming neutrino!

aanet convention: mc_tracks[0] = neutrino so grab the first row

if the first row is not unique (neutrinos are unique), it’s a muon bundle grab the most energetic then

km3pipe.mc.get_flavor(pdg_types)[source]

Build a ‘flavor’ from the ‘type’ column.

km3pipe.mc.is_neutrino(pdg_types)[source]

flavor string -> is_neutrino

km3pipe.mc.is_muon(pdg_types)[source]

flavor string -> is_neutrino