Skip to content

Commit

Permalink
use channel tight coincidence level (#745)
Browse files Browse the repository at this point in the history
Co-authored-by: Evan Shockley <[email protected]>
Co-authored-by: Shingo Kazama <[email protected]>
Co-authored-by: Daniel Wenz <[email protected]>
  • Loading branch information
4 people authored Dec 9, 2021
1 parent 23e4eac commit 8703c5d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions straxen/plugins/peaklet_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,23 +558,21 @@ class PeakletClassification(strax.Plugin):
parallel = True
dtype = (strax.peak_interval_dtype
+ [('type', np.int8, 'Classification of the peak(let)')])
__version__ = '0.2.1'
__version__ = '0.2.2'

def compute(self, peaklets):
peaks = peaklets

ptype = np.zeros(len(peaklets), dtype=np.int8)

# Properties needed for classification. Bit annoying these computations
# are duplicated in peak_basics curently...
rise_time = -peaks['area_decile_from_midpoint'][:, 1]
n_channels = (peaks['area_per_channel'] > 0).sum(axis=1)
rise_time = -peaklets['area_decile_from_midpoint'][:, 1]
n_channels = (peaklets['area_per_channel'] > 0).sum(axis=1)

is_s1 = (
(rise_time <= self.config['s1_max_rise_time'])
| ((rise_time <= self.config['s1_max_rise_time_post100'])
& (peaks['area'] > 100)))
is_s1 &= peaks['tight_coincidence'] >= self.config['s1_min_coincidence']
& (peaklets['area'] > 100)))
is_s1 &= peaklets['tight_coincidence_channel'] >= self.config['s1_min_coincidence']
ptype[is_s1] = 1

is_s2 = n_channels >= self.config['s2_min_pmts']
Expand Down

0 comments on commit 8703c5d

Please sign in to comment.