Skip to content

Commit

Permalink
fix bad truncation when filling TOF dia
Browse files Browse the repository at this point in the history
  • Loading branch information
noferini committed Sep 24, 2024
1 parent 373f808 commit 56c3ba4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Detectors/TOF/base/src/WindowFiller.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,14 @@ void WindowFiller::fillOutputContainer(std::vector<Digit>& digits)
// check if patterns are in the current row
unsigned int initrow = mFirstIR.orbit * Geo::NWINDOW_IN_ORBIT;
for (std::vector<PatternData>::reverse_iterator it = mCratePatterns.rbegin(); it != mCratePatterns.rend(); ++it) {
//printf("pattern row=%ld current=%ld\n",it->row - initrow,mReadoutWindowCurrent);
unsigned int irow = it->row;
// printf("pattern row=%ld (%u - %u) current=%ld\n",irow - initrow,irow,initrow,mReadoutWindowCurrent);

if (it->row - initrow > mReadoutWindowCurrent) {
if (irow - initrow > mReadoutWindowCurrent) {
break;
}

if (it->row - initrow < mReadoutWindowCurrent) { // this should not happen
if (irow - initrow < mReadoutWindowCurrent) { // this should not happen
LOG(error) << "One pattern skipped because appears to occur early of the current row " << it->row << " < " << mReadoutWindowCurrent << " ?!";
} else {
uint32_t cpatt = it->pattern;
Expand All @@ -211,6 +212,7 @@ void WindowFiller::fillOutputContainer(std::vector<Digit>& digits)
uint32_t cbit = 1;

mPatterns.push_back(slot + 28); // add slot
printf("Add Dia slot = %d\n",slot);
info.addedDiagnostic(it->icrate);
npatterns++;

Expand Down

0 comments on commit 56c3ba4

Please sign in to comment.