Skip to content

Commit 2bd3a39

Browse files
authored
[FOCAL-8] Use source ID to distinguish FOCAL-E subsystems (#1721)
Endpoint unreliable, was mainly a temporary solution for the 2022 testbeam. Using the source ID is more reliable as it is set by the firmwares and will also work after recabling
1 parent bb9cf8b commit 2bd3a39

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Modules/FOCAL/src/TestbeamRawTask.cxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ void TestbeamRawTask::monitorData(o2::framework::ProcessingContext& ctx)
320320
int inputs = 0;
321321
std::vector<char> rawbuffer;
322322
int currentendpoint = 0;
323+
int currentsource = 0;
323324
for (const auto& rawData : framework::InputRecordWalker(ctx.inputs())) {
324325
if (rawData.header != nullptr && rawData.payload != nullptr) {
325326
const auto payloadSize = o2::framework::DataRefUtils::getPayloadSize(rawData);
@@ -339,14 +340,14 @@ void TestbeamRawTask::monitorData(o2::framework::ProcessingContext& ctx)
339340
if (o2::raw::RDHUtils::getStop(rdh)) {
340341
ILOG(Debug, Support) << "Stop bit received - processing payload" << ENDM;
341342
// Data ready
342-
if (currentendpoint == 1) {
343+
if (currentsource == 0x2b) { // Use source ID 43 for pads
343344
// Pad data
344345
if (!mDisablePads) {
345346
ILOG(Debug, Support) << "Processing PAD data" << ENDM;
346347
auto payloadsizeGBT = rawbuffer.size() * sizeof(char) / sizeof(o2::focal::PadGBTWord);
347348
processPadPayload(gsl::span<const o2::focal::PadGBTWord>(reinterpret_cast<const o2::focal::PadGBTWord*>(rawbuffer.data()), payloadsizeGBT));
348349
}
349-
} else if (currentendpoint == 0) {
350+
} else if (currentsource == 0x20) { // Use source ID 32 (ITS) for pixels
350351
// Pixel data
351352
if (!mDisablePixels) {
352353
auto feeID = o2::raw::RDHUtils::getFEEID(rdh);
@@ -361,6 +362,7 @@ void TestbeamRawTask::monitorData(o2::framework::ProcessingContext& ctx)
361362
} else {
362363
ILOG(Debug, Support) << "New HBF or Timeframe" << ENDM;
363364
currentendpoint = o2::raw::RDHUtils::getEndPointID(rdh);
365+
currentsource = o2::raw::RDHUtils::getSourceID(rdh);
364366
ILOG(Debug, Support) << "Using endpoint " << currentendpoint;
365367
rawbuffer.clear();
366368
}

0 commit comments

Comments
 (0)