Skip to content

Commit 9bf08d9

Browse files
authored
[PWGLF,PWGMM] Fix position of update of last BC with activity for SL BCs (#15198)
1 parent 1dda379 commit 9bf08d9

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

PWGMM/Lumi/Tasks/lumiStabilityPP.cxx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -337,23 +337,16 @@ struct LumiStabilityPP {
337337
isSuperLeadingBcFT0 = false; // not a super-leading BC for FT0
338338
}
339339

340-
if (ctpInputMask.test(12) || ctpInputMask.test(14) || ctpInputMask.test(15) || ctpInputMask.test(16) || ctpInputMask.test(17)) { // 5 FDD triggers
341-
globalBCIdOfLastBCWithActivityFDD = globalBCFDD;
342-
}
343-
if (ctpInputMask.test(0) || ctpInputMask.test(1) || ctpInputMask.test(2) || ctpInputMask.test(3) || ctpInputMask.test(4)) { // 5 FT0 triggers
344-
globalBCIdOfLastBCWithActivityFT0 = globalBC;
340+
if (!bcPatternB[localBCFDD]) {
341+
isSuperLeadingBcFDD = false; // not a super-leading BC for FDD
345342
}
346-
347343
if (!bcPatternB[localBC]) {
348-
isSuperLeadingBcFT0 = false; // not a super-leading BC
349-
}
350-
if (!bcPatternB[localBCFDD]) {
351-
isSuperLeadingBcFDD = false; // not a super-leading BC
344+
isSuperLeadingBcFT0 = false; // not a super-leading BC for FT0
352345
}
353346

354347
int64_t globalBCStart = (globalBCLastInspectedBC >= 0 && globalBCLastInspectedBC < globalBC) ? globalBCLastInspectedBC + 1 : globalBC;
355-
int64_t maxBcDiff = (rate > 0) ? 10 * static_cast<int>(nBunchesFillingScheme * constants::lhc::LHCRevFreq / rate / 1.e3) : 1500;
356-
if (globalBC - globalBCStart > maxBcDiff) { // we changed fill, we should not count all BCs between the current and the previous one
348+
int64_t maxBcDiff = (rate > 0) ? 15 * static_cast<int>(nBunchesFillingScheme * constants::lhc::LHCRevFreq / rate / 1.e3) : 1500;
349+
if (globalBC - globalBCStart > maxBcDiff) { // we have a big jump in global BCs, we should not count all BCs between the current and the previous one
357350
globalBCStart = globalBC;
358351
}
359352
for (int64_t iGlobalBC{globalBCStart}; iGlobalBC <= globalBC; ++iGlobalBC) { // we count all BCs in between one and another stored in the AO2Ds
@@ -363,12 +356,12 @@ struct LumiStabilityPP {
363356
}
364357
if (bcPatternB[iLocalBC]) {
365358
nBCsPerBcId[iLocalBC][BCB]++;
366-
if (iGlobalBC - globalBCIdOfLastBCWithActivityFDD > numEmptyBCsBeforeLeadingBC->get(0u, 2u)) {
359+
if (iGlobalBC - globalBCIdOfLastBCWithActivityFDD >= numEmptyBCsBeforeLeadingBC->get(0u, 2u)) {
367360
nBCsPerBcId[iLocalBC][BCSLFDD]++;
368361
} else {
369362
nBCsPerBcId[iLocalBC][BCNSLFDD]++;
370363
}
371-
if (iGlobalBC - globalBCIdOfLastBCWithActivityFT0 > numEmptyBCsBeforeLeadingBC->get(0u, 2u)) {
364+
if (iGlobalBC - globalBCIdOfLastBCWithActivityFT0 >= numEmptyBCsBeforeLeadingBC->get(0u, 2u)) {
372365
nBCsPerBcId[iLocalBC][BCSLFT0]++;
373366
} else {
374367
nBCsPerBcId[iLocalBC][BCNSLFT0]++;
@@ -394,6 +387,13 @@ struct LumiStabilityPP {
394387
}
395388
}
396389

390+
if (ctpInputMask.test(12) || ctpInputMask.test(14) || ctpInputMask.test(15) || ctpInputMask.test(16) || ctpInputMask.test(17)) { // 5 FDD triggers
391+
globalBCIdOfLastBCWithActivityFDD = globalBCFDD;
392+
}
393+
if (ctpInputMask.test(0) || ctpInputMask.test(1) || ctpInputMask.test(2) || ctpInputMask.test(3) || ctpInputMask.test(4)) { // 5 FT0 triggers
394+
globalBCIdOfLastBCWithActivityFT0 = globalBC;
395+
}
396+
397397
int64_t thisTFid = (globalBC - bcSOR) / nBCsPerTF;
398398

399399
if (thisTFid != currentTFid) {

0 commit comments

Comments
 (0)