Skip to content

Commit fde8016

Browse files
authored
[Common] Fill RCT once per TF + protection for unanchored runs (#10032)
1 parent ee6c095 commit fde8016

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

Common/TableProducer/eventSelection.cxx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ struct BcSelectionTask {
6868
Configurable<std::vector<int>> maxInactiveChipsPerLayer{"maxInactiveChipsPerLayer", {8, 8, 8, 111, 111, 195, 195}, "Maximum allowed number of inactive ITS chips per layer"};
6969

7070
int lastRun = -1;
71+
int64_t lastTF = -1;
72+
uint32_t lastRCT = 0;
7173
uint64_t sorTimestamp = 0; // default SOR timestamp
7274
uint64_t eorTimestamp = 1; // default EOR timestamp
7375
int64_t bcSOR = -1; // global bc of the start of run
@@ -341,11 +343,17 @@ struct BcSelectionTask {
341343
// bc loop
342344
for (auto bc : bcs) { // o2-linter: disable=const-ref-in-for-loop
343345
// store rct flags
344-
auto itrct = mapRCT->upper_bound(bc.timestamp());
345-
if (itrct != mapRCT->begin())
346-
itrct--;
347-
uint32_t rct = itrct->second;
348-
LOGP(debug, "sor={} eor={} ts={} rct={}", sorTimestamp, eorTimestamp, bc.timestamp(), rct);
346+
uint32_t rct = lastRCT;
347+
int64_t thisTF = (bc.globalBC() - bcSOR) / nBCsPerTF;
348+
if (mapRCT != nullptr && thisTF != lastTF) { // skip for unanchored runs; do it once per TF
349+
auto itrct = mapRCT->upper_bound(bc.timestamp());
350+
if (itrct != mapRCT->begin())
351+
itrct--;
352+
rct = itrct->second;
353+
LOGP(debug, "sor={} eor={} ts={} rct={}", sorTimestamp, eorTimestamp, bc.timestamp(), rct);
354+
lastRCT = rct;
355+
lastTF = thisTF;
356+
}
349357

350358
uint32_t alias{0};
351359
// workaround for pp2022 (trigger info is shifted by -294 bcs)

0 commit comments

Comments
 (0)