straxen.plugins.merged_s2s package

Submodules

straxen.plugins.merged_s2s.merged_s2s module

class straxen.plugins.merged_s2s.merged_s2s.MergedS2s[source]

Bases: OverlapWindowPlugin

Merge together peaklets if peak finding favours that they would form a single peak instead. Technically, the S2 merging algorithm merges S2 peaklets into S2 peaks. By introducing more information about the waveform and (x, y) distribution of potential groups of peaklets, the algorithm removes PI and DE population from S2 peaks.

Note: Types FAR_XYPOS_S2_TYPE (20) and WIDE_XYPOS_S2_TYPE (22) are still S2s, but they do not participate in the event building.

The algorithm merges S2 peaklets when they are close in (t, x, y). But if a group of peaklets is dense in time but sparse in (x, y), the following steps are conducted:

  1. Merge these peaklets that are dense in (x, y).

  2. Assign the peaklets that are dense in time but not dense in (x, y) by type 20,

    they are usually PI or DE.

  3. If the sum of nearby type 20 is large compared to the merged peak,

    assign the merged peak as type 22, because it is usually PI.

Reference: xenon:xenonnt:analysis:s2_merging_time_position xenon:xenonnt:analysis:sr2_peak_types

compute(peaklets, lone_hits, start, end)[source]
copied_dtype = dtype([('time', '<i8'), ('endtime', '<i8'), ('area', '<f4'), ('median_time', '<f4'), ('area_decile_from_midpoint', '<f4', (11,))])
data_kind: Dict[str, str] | str = {'enhanced_peaklet_classification': 'peaklets', 'merged_s2s': 'merged_s2s'}
static decile_interp(x, y, panel=array([0., 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.]))[source]
default_reconstruction_algorithm

Dispatch on URL protocol.

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

depends_on: Tuple[str, ...] = ('peaklets', 'peaklet_positions_cnf', 'peaklet_classification', 'lone_hits')
disable_progress_bar

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.

static get_duration(y, x)[source]

Get the duration of the merged peaklets.

static get_gap(y, x)[source]

Get the gap between two peaklets.

static get_left_right(peaklet)[source]

Get the left and right boundaries of the peaklet.

static get_merge_instructions(_peaks, start, end, max_gap, max_duration, sigma, rough_seg, sigma_seg, rough_mu_bins, poisson_max_mu, poisson_survival_ratio, normal_panel, factorial_panel, sigma_panel, maxexp, n_top_pmts, p_thresholds, dr_thresholds, posrec_algo, bayesian=True, sparse_xy=True, uncertainty_weights=True, p_value_prioritized=False, gap_thresholds=None, diagnosing=False, disable=True)[source]

Find the group of peaklets to merge.

There are two ways to merge peaklets: 1. Bayesian merging: merge peaklets based on the p-value of the time-density merging 2. Normal merging: merge peaklets based on the gap between the peaklets

get_window_size()[source]

Return the required window size in nanoseconds.

indicator_dtype = dtype([(('Peaklet is merging input or peak is merged from peaklets', 'merged'), '?')])
infer_dtype()[source]

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

maxexp

Dispatch on URL protocol.

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

merge(_peaklets, lone_hits, start, end)[source]

Merge into S2s if the peaklets are close enough in time and position.

merge_lone_hits

Dispatch on URL protocol.

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

static merge_peaklets(peaklets, start_merge_at, end_merge_at, merged, max_buffer=100000, max_unmerged=None, return_all_peaks=False)[source]
merge_s0

Dispatch on URL protocol.

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

static merge_two_peaks(x, y)[source]

Merge two peaklets in order.

merged_s2s_get_window_size_factor

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.

no_merging(peaklets)[source]
normal_max_sigma

Dispatch on URL protocol.

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

normal_n_bins

Dispatch on URL protocol.

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

p_value_prioritized

Dispatch on URL protocol.

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

poisson_max_mu

Dispatch on URL protocol.

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

poisson_survival_ratio

Dispatch on URL protocol.

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

provides: Tuple[str, ...] | str = ('merged_s2s', 'enhanced_peaklet_classification')
rm_sparse_xy

Dispatch on URL protocol.

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

rough_max_sigma

Dispatch on URL protocol.

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

rough_min_sigma

Dispatch on URL protocol.

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

rough_mu_bins

Dispatch on URL protocol.

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

rough_seg

Dispatch on URL protocol.

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

rough_sigma_bins

Dispatch on URL protocol.

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

s2_merge_dr_thresholds

Dispatch on URL protocol.

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

s2_merge_gap_thresholds

Dispatch on URL protocol.

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

s2_merge_max_duration

Dispatch on URL protocol.

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

s2_merge_p_thresholds

Dispatch on URL protocol.

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

s2_merge_unmerged_thresholds

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.

sigma_seg

Dispatch on URL protocol.

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

takes_config = immutabledict({'n_tpc_pmts': <straxen.config.url_config.URLConfig object>, 'n_top_pmts': <straxen.config.url_config.URLConfig object>, 'default_reconstruction_algorithm': <straxen.config.url_config.URLConfig object>, 's2_merge_max_duration': <straxen.config.url_config.URLConfig object>, 's2_merge_gap_thresholds': <straxen.config.url_config.URLConfig object>, 's2_merge_p_thresholds': <straxen.config.url_config.URLConfig object>, 's2_merge_dr_thresholds': <straxen.config.url_config.URLConfig object>, 's2_merge_unmerged_thresholds': <straxen.config.url_config.URLConfig object>, 'merge_lone_hits': <straxen.config.url_config.URLConfig object>, 'merge_s0': <straxen.config.url_config.URLConfig object>, 'gain_model': <straxen.config.url_config.URLConfig object>, 'rough_seg': <straxen.config.url_config.URLConfig object>, 'sigma_seg': <straxen.config.url_config.URLConfig object>, 'rough_min_sigma': <straxen.config.url_config.URLConfig object>, 'rough_max_sigma': <straxen.config.url_config.URLConfig object>, 'rough_sigma_bins': <straxen.config.url_config.URLConfig object>, 'rough_mu_bins': <straxen.config.url_config.URLConfig object>, 'poisson_max_mu': <straxen.config.url_config.URLConfig object>, 'poisson_survival_ratio': <straxen.config.url_config.URLConfig object>, 'normal_max_sigma': <straxen.config.url_config.URLConfig object>, 'normal_n_bins': <straxen.config.url_config.URLConfig object>, 'maxexp': <straxen.config.url_config.URLConfig object>, 'use_bayesian_merging': <straxen.config.url_config.URLConfig object>, 'rm_sparse_xy': <straxen.config.url_config.URLConfig object>, 'use_uncertainty_weights': <straxen.config.url_config.URLConfig object>, 'p_value_prioritized': <straxen.config.url_config.URLConfig object>, 'merged_s2s_get_window_size_factor': <straxen.config.url_config.URLConfig object>, 'disable_progress_bar': <straxen.config.url_config.URLConfig object>})
use_bayesian_merging

Dispatch on URL protocol.

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

use_uncertainty_weights

Dispatch on URL protocol.

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

Module contents