straxen.plugins.events package

Submodules

straxen.plugins.events.corrected_areas module

class straxen.plugins.events.corrected_areas.CorrectedAreas[source]

Bases: Plugin

Plugin which applies light collection efficiency maps and electron life time to the data.

Computes the cS1/cS2 for the main/alternative S1/S2 as well as the corrected life time. Note:

Please be aware that for both, the main and alternative S1, the area is corrected according to the xy-position of the main S2. There are now 3 components of cS2s: cs2_top, cS2_bottom and cs2. cs2_top and cs2_bottom are corrected by the corresponding maps, and cs2 is the sum of the two.

N-1 corrections are also provided, where each variable has all corrections applied except for one specific correction. This allows studying the impact of individual corrections.

The following corrections are applied: - Peak reconstruction bias correction (corrects for bias in peak finding algorithm) - S1 xyz correction (light collection efficiency) - S2 xy correction (light collection efficiency) - Time-dependent light yield correction - Single electron gain (SEG) and extraction efficiency (EE) correction (partition,time) - Photoionization correction for S2 bottom - Electron lifetime correction - Time-dependent charge yield correction

ab_region(x, y)[source]
apply_s2_corrections(s2_area, s2_aft, s2_bias_correction, s2_xy_correction_top, s2_xy_correction_bottom, seg_ee_corr, pi_corr_bottom, rel_cy_correction, elife_correction)[source]

Apply S2 corrections and return various corrected areas. To study the impact of individual corrections, parameters of this function can be set to 1, thereby excluding the corresponding correction.

Returns:

cs2, cs2_area_fraction_top

avg_se_gain

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

b_rel_light_yield

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

cd_region(x, y)[source]
check_s2_only_aft

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

compute(events)[source]
cs2_bottom_top_ratio_correction

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

default_reconstruction_algorithm

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

depends_on: Tuple[str, ...] = ('event_basics', 'event_positions')
description_strs = ['peak bias', 'S2 xy', 'SEG/EE', 'photoionization', 'relative charge yield', 'elife']
elife

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

infer_dtype()[source]

Return dtype of computed data; used only if no dtype attribute defined.

intermediate_cs2s = ['111111', '100000', '110000', '101000', '111000', '110001', '000001', '010001', '011101', '101101', '110101', '111001', '111100', '111101', '111110']
name_postfixes = ['_bias', '_xy', '_segee', '_pi', '_relcy', '_elife']
provides: Union[str, tuple, list] = ('corrected_areas',)
rel_charge_yield

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

rel_extraction_eff

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

rel_light_yield

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

rel_light_yield_correction(events)[source]

Compute relative light yield correction (z- and t-dependent).

s1_bias_map

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

s1_xyz_map

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

s2_bias_map

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

s2_map_names()[source]
s2_xy_map

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

se_gain

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

seg_ee_correction_preparation()[source]

Get single electron gain and extraction efficiency options.

single_electron_gain_partition

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

slope_rel_light_yield

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

takes_config = immutabledict({'elife': <straxen.config.url_config.URLConfig object>, 'default_reconstruction_algorithm': <straxen.config.url_config.URLConfig object>, 's1_xyz_map': <straxen.config.url_config.URLConfig object>, 's2_xy_map': <straxen.config.url_config.URLConfig object>, 'avg_se_gain': <straxen.config.url_config.URLConfig object>, 'se_gain': <straxen.config.url_config.URLConfig object>, 'rel_extraction_eff': <straxen.config.url_config.URLConfig object>, 'rel_charge_yield': <straxen.config.url_config.URLConfig object>, 'rel_light_yield': <straxen.config.url_config.URLConfig object>, 'b_rel_light_yield': <straxen.config.url_config.URLConfig object>, 'slope_rel_light_yield': <straxen.config.url_config.URLConfig object>, 'single_electron_gain_partition': <straxen.config.url_config.URLConfig object>, 'cs2_bottom_top_ratio_correction': <straxen.config.url_config.URLConfig object>, 's1_bias_map': <straxen.config.url_config.URLConfig object>, 's2_bias_map': <straxen.config.url_config.URLConfig object>, 'check_s2_only_aft': <straxen.config.url_config.URLConfig object>})

straxen.plugins.events.distinct_channels module

class straxen.plugins.events.distinct_channels.DistinctChannels[source]

Bases: LoopPlugin

Compute the number of contributing PMTs that contribute to the alt_s1 but not to the main S1.

compute_loop(event, peaks)[source]
depends_on: Union[str, tuple, list] = ('event_basics', 'peaks')
dtype: Union[tuple, np.dtype, immutabledict, dict] = [('alt_s1_distinct_channels', <class 'numpy.int32'>, 'Number of PMTs contributing to the secondary S1 that do not contribute to the main S1'), (('Start time since unix epoch [ns]', 'time'), <class 'numpy.int64'>), (('Exclusive end time since unix epoch [ns]', 'endtime'), <class 'numpy.int64'>)]
loop_over = 'events'
provides: Union[str, tuple, list] = ('distinct_channels',)

straxen.plugins.events.energy_estimates module

class straxen.plugins.events.energy_estimates.EnergyEstimates[source]

Bases: Plugin

Plugin which converts cS1 and cS2 into energies (from PE to KeVee).

compute(events)[source]
cs1_to_e(x)[source]
cs2_to_e(x)[source]
depends_on: Union[str, tuple, list] = 'corrected_areas'
dtype: Union[tuple, np.dtype, immutabledict, dict] = [('e_light', <class 'numpy.float32'>, 'Energy in light signal [keVee]'), ('e_charge', <class 'numpy.float32'>, 'Energy in charge signal [keVee]'), ('e_ces', <class 'numpy.float32'>, 'Energy estimate [keVee]'), (('Start time since unix epoch [ns]', 'time'), <class 'numpy.int64'>), (('Exclusive end time since unix epoch [ns]', 'endtime'), <class 'numpy.int64'>)]
g1

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

g2

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

lxe_w

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

provides: Union[str, tuple, list] = ('energy_estimates',)
save_when = 2
takes_config = immutabledict({'g1': <straxen.config.url_config.URLConfig object>, 'g2': <straxen.config.url_config.URLConfig object>, 'lxe_w': <straxen.config.url_config.URLConfig object>})

straxen.plugins.events.event_ambience module

class straxen.plugins.events.event_ambience.EventAmbience[source]

Bases: Plugin

Save Ambience of the main S1 and main S2 in the event.

References:
  • v0.0.4 reference: xenon:xenonnt:ac:prediction:shadow_ambience

  • v0.1.0 reference: xenon:xenonnt:analysis:redefine_n_competing

compute(events, peaks)[source]
depends_on: Union[str, tuple, list] = ('event_basics', 'peak_ambience')
infer_dtype()[source]

Return dtype of computed data; used only if no dtype attribute defined.

property origin_dtype
provides: Union[str, tuple, list] = ('event_ambience',)

straxen.plugins.events.event_area_per_channel module

class straxen.plugins.events.event_area_per_channel.EventAreaPerChannel[source]

Bases: Plugin

Simple plugin that provides area per channel for main and alternative S1/S2 in the event.

compressor = 'zstd'
compute(events, peaks)[source]
depends_on: Union[str, tuple, list] = ('event_basics', 'peaks')
infer_dtype()[source]

Return dtype of computed data; used only if no dtype attribute defined.

n_top_pmts

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

provides: Union[str, tuple, list] = ('event_area_per_channel',)
takes_config = immutabledict({'n_top_pmts': <straxen.config.url_config.URLConfig object>})

straxen.plugins.events.event_basics module

straxen.plugins.events.event_basics_som module

class straxen.plugins.events.event_basics_som.EventBasicsSOM[source]

Bases: EventBasicsVanilla

Adds SOM fields for S1 and S2 peaks to event basics.

child_plugin = True
provides: Union[str, tuple, list] = ('event_basics',)

straxen.plugins.events.event_info module

class straxen.plugins.events.event_info.EventInfo[source]

Bases: MergeOnlyPlugin

Plugin which merges the information of all event data_kinds into a single data_type.

compute(**kwargs)[source]
depends_on: Union[str, tuple, list] = ('event_basics', 'event_positions', 'corrected_areas', 'energy_estimates')
event_info_function

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

provides: Union[str, tuple, list] = ('event_info',)
save_when = 3
takes_config = immutabledict({'event_info_function': <straxen.config.url_config.URLConfig object>})

straxen.plugins.events.event_info_double module

class straxen.plugins.events.event_info_double.EventInfoDouble[source]

Bases: MergeOnlyPlugin

Alternate version of event_info for Kr and other double scatter.

analyses:
  • Uses a different naming convention: s1 -> s1_a, alt_s1 -> s1_b, and similarly for s2s;

  • Adds s1_b_distinct_channels, which can be tricky to compute (since it requires going back to peaks)

compute(events)[source]
depends_on: Union[str, tuple, list] = ('event_info', 'distinct_channels')
infer_dtype()[source]

Return dtype of computed data; used only if no dtype attribute defined.

provides: Union[str, tuple, list] = ('event_info_double',)
static rename_field(orig_name)[source]
save_when = 1

straxen.plugins.events.event_nearest_triggering module

class straxen.plugins.events.event_nearest_triggering.EventNearestTriggering[source]

Bases: Plugin

Time difference and properties of the nearest triggering peaks of main peaks of events.

compute(events, peaks)[source]
depends_on: Union[str, tuple, list] = ('event_basics', 'peak_basics', 'peak_nearest_triggering')
infer_dtype()[source]

Return dtype of computed data; used only if no dtype attribute defined.

provides: Union[str, tuple, list] = ('event_nearest_triggering',)
save_when = 1

straxen.plugins.events.event_pattern_fit module

class straxen.plugins.events.event_pattern_fit.EventPatternFit[source]

Bases: Plugin

Plugin that provides patter information for events.

compute(events)[source]
compute_s1_llhvalue(events, result)[source]
compute_s2_llhvalue(events, result)[source]
compute_s2_neural_llhvalue(events, result)[source]
default_reconstruction_algorithm

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

depends_on: Union[str, tuple, list] = ('event_area_per_channel', 'event_basics', 'event_positions')
electron_drift_time_gate

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

electron_drift_velocity

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

gain_model

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

infer_dtype()[source]

Return dtype of computed data; used only if no dtype attribute defined.

max_r_pattern_fit

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

mean_pe_per_photon

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

n_top_pmts

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

n_tpc_pmts

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

provides: Union[str, tuple, list] = ('event_pattern_fit',)
s1_aft_map

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

s1_min_area_pattern_fit

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

s1_optical_map

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

property s2_map_custom_objects
s2_min_area_pattern_fit

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

s2_optical_map

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

s2_tf_model

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

setup()[source]

Hook if plugin wants to do something on initialization.

store_per_channel

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

takes_config = immutabledict({'default_reconstruction_algorithm': <straxen.config.url_config.URLConfig object>, 's1_aft_map': <straxen.config.url_config.URLConfig object>, 'electron_drift_velocity': <straxen.config.url_config.URLConfig object>, 'electron_drift_time_gate': <straxen.config.url_config.URLConfig object>, 's1_optical_map': <straxen.config.url_config.URLConfig object>, 's2_optical_map': <straxen.config.url_config.URLConfig object>, 's2_tf_model': <straxen.config.url_config.URLConfig object>, 'mean_pe_per_photon': <straxen.config.url_config.URLConfig object>, 'gain_model': <straxen.config.url_config.URLConfig object>, 'n_tpc_pmts': <straxen.config.url_config.URLConfig object>, 'n_top_pmts': <straxen.config.url_config.URLConfig object>, 's1_min_area_pattern_fit': <straxen.config.url_config.URLConfig object>, 's2_min_area_pattern_fit': <straxen.config.url_config.URLConfig object>, 'store_per_channel': <straxen.config.url_config.URLConfig object>, 'max_r_pattern_fit': <straxen.config.url_config.URLConfig object>})

straxen.plugins.events.event_positions module

class straxen.plugins.events.event_positions.EventPositions[source]

Bases: Plugin

Computes the observed and corrected position for the main S1/S2 pairs in an event.

For XENONnT data, it returns the FDC corrected positions of the default_reconstruction_algorithm. In case the fdc_map is given as a file (not through xedocs), then the coordinate system should be given as (x, y, z), not (x, y, drift_time).

compute(events)[source]
default_reconstruction_algorithm

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

depends_on: Union[str, tuple, list] = 'event_basics'
electron_drift_time_gate

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

electron_drift_velocity

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

fdc_map

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

infer_dtype()[source]

Return dtype of computed data; used only if no dtype attribute defined.

provides: Union[str, tuple, list] = ('event_positions',)
setup()[source]

Hook if plugin wants to do something on initialization.

takes_config = immutabledict({'default_reconstruction_algorithm': <straxen.config.url_config.URLConfig object>, 'electron_drift_velocity': <straxen.config.url_config.URLConfig object>, 'electron_drift_time_gate': <straxen.config.url_config.URLConfig object>, 'fdc_map': <straxen.config.url_config.URLConfig object>, 'z_bias_map': <straxen.config.url_config.URLConfig object>})
z_bias_map

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

straxen.plugins.events.event_s1_positions_cnn module

class straxen.plugins.events.event_s1_positions_cnn.EventS1PositionCNN[source]

Bases: EventS1PositionBase

CNN for (x,y,z) position S1 reconstruction at event level.

algorithm: str | None = 's1_cnn'
provides: Union[str, tuple, list] = ('event_s1_positions_cnn',)
takes_config = immutabledict({'min_s1_area_s1_posrec': <straxen.config.url_config.URLConfig object>, 'n_top_pmts': <straxen.config.url_config.URLConfig object>, 'tf_model_s1_cnn': <straxen.config.url_config.URLConfig object>})
tf_model_s1_cnn

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

straxen.plugins.events.event_s2_positions_flow module

straxen.plugins.events.event_s2_positions_cnn module

straxen.plugins.events.event_s2_positions_gcn module

straxen.plugins.events.event_s2_positions_mlp module

class straxen.plugins.events.event_s2_positions_mlp.EventS2PositionMLP[source]

Bases: EventS2PositionBase

MLP neural net for S2 position reconstruction at event level.

algorithm: str | None = 'mlp'
provides: Union[str, tuple, list] = ('event_s2_positions_mlp',)
takes_config = immutabledict({'min_reconstruction_area': <straxen.config.url_config.URLConfig object>, 'n_top_pmts': <straxen.config.url_config.URLConfig object>, 'tf_model_mlp': <straxen.config.url_config.URLConfig object>})
tf_model_mlp

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

straxen.plugins.events.event_se_sensity module

straxen.plugins.events.event_shadow module

class straxen.plugins.events.event_shadow.EventShadow[source]

Bases: Plugin

This plugin can calculate shadow for main S1 and main S2 in events. It also gives the position information of the previous peaks.

References:
  • v0.1.4 reference: xenon:xenonnt:ac:prediction:shadow_ambience

compute(events, peaks)[source]
depends_on: Union[str, tuple, list] = ('event_basics', 'peak_shadow')
infer_dtype()[source]

Return dtype of computed data; used only if no dtype attribute defined.

provides: Union[str, tuple, list] = ('event_shadow',)

straxen.plugins.events.event_top_bottom_params module

class straxen.plugins.events.event_top_bottom_params.EventTopBottomParams[source]

Bases: Plugin

Pluging that computes timing characteristics of top and bottom waveforms based on waveforms stored at event level for main/alt S1/S2.

compute(events)[source]
depends_on: Union[str, tuple, list] = ('event_basics', 'event_waveform')
infer_dtype()[source]

Return dtype of computed data; used only if no dtype attribute defined.

provides: Union[str, tuple, list] = ('event_top_bottom_params',)

straxen.plugins.events.event_w_bayes_class module

straxen.plugins.events.event_waveform module

class straxen.plugins.events.event_waveform.EventWaveform[source]

Bases: Plugin

Simple plugin that provides (data) waveforms for main and alternative S1/S2 in the event.

compressor = 'zstd'
compute(events, peaks)[source]
depends_on: Union[str, tuple, list] = ('event_basics', 'peaks')
infer_dtype()[source]

Return dtype of computed data; used only if no dtype attribute defined.

n_top_pmts

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

provides: Union[str, tuple, list] = ('event_waveform',)
save_when = 1
takes_config = immutabledict({'n_top_pmts': <straxen.config.url_config.URLConfig object>})

straxen.plugins.events.events module

class straxen.plugins.events.events.Events[source]

Bases: OverlapWindowPlugin

Plugin which defines an “event” in our TPC.

An event is defined by peak(s) in fixed range of time around a peak which satisfies certain conditions:

  1. The triggering peak must have a certain area.

  2. The triggering peak must have less than “trigger_max_proximity”.

Note:

The time range which defines an event gets chopped at the chunk boundaries. This happens at invalid boundaries of the

compute(peaks, start, end)[source]
data_kind: Union[str, immutabledict, dict] = 'events'
depends_on: Union[str, tuple, list] = ('peak_basics', 'peak_proximity')
diagnose_overlapping

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

dtype: Union[tuple, np.dtype, immutabledict, dict] = [('event_number', <class 'numpy.int64'>, 'Event number in this dataset'), ('time', <class 'numpy.int64'>, 'Event start time in ns since the unix epoch'), ('endtime', <class 'numpy.int64'>, 'Event end time in ns since the unix epoch')]
electron_drift_velocity

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

event_exclude_s3

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

event_s1_min_coincidence

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

events_seen = 0
get_window_size()[source]

Return the required window size in nanoseconds.

left_event_extension

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

max_drift_length

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

provides: Union[str, tuple, list] = ('events',)
right_event_extension

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

s1_min_coincidence

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

save_when = 1
setup()[source]

Hook if plugin wants to do something on initialization.

takes_config = immutabledict({'electron_drift_velocity': <straxen.config.url_config.URLConfig object>, 'trigger_min_area': <straxen.config.url_config.URLConfig object>, 'trigger_feature': <straxen.config.url_config.URLConfig object>, 'trigger_max_proximity': <straxen.config.url_config.URLConfig object>, 'left_event_extension': <straxen.config.url_config.URLConfig object>, 'right_event_extension': <straxen.config.url_config.URLConfig object>, 'max_drift_length': <straxen.config.url_config.URLConfig object>, 'event_s1_min_coincidence': <straxen.config.url_config.URLConfig object>, 's1_min_coincidence': <straxen.config.url_config.URLConfig object>, 'event_exclude_s3': <straxen.config.url_config.URLConfig object>, 'diagnose_overlapping': <straxen.config.url_config.URLConfig object>})
trigger_feature

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

trigger_max_proximity

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

trigger_min_area

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

straxen.plugins.events.local_minimum_info module

class straxen.plugins.events.local_minimum_info.LocalMinimumInfo[source]

Bases: LoopPlugin

Looks for the main S2 peak in an event, finds the local minimum (if there is one), and looks to compute some figures of merit such as the max goodness of split, width of the valley, and height of the valley.

compressor = 'zstd'
compute_loop(event, peaks)[source]

This finds the maxima and minima for the main S2 peak and calculates its info such as the number of local maxima, the depth of the deepest local minimum over the maximum height of the peak (s2_valley_height_ratio), and the width of the local minimum valley at 90% of the valley height.

Parameters:
  • event – The event

  • peaks – The peaks belonging to the event, only the main S2 peak is considered, if there is none, this plugin returns none

Returns:

Returns a dictionary containing all of the fields above for each main S2 peak as well as the timing information.

data_kind: Union[str, immutabledict, dict] = 'events'
depends_on: Union[str, tuple, list] = ('event_basics', 'peaks')
divide_90p_width_localmin

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

dtype: Union[tuple, np.dtype, immutabledict, dict] = [(('Start time since unix epoch [ns]', 'time'), <class 'numpy.int64'>), (('Exclusive end time since unix epoch [ns]', 'endtime'), <class 'numpy.int64'>), (('Maximum Goodness of Split', 's2_max_gos'), <class 'numpy.float32'>), (('Number of local maxima of the smoothed peak', 's2_num_loc_max'), <class 'numpy.int16'>), (('Full gap at p% of the valley height of the deepest valley [ns],by default p = 90', 's2_valley_gap'), <class 'numpy.float32'>), (('Valley depth over max height of the deepest valley', 's2_valley_height_ratio'), <class 'numpy.float32'>)]
parallel: Union[str, bool] = 'process'
percent_valley_height

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

percentage_threshold_localmin

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

provides: Union[str, tuple, list] = ('event_local_min_info',)
smoothing_power_localmin

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

takes_config = immutabledict({'divide_90p_width_localmin': <straxen.config.url_config.URLConfig object>, 'smoothing_power_localmin': <straxen.config.url_config.URLConfig object>, 'percentage_threshold_localmin': <straxen.config.url_config.URLConfig object>, 'percent_valley_height': <straxen.config.url_config.URLConfig object>})

straxen.plugins.events.multi_scatter module

class straxen.plugins.events.multi_scatter.EventInfoMS[source]

Bases: Plugin

Plugin to collect multiple-scatter event observables.

compute(events, peaks)[source]
cs1_to_e(x)[source]
cs2_to_e(x)[source]
depends_on: Union[str, tuple, list] = ('event_info', 'peak_basics', 'peak_per_event', 'peak_corrections', 'peak_positions')
electron_drift_velocity

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

g1

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

g2

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

infer_dtype()[source]

Return dtype of computed data; used only if no dtype attribute defined.

lxe_w

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

max_drift_length

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

ms_window_fac

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

provides: Union[str, tuple, list] = ('event_ms_naive',)
save_when = 2
setup()[source]

Hook if plugin wants to do something on initialization.

takes_config = immutabledict({'g1': <straxen.config.url_config.URLConfig object>, 'g2': <straxen.config.url_config.URLConfig object>, 'lxe_w': <straxen.config.url_config.URLConfig object>, 'electron_drift_velocity': <straxen.config.url_config.URLConfig object>, 'max_drift_length': <straxen.config.url_config.URLConfig object>, 'ms_window_fac': <straxen.config.url_config.URLConfig object>})

straxen.plugins.events.s2_recon_pos_diff module

class straxen.plugins.events.s2_recon_pos_diff.S2ReconPosDiff[source]

Bases: Plugin

Plugin that provides position reconstruction difference for S2s in events, see note:

https://xe1t-wiki.lngs.infn.it/doku.php?id=xenon:shengchao:sr0:reconstruction_quality

cal_avg_and_std(values, axis=1)[source]
compute(events)[source]
compute_pos_diff(events, result)[source]
depends_on: Union[str, tuple, list] = 'event_basics'
eval_recon(data, name_x_list, name_y_list)[source]

This function reads the name list based on s2/alt_s2 and all recon algorithm registered Each row consists the reconstructed x/y and their average and standard deviation is calculated.

infer_dtype()[source]

Return dtype of computed data; used only if no dtype attribute defined.

provides: Union[str, tuple, list] = ('s2_recon_pos_diff',)
recon_alg_included

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

save_when = 1
takes_config = immutabledict({'recon_alg_included': <straxen.config.url_config.URLConfig object>})

straxen.plugins.events.veto_proximity module

straxen.plugins.events.veto_proximity.DTYPE_VETO_INTERVALS

alias of int64

class straxen.plugins.events.veto_proximity.VetoProximity[source]

Bases: ExhaustPlugin

Find the closest next/previous veto start w.r.t.

the event time or when a busy happens during an event.

compute(events, veto_intervals)[source]
data_kind: Union[str, immutabledict, dict] = 'events'
depends_on: Union[str, tuple, list] = ('event_basics', 'veto_intervals')
event_window_fields

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

static get_overlapping_window_time(vetos_during_event, selected_intervals, event_window, result_buffer)[source]

Computes total time each event overlaps with the corresponding veto.

infer_dtype()[source]

Return dtype of computed data; used only if no dtype attribute defined.

provides: Union[str, tuple, list] = ('veto_proximity',)
set_result_for_veto(result_buffer: ndarray, event_window: ndarray, veto_intervals: ndarray, veto_name: str) None[source]

Fill the result buffer inplace. Goal is to find vetos with <veto_name> that are either during, before or after the current event_window.

Parameters:
  • result_buffer – The buffer to fill inplace

  • event_window – start/stop boundaries of the event to consider. Should be an array with [‘time’] and [‘endtime’] which can be based on event start/end times or S1/S2 times

  • veto_intervals – veto intervals datatype

  • veto_name – The name of the veto to fill the result buffer for

Returns:

Nothing, results are filled in place

takes_config = immutabledict({'event_window_fields': <straxen.config.url_config.URLConfig object>})
veto_names = ['busy', 'busy_he', 'hev', 'straxen_deadtime']

Module contents