straxen.legacy.plugins_1t package

Submodules

straxen.legacy.plugins_1t.event_info module

class straxen.legacy.plugins_1t.event_info.EventInfo1T[source]

Bases: MergeOnlyPlugin

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

This only uses 1T data-types as several event-plugins are nT only

config: Dict
data_kind: str | immutabledict | dict
depends_on: tuple = ('event_basics', 'event_positions', 'corrected_areas', 'energy_estimates')
deps: Dict
dtype: tuple | dtype | immutabledict | dict
input_buffer: Dict[str, Chunk]
provides: tuple = ('event_info',)
run_i: int
run_id: str
save_when = 3

straxen.legacy.plugins_1t.pax_interface module

class straxen.legacy.plugins_1t.pax_interface.RecordsFromPax[source]

Bases: Plugin

compressor = 'zstd'
data_kind: Union[str, immutabledict, dict] = 'raw_records'
depends_on: Tuple = ()
infer_dtype()[source]

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

iter(*args, **kwargs)[source]

Iterate over dependencies and yield results.

Parameters:
  • iters – dict with iterators over dependencies

  • executor – Executor to punt computation tasks to. If None, will compute inside the plugin’s thread.

parallel: Union[str, bool] = False
provides: tuple = ('raw_records',)
rechunk_on_save = False
takes_config = immutabledict({'pax_raw_dir': <strax.config.Option object>, 'stop_after_zips': <strax.config.Option object>, 'events_per_chunk': <strax.config.Option object>, 'samples_per_record': <strax.config.Option object>})
straxen.legacy.plugins_1t.pax_interface.pax_to_records(input_filename, samples_per_record=110, events_per_chunk=10)[source]

Return pulse records array from pax zip input_filename Convert pax .zip files to flat records format This only works if you have pax installed in your strax environment, which is somewhat tricky.

straxen.legacy.plugins_1t.peak_positions module

class straxen.legacy.plugins_1t.peak_positions.PeakPositions1T[source]

Bases: Plugin

Compute the S2 (x,y)-position based on a neural net.

compute(peaks)[source]
config: Dict
data_kind: str | immutabledict | dict
depends_on: tuple = 'peaks'
deps: Dict
dtype: tuple | dtype | immutabledict | dict = [('x', <class 'numpy.float32'>, 'Reconstructed S2 X position (cm), uncorrected'), ('y', <class 'numpy.float32'>, 'Reconstructed S2 Y position (cm), uncorrected'), (('Start time since unix epoch [ns]', 'time'), <class 'numpy.int64'>), (('Exclusive end time since unix epoch [ns]', 'endtime'), <class 'numpy.int64'>)]
input_buffer: Dict[str, Chunk]
parallel: str | bool = False
provides: tuple = ('peak_positions',)
run_i: int
run_id: str
setup()[source]

Hook if plugin wants to do something on initialization.

takes_config = immutabledict({'nn_architecture': <strax.config.Option object>, 'nn_weights': <strax.config.Option object>, 'min_reconstruction_area': <strax.config.Option object>, 'n_top_pmts': <strax.config.Option object>})

straxen.legacy.plugins_1t.x1t_cuts module

XENON1T cuts.

How to apply:
  • First register the plugins:

st.register_all(straxen.plugins.x1t_cuts) - Load events and the cuts you want to apply: events = st.get_array(run_id,

targets=(‘event_info’, ‘cut_s2_width’, ‘cut_s2_threshold’))

  • Apply the selection of events that pass the cut like:

selected_events = events[events[‘cut_s2_threshold’] == True]

Module contents