amstrax.plugins package
Submodules
amstrax.plugins.daqreader module
- class amstrax.plugins.daqreader.DAQReader[source]
Bases:
straxen.plugins.daqreader.DAQReaderRead the XAMS DAQ-live_data from redax and split it to the appropriate raw_record data-types based on the channel-map. Does nothing whatsoever to the live_data; not even baselining. Provides:
raw_records_v1724, sampled from the V1724 digitizer with sampling resolution = 10ns
raw_records_v1730, sampled from the V1730 digitizer with sampling resolution = 2ns
raw_records_aqmon, actually empty unless we need some strax-deadtime
- compressor = 'zstd'
- config: Dict
- data_kind: Union[str, immutabledict.immutabledict, dict] = immutabledict({'raw_records_v1724': 'raw_records_v1724', 'raw_records_v1730': 'raw_records_v1730', 'raw_records_aqmon': 'raw_records_aqmon'})
- deps: Dict
- parallel = 'process'
- rechunk_on_save = False
- class amstrax.plugins.daqreader.Fake1TDAQReader[source]
Bases:
amstrax.plugins.daqreader.DAQReader- config: Dict
- data_kind: Union[str, immutabledict.immutabledict, dict] = immutabledict({'raw_records': 'raw_records', 'raw_records_diagnostic': 'raw_records_diagnostic', 'raw_records_aqmon': 'raw_records_aqmon'})
- deps: Dict
amstrax.plugins.event_processing module
- class amstrax.plugins.event_processing.EventBasics[source]
Bases:
strax.plugin.LoopPlugin- config: Dict
- deps: Dict
- rechunk_on_save = False
- class amstrax.plugins.event_processing.EventInfo[source]
Bases:
strax.plugin.MergeOnlyPlugin- config: Dict
- deps: Dict
- rechunk_on_save = True
- save_when = 3
- class amstrax.plugins.event_processing.EventPositions[source]
Bases:
strax.plugin.LoopPlugin- config: Dict
- deps: Dict
- dtype: Union[tuple, numpy.dtype, immutabledict.immutabledict, dict] = [('xr', <class 'numpy.float32'>, 'Interaction x-position'), ('yr', <class 'numpy.float32'>, 'Interaction y-position'), ('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')]
- rechunk_on_save = False
- class amstrax.plugins.event_processing.Events[source]
Bases:
strax.plugin.OverlapWindowPlugin- config: Dict
- deps: Dict
- dtype: Union[tuple, numpy.dtype, immutabledict.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')]
- events_seen = 0
- parallel = False
- rechunk_on_save = False
- takes_config = immutabledict({'trigger_min_area': <strax.config.Option object>, 'trigger_min_competing': <strax.config.Option object>, 'left_event_extension': <strax.config.Option object>, 'right_event_extension': <strax.config.Option object>})
amstrax.plugins.pax_interface module
Convert pax .zip files to flat records format
- class amstrax.plugins.pax_interface.RecordsFromPax[source]
Bases:
strax.plugin.Plugin- compressor = 'zstd'
- config: Dict
- deps: Dict
- 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 = False
- 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>})
- amstrax.plugins.pax_interface.pax_to_records(input_filename, samples_per_record=110, events_per_chunk=10, dt=10)[source]
Same as straxen.pax_interface apart from dt change
Return pulse records array from pax zip input_filename This only works if you have pax installed in your strax environment, which is somewhat tricky.
amstrax.plugins.peak_processing module
- class amstrax.plugins.peak_processing.Hits[source]
Bases:
strax.plugin.Plugin- config: Dict
- deps: Dict
- dtype: Union[tuple, numpy.dtype, immutabledict.immutabledict, dict] = [(('Start time since unix epoch [ns]', 'time'), <class 'numpy.int64'>), (('Length of the interval in samples', 'length'), <class 'numpy.int32'>), (('Width of one sample [ns]', 'dt'), <class 'numpy.int16'>), (('Channel/PMT number', 'channel'), <class 'numpy.int16'>), (('Integral [ADC x samples]', 'area'), <class 'numpy.float32'>), (('Index of sample in record in which hit starts', 'left'), <class 'numpy.int16'>), (('Index of first sample in record just beyond hit (exclusive bound)', 'right'), <class 'numpy.int16'>), (('For lone hits, index of sample in record where integration starts', 'left_integration'), <class 'numpy.int16'>), (('For lone hits, index of first sample beyond integration region', 'right_integration'), <class 'numpy.int16'>), (('Internal (temporary) index of fragment in which hit was found', 'record_i'), <class 'numpy.int32'>), (('ADC threshold applied in order to find hits', 'threshold'), <class 'numpy.float32'>), (('Maximum amplitude above baseline [ADC counts]', 'height'), <class 'numpy.float32'>)]
- parallel = 'False'
- rechunk_on_save = False
- takes_config = immutabledict({'hit_threshold': <strax.config.Option object>, 'save_outside_hits': <strax.config.Option object>})
- class amstrax.plugins.peak_processing.PeakBasics[source]
Bases:
strax.plugin.Plugin- config: Dict
- deps: Dict
- dtype: Union[tuple, numpy.dtype, immutabledict.immutabledict, dict] = [(('Start time of the peak (ns since unix epoch)', 'time'), <class 'numpy.int64'>), (('End time of the peak (ns since unix epoch)', 'endtime'), <class 'numpy.int64'>), (('Peak integral in PE', 'area'), <class 'numpy.float32'>), (('Number of PMTs contributing to the peak', 'n_channels'), <class 'numpy.int16'>), (('PMT number which contributes the most PE', 'max_pmt'), <class 'numpy.int16'>), (('Area of signal in the largest-contributing PMT (PE)', 'max_pmt_area'), <class 'numpy.int32'>), (('Width (in ns) of the central 50% area of the peak', 'range_50p_area'), <class 'numpy.float32'>), (('Fraction of area seen by the top array', 'area_fraction_top'), <class 'numpy.float32'>), (('Length of the peak waveform in samples', 'length'), <class 'numpy.int32'>), (('Time resolution of the peak waveform in ns', 'dt'), <class 'numpy.int16'>), ('n_competing', <class 'numpy.int32'>, 'Number of nearby larger or slightly smaller peaks')]
- parallel = 'False'
- rechunk_on_save = False
- takes_config = immutabledict({'min_area_fraction': <strax.config.Option object>, 'nearby_window': <strax.config.Option object>})
- class amstrax.plugins.peak_processing.PeakClassification[source]
Bases:
strax.plugin.Plugin- config: Dict
- deps: Dict
- dtype: Union[tuple, numpy.dtype, immutabledict.immutabledict, dict] = [('type', <class 'numpy.int8'>, 'Classification of the peak.'), ('time', <class 'numpy.int64'>, 'Start time of the peak (ns since unix epoch)'), ('endtime', <class 'numpy.int64'>, 'End time of the peak (ns since unix epoch)')]
- parallel = True
- rechunk_on_save = False
- takes_config = immutabledict({'s1_max_width': <strax.config.Option object>, 's1_min_area': <strax.config.Option object>, 's2_min_area': <strax.config.Option object>, 's2_min_width': <strax.config.Option object>})
- class amstrax.plugins.peak_processing.PeakPositions[source]
Bases:
strax.plugin.Plugin- config: Dict
- deps: Dict
- dtype: Union[tuple, numpy.dtype, immutabledict.immutabledict, dict] = [('xr', <class 'numpy.float32'>, 'Interaction x-position'), ('yr', <class 'numpy.float32'>, 'Interaction y-position'), ('r', <class 'numpy.float32'>, 'radial distance'), ('time', <class 'numpy.int64'>, 'Start time of the peak (ns since unix epoch)'), ('endtime', <class 'numpy.int64'>, 'End time of the peak (ns since unix epoch)')]
- rechunk_on_save = False
amstrax.plugins.pulse_processing module
- class amstrax.plugins.pulse_processing.PulseProcessing[source]
Bases:
strax.plugin.PluginSplit raw_records into:
(tpc) records
pulse_counts
- For TPC records, apply basic processing:
1. Flip, baseline, and integrate the waveform 3. Find hits, and zero outside hits.
pulse_counts holds some average information for the individual PMT channels for each chunk of raw_records. This includes e.g. number of recorded pulses, lone_pulses (pulses which do not overlap with any other pulse), or mean values of baseline and baseline rms channel.
- compressor = 'lz4'
- config: Dict
- data_kind: Union[str, immutabledict.immutabledict, dict] = {'pulse_counts': 'pulse_counts', 'records': 'records'}
- deps: Dict
- parallel = 'process'
- rechunk_on_save = immutabledict({'records': False, 'pulse_counts': True})
- takes_config = immutabledict({'baseline_samples': <strax.config.Option object>, 'save_outside_hits': <strax.config.Option object>, 'n_tpc_pmts': <strax.config.Option object>, 'check_raw_record_overlaps': <strax.config.Option object>, 'allow_sloppy_chunking': <strax.config.Option object>, 'hit_min_amplitude': <strax.config.Option object>})
amstrax.plugins.pulse_processing_alt_baseline module
- class amstrax.plugins.pulse_processing_alt_baseline.PeakBasicsBottomAltBl[source]
Bases:
strax.plugin.Plugin- config: Dict
- deps: Dict
- dtype: Union[tuple, numpy.dtype, immutabledict.immutabledict, dict] = [(('Start time of the peak (ns since unix epoch)', 'time'), <class 'numpy.int64'>), (('End time of the peak (ns since unix epoch)', 'endtime'), <class 'numpy.int64'>), (('Peak integral in PE', 'area'), <class 'numpy.float32'>), (('Number of PMTs contributing to the peak', 'n_channels'), <class 'numpy.int16'>), (('PMT number which contributes the most PE', 'max_pmt'), <class 'numpy.int16'>), (('Area of signal in the largest-contributing PMT (PE)', 'max_pmt_area'), <class 'numpy.int32'>), (('Width (in ns) of the central 50% area of the peak', 'range_50p_area'), <class 'numpy.float32'>), (('Fraction of area seen by the top array', 'area_fraction_top'), <class 'numpy.float32'>), (('Length of the peak waveform in samples', 'length'), <class 'numpy.int32'>), (('Time resolution of the peak waveform in ns', 'dt'), <class 'numpy.int16'>)]
- parallel = 'False'
- rechunk_on_save = True
- class amstrax.plugins.pulse_processing_alt_baseline.PeakBasicsTopAltBl[source]
Bases:
strax.plugin.Plugin- config: Dict
- deps: Dict
- dtype: Union[tuple, numpy.dtype, immutabledict.immutabledict, dict] = [(('Start time of the peak (ns since unix epoch)', 'time'), <class 'numpy.int64'>), (('End time of the peak (ns since unix epoch)', 'endtime'), <class 'numpy.int64'>), (('Peak integral in PE', 'area'), <class 'numpy.float32'>), (('Number of PMTs contributing to the peak', 'n_channels'), <class 'numpy.int16'>), (('PMT number which contributes the most PE', 'max_pmt'), <class 'numpy.int16'>), (('Area of signal in the largest-contributing PMT (PE)', 'max_pmt_area'), <class 'numpy.int32'>), (('Width (in ns) of the central 50% area of the peak', 'range_50p_area'), <class 'numpy.float32'>), (('Fraction of area seen by the top array', 'area_fraction_top'), <class 'numpy.float32'>), (('Length of the peak waveform in samples', 'length'), <class 'numpy.int32'>), (('Time resolution of the peak waveform in ns', 'dt'), <class 'numpy.int16'>)]
- parallel = 'False'
- rechunk_on_save = True
- class amstrax.plugins.pulse_processing_alt_baseline.PeaksAltBl[source]
Bases:
strax.plugin.Plugin- config: Dict
- data_kind: Union[str, immutabledict.immutabledict, dict] = {'peaks_bottom_alt_bl': 'peaks', 'peaks_top_alt_bl': 'peaks'}
- deps: Dict
- dtype: Union[tuple, numpy.dtype, immutabledict.immutabledict, dict] = {'peaks_bottom_alt_bl': [(('Start time since unix epoch [ns]', 'time'), <class 'numpy.int64'>), (('Length of the interval in samples', 'length'), <class 'numpy.int32'>), (('Width of one sample [ns]', 'dt'), <class 'numpy.int32'>), (('Channel/PMT number', 'channel'), <class 'numpy.int16'>), (('Classification of the peak(let)', 'type'), <class 'numpy.int8'>), (('Integral across channels [PE]', 'area'), <class 'numpy.float32'>), (('Integral per channel [PE]', 'area_per_channel'), <class 'numpy.float32'>, 8), (('Number of hits contributing at least one sample to the peak ', 'n_hits'), <class 'numpy.int32'>), (('Waveform data in PE/sample (not PE/ns!)', 'data'), <class 'numpy.float32'>, 200), (('Peak widths in range of central area fraction [ns]', 'width'), <class 'numpy.float32'>, 11), (('Peak widths: time between nth and 5th area decile [ns]', 'area_decile_from_midpoint'), <class 'numpy.float32'>, 11), (('Does the channel reach ADC saturation?', 'saturated_channel'), <class 'numpy.int8'>, 8), (('Total number of saturated channels', 'n_saturated_channels'), <class 'numpy.int16'>), (('Hits within tight range of mean', 'tight_coincidence'), <class 'numpy.int16'>), (('number of contributing channels within tight range of mean', 'tight_coincidence_channel'), <class 'numpy.int16'>), (('Largest gap between hits inside peak [ns]', 'max_gap'), <class 'numpy.int32'>), (('Maximum interior goodness of split', 'max_goodness_of_split'), <class 'numpy.float32'>), (('Maximum height of the peak', 'peak_max'), <class 'numpy.int16'>)], 'peaks_top_alt_bl': [(('Start time since unix epoch [ns]', 'time'), <class 'numpy.int64'>), (('Length of the interval in samples', 'length'), <class 'numpy.int32'>), (('Width of one sample [ns]', 'dt'), <class 'numpy.int32'>), (('Channel/PMT number', 'channel'), <class 'numpy.int16'>), (('Classification of the peak(let)', 'type'), <class 'numpy.int8'>), (('Integral across channels [PE]', 'area'), <class 'numpy.float32'>), (('Integral per channel [PE]', 'area_per_channel'), <class 'numpy.float32'>, 8), (('Number of hits contributing at least one sample to the peak ', 'n_hits'), <class 'numpy.int32'>), (('Waveform data in PE/sample (not PE/ns!)', 'data'), <class 'numpy.float32'>, 200), (('Peak widths in range of central area fraction [ns]', 'width'), <class 'numpy.float32'>, 11), (('Peak widths: time between nth and 5th area decile [ns]', 'area_decile_from_midpoint'), <class 'numpy.float32'>, 11), (('Does the channel reach ADC saturation?', 'saturated_channel'), <class 'numpy.int8'>, 8), (('Total number of saturated channels', 'n_saturated_channels'), <class 'numpy.int16'>), (('Hits within tight range of mean', 'tight_coincidence'), <class 'numpy.int16'>), (('number of contributing channels within tight range of mean', 'tight_coincidence_channel'), <class 'numpy.int16'>), (('Largest gap between hits inside peak [ns]', 'max_gap'), <class 'numpy.int32'>), (('Maximum interior goodness of split', 'max_goodness_of_split'), <class 'numpy.float32'>), (('Maximum height of the peak', 'peak_max'), <class 'numpy.int16'>)]}
- parallel = 'process'
- rechunk_on_save = True
- takes_config = immutabledict({'peak_gap_threshold': <strax.config.Option object>, 'peak_left_extension': <strax.config.Option object>, 'peak_right_extension': <strax.config.Option object>, 'peak_min_area': <strax.config.Option object>, 'peak_min_pmts': <strax.config.Option object>, 'single_channel_peaks': <strax.config.Option object>, 'peak_split_min_height': <strax.config.Option object>, 'peak_split_min_ratio': <strax.config.Option object>, 'diagnose_sorting': <strax.config.Option object>, 'pmt_channel': <strax.config.Option object>, 'trigger_threshold': <strax.config.Option object>})
- class amstrax.plugins.pulse_processing_alt_baseline.PulseProcessing[source]
Bases:
strax.plugin.PluginSplit raw_records into:
tpc_records
diagnostic_records
aqmon_records
Perhaps this should be done by DAQreader in the future
For TPC records, apply basic processing:
Apply software HE veto after high-energy peaks.
Find hits, apply linear filter, and zero outside hits.
- compressor = 'zstd'
- config: Dict
- data_kind: Union[str, immutabledict.immutabledict, dict] = {'pulse_counts': 'pulse_counts', 'records_alt_bl': 'records_alt_bl'}
- deps: Dict
- parallel = 'process'
- rechunk_on_save = False
- takes_config = immutabledict({'save_outside_hits': <strax.config.Option object>, 'trigger_threshold': <strax.config.Option object>})