From 4edc6cb8b2bc368951fb7275b13ec2a6954cef31 Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Thu, 12 Mar 2026 12:49:11 +0100 Subject: [PATCH 01/11] fixes to jetCorrelationD0.cxx task --- PWGJE/Tasks/jetCorrelationD0.cxx | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index 44a912e7221..6c7fd50cc71 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -19,19 +19,16 @@ #include "Common/Core/RecoDecay.h" -#include +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/Logger.h" +#include "Framework/runDataProcessing.h" #include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include +#include + #include #include #include @@ -108,8 +105,8 @@ DECLARE_SOA_TABLE(D0McPTables, "AOD", "D0MCPTABLE", namespace jetInfo { // D0 tables -DECLARE_SOA_INDEX_COLUMN(D0DataTable, d0DataTable); -DECLARE_SOA_INDEX_COLUMN(D0McPTable, d0McPTable); +DECLARE_SOA_INDEX_COLUMN(D0DataTable, d0Data); +DECLARE_SOA_INDEX_COLUMN(D0McPTable, d0MCP); // Jet DECLARE_SOA_COLUMN(JetPt, jetPt, float); DECLARE_SOA_COLUMN(JetEta, jetEta, float); From 69133a6b829de032fb54f88905b1ebf7590cd4eb Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Thu, 12 Mar 2026 14:33:37 +0100 Subject: [PATCH 02/11] Updating columns for jetCorrelation D0 task --- PWGJE/Tasks/jetCorrelationD0.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index 6c7fd50cc71..37eed8f5384 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -57,10 +57,8 @@ DECLARE_SOA_TABLE(McCollisionTables, "AOD", "MCCOLLINFOTABLE", namespace collisionInfo { -// DECLARE_SOA_INDEX_COLUMN(CollisionTable, collisionTable); -DECLARE_SOA_INDEX_COLUMN_CUSTOM(CollisionTable, collisionTable, "COLLINFOTABLES"); -// DECLARE_SOA_INDEX_COLUMN(McCollisionTable, mcCollisionTable); -DECLARE_SOA_INDEX_COLUMN_CUSTOM(McCollisionTable, mcCollisionTable, "MCCOLLINFOTABLES"); +DECLARE_SOA_INDEX_COLUMN(CollisionTable, collisionTable); +DECLARE_SOA_INDEX_COLUMN(McCollisionTable, mcCollisionTable); } // namespace collisionInfo namespace d0Info { From 67c038fcb2f23ba81959748e5c5a60b6fa31fa6e Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Wed, 25 Mar 2026 17:04:09 +0100 Subject: [PATCH 03/11] Adding processMcMatched and mirroring dPhi dists --- PWGJE/Tasks/jetCorrelationD0.cxx | 161 +++++++++++++++++++++++-------- 1 file changed, 120 insertions(+), 41 deletions(-) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index 37eed8f5384..a72c2bca61d 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -16,6 +16,7 @@ #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" +#include "PWGJE/Core/JetHFUtilities.h" #include "Common/Core/RecoDecay.h" @@ -57,8 +58,8 @@ DECLARE_SOA_TABLE(McCollisionTables, "AOD", "MCCOLLINFOTABLE", namespace collisionInfo { -DECLARE_SOA_INDEX_COLUMN(CollisionTable, collisionTable); -DECLARE_SOA_INDEX_COLUMN(McCollisionTable, mcCollisionTable); +DECLARE_SOA_INDEX_COLUMN_CUSTOM(CollisionTable, collisionTable, "COLLINFOTABLES"); +DECLARE_SOA_INDEX_COLUMN_CUSTOM(McCollisionTable, mcCollisionTable, "MCCOLLINFOTABLES"); } // namespace collisionInfo namespace d0Info { @@ -79,7 +80,7 @@ DECLARE_SOA_COLUMN(D0PhiD, d0PhiD, float); DECLARE_SOA_COLUMN(D0Reflection, d0Reflection, int); } // namespace d0Info -DECLARE_SOA_TABLE(D0DataTables, "AOD", "D0DATATABLE", +DECLARE_SOA_TABLE(D0DataTables, "AOD", "D0TABLE", o2::soa::Index<>, collisionInfo::CollisionTableId, d0Info::D0PromptBDT, @@ -109,8 +110,12 @@ DECLARE_SOA_INDEX_COLUMN(D0McPTable, d0MCP); DECLARE_SOA_COLUMN(JetPt, jetPt, float); DECLARE_SOA_COLUMN(JetEta, jetEta, float); DECLARE_SOA_COLUMN(JetPhi, jetPhi, float); +DECLARE_SOA_COLUMN(PJetPt, pJetPt, float); +DECLARE_SOA_COLUMN(PJetEta, pJetEta, float); +DECLARE_SOA_COLUMN(PJetPhi, pJetPhi, float); // D0-jet DECLARE_SOA_COLUMN(D0JetDeltaPhi, d0JetDeltaPhi, float); +DECLARE_SOA_COLUMN(D0JetDeltaPhiP, d0JetDeltaPhiP, float); } // namespace jetInfo DECLARE_SOA_TABLE_STAGED(JetDataTables, "JETDATATABLE", @@ -122,14 +127,26 @@ DECLARE_SOA_TABLE_STAGED(JetDataTables, "JETDATATABLE", jetInfo::JetPhi, jetInfo::D0JetDeltaPhi); -DECLARE_SOA_TABLE_STAGED(JetMCPTables, "JETMCPTABLE", +DECLARE_SOA_TABLE_STAGED(JetMcPTables, "JETMCPTABLE", o2::soa::Index<>, collisionInfo::McCollisionTableId, jetInfo::D0McPTableId, jetInfo::JetPt, jetInfo::JetEta, jetInfo::JetPhi, - jetInfo::D0JetDeltaPhi); + jetInfo::D0JetDeltaPhiP); + +DECLARE_SOA_TABLE_STAGED(JetMatchedTables, "JETMATCHEDTABLE", + o2::soa::Index<>, + collisionInfo::CollisionTableId, + jetInfo::JetPt, + jetInfo::JetEta, + jetInfo::JetPhi, + jetInfo::PJetPt, + jetInfo::PJetEta, + jetInfo::PJetPhi, + jetInfo::D0JetDeltaPhi, + jetInfo::D0JetDeltaPhiP) } // namespace o2::aod @@ -138,21 +155,21 @@ struct JetCorrelationD0 { Produces tableCollision; Produces tableMcCollision; Produces tableD0; - Produces tableD0MCParticle; + Produces tableD0McParticle; Produces tableJet; - Produces tableJetMCParticle; + Produces tableJetMcParticle; + Produces tableJetMatched; // Configurables Configurable eventSelections{"eventSelections", "sel8", "choose event selection"}; Configurable skipMBGapEvents{"skipMBGapEvents", false, "decide to run over MB gap events or not"}; Configurable applyRCTSelections{"applyRCTSelections", true, "decide to apply RCT selections"}; - // Configurable triggerMasks{"triggerMasks", "", "possible JE Trigger masks: fJetChLowPt,fJetChHighPt,fTrackLowPt,fTrackHighPt,fJetD0ChLowPt,fJetD0ChHighPt,fJetLcChLowPt,fJetLcChHighPt,fEMCALReadout,fJetFullHighPt,fJetFullLowPt,fJetNeutralHighPt,fJetNeutralLowPt,fGammaVeryHighPtEMCAL,fGammaVeryHighPtDCAL,fGammaHighPtEMCAL,fGammaHighPtDCAL,fGammaLowPtEMCAL,fGammaLowPtDCAL,fGammaVeryLowPtEMCAL,fGammaVeryLowPtDCAL"}; Configurable jetPtCutMin{"jetPtCutMin", 5.0, "minimum value of jet pt"}; Configurable d0PtCutMin{"d0PtCutMin", 1.0, "minimum value of d0 pt"}; Configurable vertexZCut{"vertexZCut", 10.0, "Accepted z-vertex range"}; Configurable pTHatExponent{"pTHatExponent", 6.0, "exponent of the event weight for the calculation of pTHat"}; - Configurable pTHatMaxMCD{"pTHatMaxMCD", 999.0, "maximum fraction of hard scattering for jet acceptance in detector MC"}; - Configurable pTHatMaxMCP{"pTHatMaxMCP", 999.0, "maximum fraction of hard scattering for jet acceptance in particle MC"}; + Configurable pTHatMaxMcD{"pTHatMaxMcD", 999.0, "maximum fraction of hard scattering for jet acceptance in detector MC"}; + Configurable pTHatMaxMcP{"pTHatMaxMcP", 999.0, "maximum fraction of hard scattering for jet acceptance in particle MC"}; Configurable pTHatAbsoluteMin{"pTHatAbsoluteMin", -99.0, "minimum value of pTHat"}; // Filters @@ -174,13 +191,13 @@ struct JetCorrelationD0 { registry.fill(HIST("hD0Phi"), d0.phi()); } template - void fillJetHistograms(T const& jet, U const& dphi) + void fillJetHistograms(T const& jet, U const& dPhi) { registry.fill(HIST("hJetPt"), jet.pt()); registry.fill(HIST("hJetEta"), jet.eta()); registry.fill(HIST("hJetPhi"), jet.phi()); registry.fill(HIST("hJet3D"), jet.pt(), jet.eta(), jet.phi()); - registry.fill(HIST("h_Jet_pT_D0_Jet_dPhi"), jet.pt(), dphi); + registry.fill(HIST("h_Jet_pT_D0_Jet_dPhi"), jet.pt(), dPhi); } template @@ -196,9 +213,9 @@ struct JetCorrelationD0 { } template - // Jetbase is an MCD jet. We then loop through jettagv(MCP jets) to test if they match + // Jetbase is an McD jet. We then loop through jettagv(McP jets) to test if they match // void fillMatchedHistograms(T const& jetBase, float weight = 1.0) // float leadingTrackPtBase, - void fillMatchedHistograms(T const& jetsBase, U const&, float weight = 1.0, float rho = 0.0) + void fillMatchedHistograms(T const& jetsBase, U const& jetsTag, float weight = 1.0, float rho = 0.0) { for (const auto& jetBase : jetsBase) { if (jetBase.has_matchedJetGeo()) { // geometric matching @@ -279,23 +296,26 @@ struct JetCorrelationD0 { if (jet.pt() < jetPtCutMin) { continue; } - float dphi = RecoDecay::constrainAngle(jet.phi() - d0Candidate.phi()); - if (std::abs(dphi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { // this is quite loose instead of pi/2 could do 0.6 + float dPhi = RecoDecay::constrainAngle(jet.phi() - d0Candidate.phi()); + if (dPhi > o2::constants::math::PI) { + dPhi = 2 * o2::constants::math::PI - dPhi; + } + if (std::abs(dPhi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { continue; } - fillJetHistograms(jet, dphi); + fillJetHistograms(jet, dPhi); tableJet(tableCollision.lastIndex(), tableD0.lastIndex(), jet.pt(), jet.eta(), jet.phi(), - dphi); + dPhi); } } } PROCESS_SWITCH(JetCorrelationD0, processData, "charged particle level jet analysis", true); - void processMCDetector(soa::Filtered::iterator const& collision, + void processMcDetector(soa::Filtered::iterator const& collision, aod::CandidatesD0MCD const& d0Candidates, soa::Join const& jets) { @@ -322,60 +342,119 @@ struct JetCorrelationD0 { if (jet.pt() < jetPtCutMin) { continue; } - float dphi = RecoDecay::constrainAngle(jet.phi() - d0Candidate.phi()); - if (std::abs(dphi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { // this is quite loose instead of pi/2 could do 0.6 + float dPhi = RecoDecay::constrainAngle(jet.phi() - d0Candidate.phi()); + if (dPhi > o2::constants::math::PI) { + dPhi = 2 * o2::constants::math::PI - dPhi; + } + if (std::abs(dPhi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { continue; } - fillJetHistograms(jet, dphi); + fillJetHistograms(jet, dPhi); tableJet(tableCollision.lastIndex(), tableD0.lastIndex(), jet.pt(), jet.eta(), jet.phi(), - dphi); + dPhi); } } } - PROCESS_SWITCH(JetCorrelationD0, processMCDetector, "charged particle level jet analysis", false); + PROCESS_SWITCH(JetCorrelationD0, processMcDetector, "charged particle level jet analysis", false); - void processMCParticle(aod::JetMcCollision const& collision, - aod::CandidatesD0MCP const& d0MCPCandidates, + void processMcParticle(aod::JetMcCollision const& collision, + aod::CandidatesD0MCP const& d0McPCandidates, soa::Filtered> const& jets) { if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents, applyRCTSelections)) { // build without this return; } tableMcCollision(collision.posZ()); - for (const auto& d0MCPCandidate : d0MCPCandidates) { - if (d0MCPCandidate.pt() < d0PtCutMin) { + for (const auto& d0McPCandidate : d0McPCandidates) { + if (d0McPCandidate.pt() < d0PtCutMin) { continue; } - tableD0MCParticle(tableCollision.lastIndex(), - d0MCPCandidate.originMcGen(), - d0MCPCandidate.pt(), - d0MCPCandidate.eta(), - d0MCPCandidate.phi(), - d0MCPCandidate.y()); + tableD0McParticle(tableCollision.lastIndex(), + d0McPCandidate.originMcGen(), + d0McPCandidate.pt(), + d0McPCandidate.eta(), + d0McPCandidate.phi(), + d0McPCandidate.y()); for (const auto& jet : jets) { if (jet.pt() < jetPtCutMin) { continue; } - float dphi = RecoDecay::constrainAngle(jet.phi() - d0MCPCandidate.phi()); - if (std::abs(dphi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { + float dPhi = RecoDecay::constrainAngle(jet.phi() - d0McPCandidate.phi()); + if (dPhi > o2::constants::math::PI) { + dPhi = 2 * o2::constants::math::PI - dPhi; + } + if (std::abs(dPhi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { continue; } - fillJetHistograms(jet, dphi); - tableJetMCParticle(tableCollision.lastIndex(), - tableD0MCParticle.lastIndex(), + fillJetHistograms(jet, dPhi); + tableJetMcParticle(tableCollision.lastIndex(), + tableD0McParticle.lastIndex(), jet.pt(), jet.eta(), jet.phi(), - dphi); + dPhi); } } } - PROCESS_SWITCH(JetCorrelationD0, processMCParticle, "process MC Particle jets", false); + PROCESS_SWITCH(JetCorrelationD0, processMcParticle, "process MC Particle jets", false); + + void processMcMatched(soa::Filtered::iterator const& collision, + aod::CandidatesD0MCD const& d0Candidates, + //soa::Filtered const& tracks, + //soa::Filtered const& particles, + aod::JMcTrackLbs const& tracks, + aod::JetParticles const& particles, + soa::Join const& McDJets) + { + if (!applyCollisionSelections(collision)) { + return; + } + //const auto& mcCollision = collision.mcCollision_as(); + tableCollision(collision.posZ()); + for (const auto& d0Candidate : d0Candidates) { + if (d0Candidate.pt() < d0PtCutMin) { // once settled on a mlcut, then add the lower bound of the systematics as a cut here + continue; + } + bool isMatched = false; + const auto& d0Particle = jethfutilities::matchedHFParticle(d0Candidate, tracks, particles, isMatched); + if (!isMatched) { + continue; + } + //const auto& d0ParticleId = jethfutilities::matchedHFParticle(d0Particle, tracks, particles); + for (const auto& McDJet : McDJets) { + if (McDJet.pt() < jetPtCutMin) { + continue; + } + float dPhiD = RecoDecay::constrainAngle(McDJet.phi() - d0Candidate.phi()); + if (dPhiD > o2::constants::math::PI) { + dPhiD = 2 * o2::constants::math::PI - dPhiD; + } + if (McDJet.has_matchedJetGeo()) { // geometric matching + for (auto const& McPJet : McDJet.template matchedJetGeo_as()) { + float dPhiP = RecoDecay::constrainAngle(McPJet.phi() - d0Particle.phi()); + if (dPhiP > o2::constants::math::PI) { + dPhiP = 2 * o2::constants::math::PI - dPhiP; + } + tableJetMatched(tableCollision.lastIndex(), // add dPhi for both cases + McDJet.pt(), + McDJet.eta(), + McDJet.phi(), + McPJet.pt(), + McPJet.eta(), + McPJet.phi(), + dPhiD, + dPhiP); + } + } + } + } + } + PROCESS_SWITCH(JetCorrelationD0, processMcMatched, "process matching of jets", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From f8260f4280e079c1389bbb23591b57b03b5c2a3a Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Thu, 26 Mar 2026 22:11:23 +0100 Subject: [PATCH 04/11] adding dPhi to processMcMatched --- PWGJE/Tasks/jetCorrelationD0.cxx | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index a72c2bca61d..18e791ede1c 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -118,7 +118,7 @@ DECLARE_SOA_COLUMN(D0JetDeltaPhi, d0JetDeltaPhi, float); DECLARE_SOA_COLUMN(D0JetDeltaPhiP, d0JetDeltaPhiP, float); } // namespace jetInfo -DECLARE_SOA_TABLE_STAGED(JetDataTables, "JETDATATABLE", +DECLARE_SOA_TABLE_STAGED(JetDataTables, "JETTABLE", o2::soa::Index<>, collisionInfo::CollisionTableId, jetInfo::D0DataTableId, @@ -363,9 +363,9 @@ struct JetCorrelationD0 { void processMcParticle(aod::JetMcCollision const& collision, aod::CandidatesD0MCP const& d0McPCandidates, - soa::Filtered> const& jets) + soa::Join const& jets) { - if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents, applyRCTSelections)) { // build without this + if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents, applyRCTSelections)) { return; } tableMcCollision(collision.posZ()); @@ -405,16 +405,14 @@ struct JetCorrelationD0 { void processMcMatched(soa::Filtered::iterator const& collision, aod::CandidatesD0MCD const& d0Candidates, - //soa::Filtered const& tracks, - //soa::Filtered const& particles, - aod::JMcTrackLbs const& tracks, + aod::JetTracksMCD const& tracks, aod::JetParticles const& particles, - soa::Join const& McDJets) + soa::Join const& McDJets, + aod::ChargedMCParticleLevelJets const&) { if (!applyCollisionSelections(collision)) { return; } - //const auto& mcCollision = collision.mcCollision_as(); tableCollision(collision.posZ()); for (const auto& d0Candidate : d0Candidates) { if (d0Candidate.pt() < d0PtCutMin) { // once settled on a mlcut, then add the lower bound of the systematics as a cut here @@ -434,13 +432,19 @@ struct JetCorrelationD0 { if (dPhiD > o2::constants::math::PI) { dPhiD = 2 * o2::constants::math::PI - dPhiD; } + if (std::abs(dPhiD - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { + continue; + } if (McDJet.has_matchedJetGeo()) { // geometric matching for (auto const& McPJet : McDJet.template matchedJetGeo_as()) { float dPhiP = RecoDecay::constrainAngle(McPJet.phi() - d0Particle.phi()); if (dPhiP > o2::constants::math::PI) { dPhiP = 2 * o2::constants::math::PI - dPhiP; } - tableJetMatched(tableCollision.lastIndex(), // add dPhi for both cases + //if (std::abs(dPhiD - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { + // continue; + //} + tableJetMatched(tableCollision.lastIndex(), McDJet.pt(), McDJet.eta(), McDJet.phi(), From d5f18b2c6ba026ab5857b197f4ed71f75fcda17a Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Thu, 26 Mar 2026 22:12:03 +0100 Subject: [PATCH 05/11] formatting --- PWGJE/Tasks/jetCorrelationD0.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index 18e791ede1c..109d6944709 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -441,9 +441,9 @@ struct JetCorrelationD0 { if (dPhiP > o2::constants::math::PI) { dPhiP = 2 * o2::constants::math::PI - dPhiP; } - //if (std::abs(dPhiD - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { - // continue; - //} + // if (std::abs(dPhiD - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { + // continue; + // } tableJetMatched(tableCollision.lastIndex(), McDJet.pt(), McDJet.eta(), From 6320a60ded5d1495d3a4657ee9a3a0f920a6a685 Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Thu, 26 Mar 2026 22:30:09 +0100 Subject: [PATCH 06/11] fixing headers --- PWGJE/Tasks/jetCorrelationD0.cxx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index 109d6944709..8b116d25235 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -25,10 +25,6 @@ #include "Framework/HistogramRegistry.h" #include "Framework/Logger.h" #include "Framework/runDataProcessing.h" -#include -#include - -#include #include #include From 707436a7a3a56d1c667f453ae4f61817b6cf6c3e Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Thu, 26 Mar 2026 22:43:43 +0100 Subject: [PATCH 07/11] Fixes to merge conflicts --- PWGJE/Tasks/jetCorrelationD0.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index 8b116d25235..95b796e9b1c 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -100,8 +100,8 @@ DECLARE_SOA_TABLE(D0McPTables, "AOD", "D0MCPTABLE", namespace jetInfo { // D0 tables -DECLARE_SOA_INDEX_COLUMN(D0DataTable, d0Data); -DECLARE_SOA_INDEX_COLUMN(D0McPTable, d0MCP); +DECLARE_SOA_INDEX_COLUMN(D0DataTable, d0DataTable); +DECLARE_SOA_INDEX_COLUMN(D0McPTable, d0McPTable); // Jet DECLARE_SOA_COLUMN(JetPt, jetPt, float); DECLARE_SOA_COLUMN(JetEta, jetEta, float); @@ -419,7 +419,6 @@ struct JetCorrelationD0 { if (!isMatched) { continue; } - //const auto& d0ParticleId = jethfutilities::matchedHFParticle(d0Particle, tracks, particles); for (const auto& McDJet : McDJets) { if (McDJet.pt() < jetPtCutMin) { continue; @@ -437,7 +436,7 @@ struct JetCorrelationD0 { if (dPhiP > o2::constants::math::PI) { dPhiP = 2 * o2::constants::math::PI - dPhiP; } - // if (std::abs(dPhiD - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { + // if (std::abs(dPhiP - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { // continue; // } tableJetMatched(tableCollision.lastIndex(), From 086e3ca5a70e8b04b387f2250fc39886381a7d03 Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Thu, 26 Mar 2026 22:52:19 +0100 Subject: [PATCH 08/11] formatting --- PWGJE/Tasks/jetCorrelationD0.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index 95b796e9b1c..c89042e1229 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -417,7 +417,7 @@ struct JetCorrelationD0 { bool isMatched = false; const auto& d0Particle = jethfutilities::matchedHFParticle(d0Candidate, tracks, particles, isMatched); if (!isMatched) { - continue; + continue; } for (const auto& McDJet : McDJets) { if (McDJet.pt() < jetPtCutMin) { From 10add02d7ec7fbc36f9784c858c86b491ccbd520 Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Fri, 27 Mar 2026 22:53:37 +0100 Subject: [PATCH 09/11] Fixes to jetCorrelationD0 task --- PWGJE/Tasks/jetCorrelationD0.cxx | 50 ++++++++++++-------------------- 1 file changed, 19 insertions(+), 31 deletions(-) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index c89042e1229..f318f761ad3 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -52,10 +52,15 @@ DECLARE_SOA_TABLE(McCollisionTables, "AOD", "MCCOLLINFOTABLE", o2::soa::Index<>, d0collisionInfo::PosZ); +DECLARE_SOA_TABLE(MatchCollTables, "AOD", "MATCHCOLLTABLE", + o2::soa::Index<>, + d0collisionInfo::PosZ); + namespace collisionInfo { DECLARE_SOA_INDEX_COLUMN_CUSTOM(CollisionTable, collisionTable, "COLLINFOTABLES"); DECLARE_SOA_INDEX_COLUMN_CUSTOM(McCollisionTable, mcCollisionTable, "MCCOLLINFOTABLES"); +DECLARE_SOA_INDEX_COLUMN_CUSTOM(MatchCollTable, matchCollTable, "MATCHCOLLTABLES"); } // namespace collisionInfo namespace d0Info { @@ -134,7 +139,7 @@ DECLARE_SOA_TABLE_STAGED(JetMcPTables, "JETMCPTABLE", DECLARE_SOA_TABLE_STAGED(JetMatchedTables, "JETMATCHEDTABLE", o2::soa::Index<>, - collisionInfo::CollisionTableId, + collisionInfo::MatchCollTableId, jetInfo::JetPt, jetInfo::JetEta, jetInfo::JetPhi, @@ -142,13 +147,14 @@ DECLARE_SOA_TABLE_STAGED(JetMatchedTables, "JETMATCHEDTABLE", jetInfo::PJetEta, jetInfo::PJetPhi, jetInfo::D0JetDeltaPhi, - jetInfo::D0JetDeltaPhiP) + jetInfo::D0JetDeltaPhiP); } // namespace o2::aod struct JetCorrelationD0 { // Define new table Produces tableCollision; + Produces tableMatchedCollision; Produces tableMcCollision; Produces tableD0; Produces tableD0McParticle; @@ -162,6 +168,8 @@ struct JetCorrelationD0 { Configurable applyRCTSelections{"applyRCTSelections", true, "decide to apply RCT selections"}; Configurable jetPtCutMin{"jetPtCutMin", 5.0, "minimum value of jet pt"}; Configurable d0PtCutMin{"d0PtCutMin", 1.0, "minimum value of d0 pt"}; + Configurable jetMcPtCutMin{"jetMcPtCutMin", 3.0, "minimum value of jet pt particle level"}; + Configurable d0McPtCutMin{"d0McPtCutMin", 0.5, "minimum value of d0 pt particle level"}; Configurable vertexZCut{"vertexZCut", 10.0, "Accepted z-vertex range"}; Configurable pTHatExponent{"pTHatExponent", 6.0, "exponent of the event weight for the calculation of pTHat"}; Configurable pTHatMaxMcD{"pTHatMaxMcD", 999.0, "maximum fraction of hard scattering for jet acceptance in detector MC"}; @@ -207,26 +215,6 @@ struct JetCorrelationD0 { registry.fill(HIST("hZvtxSelected"), collision.posZ()); return true; } - - template - // Jetbase is an McD jet. We then loop through jettagv(McP jets) to test if they match - // void fillMatchedHistograms(T const& jetBase, float weight = 1.0) // float leadingTrackPtBase, - void fillMatchedHistograms(T const& jetsBase, U const& jetsTag, float weight = 1.0, float rho = 0.0) - { - for (const auto& jetBase : jetsBase) { - if (jetBase.has_matchedJetGeo()) { // geometric matching - for (auto const& jetTag : jetBase.template matchedJetGeo_as>()) { - registry.fill(HIST("hPtMatched"), jetBase.pt() - (rho * jetBase.area()), jetTag.pt(), weight); - registry.fill(HIST("hPtMatched1d"), jetTag.pt(), weight); - registry.fill(HIST("hPhiMatched"), jetBase.phi(), jetTag.phi(), weight); - registry.fill(HIST("hEtaMatched"), jetBase.eta(), jetTag.eta(), weight); - registry.fill(HIST("hPtResolution"), jetTag.pt(), (jetTag.pt() - (jetBase.pt() - (rho * jetBase.area()))) / jetTag.pt(), weight); - registry.fill(HIST("hPhiResolution"), jetTag.pt(), jetTag.phi() - jetBase.phi(), weight); - registry.fill(HIST("hEtaResolution"), jetTag.pt(), jetTag.eta() - jetBase.eta(), weight); - } - } - } - } void init(InitContext const&) { eventSelectionBits = jetderiveddatautilities::initialiseEventSelectionBits(static_cast(eventSelections)); @@ -355,7 +343,7 @@ struct JetCorrelationD0 { } } } - PROCESS_SWITCH(JetCorrelationD0, processMcDetector, "charged particle level jet analysis", false); + PROCESS_SWITCH(JetCorrelationD0, processMcDetector, "charged detector level jet analysis", false); void processMcParticle(aod::JetMcCollision const& collision, aod::CandidatesD0MCP const& d0McPCandidates, @@ -366,10 +354,10 @@ struct JetCorrelationD0 { } tableMcCollision(collision.posZ()); for (const auto& d0McPCandidate : d0McPCandidates) { - if (d0McPCandidate.pt() < d0PtCutMin) { + if (d0McPCandidate.pt() < d0McPtCutMin) { continue; } - tableD0McParticle(tableCollision.lastIndex(), + tableD0McParticle(tableMcCollision.lastIndex(), d0McPCandidate.originMcGen(), d0McPCandidate.pt(), d0McPCandidate.eta(), @@ -377,7 +365,7 @@ struct JetCorrelationD0 { d0McPCandidate.y()); for (const auto& jet : jets) { - if (jet.pt() < jetPtCutMin) { + if (jet.pt() < jetMcPtCutMin) { continue; } float dPhi = RecoDecay::constrainAngle(jet.phi() - d0McPCandidate.phi()); @@ -388,7 +376,7 @@ struct JetCorrelationD0 { continue; } fillJetHistograms(jet, dPhi); - tableJetMcParticle(tableCollision.lastIndex(), + tableJetMcParticle(tableMcCollision.lastIndex(), tableD0McParticle.lastIndex(), jet.pt(), jet.eta(), @@ -397,7 +385,7 @@ struct JetCorrelationD0 { } } } - PROCESS_SWITCH(JetCorrelationD0, processMcParticle, "process MC Particle jets", false); + PROCESS_SWITCH(JetCorrelationD0, processMcParticle, "charged MC Particle jets", false); void processMcMatched(soa::Filtered::iterator const& collision, aod::CandidatesD0MCD const& d0Candidates, @@ -409,7 +397,7 @@ struct JetCorrelationD0 { if (!applyCollisionSelections(collision)) { return; } - tableCollision(collision.posZ()); + tableMatchedCollision(collision.posZ()); for (const auto& d0Candidate : d0Candidates) { if (d0Candidate.pt() < d0PtCutMin) { // once settled on a mlcut, then add the lower bound of the systematics as a cut here continue; @@ -439,7 +427,7 @@ struct JetCorrelationD0 { // if (std::abs(dPhiP - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { // continue; // } - tableJetMatched(tableCollision.lastIndex(), + tableJetMatched(tableMatchedCollision.lastIndex(), McDJet.pt(), McDJet.eta(), McDJet.phi(), @@ -453,7 +441,7 @@ struct JetCorrelationD0 { } } } - PROCESS_SWITCH(JetCorrelationD0, processMcMatched, "process matching of jets", false); + PROCESS_SWITCH(JetCorrelationD0, processMcMatched, "process matching of particle level jets to detector level jets", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 48eb8e6e11c0ce0688daa61e6c845216fd5b7923 Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Fri, 27 Mar 2026 23:01:32 +0100 Subject: [PATCH 10/11] Formatting --- PWGJE/Tasks/jetCorrelationD0.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index f318f761ad3..7dd3f986115 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -284,7 +284,7 @@ struct JetCorrelationD0 { if (dPhi > o2::constants::math::PI) { dPhi = 2 * o2::constants::math::PI - dPhi; } - if (std::abs(dPhi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { + if (std::abs(dPhi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { continue; } fillJetHistograms(jet, dPhi); @@ -439,7 +439,7 @@ struct JetCorrelationD0 { } } } - } + } } PROCESS_SWITCH(JetCorrelationD0, processMcMatched, "process matching of particle level jets to detector level jets", false); }; From 3f6b4b7dd40e312f109f47d20c6640f5af927860 Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Fri, 27 Mar 2026 23:17:01 +0100 Subject: [PATCH 11/11] Formatting --- PWGJE/Tasks/jetCorrelationD0.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index 7dd3f986115..4ebc99c54e1 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -14,9 +14,9 @@ /// \author Matthew Ockleton matthew.ockleton@cern.ch, University of Liverpool #include "PWGJE/Core/JetDerivedDataUtilities.h" +#include "PWGJE/Core/JetHFUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "PWGJE/Core/JetHFUtilities.h" #include "Common/Core/RecoDecay.h"