From 0816c30a26f9d899541d4b8b7de78c19906b5941 Mon Sep 17 00:00:00 2001 From: Yakiv <5348341@upjs.sk> Date: Fri, 29 Nov 2024 15:33:23 +0100 Subject: [PATCH 1/2] Added correlation function for hadrons. --- PWGLF/DataModel/LFHStrangeCorrelationTables.h | 45 +++-- .../Strangeness/hStrangeCorrelationFilter.cxx | 38 +++- .../Tasks/Strangeness/hStrangeCorrelation.cxx | 185 ++++++++++++++---- 3 files changed, 211 insertions(+), 57 deletions(-) diff --git a/PWGLF/DataModel/LFHStrangeCorrelationTables.h b/PWGLF/DataModel/LFHStrangeCorrelationTables.h index 1b31239f406..7f7578b3632 100644 --- a/PWGLF/DataModel/LFHStrangeCorrelationTables.h +++ b/PWGLF/DataModel/LFHStrangeCorrelationTables.h @@ -50,26 +50,33 @@ DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! DECLARE_SOA_INDEX_COLUMN_FULL(Track, track, int, Tracks, "_Assoc"); //! } // namespace assocPions DECLARE_SOA_TABLE(AssocPions, "AOD", "ASSOCPIONS", o2::soa::Index<>, assocPions::CollisionId, assocPions::TrackId); + +namespace assocHadrons +{ +DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! +DECLARE_SOA_INDEX_COLUMN_FULL(Track, track, int, Tracks, "_Assoc"); //! +} // namespace assocHadrons +DECLARE_SOA_TABLE(AssocHadrons, "AOD", "ASSOCHADRONS", o2::soa::Index<>, assocHadrons::CollisionId, assocHadrons::TrackId); /// _________________________________________ /// Table for storing associated V0 indices namespace assocV0s { -DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! -DECLARE_SOA_INDEX_COLUMN(V0Core, v0Core); //! +DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! +DECLARE_SOA_INDEX_COLUMN(V0Core, v0Core); //! // dEdx compatibility is done via encoded integer: 0: passes loose; 1: passes normal, 2: passes tight; definition of loose/normal/tight is in hStrangeCorrelationFilter DECLARE_SOA_COLUMN(CompatibleK0Short, compatibleK0Short, int); // compatible with K0Short dEdx, encoded syst checks DECLARE_SOA_COLUMN(CompatibleLambda, compatibleLambda, int); // compatible with Lambda dEdx, encoded syst checks DECLARE_SOA_COLUMN(CompatibleAntiLambda, compatibleAntiLambda, int); // compatible with AntiLambda dEdx, encoded syst checks -DECLARE_SOA_COLUMN(MCTrueK0Short, mcTrueK0Short, bool); // true K0Short in MC -DECLARE_SOA_COLUMN(MCTrueLambda, mcTrueLambda, bool); // true Lambda in MC -DECLARE_SOA_COLUMN(MCTrueAntiLambda, mcTrueAntiLambda, bool); // true AntiLambda in MC -DECLARE_SOA_COLUMN(MCPhysicalPrimary, mcPhysicalPrimary, bool); // true physical primary flag -DECLARE_SOA_COLUMN(NSigmaMassK0Short, nSigmaMassK0Short, float); // -DECLARE_SOA_COLUMN(NSigmaMassLambda, nSigmaMassLambda, float); // +DECLARE_SOA_COLUMN(MCTrueK0Short, mcTrueK0Short, bool); // true K0Short in MC +DECLARE_SOA_COLUMN(MCTrueLambda, mcTrueLambda, bool); // true Lambda in MC +DECLARE_SOA_COLUMN(MCTrueAntiLambda, mcTrueAntiLambda, bool); // true AntiLambda in MC +DECLARE_SOA_COLUMN(MCPhysicalPrimary, mcPhysicalPrimary, bool); // true physical primary flag +DECLARE_SOA_COLUMN(NSigmaMassK0Short, nSigmaMassK0Short, float); // +DECLARE_SOA_COLUMN(NSigmaMassLambda, nSigmaMassLambda, float); // DECLARE_SOA_COLUMN(NSigmaMassAntiLambda, nSigmaMassAntiLambda, float); // -DECLARE_SOA_DYNAMIC_COLUMN(Compatible, compatible, //! check compatibility with a hypothesis of a certain number (0 - K0, 1 - L, 2 - Lbar) +DECLARE_SOA_DYNAMIC_COLUMN(Compatible, compatible, //! check compatibility with a hypothesis of a certain number (0 - K0, 1 - L, 2 - Lbar) [](int cK0Short, int cLambda, int cAntiLambda, int value, int compatibilityLevel) -> bool { if (value == 0 && bitcheck(cK0Short, compatibilityLevel)) return true; @@ -119,8 +126,8 @@ DECLARE_SOA_TABLE(AssocV0s, "AOD", "ASSOCV0S", o2::soa::Index<>, /// Table for storing associated casc indices namespace assocCascades { -DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! -DECLARE_SOA_INDEX_COLUMN(CascData, cascData); //! +DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! +DECLARE_SOA_INDEX_COLUMN(CascData, cascData); //! // dEdx compatibility is done via encoded integer: 0: passes loose; 1: passes normal, 2: passes tight; definition of loose/normal/tight is in hStrangeCorrelationFilter DECLARE_SOA_COLUMN(CompatibleXiMinus, compatibleXiMinus, int); // compatible with XiMinus @@ -128,14 +135,14 @@ DECLARE_SOA_COLUMN(CompatibleXiPlus, compatibleXiPlus, int); // compatib DECLARE_SOA_COLUMN(CompatibleOmegaMinus, compatibleOmegaMinus, int); // compatible with OmegaMinus DECLARE_SOA_COLUMN(CompatibleOmegaPlus, compatibleOmegaPlus, int); // compatible with OmegaPlus -DECLARE_SOA_COLUMN(MCTrueXiMinus, mcTrueXiMinus, bool); // true XiMinus in mc -DECLARE_SOA_COLUMN(MCTrueXiPlus, mcTrueXiPlus, bool); // true XiPlus in mc -DECLARE_SOA_COLUMN(MCTrueOmegaMinus, mcTrueOmegaMinus, bool); // true OmegaMinus in mc -DECLARE_SOA_COLUMN(MCTrueOmegaPlus, mcTrueOmegaPlus, bool); // true OmegaPlus in mc -DECLARE_SOA_COLUMN(MCPhysicalPrimary, mcPhysicalPrimary, bool); // physical primary in MC -DECLARE_SOA_COLUMN(NSigmaMassXi, nSigmaMassXi, float); // -DECLARE_SOA_COLUMN(NSigmaMassOmega, nSigmaMassOmega, float); // -DECLARE_SOA_DYNAMIC_COLUMN(Compatible, compatible, //! check compatibility with a hypothesis of a certain number (0 - K0, 1 - L, 2 - Lbar) +DECLARE_SOA_COLUMN(MCTrueXiMinus, mcTrueXiMinus, bool); // true XiMinus in mc +DECLARE_SOA_COLUMN(MCTrueXiPlus, mcTrueXiPlus, bool); // true XiPlus in mc +DECLARE_SOA_COLUMN(MCTrueOmegaMinus, mcTrueOmegaMinus, bool); // true OmegaMinus in mc +DECLARE_SOA_COLUMN(MCTrueOmegaPlus, mcTrueOmegaPlus, bool); // true OmegaPlus in mc +DECLARE_SOA_COLUMN(MCPhysicalPrimary, mcPhysicalPrimary, bool); // physical primary in MC +DECLARE_SOA_COLUMN(NSigmaMassXi, nSigmaMassXi, float); // +DECLARE_SOA_COLUMN(NSigmaMassOmega, nSigmaMassOmega, float); // +DECLARE_SOA_DYNAMIC_COLUMN(Compatible, compatible, //! check compatibility with a hypothesis of a certain number (0 - K0, 1 - L, 2 - Lbar) [](int cXiMinus, int cXiPlus, int cOmegaMinus, int cOmegaPlus, int value, int compatibilityLevel) -> bool { if (value == 0 && bitcheck(cXiMinus, compatibilityLevel)) return true; diff --git a/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx b/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx index 0dd6cf1d4ec..220670d1e4a 100644 --- a/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx +++ b/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx @@ -141,6 +141,7 @@ struct hstrangecorrelationfilter { Produces assocPion; Produces assocV0; Produces assocCascades; + Produces assocHadrons; TF1* fK0Mean = new TF1("fK0Mean", "[0]+[1]*x+[2]*TMath::Exp(-[3]*x)"); TF1* fK0Width = new TF1("fK0Width", "[0]+[1]*x+[2]*TMath::Exp(-[3]*x)"); @@ -314,7 +315,41 @@ struct hstrangecorrelationfilter { continue; } - assocPion( + assocHadrons( + track.collisionId(), + track.globalIndex()); + } + } + + void processAssocHadrons(soa::Join::iterator const& collision, soa::Filtered> const& tracks) + { + // Perform basic event selection + if (!collision.sel8()) { + return; + } + // No need to correlate stuff that's in far collisions + if (TMath::Abs(collision.posZ()) > 10.0) { + return; + } + + /// _________________________________________________ + /// Step 1: Populate table with trigger tracks + for (auto const& track : tracks) { + if (track.eta() > assocEtaMax || track.eta() < assocEtaMin) { + continue; + } + // if (track.sign()= 1 ) {continue;} + if (track.pt() > assocPtCutMax || track.pt() < assocPtCutMin) { + continue; + } + if (track.tpcNClsCrossedRows() < minTPCNCrossedRows) { + continue; // crossed rows + } + if (!track.hasITS() && triggerRequireITS) { + continue; // skip, doesn't have ITS signal (skips lots of TPC-only!) + } + + assocHadrons( track.collisionId(), track.globalIndex()); } @@ -494,6 +529,7 @@ struct hstrangecorrelationfilter { PROCESS_SWITCH(hstrangecorrelationfilter, processV0s, "Produce associated V0 tables", true); PROCESS_SWITCH(hstrangecorrelationfilter, processAssocPions, "Produce associated Pion tables", true); PROCESS_SWITCH(hstrangecorrelationfilter, processCascades, "Produce associated cascade tables", true); + PROCESS_SWITCH(hstrangecorrelationfilter, processAssocHadrons, "Produce associated Hadron tables", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx b/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx index 4e16c31f995..6a3cebdea70 100644 --- a/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx +++ b/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx @@ -56,6 +56,7 @@ struct correlateStrangeness { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + Configurable doCorrelationHadron{"doCorrelationHadron", false, "do Hadron correlation"}; Configurable doCorrelationK0Short{"doCorrelationK0Short", true, "do K0Short correlation"}; Configurable doCorrelationLambda{"doCorrelationLambda", false, "do Lambda correlation"}; Configurable doCorrelationAntiLambda{"doCorrelationAntiLambda", false, "do AntiLambda correlation"}; @@ -152,6 +153,8 @@ struct correlateStrangeness { TH2F* hEfficiencyOmegaMinus; TH2F* hEfficiencyOmegaPlus; + TH2F* hEfficiencyHadron; + using BinningType = ColumnBinningPolicy; BinningType colBinning{{axisVtxZ, axisMult}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. @@ -159,15 +162,16 @@ struct correlateStrangeness { Preslice collisionSliceTracks = aod::triggerTracks::collisionId; Preslice collisionSliceV0s = aod::assocV0s::collisionId; Preslice collisionSliceCascades = aod::assocCascades::collisionId; - Preslice collisionSlicePions = aod::assocPions::collisionId; + // Preslice collisionSlicePions = aod::assocHadrons::collisionId; + Preslice collisionSliceHadrons = aod::assocHadrons::collisionId; Preslice perCollision = aod::mcparticle::mcCollisionId; static constexpr std::string_view v0names[] = {"K0Short", "Lambda", "AntiLambda"}; static constexpr std::string_view cascadenames[] = {"XiMinus", "XiPlus", "OmegaMinus", "OmegaPlus"}; - static constexpr std::string_view particlenames[] = {"K0Short", "Lambda", "AntiLambda", "XiMinus", "XiPlus", "OmegaMinus", "OmegaPlus", "Pion"}; + static constexpr std::string_view particlenames[] = {"K0Short", "Lambda", "AntiLambda", "XiMinus", "XiPlus", "OmegaMinus", "OmegaPlus", "Pion", "Hadron"}; static constexpr int pdgCodes[] = {310, 3122, -3122, 3312, -3312, 3334, -3334, 211}; - uint8_t doCorrelation; + uint16_t doCorrelation; int mRunNumber; std::vector> axisRanges; @@ -449,7 +453,7 @@ struct correlateStrangeness { } } - void fillCorrelationsPion(aod::TriggerTracks const& triggers, aod::AssocPions const& assocs, bool mixing, float pvz, float mult) + void fillCorrelationsHadron(aod::TriggerTracks const& triggers, aod::AssocHadrons const& assocs, bool mixing, float pvz, float mult, int indexAssoc) { for (auto& triggerTrack : triggers) { @@ -459,15 +463,20 @@ struct correlateStrangeness { if (!isValidTrigger(trigg)) continue; + static_for<7, 8>([&](auto i) { + constexpr int index = i.value; + if (bitcheck(doCorrelation, i)) { if (!mixing) - histos.fill(HIST("sameEvent/TriggerParticlesPion"), trigg.pt(), mult); + histos.fill(HIST("sameEvent/TriggerParticles") + HIST(particlenames[index]), trigg.pt(), mult); for (auto& assocTrack : assocs) { auto assoc = assocTrack.track_as(); + + //---] removing autocorrelations [--- if (doAutocorrelationRejection) { if (trigg.globalIndex() == assoc.globalIndex()) { - histos.fill(HIST("hNumberOfRejectedPairsPions"), 0.5); + histos.fill(HIST("hNumberOfRejectedPairs") + HIST(particlenames[index]), 0.5); continue; } } @@ -490,10 +499,11 @@ struct correlateStrangeness { continue; if (!mixing) - histos.fill(HIST("sameEvent/Pion"), deltaphi, deltaeta, ptassoc, pttrigger, pvz, mult); + histos.fill(HIST("sameEvent/Signal/") + HIST(particlenames[index]), deltaphi, deltaeta, ptassoc, pttrigger, pvz, mult); else - histos.fill(HIST("mixedEvent/Pion"), deltaphi, deltaeta, ptassoc, pttrigger, pvz, mult); + histos.fill(HIST("mixedEvent/Signal/") + HIST(particlenames[index]), deltaphi, deltaeta, ptassoc, pttrigger, pvz, mult); } + } }); } } @@ -509,6 +519,8 @@ struct correlateStrangeness { hEfficiencyOmegaMinus = 0x0; hEfficiencyOmegaPlus = 0x0; + hEfficiencyHadron = 0x0; + // set bitmap for convenience doCorrelation = 0; if (doCorrelationK0Short) @@ -527,6 +539,8 @@ struct correlateStrangeness { bitset(doCorrelation, 6); if (doCorrelationPion) bitset(doCorrelation, 7); + if (doCorrelationHadron) + bitset(doCorrelation, 8); // Store axis ranges to prevent spurious filling // axis status: @@ -688,10 +702,12 @@ struct correlateStrangeness { histos.add("hClosureTestEventCounter", "hClosureTestEventCounter", kTH1F, {{10, 0, 10}}); + histos.add("hNumberOfRejectedPairsHadron", "hNumberOfRejectedPairsHadron", kTH1F, {{1, 0, 1}}); histos.add("hNumberOfRejectedPairsV0", "hNumberOfRejectedPairsV0", kTH1F, {{1, 0, 1}}); histos.add("hNumberOfRejectedPairsCascades", "hNumberOfRejectedPairsCascades", kTH1F, {{1, 0, 1}}); - histos.add("hNumberOfRejectedPairsPions", "hNumberOfRejectedPairsPions", kTH1F, {{1, 0, 1}}); + histos.add("hNumberOfRejectedPairsPion", "hNumberOfRejectedPairsPion", kTH1F, {{1, 0, 1}}); + histos.add("sameEvent/TriggerParticlesHadron", "TriggersHadron", kTH2F, {axisPtQA, axisMult}); histos.add("sameEvent/TriggerParticlesV0", "TriggersV0", kTH2F, {axisPtQA, axisMult}); histos.add("sameEvent/TriggerParticlesCascade", "TriggersCascade", kTH2F, {axisPtQA, axisMult}); histos.add("sameEvent/TriggerParticlesPion", "TriggersPion", kTH2F, {axisPtQA, axisMult}); @@ -712,23 +728,23 @@ struct correlateStrangeness { histos.add("hTriggerPtResolution", ";p_{T}^{reconstructed} (GeV/c); p_{T}^{generated} (GeV/c)", kTH2F, {axisPtQA, axisPtQA}); histos.add("hTriggerPrimaryEtaVsPt", "hTriggerPrimaryEtaVsPt", kTH3F, {axisPtQA, axisEta, axisMult}); histos.add("hTrackEtaVsPtVsPhi", "hTrackEtaVsPtVsPhi", kTH3F, {axisPtQA, axisEta, axisPhi}); + histos.add("hTrackAttempt", "Attempt", kTH3F, {axisPtQA, axisEta, axisPhi}); bool hStrange = false; - for (int i = 0; i < 8; i++) { - if ((doprocessSameEventHV0s && i < 3) || (doprocessSameEventHCascades && i > 2 && i < 7) || (doprocessSameEventHPions && i == 7)) - histos.add(fmt::format("h{}EtaVsPtVsPhi", particlenames[i]).c_str(), "", kTH3F, {axisPtQA, axisEta, axisPhi}); - if ((doprocessSameEventHV0s && i < 3) || (doprocessSameEventHCascades && i > 2 && i < 7)) - histos.add(fmt::format("h{}EtaVsPtVsPhiBg", particlenames[i]).c_str(), "", kTH3F, {axisPtQA, axisEta, axisPhi}); + for (int i = 0; i < 9; i++) { if (bitcheck(doCorrelation, i)) { - histos.add(fmt::format("hITSClusters{}NegativeDaughterToward", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); - histos.add(fmt::format("hITSClusters{}PositiveDaughterToward", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); - histos.add(fmt::format("hITSClusters{}NegativeDaughterTransverse", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); - histos.add(fmt::format("hITSClusters{}PositiveDaughterTransverse", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); + histos.add(fmt::format("h{}EtaVsPtVsPhi", particlenames[i]).c_str(), "", kTH3F, {axisPtQA, axisEta, axisPhi}); histos.add(fmt::format("h3d{}Spectrum", particlenames[i]).c_str(), fmt::format("h3d{}Spectrum", particlenames[i]).c_str(), kTH3F, {axisPtQA, axisMult, axisMassNSigma}); histos.add(fmt::format("h3d{}SpectrumY", particlenames[i]).c_str(), fmt::format("h3d{}SpectrumY", particlenames[i]).c_str(), kTH3F, {axisPtQA, axisMult, axisMassNSigma}); histos.add(fmt::format("sameEvent/Signal/{}", particlenames[i]).c_str(), "", kTHnF, {axisDeltaPhiNDim, axisDeltaEtaNDim, axisPtAssocNDim, axisPtTriggerNDim, axisVtxZNDim, axisMultNDim}); - if (i < 7) + if (i < 7) { hStrange = true; + histos.add(fmt::format("h{}EtaVsPtVsPhiBg", particlenames[i]).c_str(), "", kTH3F, {axisPtQA, axisEta, axisPhi}); + histos.add(fmt::format("hITSClusters{}NegativeDaughterToward", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); + histos.add(fmt::format("hITSClusters{}PositiveDaughterToward", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); + histos.add(fmt::format("hITSClusters{}NegativeDaughterTransverse", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); + histos.add(fmt::format("hITSClusters{}PositiveDaughterTransverse", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); + } } } if (hStrange) { @@ -738,7 +754,7 @@ struct correlateStrangeness { LOGF(info, "Init THnFs done"); // mixed-event correlation functions - if (doprocessMixedEventHV0s || doprocessMixedEventHCascades || doprocessMixedEventHPions) { + if (doprocessMixedEventHV0s || doprocessMixedEventHCascades || doprocessMixedEventHPions || doprocessMixedEventHHadrons) { histos.addClone("sameEvent/", "mixedEvent/"); } @@ -823,6 +839,61 @@ struct correlateStrangeness { } } + void processSameEventHHadrons(soa::Join::iterator const& collision, + aod::AssocHadrons const& assocHadrons, aod::TriggerTracks const& triggerTracks, + TracksComplete const&, aod::BCsWithTimestamps const&) + { + // ________________________________________________ + // skip if desired trigger not found + if (triggerPresenceMap.size() > 0 && !bitcheck(triggerPresenceMap[collision.globalIndex()], triggerBinToSelect)) { + return; + } + + // ________________________________________________ + // Perform basic event selection + if (!collision.sel8()) { + return; + } + if (TMath::Abs(collision.posZ()) > zVertexCut) { + return; + } + if (collision.centFT0M() > axisRanges[5][1] || collision.centFT0M() < axisRanges[5][0]) { + return; + } + if (!collision.isInelGt0() && selectINELgtZERO) { + return; + } + // ________________________________________________ + if (!doprocessSameEventHCascades && !doprocessSameEventHV0s && !doprocessSameEventHPions) { + histos.fill(HIST("MixingQA/hSECollisionBins"), colBinning.getBin({collision.posZ(), collision.centFT0M()})); + histos.fill(HIST("EventQA/hMult"), collision.centFT0M()); + histos.fill(HIST("EventQA/hPvz"), collision.posZ()); + } + + // Do basic QA + for (auto const& hadron : assocHadrons) { + auto hadronTrack = hadron.track_as(); + histos.fill(HIST("hHadronEtaVsPtVsPhi"), hadronTrack.pt(), hadronTrack.eta(), hadronTrack.phi()); + } + if (!doprocessSameEventHCascades && !doprocessSameEventHV0s && !doprocessSameEventHPions) { + for (auto const& triggerTrack : triggerTracks) { + auto track = triggerTrack.track_as(); + if (!isValidTrigger(track)) + continue; + histos.fill(HIST("hTriggerAllSelectedEtaVsPt"), track.pt(), track.eta(), collision.centFT0M()); + histos.fill(HIST("hTriggerPtResolution"), track.pt(), triggerTrack.mcOriginalPt()); + if (doTriggPhysicalPrimary && !triggerTrack.mcPhysicalPrimary()) + continue; + histos.fill(HIST("hTriggerPrimaryEtaVsPt"), track.pt(), track.eta(), collision.centFT0M()); + histos.fill(HIST("hTrackEtaVsPtVsPhi"), track.pt(), track.eta(), track.phi()); + } + } + + // ________________________________________________ + // Do hadron - hadron correlations + fillCorrelationsHadron(triggerTracks, assocHadrons, false, collision.posZ(), collision.centFT0M(), 7); + } + void processSameEventHV0s(soa::Join::iterator const& collision, aod::AssocV0s const& associatedV0s, aod::TriggerTracks const& triggerTracks, V0DatasWithoutTrackX const&, aod::V0sLinked const&, TracksComplete const&, aod::BCsWithTimestamps const&) @@ -1023,7 +1094,7 @@ struct correlateStrangeness { fillCorrelationsCascade(triggerTracks, associatedCascades, false, collision.posX(), collision.posY(), collision.posZ(), collision.centFT0M()); } void processSameEventHPions(soa::Join::iterator const& collision, - aod::AssocPions const& associatedPions, aod::TriggerTracks const& triggerTracks, + aod::AssocHadrons const& associatedPions, aod::TriggerTracks const& triggerTracks, TracksComplete const&, aod::BCsWithTimestamps const&) { // ________________________________________________ @@ -1073,8 +1144,51 @@ struct correlateStrangeness { // ________________________________________________ // Do hadron - Pion correlations - fillCorrelationsPion(triggerTracks, associatedPions, false, collision.posZ(), collision.centFT0M()); + fillCorrelationsHadron(triggerTracks, associatedPions, false, collision.posZ(), collision.centFT0M(), 8); + } + + void processMixedEventHHadrons(soa::Join const& collisions, + aod::AssocHadrons const& assocHadrons, aod::TriggerTracks const& triggerTracks, + TracksComplete const&) + { + for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, mixingParameter, -1, collisions, collisions)) { + + // ________________________________________________ + // skip if desired trigger not found + if (triggerPresenceMap.size() > 0 && (!bitcheck(triggerPresenceMap[collision1.globalIndex()], triggerBinToSelect) || !bitcheck(triggerPresenceMap[collision2.globalIndex()], triggerBinToSelect))) { + return; + } + + // ________________________________________________ + // Perform basic event selection on both collisions + if (!collision1.sel8() || !collision2.sel8()) + continue; + if (TMath::Abs(collision1.posZ()) > zVertexCut || TMath::Abs(collision2.posZ()) > zVertexCut) + continue; + if (collision1.centFT0M() > axisRanges[5][1] || collision1.centFT0M() < axisRanges[5][0]) + continue; + if (collision2.centFT0M() > axisRanges[5][1] || collision2.centFT0M() < axisRanges[5][0]) + continue; + if ((!collision1.isInelGt0() || !collision2.isInelGt0()) && selectINELgtZERO) + continue; + + if (collision1.globalIndex() == collision2.globalIndex()) { + histos.fill(HIST("MixingQA/hMixingQA"), 0.0f); // same-collision pair counting + } + + histos.fill(HIST("MixingQA/hMEpvz1"), collision1.posZ()); + histos.fill(HIST("MixingQA/hMEpvz2"), collision2.posZ()); + histos.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), collision1.centFT0M()})); + // ________________________________________________ + // Do slicing + auto slicedTriggerTracks = triggerTracks.sliceBy(collisionSliceTracks, collision1.globalIndex()); + auto slicedAssocHadrons = assocHadrons.sliceBy(collisionSliceHadrons, collision2.globalIndex()); + // ________________________________________________ + // Do hadron - hadron correlations + fillCorrelationsHadron(slicedTriggerTracks, slicedAssocHadrons, true, collision1.posZ(), collision1.centFT0M(), 7); + } } + void processMixedEventHV0s(soa::Join const& collisions, aod::AssocV0s const& associatedV0s, aod::TriggerTracks const& triggerTracks, V0DatasWithoutTrackX const&, aod::V0sLinked const&, TracksComplete const&, aod::BCsWithTimestamps const&) @@ -1165,7 +1279,7 @@ struct correlateStrangeness { } } void processMixedEventHPions(soa::Join const& collisions, - aod::AssocPions const& assocPions, aod::TriggerTracks const& triggerTracks, + aod::AssocHadrons const& assocPions, aod::TriggerTracks const& triggerTracks, TracksComplete const&) { for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, mixingParameter, -1, collisions, collisions)) { @@ -1199,10 +1313,10 @@ struct correlateStrangeness { // ________________________________________________ // Do slicing auto slicedTriggerTracks = triggerTracks.sliceBy(collisionSliceTracks, collision1.globalIndex()); - auto slicedAssocPions = assocPions.sliceBy(collisionSlicePions, collision2.globalIndex()); + auto slicedAssocPions = assocPions.sliceBy(collisionSliceHadrons, collision2.globalIndex()); // ________________________________________________ // Do hadron - cascade correlations - fillCorrelationsPion(slicedTriggerTracks, slicedAssocPions, true, collision1.posZ(), collision1.centFT0M()); + fillCorrelationsHadron(slicedTriggerTracks, slicedAssocPions, true, collision1.posZ(), collision1.centFT0M(), 8); } } @@ -1451,16 +1565,9 @@ struct correlateStrangeness { continue; } if (abs(mcParticle.pdgCode()) == 211 || abs(mcParticle.pdgCode()) == 321 || abs(mcParticle.pdgCode()) == 2212 || abs(mcParticle.pdgCode()) == 11 || abs(mcParticle.pdgCode()) == 13) { - Int_t charge = 0; - if (mcParticle.pdgCode() < 0) - charge = -1; - if (mcParticle.pdgCode() > 0) - charge = 1; if (!doTriggPhysicalPrimary || mcParticle.isPhysicalPrimary()) { - if ((triggerParticleCharge > 0 && charge > 0) || (triggerParticleCharge < 0 && charge < 0) || triggerParticleCharge == 0) { - triggerIndices.emplace_back(iteratorNum); - histos.fill(HIST("ClosureTest/hTrigger"), gpt, geta, bestCollisionFT0Mpercentile); - } + triggerIndices.emplace_back(iteratorNum); + histos.fill(HIST("ClosureTest/hTrigger"), gpt, geta, bestCollisionFT0Mpercentile); } } if (!doAssocPhysicalPrimary || mcParticle.isPhysicalPrimary()) { @@ -1545,15 +1652,19 @@ struct correlateStrangeness { } } - PROCESS_SWITCH(correlateStrangeness, processSelectEventWithTrigger, "Select events with trigger only", false); + PROCESS_SWITCH(correlateStrangeness, processSelectEventWithTrigger, "Select events with trigger only", true); PROCESS_SWITCH(correlateStrangeness, processSameEventHV0s, "Process same events, h-V0s", true); PROCESS_SWITCH(correlateStrangeness, processSameEventHCascades, "Process same events, h-Cascades", true); PROCESS_SWITCH(correlateStrangeness, processSameEventHPions, "Process same events, h-Pion", true); + PROCESS_SWITCH(correlateStrangeness, processSameEventHHadrons, "Process same events, h-h", true); + PROCESS_SWITCH(correlateStrangeness, processMixedEventHV0s, "Process mixed events, h-V0s", true); PROCESS_SWITCH(correlateStrangeness, processMixedEventHCascades, "Process mixed events, h-Cascades", true); PROCESS_SWITCH(correlateStrangeness, processMixedEventHPions, "Process mixed events, h-Pion", true); - PROCESS_SWITCH(correlateStrangeness, processMCGenerated, "Process MC generated", true); - PROCESS_SWITCH(correlateStrangeness, processClosureTest, "Process Closure Test", true); + PROCESS_SWITCH(correlateStrangeness, processMixedEventHHadrons, "Process mixed events, h-h", true); + + PROCESS_SWITCH(correlateStrangeness, processMCGenerated, "Process MC generated", false); + PROCESS_SWITCH(correlateStrangeness, processClosureTest, "Process Closure Test", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From fc1cc5e630177b0b6cc810b0620873de7f90948a Mon Sep 17 00:00:00 2001 From: yakparo Date: Sat, 30 Nov 2024 11:32:07 +0100 Subject: [PATCH 2/2] Formatting fix --- PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx b/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx index 6a3cebdea70..e1fe312d225 100644 --- a/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx +++ b/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx @@ -464,7 +464,7 @@ struct correlateStrangeness { continue; static_for<7, 8>([&](auto i) { - constexpr int index = i.value; + constexpr int index = i.value; if (bitcheck(doCorrelation, i)) { if (!mixing) histos.fill(HIST("sameEvent/TriggerParticles") + HIST(particlenames[index]), trigg.pt(), mult);