Skip to content

Commit

Permalink
added gain correction in options
Browse files Browse the repository at this point in the history
  • Loading branch information
cfuselli committed Dec 6, 2023
1 parent f13ff35 commit a885a9a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions amstrax/plugins/peaks/peaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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)
Expand Down

0 comments on commit a885a9a

Please sign in to comment.