NuRadioReco.framework.event module

class NuRadioReco.framework.event.Event(run_number, event_id)[source]

Bases: object

Methods

add_particle(particle)

Adds a MC particle to the event

add_shower(shower)

Adds a radio shower to the event

add_sim_emitter(sim_emitter)

Add a simulated emitter to the event

add_sim_shower(sim_shower)

Add a simulated shower to the event

get_first_shower([ids])

Returns only the first shower stored in the event.

get_first_sim_emitter([ids])

Returns only the first sim emitter stored in the event.

get_first_sim_shower([ids])

Returns only the first sim shower stored in the event.

get_hybrid_information()

Get information about hybrid detector data stored in the event.

get_interaction_products(parent_particle[, ...])

Return all the daughter particles and showers generated in the interaction of the <parent_particle>

get_parent(particle_or_shower)

returns the parent of a particle or a shower

get_particle(particle_id)

returns a specific MC particle identified by its unique id

get_particles()

Returns an iterator over the MC particles stored in the event

get_primary()

returns a first MC particle

get_shower(shower_id)

returns a specific shower identified by its unique id

get_showers([ids])

Returns an iterator over the showers stored in the event

get_sim_emitter(emitter_id)

returns a specific emitter identified by its unique id

get_sim_emitters()

Get an iterator over all simulated emitters in the event

get_sim_shower(shower_id)

returns a specific shower identified by its unique id

get_sim_showers()

Get an iterator over all simulated showers in the event

get_station([station_id])

Returns the station for a given station id.

has_particle([particle_id])

Returns true if at least one MC particle is stored in the event

has_shower([shower_id])

Returns true if at least one shower is stored in the event

has_sim_emitter([emitter_id])

Returns true if at least one simulated emitter is stored in the event

has_sim_shower([shower_id])

Returns true if at least one simulated shower is stored in the event

has_triggered([trigger_name])

Returns true if any station has been triggered.

iter_modules([station_id])

returns an interator that loops over all modules.

register_module_event(instance, name, kwargs)

registers modules applied to this event

register_module_station(station_id, ...)

registers modules applied to this event

deserialize

get_generator_info

get_id

get_parameter

get_run_number

get_station_ids

get_stations

has_generator_info

has_parameter

serialize

set_generator_info

set_id

set_parameter

set_station

register_module_event(instance, name, kwargs)[source]

registers modules applied to this event

Parameters:
instance: module instance

the instance of the module that should be registered

name: module name

the name of the module

kwargs:

the key word arguments of the run method

register_module_station(station_id, instance, name, kwargs)[source]

registers modules applied to this event

Parameters:
station_id: int

the station id

instance: module instance

the instance of the module that should be registered

name: module name

the name of the module

kwargs:

the key word arguments of the run method

iter_modules(station_id=None)[source]

returns an interator that loops over all modules. If a station id is provided it loops over all modules that are applied on event or station level (on this particular station). If no station_id is provided, the loop is only over the event modules. The order follows the sequence these modules were applied

get_parameter(key)[source]
set_parameter(key, value)[source]
has_parameter(key)[source]
get_generator_info(key)[source]
set_generator_info(key, value)[source]
has_generator_info(key)[source]
get_id()[source]
set_id(evt_id)[source]
get_run_number()[source]
get_station(station_id=None)[source]

Returns the station for a given station id.

Parameters:
station_id: int

Id of the station you want to get. If None and event has only one station return it, otherwise raise error. (Default: None)

Returns:
station: NuRadioReco.framework.station
get_stations()[source]
get_station_ids()[source]
set_station(station)[source]
has_triggered(trigger_name=None)[source]

Returns true if any station has been triggered.

Parameters:
trigger_name: string or None (default None)
  • if None: The function returns False if not trigger was set. If one or multiple triggers were set,

    it returns True if any of those triggers triggered

  • if trigger name is set: return if the trigger with name ‘trigger_name’ has a trigger

Returns:
has_triggeredbool
add_particle(particle)[source]

Adds a MC particle to the event

Parameters:
particleNuRadioReco.framework.particle.Particle

The MC particle to be added to the event

get_particles()[source]

Returns an iterator over the MC particles stored in the event

get_particle(particle_id)[source]

returns a specific MC particle identified by its unique id

get_primary()[source]

returns a first MC particle

get_parent(particle_or_shower)[source]

returns the parent of a particle or a shower

has_particle(particle_id=None)[source]

Returns true if at least one MC particle is stored in the event

If particle_id is given, it checks if this particular MC particle exists

get_interaction_products(parent_particle, showers=True, particles=True)[source]

Return all the daughter particles and showers generated in the interaction of the <parent_particle>

Parameters:
showers: bool

Include simulated showers in the list

showers: bool

Include simulated particles in the list

add_shower(shower)[source]

Adds a radio shower to the event

Parameters:
shower: RadioShower object

The shower to be added to the event

get_showers(ids=None)[source]

Returns an iterator over the showers stored in the event

Parameters:
ids: list of integers

A list of station IDs. Only showers that are associated with all stations in the list are returned

get_shower(shower_id)[source]

returns a specific shower identified by its unique id

has_shower(shower_id=None)[source]

Returns true if at least one shower is stored in the event

If shower_id is given, it checks if this particular shower exists

get_first_shower(ids=None)[source]

Returns only the first shower stored in the event. Useful in cases when there is only one shower in the event.

Parameters:
ids: list of integers

A list of station IDs. The first shower that is associated with all stations in the list is returned

add_sim_shower(sim_shower)[source]

Add a simulated shower to the event

Parameters:
sim_shower: RadioShower object

The shower to be added to the event

get_sim_showers()[source]

Get an iterator over all simulated showers in the event

get_sim_shower(shower_id)[source]

returns a specific shower identified by its unique id

get_first_sim_shower(ids=None)[source]

Returns only the first sim shower stored in the event. Useful in cases when there is only one shower in the event.

Parameters:
ids: list of integers

A list of station IDs. The first shower that is associated with all stations in the list is returned

has_sim_shower(shower_id=None)[source]

Returns true if at least one simulated shower is stored in the event

If shower_id is given, it checks if this particular shower exists

add_sim_emitter(sim_emitter)[source]

Add a simulated emitter to the event

Parameters:
sim_emitter: SimEmitter object

The emitter to be added to the event

get_sim_emitters()[source]

Get an iterator over all simulated emitters in the event

get_sim_emitter(emitter_id)[source]

returns a specific emitter identified by its unique id

get_first_sim_emitter(ids=None)[source]

Returns only the first sim emitter stored in the event. Useful in cases when there is only one emitter in the event.

Parameters:
station_ids: list of integers

A list of station IDs. The first emitter that is associated with all stations in the list is returned

has_sim_emitter(emitter_id=None)[source]

Returns true if at least one simulated emitter is stored in the event

If emitter_id is given, it checks if this particular emitter exists

get_hybrid_information()[source]

Get information about hybrid detector data stored in the event.

serialize(mode)[source]
deserialize(data_pkl)[source]