Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions Common/TableProducer/eventSelection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
if (run != lastRun) {
lastRun = run;
int run3min = 500000;
if (run < run3min) { // unanchored Run3 MC
if (run < run3min) { // unanchored Run3 MC
auto runDuration = ccdb->getRunDuration(run, true); // fatalise if timestamps are not found
// SOR and EOR timestamps
sorTimestamp = runDuration.first; // timestamp of the SOR/SOX/STF in ms
Expand Down Expand Up @@ -351,7 +351,7 @@
}

int triggerBcShift = confTriggerBcShift;
if (confTriggerBcShift == 999) { // o2-linter: disable=magic-number (indeed, this is a magic number)
if (confTriggerBcShift == 999) { // o2-linter: disable=magic-number (indeed, this is a magic number)

Check failure on line 354 in Common/TableProducer/eventSelection.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
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)
}

Expand Down Expand Up @@ -415,7 +415,7 @@
timeT0ABG = bc.has_ft0() ? bc.ft0().timeA() : -999.f;
timeT0CBG = bc.has_ft0() ? bc.ft0().timeC() : -999.f;
}
if (bc.globalBC() + bcDistanceToBeamGasForFDD == globalBC) {
if (bc.globalBC() + bcDistanceToBeamGasForFDD == globalBC) {
timeFDABG = bc.has_fdd() ? bc.fdd().timeA() : -999.f;
timeFDCBG = bc.has_fdd() ? bc.fdd().timeC() : -999.f;
}
Expand Down Expand Up @@ -493,16 +493,16 @@
// Temporary workaround to get visible cross section. TODO: store run-by-run visible cross sections in CCDB
const char* srun = Form("%d", run);

bool injectionEnergy = (run >= 500000 && run <= 520099) || (run >= 534133 && run <= 534468); // o2-linter: disable=magic-number (todo: extract from ccdb)

Check failure on line 496 in Common/TableProducer/eventSelection.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
// Cross sections in ub. Using dummy -1 if lumi estimator is not reliable
float csTVX = isPP ? (injectionEnergy ? 0.0355e6 : 0.0594e6) : -1.;
float csTCE = isPP ? -1. : 10.36e6;
float csZEM = isPP ? -1. : 415.2e6; // see AN: https://alice-notes.web.cern.ch/node/1515
float csZNC = isPP ? -1. : 214.5e6; // see AN: https://alice-notes.web.cern.ch/node/1515
if (run > 543437 && run < 543514) { // o2-linter: disable=magic-number (todo: store and extract cross sections from ccdb)
if (run > 543437 && run < 543514) { // o2-linter: disable=magic-number (todo: store and extract cross sections from ccdb)

Check failure on line 502 in Common/TableProducer/eventSelection.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
csTCE = 8.3e6;
}
if (run >= 543514) {

Check failure on line 505 in Common/TableProducer/eventSelection.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
csTCE = 4.10e6; // see AN: https://alice-notes.web.cern.ch/node/1515
}

Expand Down Expand Up @@ -720,7 +720,7 @@
int spdClusters = bc.spdClustersL0() + bc.spdClustersL1();

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

// copy rct flags from bcsel table
uint32_t rct = bc.rct_raw();
Expand All @@ -740,7 +740,7 @@
sel1 = sel1 && bc.selection_bit(kNoTPCHVdip);

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

// fill counters
if (isMC == 1 || (!isINT1period && bc.alias_bit(kINT7)) || (isINT1period && bc.alias_bit(kINT1))) {
Expand All @@ -760,7 +760,7 @@
int run = bcs.iteratorAt(0).runNumber();
// extract bc pattern from CCDB for data or anchored MC only
int run3min = 500000;
if (run != lastRun && run >= run3min) {
if (run != lastRun && run >= run3min) {
lastRun = run;
auto runInfo = o2::parameters::AggregatedRunInfo::buildAggregatedRunInfo(o2::ccdb::BasicCCDBManager::instance(), run);
// first bc of the first orbit
Expand Down Expand Up @@ -855,7 +855,7 @@
float sumTime = 0, sumW = 0, sumHighPtTime = 0, sumHighPtW = 0;
for (const auto& track : colPvTracks) {
float trackTime = track.trackTime();
if (track.itsNCls() >= 5) // o2-linter: disable=magic-number (indeed, this is a magic number, counting layers 5, 6, 7)

Check failure on line 858 in Common/TableProducer/eventSelection.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
vTracksITS567perColl[colIndex]++;
if (track.hasTRD())
vIsVertexTRDmatched[colIndex] = 1;
Expand Down Expand Up @@ -1127,16 +1127,16 @@
if (confUseWeightsForOccupancyVariable) {
// weighted occupancy
wOccup = 0;
if (dt >= -40 && dt < -5) // collisions in the past // o2-linter: disable=magic-number (to be checked by Igor)
wOccup = 1. / 1225 * (dt + 40) * (dt + 40); // o2-linter: disable=magic-number (to be checked by Igor)
else if (dt >= -5 && dt < 15) // collisions near a given one // o2-linter: disable=magic-number (to be checked by Igor)
if (dt >= -40 && dt < -5) // collisions in the past // o2-linter: disable=magic-number (to be checked by Igor)
wOccup = 1. / 1225 * (dt + 40) * (dt + 40); // o2-linter: disable=magic-number (to be checked by Igor)
else if (dt >= -5 && dt < 15) // collisions near a given one // o2-linter: disable=magic-number (to be checked by Igor)
wOccup = 1;
// else if (dt >= 15 && dt < 100) // collisions from the future
// wOccup = -1. / 85 * dt + 20. / 17;
else if (dt >= 15 && dt < 40) // collisions from the future // o2-linter: disable=magic-number (to be checked by Igor)
wOccup = -0.4 / 25 * dt + 1.24; // o2-linter: disable=magic-number (to be checked by Igor)
else if (dt >= 40 && dt < 100) // collisions from the distant future // o2-linter: disable=magic-number (to be checked by Igor)
wOccup = -0.4 / 60 * dt + 0.6 + 0.8 / 3; // o2-linter: disable=magic-number (to be checked by Igor)
else if (dt >= 15 && dt < 40) // collisions from the future // o2-linter: disable=magic-number (to be checked by Igor)
wOccup = -0.4 / 25 * dt + 1.24; // o2-linter: disable=magic-number (to be checked by Igor)
else if (dt >= 40 && dt < 100) // collisions from the distant future // o2-linter: disable=magic-number (to be checked by Igor)
wOccup = -0.4 / 60 * dt + 0.6 + 0.8 / 3; // o2-linter: disable=magic-number (to be checked by Igor)
}
nITS567tracksInFullTimeWindow += wOccup * vTracksITS567perColl[thisColIndex];
sumAmpFT0CInFullTimeWindow += wOccup * vAmpFT0CperColl[thisColIndex];
Expand All @@ -1149,12 +1149,12 @@

// standard cut on other collisions vs delta-times
const float driftV = 2.5; // drift velocity in cm/us, TPC drift_length / drift_time = 250 cm / 100 us
if (std::fabs(dt) < 2.0) { // us, complete veto on other collisions

Check failure on line 1152 in Common/TableProducer/eventSelection.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
nCollsWithFT0CAboveVetoStandard++;
} else if (dt > -4.0 && dt <= -2.0) { // us, strict veto to suppress fake ITS-TPC matches more

Check failure on line 1154 in Common/TableProducer/eventSelection.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
if (vAmpFT0CperColl[thisColIndex] > confFT0CamplCutVetoOnCollInTimeRange / 5)
nCollsWithFT0CAboveVetoStandard++;
} else if (std::fabs(dt) < 8 + std::fabs(vZ) / driftV) { // loose veto, 8 us corresponds to maximum possible |vZ|, which is ~20 cm

Check failure on line 1157 in Common/TableProducer/eventSelection.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
// counting number of other collisions with multiplicity above threshold
if (vAmpFT0CperColl[thisColIndex] > confFT0CamplCutVetoOnCollInTimeRange)
nCollsWithFT0CAboveVetoStandard++;
Expand Down
Loading