Skip to content

Commit

Permalink
Following the breaking change of AxFoundation/strax#910 (#1452)
Browse files Browse the repository at this point in the history
  • Loading branch information
dachengx authored Oct 16, 2024
1 parent df0d488 commit a759148
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
Binary file added .coverage
Binary file not shown.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ docs/_build
# Pycharm
.idea

# coverage
.coverage

# graphviz
*.gv
*.dot
Expand Down
2 changes: 1 addition & 1 deletion straxen/plugins/events/event_top_bottom_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def infer_dtype(self):
def compute(self, events):
result = np.zeros(events.shape, dtype=self.dtype)
result["time"], result["endtime"] = events["time"], strax.endtime(events)
peak_dtype = strax.peak_dtype(n_channels=straxen.n_tpc_pmts, digitize_top=False)
peak_dtype = strax.peak_dtype(n_channels=straxen.n_tpc_pmts, store_data_top=False)
for type_ in self.ptypes:
for arr_ in self.arrs:
# in order to reuse the same definitions as in other parts, we create "fake peaks"
Expand Down
3 changes: 2 additions & 1 deletion straxen/plugins/merged_s2s/merged_s2s.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ def compute(self, peaklets, lone_hits):

if "data_top" not in peaklets.dtype.names:
peaklets_w_field = np.zeros(
len(peaklets), dtype=strax.peak_dtype(n_channels=self.n_tpc_pmts, digitize_top=True)
len(peaklets),
dtype=strax.peak_dtype(n_channels=self.n_tpc_pmts, store_data_top=True),
)
strax.copy_to_buffer(peaklets, peaklets_w_field, "_add_data_top_field")
del peaklets
Expand Down
8 changes: 5 additions & 3 deletions straxen/plugins/peaklets/peaklets.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def infer_dtype(self):
return dict(
peaklets=strax.peak_dtype(
n_channels=self.n_tpc_pmts,
digitize_top=self.sum_waveform_top_array,
store_data_top=self.sum_waveform_top_array,
),
lone_hits=strax.hit_dtype,
)
Expand Down Expand Up @@ -205,7 +205,7 @@ def compute(self, records, start, end):
right_extension=self.peak_right_extension,
min_channels=self.peak_min_pmts,
# NB, need to have the data_top field here, will discard if not digitized later
result_dtype=strax.peak_dtype(n_channels=self.n_tpc_pmts, digitize_top=True),
result_dtype=strax.peak_dtype(n_channels=self.n_tpc_pmts, store_data_top=True),
max_duration=self.peaklet_max_duration,
)

Expand Down Expand Up @@ -543,7 +543,9 @@ def peak_saturation_correction(
peaks[peak_i]["length"] = p["length"] * p["dt"] / dt
peaks[peak_i]["dt"] = dt

strax.sum_waveform(peaks, hitlets, records, rlinks, to_pe, n_top_channels, peak_list)
strax.sum_waveform(
peaks, hitlets, records, rlinks, to_pe, n_top_channels, select_peaks_indices=peak_list
)
return peak_list


Expand Down
4 changes: 3 additions & 1 deletion straxen/plugins/peaklets_he/peaklets_he.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ def n_tpc_pmts(self):
return self.n_he_pmts

def infer_dtype(self):
return strax.peak_dtype(n_channels=self.n_he_pmts, digitize_top=self.sum_waveform_top_array)
return strax.peak_dtype(
n_channels=self.n_he_pmts, store_data_top=self.sum_waveform_top_array
)

def setup(self):
self.to_pe = self.gain_model
Expand Down

0 comments on commit a759148

Please sign in to comment.