From 981987ca9c96e125d8c6addd36ad48809e1d9137 Mon Sep 17 00:00:00 2001 From: Iulian Date: Mon, 9 Nov 2026 15:58:24 +0200 Subject: [PATCH 1/2] Update mean-pT profiles for angular correlation regions in delta phi --- .../Tasks/FoxWolframCorrelation.cxx | 79 +++++++++++++------ 1 file changed, 55 insertions(+), 24 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/FoxWolframCorrelation.cxx b/PWGCF/TwoParticleCorrelations/Tasks/FoxWolframCorrelation.cxx index 7cd6f5fdf87..3abc0b08f6e 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/FoxWolframCorrelation.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/FoxWolframCorrelation.cxx @@ -190,6 +190,9 @@ struct FoxWolframCorrelation { Configurable topologyMode{"topologyMode", kTriEvSetNom, "SelOpt: 0 AllEv, 1 TriNom, 2 IsoNom, 3 TriSet1p, 4 TriSet2p, 5 TriSet3p, 6 TriSet1m, 7 TriSet2m, 8 TriSet3m"}; + //// Minimum associated pT included in mean-pT profiles //// + Configurable meanPtMin{"meanPtMin", 0.5, "Associated pT threshold for mean-pT profiles (GeV/c)"}; + // Choose the pair selection for same-event correlations. Configurable leadAssocMode{"leadAssocMode", 2, "0: ALL i-j pairs (pT<3); 1: pTLead in (2,3) & pTAssoc < 2; 2: pTAssoc < pTLead"}; @@ -254,6 +257,15 @@ struct FoxWolframCorrelation { "awayPtD0_", "awayPtD1_", "awayPtD2_", "awayPtD3_", "awayPtD4_", "awayPtD5_"}; + //// Profile names match the folded LR declarations //// + static constexpr std::array nearMeanNames = { + "nearPtDMean0_", "nearPtDMean1_", "nearPtDMean2_", + "nearPtDMean3_", "nearPtDMean4_", "nearPtDMean5_"}; + + static constexpr std::array awayMeanNames = { + "awayPtDMean0_", "awayPtDMean1_", "awayPtDMean2_", + "awayPtDMean3_", "awayPtDMean4_", "awayPtDMean5_"}; + static constexpr std::array allLRNames = { "allLRNear", "allLRValley", "allLRAway"}; @@ -417,10 +429,14 @@ struct FoxWolframCorrelation { histos.add(fmt::format("Spectra/etaphiTriEv_BIN{}", i).c_str(), fmt::format("etaphiTriEv_BIN{}", i).c_str(), kTH2D, {axisPhi, axisEta}); histos.add(fmt::format("Spectra/ptphiTriEv_BIN{}", i).c_str(), fmt::format("ptphiTriEv_BIN{}", i).c_str(), kTH2D, {axisPhi, axispT}); - //// Six near spectra and six combined 120/240-degree spectra per multiplicity bin //// - for (int angularBin = 0; angularBin < 6; ++angularBin) { - foldedHistos.add(fmt::format("triEvFoldedLR/nearPtD{}_BIN{}", angularBin, i).c_str(), fmt::format("LR near: {}-{} deg from 0", 10 * angularBin, 10 * (angularBin + 1)).c_str(), kTH1D, {axispT}); - foldedHistos.add(fmt::format("triEvFoldedLR/awayPtD{}_BIN{}", angularBin, i).c_str(), fmt::format("LR away: {}-{} deg from 120 and 240", 10 * angularBin, 10 * (angularBin + 1)).c_str(), kTH1D, {axispT}); + //// Folded LR pT spectra and mean pT versus multiplicity //// + for (int angBin = 0; angBin < 6; ++angBin) { + + foldedHistos.add(fmt::format("triEvFoldedLR/nearPtD{}_BIN{}", angBin, i).c_str(), fmt::format("LR near: {}-{} deg from 0", 10 * angBin, 10 * (angBin + 1)).c_str(), kTH1D, {axispT}); + foldedHistos.add(fmt::format("triEvFoldedLR/nearPtDMean{}_BIN{}", angBin, i).c_str(), fmt::format("LR near: {}-{} deg from 0", 10 * angBin, 10 * (angBin + 1)).c_str(), kTProfile, {axisMultip}); + + foldedHistos.add(fmt::format("triEvFoldedLR/awayPtD{}_BIN{}", angBin, i).c_str(), fmt::format("LR away: {}-{} deg from 120 and 240", 10 * angBin, 10 * (angBin + 1)).c_str(), kTH1D, {axispT}); + foldedHistos.add(fmt::format("triEvFoldedLR/awayPtDMean{}_BIN{}", angBin, i).c_str(), fmt::format("LR away: {}-{} deg from 120 and 240", 10 * angBin, 10 * (angBin + 1)).c_str(), kTProfile, {axisMultip}); } //// ALL: pT spectra (TH1D) and mean associated pT versus multiplicity (TProfile) //// @@ -479,7 +495,6 @@ struct FoxWolframCorrelation { if (doFWMCorrelations) { for (size_t k = 0; k < fwmCorrelationNames.size(); ++k) { - const int first = fwmCorrelationFirst[k] + 1; const int second = fwmCorrelationSecond[k] + 1; @@ -658,22 +673,25 @@ struct FoxWolframCorrelation { //// Helper for one multiplicity bin (Idx is a template parameter, not a captured lambda variable) //// //// Avoids the GCC 14 ICE in tsubst_expr caused by nested generic static_for lambdas //// template - void fillFoldedBin(double deltaPhi, double pt) + void fillFoldedBin(int nTracks, double deltaPhi, double pt) { const double degToRad = constants::math::PI / 180.; - //// Adjacent windows include the lower edge and exclude the upper edge //// + //// Six angular intervals with the existing strict boundary cuts //// static_for<0, 5>([&](auto j) { - constexpr int angularBin = j.value; - constexpr double lo = 10. * angularBin; - constexpr double hi = 10. * (angularBin + 1); + constexpr int angBin = j.value; + constexpr double lo = 10. * angBin; + constexpr double hi = 10. * (angBin + 1); //// Combine the two sides of the near peak at zero //// const bool inNear = (deltaPhi > -hi * degToRad && deltaPhi < -lo * degToRad) || (deltaPhi > lo * degToRad && deltaPhi < hi * degToRad); if (inNear) { - foldedHistos.fill(HIST("triEvFoldedLR/") + HIST(nearNames[angularBin]) + HIST(binNames[Idx]), pt); - } + if (pt > meanPtMin.value) { + foldedHistos.fill(HIST("triEvFoldedLR/") + HIST(nearNames[angBin]) + HIST(binNames[Idx]), pt); + foldedHistos.fill(HIST("triEvFoldedLR/") + HIST(nearMeanNames[angBin]) + HIST(binNames[Idx]), nTracks, pt); + } // for pt > meanPtMin + } // PEAK 1 //// Combine both sides of 120 and 240 degrees //// //// The final window maps angles above 270 degrees to negative deltaPhi //// @@ -682,14 +700,18 @@ struct FoxWolframCorrelation { (deltaPhi > (240. + lo - 360.) * degToRad && deltaPhi < (240. + hi - 360.) * degToRad); if (inAway) { - foldedHistos.fill(HIST("triEvFoldedLR/") + HIST(awayNames[angularBin]) + HIST(binNames[Idx]), pt); - } + if (pt > meanPtMin.value) { + foldedHistos.fill(HIST("triEvFoldedLR/") + HIST(awayNames[angBin]) + HIST(binNames[Idx]), pt); + foldedHistos.fill(HIST("triEvFoldedLR/") + HIST(awayMeanNames[angBin]) + HIST(binNames[Idx]), nTracks, pt); + } // for pt > meanPtMin + } // PEAKS 2 AND 3 }); } //// TRI LR pT spectra in six symmetric angular intervals //// template void fillSameEventFoldedLR(int binIndex, + int nTracks, Track const& associatedTrack, double deltaPhi, double deltaEta, @@ -722,7 +744,7 @@ struct FoxWolframCorrelation { return; } - fillFoldedBin(deltaPhi, associatedTrack.pt()); + fillFoldedBin(nTracks, deltaPhi, associatedTrack.pt()); }); } @@ -742,13 +764,18 @@ struct FoxWolframCorrelation { } if (inLR) { - histos.fill(HIST("allEvPkVall/") + HIST(allLRNames[region]) + HIST("Pt_") + HIST(binNames[Idx]), pt); - histos.fill(HIST("allEvPkVall/") + HIST(allLRNames[region]) + HIST("PtMultip_") + HIST(binNames[Idx]), nTracks, pt); + if (pt > meanPtMin.value) { + histos.fill(HIST("allEvPkVall/") + HIST(allLRNames[region]) + HIST("Pt_") + HIST(binNames[Idx]), pt); + histos.fill(HIST("allEvPkVall/") + HIST(allLRNames[region]) + HIST("PtMultip_") + HIST(binNames[Idx]), nTracks, pt); + } // for pt > meanPtMin } if (inSR) { - histos.fill(HIST("allEvPkVall/") + HIST(allSRNames[region]) + HIST("Pt_") + HIST(binNames[Idx]), pt); - histos.fill(HIST("allEvPkVall/") + HIST(allSRNames[region]) + HIST("PtMultip_") + HIST(binNames[Idx]), nTracks, pt); + + if (pt > meanPtMin.value) { + histos.fill(HIST("allEvPkVall/") + HIST(allSRNames[region]) + HIST("Pt_") + HIST(binNames[Idx]), pt); + histos.fill(HIST("allEvPkVall/") + HIST(allSRNames[region]) + HIST("PtMultip_") + HIST(binNames[Idx]), nTracks, pt); + } // for pt > meanPtMin } }); } @@ -763,13 +790,17 @@ struct FoxWolframCorrelation { } if (inLR) { - histos.fill(HIST("triEvPkVall/") + HIST(triLRNames[region]) + HIST("Pt_") + HIST(binNames[Idx]), pt); - histos.fill(HIST("triEvPkVall/") + HIST(triLRNames[region]) + HIST("PtMultip_") + HIST(binNames[Idx]), nTracks, pt); + if (pt > meanPtMin.value) { + histos.fill(HIST("triEvPkVall/") + HIST(triLRNames[region]) + HIST("Pt_") + HIST(binNames[Idx]), pt); + histos.fill(HIST("triEvPkVall/") + HIST(triLRNames[region]) + HIST("PtMultip_") + HIST(binNames[Idx]), nTracks, pt); + } // for pt > meanPtMin } if (inSR) { - histos.fill(HIST("triEvPkVall/") + HIST(triSRNames[region]) + HIST("Pt_") + HIST(binNames[Idx]), pt); - histos.fill(HIST("triEvPkVall/") + HIST(triSRNames[region]) + HIST("PtMultip_") + HIST(binNames[Idx]), nTracks, pt); + if (pt > meanPtMin.value) { + histos.fill(HIST("triEvPkVall/") + HIST(triSRNames[region]) + HIST("Pt_") + HIST(binNames[Idx]), pt); + histos.fill(HIST("triEvPkVall/") + HIST(triSRNames[region]) + HIST("PtMultip_") + HIST(binNames[Idx]), nTracks, pt); + } // for pt > meanPtMin } }); } @@ -1041,7 +1072,7 @@ struct FoxWolframCorrelation { //// Fixed-window spectra and mean-pT profiles //// fillSameEventPtHist(i + 1, nGlobalTracks, track2, deltaPhi, deltaEta, isLeadAssocPair); //// TRI LR spectra in symmetric 10-degree windows //// - fillSameEventFoldedLR(i + 1, track2, deltaPhi, deltaEta, isLeadAssocPair); + fillSameEventFoldedLR(i + 1, nGlobalTracks, track2, deltaPhi, deltaEta, isLeadAssocPair); } } } From 3195797bb6da91eedd809b4a56568b8d519f4bb7 Mon Sep 17 00:00:00 2001 From: Iulian Date: Tue, 10 Nov 2026 12:17:06 +0200 Subject: [PATCH 2/2] Rename Fox-Wolfram task source file --- .../Tasks/CMakeLists.txt | 2 +- ...relation.cxx => foxWolframCorrelation.cxx} | 212 +++++++++--------- 2 files changed, 108 insertions(+), 106 deletions(-) rename PWGCF/TwoParticleCorrelations/Tasks/{FoxWolframCorrelation.cxx => foxWolframCorrelation.cxx} (88%) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt index 83f52b206e0..ae59372d44d 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt +++ b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt @@ -144,7 +144,7 @@ o2physics_add_dpl_workflow(lambda-or-anti-lambda-producer-with-spin COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(fox-wolfram-correlation - SOURCES FoxWolframCorrelation.cxx + SOURCES foxWolframCorrelation.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/FoxWolframCorrelation.cxx b/PWGCF/TwoParticleCorrelations/Tasks/foxWolframCorrelation.cxx similarity index 88% rename from PWGCF/TwoParticleCorrelations/Tasks/FoxWolframCorrelation.cxx rename to PWGCF/TwoParticleCorrelations/Tasks/foxWolframCorrelation.cxx index 3abc0b08f6e..c76e92489fb 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/FoxWolframCorrelation.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/foxWolframCorrelation.cxx @@ -9,12 +9,12 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file FoxWolframCorrelation.cxx +/// \file foxWolframCorrelation.cxx /// \author Andreicovici Iulian Florin /// \brief RECO-level event shape analysis using Fox-Wolfram Moments for O+O collisions. /// Classifies events by topology (triangular), fills correlation histograms, /// and produces custom SOA tables for mixed-event background estimation. -/// \since 06 Nov 2026 +/// \since 10 Nov 2026 #include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/RecoDecay.h" @@ -117,11 +117,13 @@ template bool passesLeadAssoc(int mode, bool foundPart, Track const& track1, Track const& track2, TLead const& triggTrk, TLead const& triggTrkPart) { + auto ptUpperLim1 = 3.f, ptUpperLim2 = 2.f; // low and high limits in pt + if (mode == kAllPairs) { // all i-j pairs - return (track1.pt() < 3.f) && (track2.pt() < 3.f); + return (track1.pt() < ptUpperLim1) && (track2.pt() < ptUpperLim1); } if (mode == kpTLeadConstrain) { // L-A: Leading pt in (2,3), Assoc pt < 2 - return foundPart && (track1.globalIndex() == triggTrkPart.globalIndex()) && (track2.pt() < 2.f); + return foundPart && (track1.globalIndex() == triggTrkPart.globalIndex()) && (track2.pt() < ptUpperLim2); } if (mode == kpTLeadFree) { // L-A return (track1.globalIndex() == triggTrk.globalIndex()) && (track2.pt() < track1.pt()); @@ -140,6 +142,8 @@ auto findLeadingPart(T const& tracks) double ptMaxAll = -1., ptMaxPart = -1.; bool foundPart = false; + auto ptLim1 = 2.f, ptLim2 = 3.f; // low and high limits in pt + for (const auto& track : tracks) { // pT Leading (no constraint) if (track.pt() > ptMaxAll) { @@ -148,7 +152,7 @@ auto findLeadingPart(T const& tracks) } // pT Leading in (2,3) - if (track.pt() > 2.f && track.pt() < 3.f && track.pt() > ptMaxPart) { + if (track.pt() > ptLim1 && track.pt() < ptLim2 && track.pt() > ptMaxPart) { ptMaxPart = track.pt(); leadingPartId = i; foundPart = true; @@ -244,48 +248,48 @@ struct FoxWolframCorrelation { static constexpr int MaxMultBins = 10; int nMultBins = 0; // set in init() from multLower/multUpper - static constexpr std::array binNames = { + static constexpr std::array BinNames = { "BIN1", "BIN2", "BIN3", "BIN4", "BIN5", "BIN6", "BIN7", "BIN8", "BIN9", "BIN10"}; //// Class-level names for compile-time HIST lookups in nested loops //// - static constexpr std::array nearNames = { + static constexpr std::array NearNames = { "nearPtD0_", "nearPtD1_", "nearPtD2_", "nearPtD3_", "nearPtD4_", "nearPtD5_"}; - static constexpr std::array awayNames = { + static constexpr std::array AwayNames = { "awayPtD0_", "awayPtD1_", "awayPtD2_", "awayPtD3_", "awayPtD4_", "awayPtD5_"}; //// Profile names match the folded LR declarations //// - static constexpr std::array nearMeanNames = { + static constexpr std::array NearMeanNames = { "nearPtDMean0_", "nearPtDMean1_", "nearPtDMean2_", "nearPtDMean3_", "nearPtDMean4_", "nearPtDMean5_"}; - static constexpr std::array awayMeanNames = { + static constexpr std::array AwayMeanNames = { "awayPtDMean0_", "awayPtDMean1_", "awayPtDMean2_", "awayPtDMean3_", "awayPtDMean4_", "awayPtDMean5_"}; - static constexpr std::array allLRNames = { + static constexpr std::array AllLrNames = { "allLRNear", "allLRValley", "allLRAway"}; - static constexpr std::array allSRNames = { + static constexpr std::array AllSrNames = { "allSRNear", "allSRValley", "allSRAway"}; - static constexpr std::array triLRNames = { + static constexpr std::array TriLrNames = { "triLRPeak1", "triLRPeak2", "triLRPeak3", "triLRValleys"}; - static constexpr std::array triSRNames = { + static constexpr std::array TriSrNames = { "triSRPeak1", "triSRPeak2", "triSRPeak3", "triSRValleys"}; // Map each unique pair of Fox-Wolfram moments to its histogram. - static constexpr std::array fwmRangeNames = {"FWM_BIN1/", "FWM_BIN2/", "FWM_BIN3/"}; - static constexpr std::array fwmHNames = {"H1", "H2", "H3", "H4", "H5", "H6", "H7", "H8"}; - static constexpr std::array fwmMultHNames = {"Multip_H1", "Multip_H2", "Multip_H3", "Multip_H4", "Multip_H5", "Multip_H6", "Multip_H7", "Multip_H8"}; + static constexpr std::array FwmRangeNames = {"FWM_BIN1/", "FWM_BIN2/", "FWM_BIN3/"}; + static constexpr std::array FwmHlNames = {"H1", "H2", "H3", "H4", "H5", "H6", "H7", "H8"}; + static constexpr std::array FwmMulthNames = {"Multip_H1", "Multip_H2", "Multip_H3", "Multip_H4", "Multip_H5", "Multip_H6", "Multip_H7", "Multip_H8"}; - static constexpr std::array fwmCorrelationNames = {"H1_H2", "H1_H3", "H1_H4", "H1_H5", "H1_H6", "H1_H7", "H1_H8", "H2_H3", "H2_H4", "H2_H5", "H2_H6", "H2_H7", "H2_H8", "H3_H4", "H3_H5", "H3_H6", "H3_H7", "H3_H8", "H4_H5", "H4_H6", "H4_H7", "H4_H8", "H5_H6", "H5_H7", "H5_H8", "H6_H7", "H6_H8", "H7_H8"}; - static constexpr std::array fwmCorrelationFirst = {0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6}; - static constexpr std::array fwmCorrelationSecond = {1, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 3, 4, 5, 6, 7, 4, 5, 6, 7, 5, 6, 7, 6, 7, 7}; + static constexpr std::array FwmCorrelationNames = {"H1_H2", "H1_H3", "H1_H4", "H1_H5", "H1_H6", "H1_H7", "H1_H8", "H2_H3", "H2_H4", "H2_H5", "H2_H6", "H2_H7", "H2_H8", "H3_H4", "H3_H5", "H3_H6", "H3_H7", "H3_H8", "H4_H5", "H4_H6", "H4_H7", "H4_H8", "H5_H6", "H5_H7", "H5_H8", "H6_H7", "H6_H8", "H7_H8"}; + static constexpr std::array FwmCorrelationFirst = {0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6}; + static constexpr std::array FwmCorrelationSecond = {1, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 3, 4, 5, 6, 7, 4, 5, 6, 7, 5, 6, 7, 6, 7, 7}; // Register event, track, moment, and correlation histograms. void init(InitContext const&) @@ -300,9 +304,7 @@ struct FoxWolframCorrelation { LOGF(fatal, "multLower/multUpper must have the same size, between 1 and %d entries", MaxMultBins); } nMultBins = static_cast(multLower.value.size()); - if (nMultBins < 3) { - LOGF(fatal, "At least three broad multiplicity ranges are required"); - } + for (int i = 0; i < nMultBins; ++i) { if (multLower.value[i] > multUpper.value[i]) { LOGF(fatal, "Multiplicity bin %d has multLower (%d) > multUpper (%d)", i + 1, multLower.value[i], multUpper.value[i]); @@ -430,13 +432,13 @@ struct FoxWolframCorrelation { histos.add(fmt::format("Spectra/ptphiTriEv_BIN{}", i).c_str(), fmt::format("ptphiTriEv_BIN{}", i).c_str(), kTH2D, {axisPhi, axispT}); //// Folded LR pT spectra and mean pT versus multiplicity //// - for (int angBin = 0; angBin < 6; ++angBin) { + for (int AngBin = 0; AngBin < 6; ++AngBin) { - foldedHistos.add(fmt::format("triEvFoldedLR/nearPtD{}_BIN{}", angBin, i).c_str(), fmt::format("LR near: {}-{} deg from 0", 10 * angBin, 10 * (angBin + 1)).c_str(), kTH1D, {axispT}); - foldedHistos.add(fmt::format("triEvFoldedLR/nearPtDMean{}_BIN{}", angBin, i).c_str(), fmt::format("LR near: {}-{} deg from 0", 10 * angBin, 10 * (angBin + 1)).c_str(), kTProfile, {axisMultip}); + foldedHistos.add(fmt::format("triEvFoldedLR/nearPtD{}_BIN{}", AngBin, i).c_str(), fmt::format("LR near: {}-{} deg from 0", 10 * AngBin, 10 * (AngBin + 1)).c_str(), kTH1D, {axispT}); + foldedHistos.add(fmt::format("triEvFoldedLR/nearPtDMean{}_BIN{}", AngBin, i).c_str(), fmt::format("LR near: {}-{} deg from 0", 10 * AngBin, 10 * (AngBin + 1)).c_str(), kTProfile, {axisMultip}); - foldedHistos.add(fmt::format("triEvFoldedLR/awayPtD{}_BIN{}", angBin, i).c_str(), fmt::format("LR away: {}-{} deg from 120 and 240", 10 * angBin, 10 * (angBin + 1)).c_str(), kTH1D, {axispT}); - foldedHistos.add(fmt::format("triEvFoldedLR/awayPtDMean{}_BIN{}", angBin, i).c_str(), fmt::format("LR away: {}-{} deg from 120 and 240", 10 * angBin, 10 * (angBin + 1)).c_str(), kTProfile, {axisMultip}); + foldedHistos.add(fmt::format("triEvFoldedLR/awayPtD{}_BIN{}", AngBin, i).c_str(), fmt::format("LR away: {}-{} deg from 120 and 240", 10 * AngBin, 10 * (AngBin + 1)).c_str(), kTH1D, {axispT}); + foldedHistos.add(fmt::format("triEvFoldedLR/awayPtDMean{}_BIN{}", AngBin, i).c_str(), fmt::format("LR away: {}-{} deg from 120 and 240", 10 * AngBin, 10 * (AngBin + 1)).c_str(), kTProfile, {axisMultip}); } //// ALL: pT spectra (TH1D) and mean associated pT versus multiplicity (TProfile) //// @@ -494,13 +496,13 @@ struct FoxWolframCorrelation { // Register optional pairwise moment correlations. if (doFWMCorrelations) { - for (size_t k = 0; k < fwmCorrelationNames.size(); ++k) { - const int first = fwmCorrelationFirst[k] + 1; - const int second = fwmCorrelationSecond[k] + 1; + for (size_t k = 0; k < FwmCorrelationNames.size(); ++k) { + const int first = FwmCorrelationFirst[k] + 1; + const int second = FwmCorrelationSecond[k] + 1; - histos.add(fmt::format("FWM_BIN1/{}", fwmCorrelationNames[k]).c_str(), fmt::format("H_{{{}}} vs H_{{{}}}", first, second).c_str(), kTH2D, {axisHlfine, axisHlfine}); - histos.add(fmt::format("FWM_BIN2/{}", fwmCorrelationNames[k]).c_str(), fmt::format("H_{{{}}} vs H_{{{}}}", first, second).c_str(), kTH2D, {axisHlfine, axisHlfine}); - histos.add(fmt::format("FWM_BIN3/{}", fwmCorrelationNames[k]).c_str(), fmt::format("H_{{{}}} vs H_{{{}}}", first, second).c_str(), kTH2D, {axisHlfine, axisHlfine}); + histos.add(fmt::format("FWM_BIN1/{}", FwmCorrelationNames[k]).c_str(), fmt::format("H_{{{}}} vs H_{{{}}}", first, second).c_str(), kTH2D, {axisHlfine, axisHlfine}); + histos.add(fmt::format("FWM_BIN2/{}", FwmCorrelationNames[k]).c_str(), fmt::format("H_{{{}}} vs H_{{{}}}", first, second).c_str(), kTH2D, {axisHlfine, axisHlfine}); + histos.add(fmt::format("FWM_BIN3/{}", FwmCorrelationNames[k]).c_str(), fmt::format("H_{{{}}} vs H_{{{}}}", first, second).c_str(), kTH2D, {axisHlfine, axisHlfine}); } } } @@ -650,59 +652,59 @@ struct FoxWolframCorrelation { // Fill inclusive spectra and selected-topology spectra for this interval. static_for<0, 9>([&](auto i) { - constexpr int idx = i.value; + constexpr int IdxVal = i.value; - if (binIndex == idx + 1) { + if (binIndex == IdxVal + 1) { for (const auto& track : tracks) { - histos.fill(HIST("Spectra/etaphiAllEv_") + HIST(binNames[idx]), track.phi(), track.eta()); - histos.fill(HIST("Spectra/ptphiAllEv_") + HIST(binNames[idx]), track.phi(), track.pt()); + histos.fill(HIST("Spectra/etaphiAllEv_") + HIST(BinNames[IdxVal]), track.phi(), track.eta()); + histos.fill(HIST("Spectra/ptphiAllEv_") + HIST(BinNames[IdxVal]), track.phi(), track.pt()); if (!isSelectedTopology) { continue; } // TRI Ev. - histos.fill(HIST("Spectra/etaphiTriEv_") + HIST(binNames[idx]), track.phi(), track.eta()); - histos.fill(HIST("Spectra/ptphiTriEv_") + HIST(binNames[idx]), track.phi(), track.pt()); + histos.fill(HIST("Spectra/etaphiTriEv_") + HIST(BinNames[IdxVal]), track.phi(), track.eta()); + histos.fill(HIST("Spectra/ptphiTriEv_") + HIST(BinNames[IdxVal]), track.phi(), track.pt()); } } }); // per Multip Bin } - //// Helper for one multiplicity bin (Idx is a template parameter, not a captured lambda variable) //// + //// Helper for one multiplicity bin (IdxVal is a template parameter, not a captured lambda variable) //// //// Avoids the GCC 14 ICE in tsubst_expr caused by nested generic static_for lambdas //// - template + template void fillFoldedBin(int nTracks, double deltaPhi, double pt) { const double degToRad = constants::math::PI / 180.; //// Six angular intervals with the existing strict boundary cuts //// static_for<0, 5>([&](auto j) { - constexpr int angBin = j.value; - constexpr double lo = 10. * angBin; - constexpr double hi = 10. * (angBin + 1); + constexpr int AngBin = j.value; + constexpr double LowLim = 10. * AngBin; + constexpr double HighLim = 10. * (AngBin + 1); //// Combine the two sides of the near peak at zero //// - const bool inNear = (deltaPhi > -hi * degToRad && deltaPhi < -lo * degToRad) || (deltaPhi > lo * degToRad && deltaPhi < hi * degToRad); + const bool inNear = (deltaPhi > -HighLim * degToRad && deltaPhi < -LowLim * degToRad) || (deltaPhi > LowLim * degToRad && deltaPhi < HighLim * degToRad); if (inNear) { if (pt > meanPtMin.value) { - foldedHistos.fill(HIST("triEvFoldedLR/") + HIST(nearNames[angBin]) + HIST(binNames[Idx]), pt); - foldedHistos.fill(HIST("triEvFoldedLR/") + HIST(nearMeanNames[angBin]) + HIST(binNames[Idx]), nTracks, pt); + foldedHistos.fill(HIST("triEvFoldedLR/") + HIST(NearNames[AngBin]) + HIST(BinNames[IdxVal]), pt); + foldedHistos.fill(HIST("triEvFoldedLR/") + HIST(NearMeanNames[AngBin]) + HIST(BinNames[IdxVal]), nTracks, pt); } // for pt > meanPtMin } // PEAK 1 //// Combine both sides of 120 and 240 degrees //// //// The final window maps angles above 270 degrees to negative deltaPhi //// - const bool inAway = (deltaPhi > (120. - hi) * degToRad && deltaPhi < (120. - lo) * degToRad) || (deltaPhi > (120. + lo) * degToRad && deltaPhi < (120. + hi) * degToRad) || - (deltaPhi > (240. - hi) * degToRad && deltaPhi < (240. - lo) * degToRad) || (deltaPhi > (240. + lo) * degToRad && deltaPhi < (240. + hi) * degToRad) || - (deltaPhi > (240. + lo - 360.) * degToRad && deltaPhi < (240. + hi - 360.) * degToRad); + const bool inAway = (deltaPhi > (120. - HighLim) * degToRad && deltaPhi < (120. - LowLim) * degToRad) || (deltaPhi > (120. + LowLim) * degToRad && deltaPhi < (120. + HighLim) * degToRad) || + (deltaPhi > (240. - HighLim) * degToRad && deltaPhi < (240. - LowLim) * degToRad) || (deltaPhi > (240. + LowLim) * degToRad && deltaPhi < (240. + HighLim) * degToRad) || + (deltaPhi > (240. + LowLim - 360.) * degToRad && deltaPhi < (240. + HighLim - 360.) * degToRad); if (inAway) { if (pt > meanPtMin.value) { - foldedHistos.fill(HIST("triEvFoldedLR/") + HIST(awayNames[angBin]) + HIST(binNames[Idx]), pt); - foldedHistos.fill(HIST("triEvFoldedLR/") + HIST(awayMeanNames[angBin]) + HIST(binNames[Idx]), nTracks, pt); + foldedHistos.fill(HIST("triEvFoldedLR/") + HIST(AwayNames[AngBin]) + HIST(BinNames[IdxVal]), pt); + foldedHistos.fill(HIST("triEvFoldedLR/") + HIST(AwayMeanNames[AngBin]) + HIST(BinNames[IdxVal]), nTracks, pt); } // for pt > meanPtMin } // PEAKS 2 AND 3 }); @@ -738,18 +740,18 @@ struct FoxWolframCorrelation { //// Fill only the requested multiplicity interval //// static_for<0, 9>([&](auto i) { - constexpr int idx = i.value; + constexpr int IdxVal = i.value; - if (binIndex != idx + 1) { + if (binIndex != IdxVal + 1) { return; } - fillFoldedBin(nTracks, deltaPhi, associatedTrack.pt()); + fillFoldedBin(nTracks, deltaPhi, associatedTrack.pt()); }); } - //// Helper for one multiplicity bin (Idx is a template parameter, not a captured lambda variable) //// - template + //// Helper for one multiplicity bin (IdxVal is a template parameter, not a captured lambda variable) //// + template void fillPtBin(bool isAll, bool isTri, const std::array& allWindows, const std::array& triWindows, bool inLR, bool inSR, int nTracks, double pt) @@ -757,24 +759,24 @@ struct FoxWolframCorrelation { //// Fill ALL spectra and profiles with one entry per accepted pair //// if (isAll) { static_for<0, 2>([&](auto j) { - constexpr int region = j.value; + constexpr int RegionVal = j.value; - if (!allWindows[region]) { + if (!allWindows[RegionVal]) { return; } if (inLR) { if (pt > meanPtMin.value) { - histos.fill(HIST("allEvPkVall/") + HIST(allLRNames[region]) + HIST("Pt_") + HIST(binNames[Idx]), pt); - histos.fill(HIST("allEvPkVall/") + HIST(allLRNames[region]) + HIST("PtMultip_") + HIST(binNames[Idx]), nTracks, pt); + histos.fill(HIST("allEvPkVall/") + HIST(AllLrNames[RegionVal]) + HIST("Pt_") + HIST(BinNames[IdxVal]), pt); + histos.fill(HIST("allEvPkVall/") + HIST(AllLrNames[RegionVal]) + HIST("PtMultip_") + HIST(BinNames[IdxVal]), nTracks, pt); } // for pt > meanPtMin } if (inSR) { if (pt > meanPtMin.value) { - histos.fill(HIST("allEvPkVall/") + HIST(allSRNames[region]) + HIST("Pt_") + HIST(binNames[Idx]), pt); - histos.fill(HIST("allEvPkVall/") + HIST(allSRNames[region]) + HIST("PtMultip_") + HIST(binNames[Idx]), nTracks, pt); + histos.fill(HIST("allEvPkVall/") + HIST(AllSrNames[RegionVal]) + HIST("Pt_") + HIST(BinNames[IdxVal]), pt); + histos.fill(HIST("allEvPkVall/") + HIST(AllSrNames[RegionVal]) + HIST("PtMultip_") + HIST(BinNames[IdxVal]), nTracks, pt); } // for pt > meanPtMin } }); @@ -783,23 +785,23 @@ struct FoxWolframCorrelation { //// Fill TRI spectra and profiles with one entry per accepted pair //// if (isTri) { static_for<0, 3>([&](auto j) { - constexpr int region = j.value; + constexpr int RegionVal = j.value; - if (!triWindows[region]) { + if (!triWindows[RegionVal]) { return; } if (inLR) { if (pt > meanPtMin.value) { - histos.fill(HIST("triEvPkVall/") + HIST(triLRNames[region]) + HIST("Pt_") + HIST(binNames[Idx]), pt); - histos.fill(HIST("triEvPkVall/") + HIST(triLRNames[region]) + HIST("PtMultip_") + HIST(binNames[Idx]), nTracks, pt); + histos.fill(HIST("triEvPkVall/") + HIST(TriLrNames[RegionVal]) + HIST("Pt_") + HIST(BinNames[IdxVal]), pt); + histos.fill(HIST("triEvPkVall/") + HIST(TriLrNames[RegionVal]) + HIST("PtMultip_") + HIST(BinNames[IdxVal]), nTracks, pt); } // for pt > meanPtMin } if (inSR) { if (pt > meanPtMin.value) { - histos.fill(HIST("triEvPkVall/") + HIST(triSRNames[region]) + HIST("Pt_") + HIST(binNames[Idx]), pt); - histos.fill(HIST("triEvPkVall/") + HIST(triSRNames[region]) + HIST("PtMultip_") + HIST(binNames[Idx]), nTracks, pt); + histos.fill(HIST("triEvPkVall/") + HIST(TriSrNames[RegionVal]) + HIST("Pt_") + HIST(BinNames[IdxVal]), pt); + histos.fill(HIST("triEvPkVall/") + HIST(TriSrNames[RegionVal]) + HIST("PtMultip_") + HIST(BinNames[IdxVal]), nTracks, pt); } // for pt > meanPtMin } }); @@ -828,8 +830,8 @@ struct FoxWolframCorrelation { const bool inSR = absEta < 0.35; //// Preserve the original open angular windows //// - const auto inPhi = [&](double lo, double hi) { - return deltaPhi > lo * degToRad && deltaPhi < hi * degToRad; + const auto inPhi = [&](double lowLim, double highLim) { + return deltaPhi > lowLim * degToRad && deltaPhi < highLim * degToRad; }; //// Event topology //// @@ -853,13 +855,13 @@ struct FoxWolframCorrelation { //// Fill only the requested multiplicity interval //// static_for<0, 9>([&](auto i) { - constexpr int idx = i.value; + constexpr int IdxVal = i.value; - if (binIndex != idx + 1) { + if (binIndex != IdxVal + 1) { return; } - fillPtBin(isAll, isTri, allWindows, triWindows, inLR, inSR, nTracks, pt); + fillPtBin(isAll, isTri, allWindows, triWindows, inLR, inSR, nTracks, pt); }); } @@ -873,9 +875,9 @@ struct FoxWolframCorrelation { { static_for<0, 9>([&](auto i) { - constexpr int idx = i.value; + constexpr int IdxVal = i.value; - if (binIndex != idx + 1) { + if (binIndex != IdxVal + 1) { return; } @@ -885,8 +887,8 @@ struct FoxWolframCorrelation { //// Count the pair and fill its original angular coordinates //// histos.fill(HIST("SamePairs/SamePairsNoLA"), binIndex); - histos.fill(HIST("Corelations/sProjTRI_") + HIST(binNames[idx]), deltaPhi); - histos.fill(HIST("Corelations/sTRI_") + HIST(binNames[idx]), deltaPhi, deltaEta); + histos.fill(HIST("Corelations/sProjTRI_") + HIST(BinNames[IdxVal]), deltaPhi); + histos.fill(HIST("Corelations/sTRI_") + HIST(BinNames[IdxVal]), deltaPhi, deltaEta); }); } @@ -896,15 +898,15 @@ struct FoxWolframCorrelation { { // H[0] = H0 (normalizare), H[1..8] = H1..H8 static_for<0, 7>([&](auto j) { - constexpr int jj = j.value; - histos.fill(HIST(fwmRangeNames[R]) + HIST(fwmHNames[jj]), H[jj + 1]); - histos.fill(HIST(fwmRangeNames[R]) + HIST(fwmMultHNames[jj]), nTrk, H[jj + 1]); + constexpr int JjIt = j.value; + histos.fill(HIST(FwmRangeNames[R]) + HIST(FwmHlNames[JjIt]), H[JjIt + 1]); + histos.fill(HIST(FwmRangeNames[R]) + HIST(FwmMulthNames[JjIt]), nTrk, H[JjIt + 1]); }); if (doFWMCorrelations) { static_for<0, 27>([&](auto k) { - constexpr int kk = k.value; - histos.fill(HIST(fwmRangeNames[R]) + HIST(fwmCorrelationNames[kk]), H[fwmCorrelationFirst[kk] + 1], H[fwmCorrelationSecond[kk] + 1]); + constexpr int KkIt = k.value; + histos.fill(HIST(FwmRangeNames[R]) + HIST(FwmCorrelationNames[KkIt]), H[FwmCorrelationFirst[KkIt] + 1], H[FwmCorrelationSecond[KkIt] + 1]); }); } } @@ -1153,12 +1155,12 @@ struct FoxWolframCorrelation { // Build mixed-event backgrounds from the selected event tables. struct FoxWolframCorrelationMixing { - SliceCache cache_bin1, cache_bin2, cache_bin3, cache_bin4, cache_bin5, cache_bin6, cache_bin7, cache_bin8, cache_bin9, cache_bin10; + SliceCache cacheBin1, cacheBin2, cacheBin3, cacheBin4, cacheBin5, cacheBin6, cacheBin7, cacheBin8, cacheBin9, cacheBin10; Preslice triCol = aod::track_tri::triangleCollisionId; HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - static constexpr std::array mixedBinNames = { + static constexpr std::array MixedBinNames = { "BIN1", "BIN2", "BIN3", "BIN4", "BIN5", "BIN6", "BIN7", "BIN8", "BIN9", "BIN10"}; Configurable nBin{"nBin", 100, "No of bis per axis"}; @@ -1207,12 +1209,12 @@ struct FoxWolframCorrelationMixing { //// Each mixing axis must cover its configured integer multiplicity interval //// for (int i = 0; i < nMultBins; ++i) { const auto& edges = axisEdges[i]; - const double lo = multLower.value[i] - 0.5; - const double hi = multUpper.value[i] + 0.5; + const double lowLim = multLower.value[i] - 0.5; + const double highLim = multUpper.value[i] + 0.5; if (multLower.value[i] > multUpper.value[i] || edges.size() < 2 || - std::abs(edges[edges.size() - 2] - lo) > 1.e-6 || - std::abs(edges.back() - hi) > 1.e-6) { - LOGF(fatal, "axisMult%d must match multiplicity limits [%.1f, %.1f]", i + 1, lo, hi); + std::abs(edges[edges.size() - 2] - lowLim) > 1.e-6 || + std::abs(edges.back() - highLim) > 1.e-6) { + LOGF(fatal, "axisMult%d must match multiplicity limits [%.1f, %.1f]", i + 1, lowLim, highLim); } } @@ -1252,16 +1254,16 @@ struct FoxWolframCorrelationMixing { BinningType binningOnPosMultip10{{axisVtx, axisMult10}}; // Create independent mixing pools for the ten multiplicity intervals. - SameKindPair pairBIN1{binningOnPosMultip1, nMixedEvents, -1, &cache_bin1}; - SameKindPair pairBIN2{binningOnPosMultip2, nMixedEvents, -1, &cache_bin2}; - SameKindPair pairBIN3{binningOnPosMultip3, nMixedEvents, -1, &cache_bin3}; - SameKindPair pairBIN4{binningOnPosMultip4, nMixedEvents, -1, &cache_bin4}; - SameKindPair pairBIN5{binningOnPosMultip5, nMixedEvents, -1, &cache_bin5}; - SameKindPair pairBIN6{binningOnPosMultip6, nMixedEvents, -1, &cache_bin6}; - SameKindPair pairBIN7{binningOnPosMultip7, nMixedEvents, -1, &cache_bin7}; - SameKindPair pairBIN8{binningOnPosMultip8, nMixedEvents, -1, &cache_bin8}; - SameKindPair pairBIN9{binningOnPosMultip9, nMixedEvents, -1, &cache_bin9}; - SameKindPair pairBIN10{binningOnPosMultip10, nMixedEvents, -1, &cache_bin10}; + SameKindPair pairBIN1{binningOnPosMultip1, nMixedEvents, -1, &cacheBin1}; + SameKindPair pairBIN2{binningOnPosMultip2, nMixedEvents, -1, &cacheBin2}; + SameKindPair pairBIN3{binningOnPosMultip3, nMixedEvents, -1, &cacheBin3}; + SameKindPair pairBIN4{binningOnPosMultip4, nMixedEvents, -1, &cacheBin4}; + SameKindPair pairBIN5{binningOnPosMultip5, nMixedEvents, -1, &cacheBin5}; + SameKindPair pairBIN6{binningOnPosMultip6, nMixedEvents, -1, &cacheBin6}; + SameKindPair pairBIN7{binningOnPosMultip7, nMixedEvents, -1, &cacheBin7}; + SameKindPair pairBIN8{binningOnPosMultip8, nMixedEvents, -1, &cacheBin8}; + SameKindPair pairBIN9{binningOnPosMultip9, nMixedEvents, -1, &cacheBin9}; + SameKindPair pairBIN10{binningOnPosMultip10, nMixedEvents, -1, &cacheBin10}; // Pointers to the pools so they can be processed in a loop (filled in init()). using MixPair = SameKindPair; @@ -1296,10 +1298,10 @@ struct FoxWolframCorrelationMixing { // Count accepted pairs in the corresponding multiplicity interval. histos.fill(HIST("MixingPairs/MixingPairsNoLA"), binIndex); static_for<0, 9>([&](auto i) { - constexpr int idx = i.value; - if (binIndex == idx + 1) { - histos.fill(HIST("Corelations/bProjTRI_") + HIST(mixedBinNames[idx]), deltaPhi); - histos.fill(HIST("Corelations/bTRI_") + HIST(mixedBinNames[idx]), deltaPhi, deltaEta); + constexpr int IdxVal = i.value; + if (binIndex == IdxVal + 1) { + histos.fill(HIST("Corelations/bProjTRI_") + HIST(MixedBinNames[IdxVal]), deltaPhi); + histos.fill(HIST("Corelations/bTRI_") + HIST(MixedBinNames[IdxVal]), deltaPhi, deltaEta); } }); }