Skip to content

Commit cfdd3f9

Browse files
committed
O2 linter fixes
1 parent bd7c613 commit cfdd3f9

1 file changed

Lines changed: 21 additions & 21 deletions

File tree

Common/TableProducer/eventSelection.cxx

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ struct BcSelectionTask {
267267
if (run != lastRun) {
268268
lastRun = run;
269269
int run3min = 500000;
270-
if (run < run3min) { // unanchored Run3 MC
270+
if (run < run3min) { // unanchored Run3 MC
271271
auto runDuration = ccdb->getRunDuration(run, true); // fatalise if timestamps are not found
272272
// SOR and EOR timestamps
273273
sorTimestamp = runDuration.first; // timestamp of the SOR/SOX/STF in ms
@@ -351,7 +351,7 @@ struct BcSelectionTask {
351351
}
352352

353353
int triggerBcShift = confTriggerBcShift;
354-
if (confTriggerBcShift == 999) { // o2-linter: disable=magic-number (indeed, this is a magic number)
354+
if (confTriggerBcShift == 999) { // o2-linter: disable=magic-number (special shift for early 2022 data)
355355
triggerBcShift = (run <= 526766 || (run >= 526886 && run <= 527237) || (run >= 527259 && run <= 527518) || run == 527523 || run == 527734 || run >= 534091) ? 0 : 294; // o2-linter: disable=magic-number (magic list of runs)
356356
}
357357

@@ -415,7 +415,7 @@ struct BcSelectionTask {
415415
timeT0ABG = bc.has_ft0() ? bc.ft0().timeA() : -999.f;
416416
timeT0CBG = bc.has_ft0() ? bc.ft0().timeC() : -999.f;
417417
}
418-
if (bc.globalBC() + bcDistanceToBeamGasForFDD == globalBC) {
418+
if (bc.globalBC() + bcDistanceToBeamGasForFDD == globalBC) {
419419
timeFDABG = bc.has_fdd() ? bc.fdd().timeA() : -999.f;
420420
timeFDCBG = bc.has_fdd() ? bc.fdd().timeC() : -999.f;
421421
}
@@ -493,17 +493,17 @@ struct BcSelectionTask {
493493
// Temporary workaround to get visible cross section. TODO: store run-by-run visible cross sections in CCDB
494494
const char* srun = Form("%d", run);
495495

496-
bool injectionEnergy = (run >= 500000 && run <= 520099) || (run >= 534133 && run <= 534468); // o2-linter: disable=magic-number (todo: extract from ccdb)
496+
bool injectionEnergy = (run >= 500000 && run <= 520099) || (run >= 534133 && run <= 534468); // o2-linter: disable=magic-number (TODO extract from ccdb)
497497
// Cross sections in ub. Using dummy -1 if lumi estimator is not reliable
498498
float csTVX = isPP ? (injectionEnergy ? 0.0355e6 : 0.0594e6) : -1.;
499499
float csTCE = isPP ? -1. : 10.36e6;
500500
float csZEM = isPP ? -1. : 415.2e6; // see AN: https://alice-notes.web.cern.ch/node/1515
501501
float csZNC = isPP ? -1. : 214.5e6; // see AN: https://alice-notes.web.cern.ch/node/1515
502-
if (run > 543437 && run < 543514) { // o2-linter: disable=magic-number (todo: store and extract cross sections from ccdb)
502+
if (run > 543437 && run < 543514) { // o2-linter: disable=magic-number (TODO store and extract cross sections from ccdb)
503503
csTCE = 8.3e6;
504504
}
505-
if (run >= 543514) {
506-
csTCE = 4.10e6; // see AN: https://alice-notes.web.cern.ch/node/1515
505+
if (run >= 543514) { // o2-linter: disable=magic-number (TODO store and extract cross sections from ccdb)
506+
csTCE = 4.10e6; // see AN: https://alice-notes.web.cern.ch/node/1515
507507
}
508508

509509
// Fill TVX (T0 vertex) counters
@@ -720,7 +720,7 @@ struct EventSelectionTask {
720720
int spdClusters = bc.spdClustersL0() + bc.spdClustersL1();
721721

722722
selection |= (spdClusters < par->fSPDClsVsTklA + nTkl * par->fSPDClsVsTklB) ? BIT(kNoSPDClsVsTklBG) : 0;
723-
selection |= !(nTkl < 6 && multV0C012 > par->fV0C012vsTklA + nTkl * par->fV0C012vsTklB) ? BIT(kNoV0C012vsTklBG) : 0; // o2-linter: disable=magic-number (nTkl dependent parameterization)
723+
selection |= !(nTkl < 6 && multV0C012 > par->fV0C012vsTklA + nTkl * par->fV0C012vsTklB) ? BIT(kNoV0C012vsTklBG) : 0; // o2-linter: disable=magic-number (nTkl dependent parameterization)
724724

725725
// copy rct flags from bcsel table
726726
uint32_t rct = bc.rct_raw();
@@ -740,7 +740,7 @@ struct EventSelectionTask {
740740
sel1 = sel1 && bc.selection_bit(kNoTPCHVdip);
741741

742742
// INT1 (SPDFO>0 | V0A | V0C) minimum bias trigger logic used in pp2010 and pp2011
743-
bool isINT1period = bc.runNumber() <= 136377 || (bc.runNumber() >= 144871 && bc.runNumber() <= 159582); // o2-linter: disable=magic-number (magic run numbers)
743+
bool isINT1period = bc.runNumber() <= 136377 || (bc.runNumber() >= 144871 && bc.runNumber() <= 159582); // o2-linter: disable=magic-number (magic run numbers)
744744

745745
// fill counters
746746
if (isMC == 1 || (!isINT1period && bc.alias_bit(kINT7)) || (isINT1period && bc.alias_bit(kINT1))) {
@@ -760,7 +760,7 @@ struct EventSelectionTask {
760760
int run = bcs.iteratorAt(0).runNumber();
761761
// extract bc pattern from CCDB for data or anchored MC only
762762
int run3min = 500000;
763-
if (run != lastRun && run >= run3min) {
763+
if (run != lastRun && run >= run3min) {
764764
lastRun = run;
765765
auto runInfo = o2::parameters::AggregatedRunInfo::buildAggregatedRunInfo(o2::ccdb::BasicCCDBManager::instance(), run);
766766
// first bc of the first orbit
@@ -855,7 +855,7 @@ struct EventSelectionTask {
855855
float sumTime = 0, sumW = 0, sumHighPtTime = 0, sumHighPtW = 0;
856856
for (const auto& track : colPvTracks) {
857857
float trackTime = track.trackTime();
858-
if (track.itsNCls() >= 5) // o2-linter: disable=magic-number (indeed, this is a magic number, counting layers 5, 6, 7)
858+
if (track.itsNCls() >= 5) // o2-linter: disable=magic-number (indeed counting layers 5 6 7)
859859
vTracksITS567perColl[colIndex]++;
860860
if (track.hasTRD())
861861
vIsVertexTRDmatched[colIndex] = 1;
@@ -1127,16 +1127,16 @@ struct EventSelectionTask {
11271127
if (confUseWeightsForOccupancyVariable) {
11281128
// weighted occupancy
11291129
wOccup = 0;
1130-
if (dt >= -40 && dt < -5) // collisions in the past // o2-linter: disable=magic-number (to be checked by Igor)
1131-
wOccup = 1. / 1225 * (dt + 40) * (dt + 40); // o2-linter: disable=magic-number (to be checked by Igor)
1132-
else if (dt >= -5 && dt < 15) // collisions near a given one // o2-linter: disable=magic-number (to be checked by Igor)
1130+
if (dt >= -40 && dt < -5) // collisions in the past // o2-linter: disable=magic-number (to be checked by Igor)
1131+
wOccup = 1. / 1225 * (dt + 40) * (dt + 40); // o2-linter: disable=magic-number (to be checked by Igor)
1132+
else if (dt >= -5 && dt < 15) // collisions near a given one // o2-linter: disable=magic-number (to be checked by Igor)
11331133
wOccup = 1;
11341134
// else if (dt >= 15 && dt < 100) // collisions from the future
11351135
// wOccup = -1. / 85 * dt + 20. / 17;
1136-
else if (dt >= 15 && dt < 40) // collisions from the future // o2-linter: disable=magic-number (to be checked by Igor)
1137-
wOccup = -0.4 / 25 * dt + 1.24; // o2-linter: disable=magic-number (to be checked by Igor)
1138-
else if (dt >= 40 && dt < 100) // collisions from the distant future // o2-linter: disable=magic-number (to be checked by Igor)
1139-
wOccup = -0.4 / 60 * dt + 0.6 + 0.8 / 3; // o2-linter: disable=magic-number (to be checked by Igor)
1136+
else if (dt >= 15 && dt < 40) // collisions from the future // o2-linter: disable=magic-number (to be checked by Igor)
1137+
wOccup = -0.4 / 25 * dt + 1.24; // o2-linter: disable=magic-number (to be checked by Igor)
1138+
else if (dt >= 40 && dt < 100) // collisions from the distant future // o2-linter: disable=magic-number (to be checked by Igor)
1139+
wOccup = -0.4 / 60 * dt + 0.6 + 0.8 / 3; // o2-linter: disable=magic-number (to be checked by Igor)
11401140
}
11411141
nITS567tracksInFullTimeWindow += wOccup * vTracksITS567perColl[thisColIndex];
11421142
sumAmpFT0CInFullTimeWindow += wOccup * vAmpFT0CperColl[thisColIndex];
@@ -1149,12 +1149,12 @@ struct EventSelectionTask {
11491149

11501150
// standard cut on other collisions vs delta-times
11511151
const float driftV = 2.5; // drift velocity in cm/us, TPC drift_length / drift_time = 250 cm / 100 us
1152-
if (std::fabs(dt) < 2.0) { // us, complete veto on other collisions
1152+
if (std::fabs(dt) < 2.0) { // us, complete veto on other collisions // o2-linter: disable=magic-number (to be checked by Igor)
11531153
nCollsWithFT0CAboveVetoStandard++;
1154-
} else if (dt > -4.0 && dt <= -2.0) { // us, strict veto to suppress fake ITS-TPC matches more
1154+
} else if (dt > -4.0 && dt <= -2.0) { // us, strict veto to suppress fake ITS-TPC matches more // o2-linter: disable=magic-number (to be checked by Igor)
11551155
if (vAmpFT0CperColl[thisColIndex] > confFT0CamplCutVetoOnCollInTimeRange / 5)
11561156
nCollsWithFT0CAboveVetoStandard++;
1157-
} else if (std::fabs(dt) < 8 + std::fabs(vZ) / driftV) { // loose veto, 8 us corresponds to maximum possible |vZ|, which is ~20 cm
1157+
} else if (std::fabs(dt) < 8 + std::fabs(vZ) / driftV) { // loose veto, 8 us corresponds to maximum possible |vZ|, which is ~20 cm // o2-linter: disable=magic-number (to be checked by Igor)
11581158
// counting number of other collisions with multiplicity above threshold
11591159
if (vAmpFT0CperColl[thisColIndex] > confFT0CamplCutVetoOnCollInTimeRange)
11601160
nCollsWithFT0CAboveVetoStandard++;

0 commit comments

Comments
 (0)