From 95323831d065c71c061e33640a90926b932c8be3 Mon Sep 17 00:00:00 2001 From: abmodak <67369858+abmodak@users.noreply.github.com> Date: Mon, 26 Jan 2026 19:33:38 +0100 Subject: [PATCH 1/2] Add configurable collision centrality/multiplicity value --- .../Tasks/longrangecorrDerived.cxx | 37 +++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx b/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx index 7a2af04602f..a418d1dfe71 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx @@ -84,6 +84,7 @@ struct LongrangecorrDerived { Configurable cfgPidMask{"cfgPidMask", 0, "Selection bitmask for the TPC particle"}; Configurable cfgV0Mask{"cfgV0Mask", 0, "Selection bitmask for the V0 particle"}; Configurable cfgVtxCut{"cfgVtxCut", 10.0f, "Vertex Z range to consider"}; + Configurable isUseCentEst{"isUseCentEst", false, "Centrality based classification"}; Configurable cfgFv0Cut{"cfgFv0Cut", 50.0f, "FV0A threshold"}; Configurable cfgFt0aCut{"cfgFt0aCut", 100.0f, "FT0A threshold"}; @@ -163,6 +164,7 @@ struct LongrangecorrDerived { mixed.setObject(new CorrelationContainer("mixedEvent", "mixedEvent", corrAxis, effAxis, userAxis)); histos.add("hMultiplicity", "hMultiplicity", kTH1D, {axisMultiplicity}); + histos.add("hCentrality", "hCentrality", kTH1D, {axisMultiplicity}); histos.add("hVertexZ", "hVertexZ", kTH1D, {axisVtxZ}); histos.add("hGapSide", "hGapSide", kTH1I, {{5, -0.5, 4.5}}); @@ -190,6 +192,9 @@ struct LongrangecorrDerived { void fillCollQA(TCollision const& col) { histos.fill(HIST("hMultiplicity"), col.multiplicity()); + if constexpr (std::experimental::is_detected::value) { + histos.fill(HIST("hCentrality"), col.centrality()); + } histos.fill(HIST("hVertexZ"), col.zvtx()); } @@ -246,6 +251,8 @@ struct LongrangecorrDerived { using HasUpc = decltype(std::declval().gapSide()); template using HasFt0 = decltype(std::declval().channelID()); + template + using HasCent = decltype(std::declval().centrality()); template void fillCorrHist(TTarget target, TTriggers const& triggers, TAssocs const& assocs, bool mixing, float vz, float multiplicity, float eventWeight) @@ -295,7 +302,15 @@ struct LongrangecorrDerived { return; } fillCollQA(col); - fillCorrHist(same, triggers, assocs, false, col.zvtx(), col.multiplicity(), 1.0); + auto multiplicity = 1.0f; + if constexpr (std::experimental::is_detected::value) { + if (isUseCentEst) + multiplicity = col.centrality(); + else + multiplicity = col.multiplicity(); + } else + multiplicity = col.multiplicity(); + fillCorrHist(same, triggers, assocs, false, col.zvtx(), multiplicity, 1.0); } // process same template @@ -309,7 +324,15 @@ struct LongrangecorrDerived { } else { (void)this; } - return col.multiplicity(); + auto multiplicity = 1.0f; + if constexpr (std::experimental::is_detected::value) { + if (isUseCentEst) + multiplicity = col.centrality(); + else + multiplicity = col.multiplicity(); + } else + multiplicity = col.multiplicity(); + return multiplicity; }; using MixedBinning = FlexibleBinningPolicy, aod::lrcorrcolltable::Zvtx, decltype(getMultiplicity)>; MixedBinning binningOnVtxAndMult{{getMultiplicity}, {axisVtxZME, axisMultME}, true}; @@ -325,7 +348,15 @@ struct LongrangecorrDerived { } } float eventweight = 1.0f / it.currentWindowNeighbours(); - fillCorrHist(mixed, tracks1, tracks2, true, col1.zvtx(), col1.multiplicity(), eventweight); + auto multiplicity = 1.0f; + if constexpr (std::experimental::is_detected::value) { + if (isUseCentEst) + multiplicity = col1.centrality(); + else + multiplicity = col1.multiplicity(); + } else + multiplicity = col1.multiplicity(); + fillCorrHist(mixed, tracks1, tracks2, true, col1.zvtx(), multiplicity, eventweight); } // pair loop } // process mixed From adaa5d39f1f29e71564db8b72b073cedffe1e8fa Mon Sep 17 00:00:00 2001 From: abmodak <67369858+abmodak@users.noreply.github.com> Date: Mon, 26 Jan 2026 19:45:27 +0100 Subject: [PATCH 2/2] Fix MegaLinter error --- .../Tasks/longrangecorrDerived.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx b/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx index a418d1dfe71..977f534729a 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx @@ -308,8 +308,9 @@ struct LongrangecorrDerived { multiplicity = col.centrality(); else multiplicity = col.multiplicity(); - } else + } else { multiplicity = col.multiplicity(); + } fillCorrHist(same, triggers, assocs, false, col.zvtx(), multiplicity, 1.0); } // process same @@ -330,8 +331,9 @@ struct LongrangecorrDerived { multiplicity = col.centrality(); else multiplicity = col.multiplicity(); - } else + } else { multiplicity = col.multiplicity(); + } return multiplicity; }; using MixedBinning = FlexibleBinningPolicy, aod::lrcorrcolltable::Zvtx, decltype(getMultiplicity)>; @@ -354,8 +356,9 @@ struct LongrangecorrDerived { multiplicity = col1.centrality(); else multiplicity = col1.multiplicity(); - } else + } else { multiplicity = col1.multiplicity(); + } fillCorrHist(mixed, tracks1, tracks2, true, col1.zvtx(), multiplicity, eventweight); } // pair loop } // process mixed