straxen.plugins.peaks package

Submodules

straxen.plugins.peaks.peak_ambience module

class straxen.plugins.peaks.peak_ambience.PeakAmbience[source]

Bases: OverlapWindowPlugin

Calculate Ambience of peaks. Features are the number of lonehits, small S0, S1, S2 in a time window before peaks, and the number of small S2 in circle near the S2 peak in a time window.

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

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

ambience_area_parameters

Dispatch on URL protocol.

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

ambience_exponents

Dispatch on URL protocol.

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

ambience_time_window_backward

Dispatch on URL protocol.

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

ambient_radius

Dispatch on URL protocol.

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

compute(lone_hits, peaks)[source]
compute_ambience(lone_hits, peaks, current_peak)[source]
data_kind: Union[str, immutabledict, dict] = 'peaks'
depends_on: Union[str, tuple, list] = ('peak_basics', 'peak_positions', 'lone_hits')
gain_model

Dispatch on URL protocol.

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

get_window_size()[source]

Return the required window size in nanoseconds.

infer_dtype()[source]

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

static lonehits_ambience(peaks, pre_hits, touching_windows, exponents, num_array, sum_array, to_pe)[source]
property origin_dtype
static peaks_ambience(peaks, pre_peaks, touching_windows, exponents, ambient_radius, num_array, sum_array)[source]
provides: Union[str, tuple, list] = ('peak_ambience',)
save_when = 1
setup()[source]

Hook if plugin wants to do something on initialization.

takes_config = immutabledict({'gain_model': <straxen.config.url_config.URLConfig object>, 'ambience_time_window_backward': <straxen.config.url_config.URLConfig object>, 'ambient_radius': <straxen.config.url_config.URLConfig object>, 'ambience_area_parameters': <straxen.config.url_config.URLConfig object>, 'ambience_exponents': <straxen.config.url_config.URLConfig object>})

straxen.plugins.peaks.peak_basics module

straxen.plugins.peaks.peak_basics_som module

class straxen.plugins.peaks.peak_basics_som.PeakBasicsSOM[source]

Bases: PeakBasicsVanilla

Adds SOM fields to peak basics to be propgated to event basics.

child_plugin = True
compute(peaks)[source]
infer_dtype()[source]

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

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

straxen.plugins.peaks.peak_classification_bayes module

straxen.plugins.peaks.peak_corrections module

class straxen.plugins.peaks.peak_corrections.PeakCorrectedAreas[source]

Bases: CorrectedAreas

Pluging to apply corrections on peak level assuming that the main S1 is the only physical S1.

compute(peaks)[source]
data_kind: Union[str, immutabledict, dict] = 'peaks'
depends_on: Tuple[str, ...] = ('peak_basics', 'peak_positions', 'peak_per_event')
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.

infer_dtype()[source]

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

provides: Union[str, tuple, list] = ('peak_corrections',)
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>, 'electron_drift_velocity': <straxen.config.url_config.URLConfig object>, 'electron_drift_time_gate': <straxen.config.url_config.URLConfig object>})

straxen.plugins.peaks.peak_nearest_triggering module

class straxen.plugins.peaks.peak_nearest_triggering.PeakNearestTriggering[source]

Bases: Events

Time difference and properties of the nearest triggering peaks in the left and right direction of peaks.

compute(peaks)[source]
compute_triggering(peaks, current_peak)[source]
data_kind: Union[str, immutabledict, dict] = 'peaks'
depends_on: Union[str, tuple, list] = ('peak_basics', 'peak_proximity')
get_window_size()[source]

Return the required window size in nanoseconds.

infer_dtype()[source]

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

static nearest_indices(reference_time, nearest_time, touching_windows)[source]

Find the nearest indices in the left and right direction.

only_trigger_min_area

Dispatch on URL protocol.

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

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

Dispatch on URL protocol.

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

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>, 'shadow_time_window_backward': <straxen.config.url_config.URLConfig object>, 'only_trigger_min_area': <straxen.config.url_config.URLConfig object>})

straxen.plugins.peaks.peak_per_event module

class straxen.plugins.peaks.peak_per_event.EventPeaks[source]

Bases: Plugin

Add event number for peaks and drift times of all s2 depending on the largest s1.

Link - https://xe1t-wiki.lngs.infn.it/doku.php?id=weiss:analysis:ms_plugin

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

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

provides: Union[str, tuple, list] = ('peak_per_event',)
save_when = 2

straxen.plugins.peaks.peak_positions module

class straxen.plugins.peaks.peak_positions.PeakPositions[source]

Bases: MergeOnlyPlugin

Merge the reconstructed algorithms of the different algorithms into a single one that can be used in Event Basics.

Select one of the plugins to provide the ‘x’ and ‘y’ to be used further down the chain. Since we already have the information needed here, there is no need to wait until events to make the decision.

Since the computation is trivial as it only combined the three input plugins, don’t save this plugins output.

compute(peaks)[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] = ('peak_positions_cnf', 'peak_positions_mlp')
infer_dtype()[source]

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

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

straxen.plugins.peaks.peak_positions_flow module

straxen.plugins.peaks.peak_positions_cnn module

straxen.plugins.peaks.peak_positions_gcn module

straxen.plugins.peaks.peak_positions_mlp module

class straxen.plugins.peaks.peak_positions_mlp.PeakPositionsMLP[source]

Bases: PeakPositionsBase

algorithm = 'mlp'
child_plugin = True
depends_on: Tuple[str, ...] | str = ('peaklet_positions_mlp', 'enhanced_peaklet_classification', 'merged_s2s', 'merged_s2_positions_mlp')
provides: Union[str, tuple, list] = ('peak_positions_mlp',)

straxen.plugins.peaks.peak_proximity module

class straxen.plugins.peaks.peak_proximity.PeakProximity[source]

Bases: OverlapWindowPlugin

Look for peaks around a peak to determine how many peaks are in proximity (in time) of a peak.

compute(peaks)[source]
compute_proximity(peaks, current_peak)[source]
depends_on: Union[str, tuple, list] = ('peak_basics', 'peak_positions')
dtype: Union[tuple, np.dtype, immutabledict, dict] = [('proximity_score', <class 'numpy.float32'>, 'Strength of proximity peaks in (time, space)'), ('n_competing_left', <class 'numpy.int32'>, 'Number of larger or slightly smaller peaks left of the main peak'), ('n_competing', <class 'numpy.int32'>, 'Number of nearby larger or slightly smaller peaks'), (('Start time since unix epoch [ns]', 'time'), <class 'numpy.int64'>), (('Exclusive end time since unix epoch [ns]', 'endtime'), <class 'numpy.int64'>)]
static find_n_competing(peaks, nearby_peaks, windows, fraction)[source]
get_window_size()[source]

Return the required window size in nanoseconds.

static peaks_proximity(peaks, pre_peaks, touching_windows, exponents, proximity_sigma, min_area_fraction=0.0)[source]
provides: Union[str, tuple, list] = ('peak_proximity',)
proximity_exponents

Dispatch on URL protocol.

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

proximity_min_area_fraction

Dispatch on URL protocol.

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

proximity_sigma

Dispatch on URL protocol.

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

proximity_type

Dispatch on URL protocol.

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

proximity_window

Dispatch on URL protocol.

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

takes_config = immutabledict({'proximity_type': <straxen.config.url_config.URLConfig object>, 'proximity_min_area_fraction': <straxen.config.url_config.URLConfig object>, 'proximity_window': <straxen.config.url_config.URLConfig object>, 'proximity_exponents': <straxen.config.url_config.URLConfig object>, 'proximity_sigma': <straxen.config.url_config.URLConfig object>})

straxen.plugins.peaks.peak_s1_positions_cnn module

class straxen.plugins.peaks.peak_s1_positions_cnn.PeakS1PositionCNN[source]

Bases: PeakS1PositionBase

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

algorithm: str | None = 's1_cnn'
provides: Union[str, tuple, list] = ('peak_s1_positions_cnn',)
takes_config = immutabledict({'min_s1_area_s1_posrec': <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.peaks.peak_se_sensity module

straxen.plugins.peaks.peak_shadow module

class straxen.plugins.peaks.peak_shadow.PeakShadow[source]

Bases: OverlapWindowPlugin

This plugin can find and calculate the time & position shadow from previous peaks in time. It also gives the area and (x, y) of the previous peaks.

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

static cluster_xy(peaks, indices, dr)[source]

Find connectivity map of peaks in xy space.

compute(peaks)[source]
compute_shadow(peaks, current_peak)[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] = ('peak_basics', 'peak_positions')
get_window_size()[source]

Return the required window size in nanoseconds.

static getsigma(sigma_and_baseline, s2)[source]
infer_dtype()[source]

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

static merge_peaks(peaks, weights, dt, dr, replace=True, last=True)[source]

Merge peaks in time and space.

static peaks_shadow(peaks, pre_peaks, touching_windows, exponent, result, is_position=False, is_sum=False, is_pdf=False, sigmas=None)[source]

For each peak in peaks, check if there is a shadow-casting peak and check if it casts the largest shadow.

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

Hook if plugin wants to do something on initialization.

shadow_deltatime_exponent

Dispatch on URL protocol.

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

shadow_merge_dr

Dispatch on URL protocol.

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

shadow_merge_dt

Dispatch on URL protocol.

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

shadow_merge_last_center

Dispatch on URL protocol.

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

shadow_merge_replace

Dispatch on URL protocol.

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

shadow_pdf_ordered

Dispatch on URL protocol.

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

shadow_sigma_and_baseline

Dispatch on URL protocol.

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

shadow_sum

Dispatch on URL protocol.

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

shadow_threshold

Dispatch on URL protocol.

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

shadow_time_window_backward

Dispatch on URL protocol.

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

shadow_uncertainty_weights

Dispatch on URL protocol.

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

property shadowdtype
takes_config = immutabledict({'shadow_threshold': <straxen.config.url_config.URLConfig object>, 'shadow_sum': <straxen.config.url_config.URLConfig object>, 'shadow_merge_replace': <straxen.config.url_config.URLConfig object>, 'shadow_merge_dt': <straxen.config.url_config.URLConfig object>, 'shadow_merge_dr': <straxen.config.url_config.URLConfig object>, 'shadow_merge_last_center': <straxen.config.url_config.URLConfig object>, 'shadow_pdf_ordered': <straxen.config.url_config.URLConfig object>, 'default_reconstruction_algorithm': <straxen.config.url_config.URLConfig object>, 'shadow_time_window_backward': <straxen.config.url_config.URLConfig object>, 'shadow_uncertainty_weights': <straxen.config.url_config.URLConfig object>, 'shadow_deltatime_exponent': <straxen.config.url_config.URLConfig object>, 'shadow_sigma_and_baseline': <straxen.config.url_config.URLConfig object>})

straxen.plugins.peaks.peak_top_bottom_params module

class straxen.plugins.peaks.peak_top_bottom_params.PeakTopBottomParams[source]

Bases: Plugin

Pluging that computes timing characteristics of top and bottom waveforms based on waveforms stored at peak level.

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

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

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

straxen.plugins.peaks.peaks module

straxen.plugins.peaks.peaks_som module

class straxen.plugins.peaks.peaks_som.PeaksSOM[source]

Bases: PeaksVanilla

Same as Peaks but include in addition SOM type field to be propagated to event_basics.

Thus, only change dtype.

child_plugin = True
compute(peaklets, merged_s2s)[source]
provides: Union[str, tuple, list] = ('peaks',)

Module contents