NuRadioReco.modules.triggerTimeAdjuster module

class NuRadioReco.modules.triggerTimeAdjuster.triggerTimeAdjuster(log_level=30)[source]

Bases: object

Modifies channel traces to simulate the effects of the trigger

The trace is cut to the length defined in the detector description relative to the trigger time. If no trigger exists, nothing is done.

Methods

begin([trigger_name, pre_trigger_time])

Parameters:

run(event, station, detector[, mode])

Run the trigger time adjuster.

begin(trigger_name=None, pre_trigger_time=55.0)[source]
Parameters:
trigger_name: string or None

name of the trigger that should be used. If trigger_name is None, the trigger with the smallest trigger_time will be used. If a name is given, corresponding trigger module must be run beforehand. If the trigger does not exist or did not trigger, this module will do nothing

pre_trigger_time: float or dict

Amount of time that should be stored in the channel trace before the trigger. If the channel trace is long enough, it will be cut accordingly. Otherwise, it will be rolled.

If given as a float, the same pre_trigger_time will be used for all channels. If a dict, the keys should be channel_id, and the values the pre_trigger_time to use for each channel. Alternatively, the keys should be the trigger_name, and the values either a float or a dictionary with (channel_id, pre_trigger_time) pairs.

run(event, station, detector, mode='sim_to_data')[source]

Run the trigger time adjuster.

This module can be used either to ‘cut’ the simulated traces into the appropriate readout windows, or to adjust the trace start times of simulated / real data to account for the different trigger readout delays.

Parameters:
event: NuRadioReco.framework.event.Event
station: NuRadioReco.framework.base_station.Station
detector: NuRadioReco.detector.detector.Detector
mode: ‘sim_to_data’ (default) | ‘data_to_sim’

If ‘sim_to_data’, cuts the (arbitrary-length) simulated traces to the appropriate readout windows. If ‘data_to_sim’, looks through all triggers in the station and adjusts the trace_start_time according to the different readout delays

If the trigger_name was specified in the begin function, only this trigger is considered.