Skip to content

Commit

Permalink
saving per channel contribution to tight coincidence (#641)
Browse files Browse the repository at this point in the history
  • Loading branch information
feigaodm committed Nov 13, 2017
1 parent b544afe commit b19b1be
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pax/datastructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ class Peak(StrictModel):
#: Total areas of all hits per PMT (pe).
area_per_channel = np.array([], dtype='float64')

# contribution to tight coincidence, 1 or 0 for each channel
coincidence_per_channel = np.array([], dtype=np.int16)

#: Total area of all hits across all PMTs (pes).
#: In XerawdpImitation mode, rightmost sample is not included in area integral.
area = 0.0
Expand Down
7 changes: 7 additions & 0 deletions pax/plugins/peak_processing/BasicProperties.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ def transform_event(self, event):
right = peak.index_of_maximum + self.tight_coincidence_samples
peak.tight_coincidence = len(np.unique(peak.hits['channel'][(x >= left) & (x <= right)]))

# list of pmts that contribute to tight coincidence of the peak
peak.coincidence_per_channel = np.zeros_like(peak.hits_per_channel)
for hitt in peak.hits:
if hitt['index_of_maximum'] >= left and hitt['index_of_maximum'] <= right:
pmt_index = hitt['channel']
peak.coincidence_per_channel[pmt_index] = 1

# Store the waveform; for tpc also store the top waveform
put_w_in_center_of_field(w, peak.sum_waveform, cog_idx)
if peak.detector == 'tpc':
Expand Down

0 comments on commit b19b1be

Please sign in to comment.