From ba15679486465d4d65ed97ee0f1355d3b640b43f Mon Sep 17 00:00:00 2001 From: Igor Altsybeev Date: Fri, 25 Sep 2026 10:17:57 +0200 Subject: [PATCH 1/2] use metadata info to set NumberOfOrbitsPerTF --- DPG/Tasks/AOTEvent/eventSelectionQa.cxx | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/DPG/Tasks/AOTEvent/eventSelectionQa.cxx b/DPG/Tasks/AOTEvent/eventSelectionQa.cxx index c5da0ee0076..ee2b172084e 100644 --- a/DPG/Tasks/AOTEvent/eventSelectionQa.cxx +++ b/DPG/Tasks/AOTEvent/eventSelectionQa.cxx @@ -16,6 +16,7 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/TriggerAliases.h" +#include "Common/Core/MetadataHelper.h" #include "Common/DataModel/EventSelection.h" #include @@ -59,6 +60,8 @@ using namespace o2::framework; using namespace o2; using namespace o2::aod::evsel; +o2::common::core::MetadataHelper metadataInfo; + using BCsRun2 = soa::Join; using BCsRun3 = soa::Join; using ColEvSels = soa::Join; @@ -66,7 +69,6 @@ using FullTracksIU = soa::Join; using FullTracksIUwithLabels = soa::Join; struct EventSelectionQaTask { - Configurable isMC{"isMC", 0, "0 - data, 1 - MC"}; Configurable nGlobalBCs{"nGlobalBCs", 100000, "number of global bcs for detailed monitoring"}; Configurable isLowFlux{"isLowFlux", 1, "1 - low flux (pp, pPb), 0 - high flux (PbPb)"}; Configurable fillITSdeadStaveHists{"fillITSdeadStaveHists", 0, "0 - no, 1 - yes"}; @@ -85,6 +87,10 @@ struct EventSelectionQaTask { int rofOffset = -1; // ITS ROF offset, in bc int rofLength = -1; // ITS ROF length, in bc + std::string strLPMProductionTag = ""; // MC production tag to be retrieved from AO2D metadata + std::string strPassName = ""; // RecoPassName (for data) or AnchorPassName (for MC) from metadata + bool isMC = false; + std::bitset bcPatternA; std::bitset bcPatternC; std::bitset bcPatternB; @@ -111,6 +117,10 @@ struct EventSelectionQaTask { ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); + isMC = metadataInfo.isMC(); + strLPMProductionTag = metadataInfo.get("LPMProductionTag"); // to extract info from ccdb by the tag + strPassName = metadataInfo.get(isMC ? "AnchorPassName" : "RecoPassName"); + const AxisSpec axisMultV0M{1000, 0., isLowFlux ? 40000. : 40000., "V0M multiplicity"}; const AxisSpec axisMultV0A{1000, 0., isLowFlux ? 40000. : 200000., "V0A multiplicity"}; const AxisSpec axisMultV0C{1000, 0., isLowFlux ? 30000. : 30000., "V0C multiplicity"}; @@ -622,8 +632,13 @@ struct EventSelectionQaTask { lastRun = run; int64_t tsSOR = 0; // dummy start-of-run timestamp for unanchored MC int64_t tsEOR = 1; // dummy end-of-run timestamp for unanchored MC - if (run >= 500000) { - auto runInfo = o2::parameters::AggregatedRunInfo::buildAggregatedRunInfo(o2::ccdb::BasicCCDBManager::instance(), run); + const int run3min = 500000; + if (run >= run3min) { + auto runInfo = (!isMC) ? o2::parameters::AggregatedRunInfo::buildAggregatedRunInfo(o2::ccdb::BasicCCDBManager::instance(), run) + : o2::parameters::AggregatedRunInfo::buildAggregatedRunInfo(o2::ccdb::BasicCCDBManager::instance(), run, strLPMProductionTag); + LOGP(info, "eventSelectionQA: isMC = {}, NumberOfOrbitsPerTF extracted from AggregatedRunInfo = {}", isMC, runInfo.orbitsPerTF); + LOGP(info, "eventSelectionQA: strLPMProductionTag = {}, strPassName = {}", strLPMProductionTag, strPassName); + // first bc of the first orbit bcSOR = runInfo.orbitSOR * nBCsPerOrbit; // number of orbits per TF @@ -1508,6 +1523,7 @@ struct EventSelectionQaTask { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { + metadataInfo.initMetadata(cfgc); return WorkflowSpec{ adaptAnalysisTask(cfgc)}; } From 72b6b7128615f9584b1bbb11106b212145f119db Mon Sep 17 00:00:00 2001 From: Igor Altsybeev Date: Fri, 25 Sep 2026 16:48:19 +0200 Subject: [PATCH 2/2] Refactor event selection logic and axis specifications --- DPG/Tasks/AOTEvent/eventSelectionQa.cxx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/DPG/Tasks/AOTEvent/eventSelectionQa.cxx b/DPG/Tasks/AOTEvent/eventSelectionQa.cxx index ee2b172084e..56a4c9a28ac 100644 --- a/DPG/Tasks/AOTEvent/eventSelectionQa.cxx +++ b/DPG/Tasks/AOTEvent/eventSelectionQa.cxx @@ -121,9 +121,9 @@ struct EventSelectionQaTask { strLPMProductionTag = metadataInfo.get("LPMProductionTag"); // to extract info from ccdb by the tag strPassName = metadataInfo.get(isMC ? "AnchorPassName" : "RecoPassName"); - const AxisSpec axisMultV0M{1000, 0., isLowFlux ? 40000. : 40000., "V0M multiplicity"}; + const AxisSpec axisMultV0M{1000, 0., 40000., "V0M multiplicity"}; const AxisSpec axisMultV0A{1000, 0., isLowFlux ? 40000. : 200000., "V0A multiplicity"}; - const AxisSpec axisMultV0C{1000, 0., isLowFlux ? 30000. : 30000., "V0C multiplicity"}; + const AxisSpec axisMultV0C{1000, 0., 30000., "V0C multiplicity"}; const AxisSpec axisMultT0A{1000, 0., isLowFlux ? 10000. : 200000., "T0A multiplicity"}; const AxisSpec axisMultT0C{1000, 0., isLowFlux ? 2000. : 70000., "T0C multiplicity"}; const AxisSpec axisMultT0M{1000, 0., isLowFlux ? 12000. : 270000., "T0M multiplicity"}; @@ -578,9 +578,7 @@ struct EventSelectionQaTask { histos.fill(HIST("hV0C012vsTklCol"), nTracklets, multRingV0C012); // filling plots for accepted events - bool accepted = 0; - accepted |= !isINT1period & col.sel7(); - accepted |= isINT1period & sel1; + bool accepted = (!isINT1period && col.sel7()) || (isINT1period && sel1); if (!accepted) { continue; } @@ -801,13 +799,13 @@ struct EventSelectionQaTask { const auto& bcPast = bcs.iteratorAt(bc.globalIndex() - deltaIndex); deltaBC = globalBC - bcPast.globalBC(); if (deltaBC < maxDeltaBC) { - pastActivityFT0 |= bcPast.has_ft0(); - pastActivityFV0 |= bcPast.has_fv0a(); - pastActivityFDD |= bcPast.has_fdd(); + pastActivityFT0 = pastActivityFT0 || bcPast.has_ft0(); + pastActivityFV0 = pastActivityFV0 || bcPast.has_fv0a(); + pastActivityFDD = pastActivityFDD || bcPast.has_fdd(); } } - bool pastActivity = pastActivityFT0 | pastActivityFV0 | pastActivityFDD; + bool pastActivity = pastActivityFT0 || pastActivityFV0 || pastActivityFDD; int localBC = bc.globalBC() % nBCsPerOrbit; float timeV0A = bc.has_fv0a() ? bc.fv0a().time() : -999.f;