NuRadioReco.modules.channelReadoutWindowCutter module
- class NuRadioReco.modules.channelReadoutWindowCutter.channelReadoutWindowCutter(log_level=0)[source]
Bases:
objectModifies channel traces to simulate the effects of the trigger and associated readout window.
The trace is cut to the length defined in the detector description relative to the trigger time taking into account the trigger’s pre_trigger_time. If no trigger exists, nothing is done. Allows to simulate randomness in the definition of the readout window.
Methods
begin([random_seed])run(event, station, detector)Cuts the traces to the readout window defined in the trigger.
- begin(random_seed=None)[source]
- Parameters:
- random_seedint or None, optional
Set a random seed, used if simulating a random jitter for the readout window. (Default: None)
- run(event, station, detector)[source]
Cuts the traces to the readout window defined in the trigger.
If multiple triggers exist, the primary trigger is used. If multiple primary triggers exist, an error is raised. If no primary trigger exists, the trigger with the earliest trigger time is defined as the primary trigger and used to set the readout windows.
- Parameters:
- event: `NuRadioReco.framework.event.Event`
- station: `NuRadioReco.framework.base_station.Station`
- detector: `NuRadioReco.detector.detector.Detector`
- NuRadioReco.modules.channelReadoutWindowCutter.get_empty_channel(station_id, channel_id, detector, trigger, sampling_rate)[source]
Returns a channel with a trace containing zeros.
The trace start time is given by the trigger, the duration of the trace is determined by the detector description, and the number of samples determined by the duration and the given sampling rate.
- Parameters:
- station_id: int
The station id
- channel_id: int
The channel id
- detector: `NuRadioReco.detector.detector.Detector`
The detector description
- trigger: `NuRadioReco.framework.trigger.Trigger`
The trigger that triggered the station
- sampling_rate: float
The sampling rate of the channel
- NuRadioReco.modules.channelReadoutWindowCutter.time_jitter(gaussian_spread=0, sample_block_size=0, sampling_rate=2.4, rng=None)[source]
Generate a readout-window jitter composed of a discrete sample offset (converted to time) and a continuous Gaussian time smear.
- Parameters:
- gaussian_spreadint or float
Standard deviation of a Gaussian time smear in samples (not time). Spread can be a float, the randomly drawn jitter will be rounded to the nearest int. (Default: 0 - no jitter)
- sample_block_sizeint
Range of the uniform sample jitter caused by an unknown position within a sampling block. Random sample is drawn from
[-sample_block_size / 2, sample_block_size / 2). (Default: 0 - no jitter)- sampling_ratefloat
Sampling rate used to convert the integer sample offset to a time value (
jitter_time = jitter_sample / sampling_rate). the input should be in GHz- rngnumpy.random.Generator
Random number generator instance, e.g.
Generator(Philox(None)).
- Returns:
- sample_jitter_timefloat
Time jitter from the discrete sample offset (
jitter_sample / sampling_rate).