diff --git a/amstrax/plugins/events/event_basics.py b/amstrax/plugins/events/event_basics.py index 2ea078ac..b344b058 100644 --- a/amstrax/plugins/events/event_basics.py +++ b/amstrax/plugins/events/event_basics.py @@ -104,7 +104,6 @@ def _set_dtype_requirements(self): ('area', np.float32, 'area, uncorrected [PE]'), ('n_channels', np.int16, 'count of contributing PMTs'), ('n_hits', np.int16, 'count of hits contributing at least one sample to the peak'), - ('n_competing', np.int32, 'number of competing peaks'), ('max_pmt', np.int16, 'PMT number which contributes the most PE'), ('max_pmt_area', np.float32, 'area in the largest-contributing PMT (PE)'), ('range_50p_area', np.float32, 'width, 50% area [ns]'), diff --git a/amstrax/plugins/events/events.py b/amstrax/plugins/events/events.py index 6435ef4c..251aac67 100644 --- a/amstrax/plugins/events/events.py +++ b/amstrax/plugins/events/events.py @@ -8,22 +8,17 @@ strax.Option('trigger_min_area', default=10, help='Peaks must have more area (PE) than this to ' 'cause events'), - strax.Option('trigger_min_competing', default=3, # not used - help='Peaks must have More nearby larger or slightly smaller' - ' peaks to cause events'), - strax.Option('left_event_extension', default=int(0), + strax.Option('left_event_extension', default=int(5e5), help='Extend events this many ns to the left from each ' 'triggering peak'), strax.Option('right_event_extension', default=int(5e4), - help='Extend events this many ns to the right from each ' 'triggering peak'), ) class Events(strax.OverlapWindowPlugin): depends_on = ['peaks', - #'peak_basics', - #'peak_proximity', - 'peak_classification'] # peak_basics instead of n_competing + 'peak_basics', + ] rechunk_on_save = False data_kind = 'events' parallel = False @@ -32,7 +27,7 @@ class Events(strax.OverlapWindowPlugin): ('time', np.int64, 'Event start time in ns since the unix epoch'), ('endtime', np.int64, 'Event end time in ns since the unix epoch')] events_seen = 0 - __version__ = '1.0.1' + __version__ = '1.0.2' def get_window_size(self): diff --git a/amstrax/plugins/peaks/peak_basics.py b/amstrax/plugins/peaks/peak_basics.py index f7755296..f8edfa5e 100644 --- a/amstrax/plugins/peaks/peak_basics.py +++ b/amstrax/plugins/peaks/peak_basics.py @@ -56,19 +56,9 @@ ), strax.Option( 's2_min_width', - default=750, + default=225, help="Minimum width for S2s" ), - strax.Option( - 's1_min_center_position', - default=0.2, - help="Minimum center position for S2s" - ), - strax.Option( - 's1_max_center_position', - default=0.44, - help="Maximum center position for S2s" - ), strax.Option( 's1_min_channels', default=5, @@ -81,12 +71,12 @@ ), strax.Option( 's2_min_area_fraction_top', - default=0.2, + default=0, help="Minimum area fraction top for S2s" ), strax.Option( 's1_max_area_fraction_top', - default=0.5, + default=.2, help="Maximum area fraction top for S1s" ), ) @@ -97,7 +87,7 @@ class PeakBasics(strax.Plugin): parallel = "False" rechunk_on_save = False - __version__ = "2.0" + __version__ = "2.1" dtype = [ (('Start time of the peak (ns since unix epoch)', 'time'), np.int64), @@ -180,15 +170,10 @@ def compute(self, peaks): # 0 = unknown # 1 = s1 # 2 = s2 - - # Negative or zero-area peaks have centertime at startime - center_position = (r['center_time'] - p['time']) / (p['dt'] * p['length']) - + is_s1 = p['area'] >= self.config['s1_min_area'] is_s1 &= r['range_50p_area'] > self.config['s1_min_width'] is_s1 &= r['range_50p_area'] < self.config['s1_max_width'] - is_s1 &= center_position > self.config['s1_min_center_position'] - is_s1 &= center_position < self.config['s1_max_center_position'] is_s1 &= r['area_fraction_top'] <= self.config['s1_max_area_fraction_top'] is_s1 &= r['n_channels'] >= self.config['s1_min_channels']