From 249226bbee0ca0fed55bf82347a41749b48b52dd Mon Sep 17 00:00:00 2001 From: David Dobrigkeit Chinellato Date: Tue, 2 Sep 2025 09:29:53 -0300 Subject: [PATCH 1/4] [Common] Sanitize power-law mapping in corner cases --- Common/Tools/Multiplicity/MultModule.h | 32 ++++++++++++++++++-------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/Common/Tools/Multiplicity/MultModule.h b/Common/Tools/Multiplicity/MultModule.h index bed8817c124..4a8b19f26f5 100644 --- a/Common/Tools/Multiplicity/MultModule.h +++ b/Common/Tools/Multiplicity/MultModule.h @@ -505,16 +505,6 @@ class MultModule listOfRequestors[kPVMults].Append(Form("%s ", "dependency check")); } - // capture the need for PYTHIA calibration in Pb-Pb runs - if (metadataInfo.isMC() && mRunNumber >= 544013 && mRunNumber <= 545367) { - internalOpts.generatorName.value = "PYTHIA"; - } - - // capture the need for PYTHIA calibration in light ion runs automatically - if (metadataInfo.isMC() && mRunNumber >= 564250 && mRunNumber <= 564472) { - internalOpts.generatorName.value = "PYTHIA"; - } - // list enabled tables for (int i = 0; i < nTablesConst; i++) { // printout to be improved in the future @@ -1145,6 +1135,20 @@ class MultModule { if (bc.runNumber() != mRunNumberCentrality) { mRunNumberCentrality = bc.runNumber(); // mark that this run has been attempted already regardless of outcome + LOGF(info, "centrality loading procedure for timestamp=%llu, run number=%d", bc.timestamp(), bc.runNumber()); + + // capture the need for PYTHIA calibration in Pb-Pb runs + if (metadataInfo.isMC() && mRunNumber >= 544013 && mRunNumber <= 545367) { + LOGF(info, "This is MC for Pb-Pb. Setting generatorName automatically to PYTHIA"); + internalOpts.generatorName.value = "PYTHIA"; + } + + // capture the need for PYTHIA calibration in light ion runs automatically + if (metadataInfo.isMC() && mRunNumber >= 564250 && mRunNumber <= 564472) { + LOGF(info, "This is MC for light ion runs. Setting generatorName automatically to PYTHIA"); + internalOpts.generatorName.value = "PYTHIA"; + } + LOGF(info, "centrality loading procedure for timestamp=%llu, run number=%d", bc.timestamp(), bc.runNumber()); TList* callst = nullptr; // Check if the ccdb path is a root file @@ -1258,6 +1262,10 @@ class MultModule auto populateTable = [&](auto& table, struct CalibrationInfo& estimator, float multiplicity, bool isInelGt0) { const bool assignOutOfRange = internalOpts.embedINELgtZEROselection && !isInelGt0; auto scaleMC = [](float x, const float pars[6]) { + float core = ((pars[0] + pars[1] * std::pow(x, pars[2])) - pars[3]) / pars[4]; + if(core<0.0f){ + return 0.0f; // this should be marked as low multiplicity and not mapped, core^pars[5] would be NaN + } return std::pow(((pars[0] + pars[1] * std::pow(x, pars[2])) - pars[3]) / pars[4], 1.0f / pars[5]); }; @@ -1343,6 +1351,10 @@ class MultModule ConfigureCentralityRun2(ccdb, metadataInfo, firstbc); auto scaleMC = [](float x, const float pars[6]) { + float core = ((pars[0] + pars[1] * std::pow(x, pars[2])) - pars[3]) / pars[4]; + if(core<0.0f){ + return 0.0f; // this should be marked as low multiplicity and not mapped, core^pars[5] would be NaN + } return std::pow(((pars[0] + pars[1] * std::pow(x, pars[2])) - pars[3]) / pars[4], 1.0f / pars[5]); }; From cb0be2dd17f0fbe99be30790c426d860f0496677 Mon Sep 17 00:00:00 2001 From: ALICE Builder Date: Tue, 2 Sep 2025 14:33:59 +0200 Subject: [PATCH 2/4] Please consider the following formatting changes (#470) --- Common/Tools/Multiplicity/MultModule.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Common/Tools/Multiplicity/MultModule.h b/Common/Tools/Multiplicity/MultModule.h index 4a8b19f26f5..e8e771b6517 100644 --- a/Common/Tools/Multiplicity/MultModule.h +++ b/Common/Tools/Multiplicity/MultModule.h @@ -1262,8 +1262,8 @@ class MultModule auto populateTable = [&](auto& table, struct CalibrationInfo& estimator, float multiplicity, bool isInelGt0) { const bool assignOutOfRange = internalOpts.embedINELgtZEROselection && !isInelGt0; auto scaleMC = [](float x, const float pars[6]) { - float core = ((pars[0] + pars[1] * std::pow(x, pars[2])) - pars[3]) / pars[4]; - if(core<0.0f){ + float core = ((pars[0] + pars[1] * std::pow(x, pars[2])) - pars[3]) / pars[4]; + if (core < 0.0f) { return 0.0f; // this should be marked as low multiplicity and not mapped, core^pars[5] would be NaN } return std::pow(((pars[0] + pars[1] * std::pow(x, pars[2])) - pars[3]) / pars[4], 1.0f / pars[5]); @@ -1351,8 +1351,8 @@ class MultModule ConfigureCentralityRun2(ccdb, metadataInfo, firstbc); auto scaleMC = [](float x, const float pars[6]) { - float core = ((pars[0] + pars[1] * std::pow(x, pars[2])) - pars[3]) / pars[4]; - if(core<0.0f){ + float core = ((pars[0] + pars[1] * std::pow(x, pars[2])) - pars[3]) / pars[4]; + if (core < 0.0f) { return 0.0f; // this should be marked as low multiplicity and not mapped, core^pars[5] would be NaN } return std::pow(((pars[0] + pars[1] * std::pow(x, pars[2])) - pars[3]) / pars[4], 1.0f / pars[5]); From 49289c6f8770d5c55eaa0f7915898b052f0316e5 Mon Sep 17 00:00:00 2001 From: lucamicheletti93 <38209984+lucamicheletti93@users.noreply.github.com> Date: Tue, 2 Sep 2025 14:38:57 +0200 Subject: [PATCH 3/4] [PWGDQ] Fixing minitree filling in dqEfficiencyWithAssoc (#12823) Co-authored-by: Lucamicheletti93 --- PWGDQ/Tasks/dqEfficiency_withAssoc.cxx | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx index b3ef5cf769a..ceec3753c28 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx @@ -768,6 +768,7 @@ struct AnalysisMuonSelection { Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; Configurable fConfigNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; + Configurable fConfigMagField{"cfgMagField", 5.0f, "Manually set magnetic field"}; Configurable fConfigGeoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; Configurable fConfigMCSignals{"cfgMuonMCSignals", "", "Comma separated list of MC signals"}; @@ -884,7 +885,9 @@ struct AnalysisMuonSelection { o2::base::Propagator::initFieldFromGRP(grpmag); VarManager::SetMagneticField(grpmag->getNominalL3Field()); } else { - LOGF(fatal, "GRP object is not available in CCDB at timestamp=%llu", events.begin().timestamp()); + // LOGF(fatal, "GRP object is not available in CCDB at timestamp=%llu", events.begin().timestamp()); + // If the magnetic field is not found it is configured by had by the user + VarManager::SetMagneticField(fConfigMagField.value); } fCurrentRun = events.begin().runNumber(); } @@ -2173,9 +2176,12 @@ struct AnalysisSameEventPairing { PresliceUnsorted perReducedMcGenEvent = aod::reducedtrackMC::reducedMCeventId; - void processMCGen(soa::Filtered const& events, ReducedMCEvents const& /*mcEvents*/, ReducedMCTracks const& mcTracks) + void processMCGen(soa::Filtered const& events, ReducedMCEvents const& mcEvents, ReducedMCTracks const& mcTracks) { // Fill Generated histograms taking into account all generated tracks + uint32_t mcDecision = 0; + int isig = 0; + for (auto& mctrack : mcTracks) { VarManager::FillTrackMC(mcTracks, mctrack); // NOTE: Signals are checked here mostly based on the skimmed MC stack, so depending on the requested signal, the stack could be incomplete. @@ -2209,9 +2215,15 @@ struct AnalysisSameEventPairing { // auto track_raw = groupedMCTracks.rawIteratorAt(track.globalIndex()); for (auto& sig : fGenMCSignals) { if (sig->CheckSignal(true, track_raw)) { + mcDecision |= (static_cast(1) << isig); fHistMan->FillHistClass(Form("MCTruthGenSel_%s", sig->GetName()), VarManager::fgValues); + if (useMiniTree.fConfigMiniTree) { + auto mcEvent = mcEvents.rawIteratorAt(track_raw.reducedMCeventId()); + dileptonMiniTreeGen(mcDecision, mcEvent.impactParameter(), track_raw.pt(), track_raw.eta(), track_raw.phi(), -999, -999, -999); + } } } + isig++; } } // end loop over reconstructed events if (fHasTwoProngGenMCsignals) { @@ -2224,12 +2236,17 @@ struct AnalysisSameEventPairing { continue; } if (sig->CheckSignal(true, t1_raw, t2_raw)) { - // mcDecision |= (static_cast(1) << isig); + mcDecision |= (static_cast(1) << isig); VarManager::FillPairMC(t1, t2); // NOTE: This feature will only work for muons fHistMan->FillHistClass(Form("MCTruthGenPair_%s", sig->GetName()), VarManager::fgValues); + if (useMiniTree.fConfigMiniTree) { + // WARNING! To be checked + dileptonMiniTreeGen(mcDecision, -999, t1.pt(), t1.eta(), t1.phi(), t2.pt(), t2.eta(), t2.phi()); + } } } } + isig++; } } } From a1dae3b8ce6825ff3d1ce73de3197d661a5b754c Mon Sep 17 00:00:00 2001 From: David Dobrigkeit Chinellato Date: Tue, 2 Sep 2025 10:02:29 -0300 Subject: [PATCH 4/4] Fix unused var --- Common/Tools/Multiplicity/MultModule.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Common/Tools/Multiplicity/MultModule.h b/Common/Tools/Multiplicity/MultModule.h index e8e771b6517..f3122106de4 100644 --- a/Common/Tools/Multiplicity/MultModule.h +++ b/Common/Tools/Multiplicity/MultModule.h @@ -440,6 +440,7 @@ class MultModule internalOpts.mEnabledTables.resize(nTablesConst, 0); LOGF(info, "Configuring tables to generate"); + LOGF(info, "Metadata information: isMC? %i", metadataInfo.isMC()); const auto& workflows = context.services().template get(); TString listOfRequestors[nTablesConst];