From a885a9a1866b312f9826f681d86efcc1f5d9f296 Mon Sep 17 00:00:00 2001 From: cfuselli Date: Wed, 6 Dec 2023 17:53:19 +0100 Subject: [PATCH] added gain correction in options --- amstrax/plugins/peaks/peaks.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/amstrax/plugins/peaks/peaks.py b/amstrax/plugins/peaks/peaks.py index e5a8052a..917c63bf 100644 --- a/amstrax/plugins/peaks/peaks.py +++ b/amstrax/plugins/peaks/peaks.py @@ -37,7 +37,10 @@ strax.Option('diagnose_sorting', track=False, default=False, help="Enable runtime checks for sorting and disjointness"), strax.Option('n_tpc_pmts', track=False, default=False, - help="Number of channels"), ) + help="Number of channels"), + strax.Option('gain_to_pe_array', default=None, + help="Gain to pe array"), +) class Peaks(strax.Plugin): depends_on = ('records',) data_kind = 'peaks' @@ -55,7 +58,10 @@ def compute(self, records, start, end): r = records - self.to_pe = np.ones(self.config['n_tpc_pmts']) + if self.config['gain_to_pe_array'] is None: + self.to_pe = np.ones(self.config['n_tpc_pmts']) + else: + self.to_pe = self.config['gain_to_pe_array'] hits = strax.find_hits(r) hits = strax.sort_by_time(hits)