Skip to content

Commit df6d59e

Browse files
authored
[Common] check if input scalers are available (#11391)
1 parent f129e29 commit df6d59e

File tree

1 file changed

+10
-35
lines changed

1 file changed

+10
-35
lines changed

Common/TableProducer/eventSelection.cxx

Lines changed: 10 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,6 @@ struct BcSelectionTask {
9595
bool isGoodITSLayersAll = true; // default value
9696
void init(InitContext&)
9797
{
98-
if (metadataInfo.isFullyDefined() && !doprocessRun2 && !doprocessRun3) { // Check if the metadata is initialized (only if not forced from the workflow configuration)
99-
LOG(info) << "Autosetting the processing mode (Run2 or Run3) based on metadata";
100-
if (metadataInfo.isRun3()) {
101-
doprocessRun3.value = true;
102-
} else {
103-
doprocessRun2.value = true;
104-
}
105-
}
106-
10798
// ccdb->setURL("http://ccdb-test.cern.ch:8080");
10899
ccdb->setURL("http://alice-ccdb.cern.ch");
109100
ccdb->setCaching(true);
@@ -580,14 +571,6 @@ struct EventSelectionTask {
580571
void init(InitContext&)
581572
{
582573
if (metadataInfo.isFullyDefined()) { // Check if the metadata is initialized (only if not forced from the workflow configuration)
583-
if (!doprocessRun2 && !doprocessRun3) {
584-
LOG(info) << "Autosetting the processing mode (Run2 or Run3) based on metadata";
585-
if (metadataInfo.isRun3()) {
586-
doprocessRun3.value = true;
587-
} else {
588-
doprocessRun2.value = true;
589-
}
590-
}
591574
if (isMC == -1) {
592575
LOG(info) << "Autosetting the MC mode based on metadata";
593576
if (metadataInfo.isMC()) {
@@ -1186,15 +1169,6 @@ struct LumiTask {
11861169

11871170
void init(InitContext&)
11881171
{
1189-
if (metadataInfo.isFullyDefined() && !doprocessRun3 && !doprocessRun3) { // Check if the metadata is initialized (only if not forced from the workflow configuration)
1190-
LOG(info) << "Autosetting the processing mode (Run2 or Run3) based on metadata";
1191-
if (metadataInfo.isRun3()) {
1192-
doprocessRun3.value = true;
1193-
} else {
1194-
doprocessRun2.value = true;
1195-
}
1196-
}
1197-
11981172
histos.add("hCounterTVX", "", kTH1D, {{1, 0., 1.}});
11991173
histos.add("hCounterTCE", "", kTH1D, {{1, 0., 1.}});
12001174
histos.add("hCounterZEM", "", kTH1D, {{1, 0., 1.}});
@@ -1277,12 +1251,12 @@ struct LumiTask {
12771251
csZNC = -1;
12781252
// Temporary workaround to get visible cross section. TODO: store run-by-run visible cross sections in CCDB
12791253
if (beamZ1 == 1 && beamZ2 == 1) {
1280-
if (std::fabs(sqrts - 900.) < 20.) { // o2-linter: disable=magic-number (TODO store and extract cross sections from ccdb)
1281-
csTVX = 0.0357e6; // ub
1282-
} else if (std::fabs(sqrts - 5360.) < 20.) { // pp-ref // o2-linter: disable=magic-number (TODO store and extract cross sections from ccdb)
1283-
csTVX = 0.0503e6; // ub
1284-
} else if (std::fabs(sqrts - 13600.) < 20.) { // o2-linter: disable=magic-number (TODO store and extract cross sections from ccdb)
1285-
csTVX = 0.0594e6; // ub
1254+
if (std::fabs(sqrts - 900.) < 100.) { // o2-linter: disable=magic-number (TODO store and extract cross sections from ccdb)
1255+
csTVX = 0.0357e6; // ub
1256+
} else if (std::fabs(sqrts - 5360.) < 100.) { // pp-ref // o2-linter: disable=magic-number (TODO store and extract cross sections from ccdb)
1257+
csTVX = 0.0503e6; // ub
1258+
} else if (std::fabs(sqrts - 13600.) < 300.) { // o2-linter: disable=magic-number (TODO store and extract cross sections from ccdb)
1259+
csTVX = 0.0594e6; // ub
12861260
} else {
12871261
LOGP(warn, "Cross section for pp @ {} GeV is not defined", sqrts);
12881262
}
@@ -1346,13 +1320,14 @@ struct LumiTask {
13461320
mOrbits.push_back(record.intRecord.orbit);
13471321
mCounterTVX.push_back(classIdTVX >= 0 ? record.scalers[classIdTVX].lmBefore : 0);
13481322
mCounterTCE.push_back(classIdTCE >= 0 ? record.scalers[classIdTCE].lmBefore : 0);
1349-
if (run >= 543437 && run < 544448) { // o2-linter: disable=magic-number (ZNC class not defined for this run range)
1350-
mCounterZNC.push_back(record.scalersInps[25]); // see ZNC=1ZNC input index in https://indico.cern.ch/event/1153630/contributions/4844362/
1323+
if (run >= 543437 && run < 544448 && record.scalersInps.size() >= 26) { // o2-linter: disable=magic-number (ZNC class not defined for this run range)
1324+
mCounterZNC.push_back(record.scalersInps[25]); // see ZNC=1ZNC input index in https://indico.cern.ch/event/1153630/contributions/4844362/
13511325
} else {
13521326
mCounterZNC.push_back(classIdZNC >= 0 ? record.scalers[classIdZNC].l1Before : 0);
13531327
}
13541328
// ZEM class not defined, using inputs instead
1355-
mCounterZEM.push_back(record.scalersInps[24]); // see ZEM=1ZED input index in https://indico.cern.ch/event/1153630/contributions/4844362/
1329+
uint32_t indexZEM = 24; // see ZEM=1ZED input index in https://indico.cern.ch/event/1153630/contributions/4844362/
1330+
mCounterZEM.push_back(record.scalersInps.size() >= indexZEM + 1 ? record.scalersInps[indexZEM] : 0);
13561331
}
13571332

13581333
// calculate pileup corrections

0 commit comments

Comments
 (0)