Skip to content

Commit

Permalink
ITS: Fix placement of REGION HEADERS during ALPIDE data encoding (#13229
Browse files Browse the repository at this point in the history
)

* ITS: Fix placement of REGION HEADERS during ALPIDE data encoding

REGION HEADERS must be placed exactly once per region with detected
hits, not before every hit within a region.

* Fix missing braces

---------

Co-authored-by: Kirill Naumov <[email protected]>
Co-authored-by: Giulio Eulisse <[email protected]>
  • Loading branch information
3 people authored Jun 20, 2024
1 parent 5b3489d commit 67d4c67
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Detectors/ITSMFT/common/reconstruction/src/AlpideCoder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,15 @@ int AlpideCoder::encodeChip(PayLoadCont& buffer, const o2::itsmft::ChipPixelData
}
buffer.addFast(makeChipHeader(chipInModule, bc)); // chip header
for (int ir = 0; ir < NRegions; ir++) {
nfound += procRegion(buffer, ir);
// For each region, we encode a REGION HEADER flag immediately
// to ensure its uniqueness.
buffer.addFast(makeRegion(ir));
int nfoundInRegion = procRegion(buffer, ir);
nfound += nfoundInRegion;
// If the region was unpopulated, we remove REGION HEADER flag.
if (!nfoundInRegion) {
buffer.erase(1);
}
}
buffer.addFast(makeChipTrailer(roflags));
resetMap();
Expand Down Expand Up @@ -114,10 +122,6 @@ int AlpideCoder::procDoubleCol(PayLoadCont& buffer, short reg, short dcol)
}
//
int ih = 0;
if (nHits) {
buffer.addFast(makeRegion(reg)); // flag region start
}

while ((ih < nHits)) {
short addrE, addrW = hits[ih++]; // address of the reference hit
uint8_t mask = 0;
Expand Down

0 comments on commit 67d4c67

Please sign in to comment.