km3modules.mc

MC Helpers.

Module Contents

Classes

GlobalRandomState() Sets the global random seed of the numpy random generator
McTruth() Extract MC info of 1st MC track.
MCTimeCorrector() Module that converts MC hit times to JTE times.

Functions

convert_mc_times_to_jte_times(times_mc, evt_timestamp_in_ns, evt_mc_time) Function that converts MC times to JTE times.
km3modules.mc.NEUTRINOS[source]
class km3modules.mc.GlobalRandomState[source]

Bases:km3pipe.Module

Sets the global random seed of the numpy random generator

KM3Pipe uses numpy routines exclusively to generate randomness. Setting a seed to a specific value will create a fully reproducible pipeline as long as your own modules also utilise numpy for random numbers.

Parameters:
seed: int, default=42
random_state[source]
configure(self)[source]
class km3modules.mc.McTruth[source]

Bases:km3pipe.Module

Extract MC info of 1st MC track.

Parameters:
most_energetic_primary: bool, default=True
configure(self)[source]
classmethod t2f(cls, row)[source]
classmethod is_nu(cls, flavor)[source]
process(self, blob)[source]
km3modules.mc.convert_mc_times_to_jte_times(times_mc, evt_timestamp_in_ns, evt_mc_time)[source]

Function that converts MC times to JTE times.

Parameters:
times_mc : np.ndarray

Time array with MC times.

evt_timestamp_in_ns : int

Total timestamp of the event in nanoseconds.

evt_mc_time : int

Mc time of the event in nanoseconds.

Returns:
ndarray

Converted time array with JTE times.

class km3modules.mc.MCTimeCorrector[source]

Bases:km3pipe.Module

Module that converts MC hit times to JTE times. Thus, the following tables need to be converted: - mc_tracks - mc_hits

Parameters:
mc_hits_key : str, optional

Name of the mc_hits to convert (default: ‘McHits’).

mc_tracks_key : str, optional

Name of the mc_tracks to convert (default: ‘McTracks’).

event_info_key : str, optional

Name of the event_info to store this in (default: ‘EventInfo’).

configure(self)[source]
process(self, blob)[source]