Skip to content

Commit

Permalink
Handle edge case when trigger width is less than trigger resolution. (#…
Browse files Browse the repository at this point in the history
…217)

Previously, this is not done correctly as the for loop will not run at all,
resulting in `trigger_histogram` being empty.
  • Loading branch information
JamesJieranShen authored Jan 17, 2025
1 parent acf82a1 commit 0f3776c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/daq/src/SplitEVDAQProc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,12 @@ Processor::Result SplitEVDAQProc::DSEvent(DS::Root *ds) {
for (int i = 0; i < nbins; i++) {
double x = triggerTrain[i];
if (x > 0) {
for (int j = i; j < i + int(fPulseWidth / bw); j++) {
int j = i;
do {
if (j >= nbins) break;
triggerHistogram[j] += x;
}
j++;
} while (j < i + int(fPulseWidth / bw));
}
}

Expand Down

0 comments on commit 0f3776c

Please sign in to comment.