From 373d3a351e49f43fa91ce2ee0d99b2f2289c299c Mon Sep 17 00:00:00 2001 From: gianniliveraro Date: Fri, 20 Feb 2026 11:13:56 -0300 Subject: [PATCH 1/2] Minor fix in doAssocStudy + Add centrality estimator options in sigmaanalysis --- .../Strangeness/sigma0builder.cxx | 2 +- PWGLF/Tasks/Strangeness/sigmaanalysis.cxx | 44 ++++++++++++++++--- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx index bd0b64872c2..d6bb3f0b11c 100644 --- a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx +++ b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx @@ -2225,7 +2225,7 @@ struct sigma0builder { //_______________________________________________ // Wrongly collision association study (MC-specific) - if constexpr (requires { coll.StraMCCollisionId(); }) { + if constexpr (requires { coll.straMCCollisionId(); }) { if (doAssocStudy) { analyzeV0CollAssoc(coll, fullV0s, bestGammasArray, true); // Photon-analysis analyzeV0CollAssoc(coll, fullV0s, bestLambdasArray, false); // Lambda-analysis diff --git a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx index 25baa565705..040d5a0092b 100644 --- a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx @@ -74,6 +74,15 @@ static const std::vector LambdaSels = {"NoSel", "V0Radius", "DCADau static const std::vector DirList = {"BeforeSel", "AfterSel"}; +enum CentEstimator { + kCentFT0C = 0, + kCentFT0M, + kCentFT0CVariant1, + kCentMFT, + kCentNGlobal, + kCentFV0A +}; + struct sigmaanalysis { Service ccdb; ctpRateFetcher rateFetcher; @@ -87,6 +96,7 @@ struct sigmaanalysis { // Event level Configurable doPPAnalysis{"doPPAnalysis", true, "if in pp, set to true"}; + Configurable centralityEstimator{"centralityEstimator", kCentFT0C, "Run 3 centrality estimator (0:CentFT0C, 1:CentFT0M, 2:CentFT0CVariant1, 3:CentMFT, 4:CentNGlobal, 5:CentFV0A)"}; Configurable fGetIR{"fGetIR", false, "Flag to retrieve the IR info."}; Configurable fIRCrashOnNull{"fIRCrashOnNull", false, "Flag to avoid CTP RateFetcher crash."}; Configurable irSource{"irSource", "T0VTX", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"}; @@ -288,6 +298,7 @@ struct sigmaanalysis { // Event Counters histos.add("hEventCentrality", "hEventCentrality", kTH1D, {axisCentrality}); + histos.add("hCentralityVsNch", "hCentralityVsNch", kTH2D, {{101, 0.0f, 101.0f}, axisNch}); histos.add("hEventSelection", "hEventSelection", kTH1D, {{21, -0.5f, +20.5f}}); histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(1, "All collisions"); @@ -573,6 +584,26 @@ struct sigmaanalysis { histos.print(); } + // Auxiliary function to get the centrality of a collision according to the selected estimator + template + auto getCentralityRun3(TCollision const& collision) + { + if (centralityEstimator == kCentFT0C) + return collision.centFT0C(); + else if (centralityEstimator == kCentFT0M) + return collision.centFT0M(); + else if (centralityEstimator == kCentFT0CVariant1) + return collision.centFT0CVariant1(); + else if (centralityEstimator == kCentMFT) + return collision.centMFT(); + else if (centralityEstimator == kCentNGlobal) + return collision.centNGlobal(); + else if (centralityEstimator == kCentFV0A) + return collision.centFV0A(); + + return -1.f; + } + // ______________________________________________________ // Check whether the collision passes our collision selections // Should work with collisions, mccollisions, stracollisions and stramccollisions tables! @@ -683,7 +714,7 @@ struct sigmaanalysis { // Fetch interaction rate only if required (in order to limit ccdb calls) float interactionRate = (fGetIR) ? rateFetcher.fetch(ccdb.service, collision.timestamp(), collision.runNumber(), irSource, fIRCrashOnNull) * 1.e-3 : -1; - float centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C(); + float centrality = getCentralityRun3(collision); if (fGetIR) { if (interactionRate < 0) @@ -708,6 +739,7 @@ struct sigmaanalysis { // Fill centrality histogram after event selection if (fillHists) histos.fill(HIST("hEventCentrality"), centrality); + histos.fill(HIST("hCentralityVsNch"), centrality, collision.multNTracksPVeta1()); return true; } @@ -780,8 +812,8 @@ struct sigmaanalysis { } if (biggestNContribs < collision.multPVTotalContributors()) { - biggestNContribs = collision.multPVTotalContributors(); - centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C(); + biggestNContribs = collision.multPVTotalContributors(); + centrality = getCentralityRun3(collision); } nCollisions++; @@ -851,7 +883,7 @@ struct sigmaanalysis { if (listBestCollisionIdx[mcCollision.globalIndex()] > -1) { auto collision = collisions.iteratorAt(listBestCollisionIdx[mcCollision.globalIndex()]); - centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C(); + centrality = getCentralityRun3(collision); if (genParticle.isSigma0()) histos.fill(HIST("Gen/h2dGenSigma0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); @@ -1017,7 +1049,7 @@ struct sigmaanalysis { int LambdaTrkCode = retrieveV0TrackCode(sigma); float photonRZLineCut = TMath::Abs(sigma.photonZconv()) * TMath::Tan(2 * TMath::ATan(TMath::Exp(-photonSelections.PhotonMaxDauEta))) - photonSelections.PhotonLineCutZ0; - float centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C(); + float centrality = getCentralityRun3(collision); if (fillSelhistos) { //_______________________________________ @@ -1657,7 +1689,7 @@ struct sigmaanalysis { continue; // Pi0s loop - float centrality = doPPAnalysis ? coll.centFT0M() : coll.centFT0C(); + float centrality = getCentralityRun3(coll); for (size_t i = 0; i < pi0grouped[coll.globalIndex()].size(); i++) { auto pi0 = fullPi0s.rawIteratorAt(pi0grouped[coll.globalIndex()][i]); From d326dc8c0041ddb85cc4337d53babcdccc4a6c9d Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Fri, 20 Feb 2026 16:11:53 +0000 Subject: [PATCH 2/2] Please consider the following formatting changes --- PWGLF/Tasks/Strangeness/sigmaanalysis.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx index 040d5a0092b..9c37b4a8b1b 100644 --- a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx @@ -739,7 +739,7 @@ struct sigmaanalysis { // Fill centrality histogram after event selection if (fillHists) histos.fill(HIST("hEventCentrality"), centrality); - histos.fill(HIST("hCentralityVsNch"), centrality, collision.multNTracksPVeta1()); + histos.fill(HIST("hCentralityVsNch"), centrality, collision.multNTracksPVeta1()); return true; } @@ -812,7 +812,7 @@ struct sigmaanalysis { } if (biggestNContribs < collision.multPVTotalContributors()) { - biggestNContribs = collision.multPVTotalContributors(); + biggestNContribs = collision.multPVTotalContributors(); centrality = getCentralityRun3(collision); }