From 6a622facd7c96fbf350060966ac496e098c57044 Mon Sep 17 00:00:00 2001 From: David Dobrigkeit Chinellato Date: Tue, 13 Jun 2023 15:22:48 -0300 Subject: [PATCH 1/3] Fix no-overflow functionality --- PWGLF/Tasks/hStrangeCorrelation.cxx | 108 +++++++++++++++------------- 1 file changed, 57 insertions(+), 51 deletions(-) diff --git a/PWGLF/Tasks/hStrangeCorrelation.cxx b/PWGLF/Tasks/hStrangeCorrelation.cxx index 6b7c5237aeb..52274998c7f 100644 --- a/PWGLF/Tasks/hStrangeCorrelation.cxx +++ b/PWGLF/Tasks/hStrangeCorrelation.cxx @@ -54,7 +54,7 @@ struct correlateStrangeness { Configurable doCorrelationOmegaPlus{"doCorrelationOmegaPlus", false, "do OmegaPlus correlation"}; Configurable doCorrelationPion{"doCorrelationPion", false, "do Pion correlation"}; Configurable zVertexCut{"zVertexCut", 10, "Cut on PV position"}; - Configurable skipUnderOverflowInTHn{"skipUnderOverflowInTHn", true, "skip under/overflow in THns"}; + Configurable skipUnderOverflowInTHn{"skipUnderOverflowInTHn", false, "skip under/overflow in THns"}; // Axes - configurable for smaller sizes ConfigurableAxis axisMult{"axisMult", {VARIABLE_WIDTH, 0.0f, 0.01f, 1.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 70.0f, 100.0f}, "Mixing bins - multiplicity"}; @@ -266,19 +266,6 @@ struct correlateStrangeness { if (doCorrelationPion) bitset(doCorrelation, 7); - // grab axis edge from ConfigurableAxes - const AxisSpec preAxisDeltaPhi{axisDeltaPhi, "#Delta#varphi"}; - const AxisSpec preAxisDeltaEta{axisDeltaEta, "#Delta#eta"}; - const AxisSpec preAxisPtAssoc{axisPtAssoc, "#it{p}_{T}^{assoc} (GeV/c)"}; - const AxisSpec preAxisVtxZ{axisVtxZ, "vertex Z (cm)"}; - const AxisSpec preAxisMult{axisMult, "mult percentile"}; - - std::vector edgesDeltaPhi = preAxisDeltaPhi.binEdges; - std::vector edgesDeltaEta = preAxisDeltaEta.binEdges; - std::vector edgesPtAssoc = preAxisPtAssoc.binEdges; - std::vector edgesVtxZ = preAxisVtxZ.binEdges; - std::vector edgesMult = preAxisMult.binEdges; - // Store axis ranges to prevent spurious filling // axis status: // --- Delta-phi is safe -> math forbids insanity @@ -287,11 +274,24 @@ struct correlateStrangeness { // --- vertex Z is safe -> skipped at evsel level // --- multiplicity -> check - std::vector rangesDeltaPhi = {static_cast(edgesDeltaPhi[0]), static_cast(edgesDeltaPhi[edgesDeltaPhi.size() - 1])}; - std::vector rangesDeltaEta = {static_cast(edgesDeltaEta[0]), static_cast(edgesDeltaEta[edgesDeltaEta.size() - 1])}; - std::vector rangesPtAssoc = {static_cast(edgesPtAssoc[0]), static_cast(edgesPtAssoc[edgesPtAssoc.size() - 1])}; - std::vector rangesVtxZ = {static_cast(edgesVtxZ[0]), static_cast(edgesVtxZ[edgesVtxZ.size() - 1])}; - std::vector rangesMult = {static_cast(edgesMult[0]), static_cast(edgesMult[edgesMult.size() - 1])}; + // grab axis edge from ConfigurableAxes + const AxisSpec preAxisDeltaPhi{axisDeltaPhi, "#Delta#varphi"}; + const AxisSpec preAxisDeltaEta{axisDeltaEta, "#Delta#eta"}; + const AxisSpec preAxisPtAssoc{axisPtAssoc, "#it{p}_{T}^{assoc} (GeV/c)"}; + const AxisSpec preAxisVtxZ{axisVtxZ, "vertex Z (cm)"}; + const AxisSpec preAxisMult{axisMult, "mult percentile"}; + + std::vector edgesDeltaPhiOrig = preAxisDeltaPhi.binEdges; + std::vector edgesDeltaEtaOrig = preAxisDeltaEta.binEdges; + std::vector edgesPtAssocOrig = preAxisPtAssoc.binEdges; + std::vector edgesVtxZOrig = preAxisVtxZ.binEdges; + std::vector edgesMultOrig = preAxisMult.binEdges; + + std::vector rangesDeltaPhi = {static_cast(edgesDeltaPhiOrig[0]), static_cast(edgesDeltaPhiOrig[edgesDeltaPhiOrig.size() - 1])}; + std::vector rangesDeltaEta = {static_cast(edgesDeltaEtaOrig[0]), static_cast(edgesDeltaEtaOrig[edgesDeltaEtaOrig.size() - 1])}; + std::vector rangesPtAssoc = {static_cast(edgesPtAssocOrig[0]), static_cast(edgesPtAssocOrig[edgesPtAssocOrig.size() - 1])}; + std::vector rangesVtxZ = {static_cast(edgesVtxZOrig[0]), static_cast(edgesVtxZOrig[edgesVtxZOrig.size() - 1])}; + std::vector rangesMult = {static_cast(edgesMultOrig[0]), static_cast(edgesMultOrig[edgesMultOrig.size() - 1])}; axisRanges.emplace_back(rangesDeltaPhi); axisRanges.emplace_back(rangesDeltaEta); @@ -299,28 +299,33 @@ struct correlateStrangeness { axisRanges.emplace_back(rangesVtxZ); axisRanges.emplace_back(rangesMult); - // check if U/O-flow skip is on - if (skipUnderOverflowInTHn) { - // v--- skipUnderOverflowInTHn ---v - // - // if enabled, this will change the axes such that they will solely cover the interval from - // edge[1] to edge[n-1]; this will mean that the bin 1 and bin N will be stored in - // under / overflow bins and will have to be manually unpacked. Do not forget to do the manual - // unpacking a posteriori! - // - // this feature is meant to save memory conveniently. - // it should actually be implemented centrally in ROOT but ok, this will do it for now. - edgesDeltaPhi.erase(edgesDeltaPhi.begin()); - edgesDeltaPhi.erase(edgesDeltaPhi.end()); - edgesDeltaEta.erase(edgesDeltaPhi.begin()); - edgesDeltaEta.erase(edgesDeltaPhi.end()); - edgesPtAssoc.erase(edgesDeltaPhi.begin()); - edgesPtAssoc.erase(edgesDeltaPhi.end()); - edgesVtxZ.erase(edgesDeltaPhi.begin()); - edgesVtxZ.erase(edgesDeltaPhi.end()); - edgesMult.erase(edgesDeltaPhi.begin()); - edgesMult.erase(edgesDeltaPhi.end()); - } + std::vector edgesDeltaPhi; + std::vector edgesDeltaEta; + std::vector edgesPtAssoc; + std::vector edgesVtxZ; + std::vector edgesMult; + + // v--- skipUnderOverflowInTHn ---v + // + // if enabled, this will change the axes such that they will solely cover the interval from + // edge[1] to edge[n-1]; this will mean that the bin 1 and bin N will be stored in + // under / overflow bins and will have to be manually unpacked. Do not forget to do the manual + // unpacking a posteriori! + // + // this feature is meant to save memory conveniently. + // it should actually be implemented centrally in ROOT but ok, this will do it for now. + + int offset = skipUnderOverflowInTHn?1:0; + for( int i=offset; i([&](auto i) { constexpr int index = i.value; if (v0.compatible(index) && bitcheck(doCorrelation, index)) - histos.fill(HIST("h2dMass") + HIST(v0names[index]), v0Data.pt(), v0Data.m(index)); + histos.fill(HIST("h3dMass") + HIST(v0names[index]), v0Data.pt(), v0Data.m(index), collision.centFT0M()); }); } if (!doprocessSameEventHCascades) { @@ -461,7 +467,7 @@ struct correlateStrangeness { static_for<0, 3>([&](auto i) { constexpr int index = i.value; if (casc.compatible(index) && bitcheck(doCorrelation, index + 3)) - histos.fill(HIST("h2dMass") + HIST(cascadenames[index]), cascData.pt(), cascData.m(index)); + histos.fill(HIST("h3dMass") + HIST(cascadenames[index]), cascData.pt(), cascData.m(index), collision.centFT0M()); }); } for (auto const& triggerTrack : triggerTracks) { From 69880c9c7a89ea861d839d9b34770c71effd6ec6 Mon Sep 17 00:00:00 2001 From: David Dobrigkeit Chinellato Date: Tue, 13 Jun 2023 15:24:16 -0300 Subject: [PATCH 2/3] Fix axes --- PWGLF/Tasks/hStrangeCorrelation.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/hStrangeCorrelation.cxx b/PWGLF/Tasks/hStrangeCorrelation.cxx index 52274998c7f..84d95494015 100644 --- a/PWGLF/Tasks/hStrangeCorrelation.cxx +++ b/PWGLF/Tasks/hStrangeCorrelation.cxx @@ -335,7 +335,7 @@ struct correlateStrangeness { if (bitcheck(doCorrelation, 0)) { histos.add("h3dMassK0Short", "h3dMassK0Short", kTH3F, {axisPtQA, axisK0ShortMass, axisMult}); - histos.add("sameEvent/Signal/K0Short", "K0Short", kTHnF, {axisDeltaPhi, axisDeltaEta, axisPtAssoc, axisVtxZ, axisMult}); + histos.add("sameEvent/Signal/K0Short", "K0Short", kTHnF, {axisDeltaPhiNDim, axisDeltaEtaNDim, axisPtAssocNDim, axisVtxZNDim, axisMultNDim}); } if (bitcheck(doCorrelation, 1)) { histos.add("h3dMassLambda", "h3dMassLambda", kTH3F, {axisPtQA, axisLambdaMass, axisMult}); From e45b75064760f4be86c149c20e4ac276fa16cdae Mon Sep 17 00:00:00 2001 From: ALICE Builder Date: Tue, 13 Jun 2023 20:26:08 +0200 Subject: [PATCH 3/3] Please consider the following formatting changes (#124) --- PWGLF/Tasks/hStrangeCorrelation.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PWGLF/Tasks/hStrangeCorrelation.cxx b/PWGLF/Tasks/hStrangeCorrelation.cxx index 84d95494015..146d13664b3 100644 --- a/PWGLF/Tasks/hStrangeCorrelation.cxx +++ b/PWGLF/Tasks/hStrangeCorrelation.cxx @@ -315,16 +315,16 @@ struct correlateStrangeness { // this feature is meant to save memory conveniently. // it should actually be implemented centrally in ROOT but ok, this will do it for now. - int offset = skipUnderOverflowInTHn?1:0; - for( int i=offset; i