From f0836d178cd4ebb4c78801a3157825d0971a9ea1 Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Thu, 25 Jun 2026 13:50:42 +0200 Subject: [PATCH 1/6] Fixes for MC --- 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 e60e16c1a7f..2c6d7d1fcb1 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -200,7 +200,7 @@ struct JetCorrelationD0 { // 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 applyRCTSelections{"applyRCTSelections", false, "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"}; From d219857a9ef745ecd3c20e00eb3d630bf4b247e2 Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Mon, 29 Jun 2026 09:13:10 +0200 Subject: [PATCH 2/6] Adding MC D0 decay channel --- 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 2c6d7d1fcb1..e60e16c1a7f 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -200,7 +200,7 @@ struct JetCorrelationD0 { // Configurables Configurable eventSelections{"eventSelections", "sel8", "choose event selection"}; Configurable skipMBGapEvents{"skipMBGapEvents", false, "decide to run over MB gap events or not"}; - Configurable applyRCTSelections{"applyRCTSelections", false, "decide to apply RCT selections"}; + 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"}; From 094f64115512f9a5c26ab462d7e19456fca7b345 Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Wed, 5 Aug 2026 16:33:06 +0200 Subject: [PATCH 3/6] fixing build errors --- PWGJE/Tasks/jetCorrelationD0.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index e60e16c1a7f..cc4e25c8aac 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -37,9 +37,10 @@ #include #include #include -#include #include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; From c1b2df4f805e02e341397a75b62a0b2bd51aa7f9 Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Wed, 5 Aug 2026 16:38:22 +0200 Subject: [PATCH 4/6] clang formatting --- PWGJE/Tasks/jetCorrelationD0.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index cc4e25c8aac..ee9a59359d9 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -39,8 +39,6 @@ #include #include -#include - using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; From 091ecd3d25a2c0ed72048da4248f7c2a66ce43d7 Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Thu, 6 Aug 2026 10:19:10 +0200 Subject: [PATCH 5/6] adding enum D0McCategory --- PWGJE/Tasks/jetCorrelationD0.cxx | 43 +++++++++++++++++++------------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index ee9a59359d9..ddd7cede0b6 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -18,6 +18,8 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" +#include "PWGHF/Core/DecayChannels.h" + #include "Common/Core/RecoDecay.h" #include @@ -43,6 +45,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; +namespace hf2Prong = o2::hf_decay::hf_cand_2prong; namespace o2::aod { @@ -289,6 +292,15 @@ struct JetCorrelationD0 { registry.add("hPhiResolution", "#phi resolution;#p_{T,part};Resolution", {HistType::kTH2F, {{400, 0, 400}, {1000, -7.0, 7.0}}}); registry.add("hEtaResolution", "#eta resolution;#p_{T,part};Resolution", {HistType::kTH2F, {{400, 0, 400}, {1000, -1.0, 1.0}}}); } + enum D0McCategory : int { + Undefined = -1, // no truth match / unclassified + Signal = 0, // correctly identified D0(bar), π+ K− + Reflection = 1, // true D0(bar) reconstructed with swapped mass hypothesis + CorrBkgPiKPi0 = 2, // correlated background: π+ K− π0 + CorrBkgPiPi = 3, // correlated background: π+ π− + CorrBkgPiPiPi0 = 4, // correlated background: π+ π− π0 + CorrBkgKK = 5 // correlated background: K+ K− + }; void processData(soa::Filtered::iterator const& collision, aod::CandidatesD0Data const& d0Candidates, soa::Join const& jets) @@ -353,12 +365,7 @@ struct JetCorrelationD0 { int matchedFrom = 0; int selectedAs = 0; - int category = -1; // -1 undefined, 0 signal, 1 reflection, 2-5 correlated backgrounds - constexpr int kD0ToKPi = 1; - constexpr int kD0ToKPiPi = 2; - constexpr int kD0ToPiPi = 3; - constexpr int kD0ToPiPiPi = 4; - constexpr int kD0ToKK = 5; + int category = D0McCategory::Undefined; if (d0DecayChannel > 0) { // matched to a D0 on truth level (any channel) matchedFrom = 1; @@ -370,18 +377,18 @@ struct JetCorrelationD0 { } else if ((d0Candidate.candidateSelFlag() & BIT(1)) != 0) { // CandidateSelFlag == BIT(1) -> selected as D0bar selectedAs = -1; } - if ((std::abs(d0DecayChannel) == kD0ToKPi) && (matchedFrom != 0) && (selectedAs == matchedFrom)) { - category = 0; // signal -> D0 or D0bar, π+ K− - } else if ((d0DecayChannel == kD0ToKPi) && (selectedAs == -1 * matchedFrom)) { - category = 1; // reflection - } else if (d0DecayChannel == kD0ToKPiPi) { - category = 2; // corr bkg: π+ K− π0 - } else if (d0DecayChannel == kD0ToPiPi) { - category = 3; // corr bkg: π+ π− - } else if (d0DecayChannel == kD0ToPiPiPi) { - category = 4; // corr bkg: π+ π− π0 - } else if (d0DecayChannel == kD0ToKK) { - category = 5; // corr bkg: K+ K− + if ((std::abs(d0DecayChannel) == hf2Prong::DecayChannelMain::D0ToPiK) && (matchedFrom != 0) && (selectedAs == matchedFrom)) { + category = D0McCategory::Signal; // D0 or D0bar, π+ K− + } else if ((d0DecayChannel == hf2Prong::DecayChannelMain::D0ToPiK) && (selectedAs == -1 * matchedFrom)) { + category = D0McCategory::Reflection; + } else if (d0DecayChannel == hf2Prong::DecayChannelMain::D0ToPiKPi0) { + category = D0McCategory::CorrBkgPiKPi0; + } else if (d0DecayChannel == hf2Prong::DecayChannelMain::D0ToPiPi) { + category = D0McCategory::CorrBkgPiPi; + } else if (d0DecayChannel == hf2Prong::DecayChannelMain::D0ToPiPiPi0) { + category = D0McCategory::CorrBkgPiPiPi0; + } else if (d0DecayChannel == hf2Prong::DecayChannelMain::D0ToKK) { + category = D0McCategory::CorrBkgKK; } tableD0McDetector(tableCollision.lastIndex(), // might want to add some more detector level D0 quantities like prompt or non prompt info From 20bac37a82868688a57ec76310d40586f6add4c0 Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Thu, 6 Aug 2026 10:22:35 +0200 Subject: [PATCH 6/6] clang formatting --- PWGJE/Tasks/jetCorrelationD0.cxx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index ddd7cede0b6..bd6f919d333 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -13,13 +13,12 @@ /// \brief Task for analysing D0 triggered jet events. /// \author Matthew Ockleton matthew.ockleton@cern.ch, University of Liverpool +#include "PWGHF/Core/DecayChannels.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/Core/JetHFUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "PWGHF/Core/DecayChannels.h" - #include "Common/Core/RecoDecay.h" #include @@ -293,13 +292,13 @@ struct JetCorrelationD0 { registry.add("hEtaResolution", "#eta resolution;#p_{T,part};Resolution", {HistType::kTH2F, {{400, 0, 400}, {1000, -1.0, 1.0}}}); } enum D0McCategory : int { - Undefined = -1, // no truth match / unclassified - Signal = 0, // correctly identified D0(bar), π+ K− - Reflection = 1, // true D0(bar) reconstructed with swapped mass hypothesis - CorrBkgPiKPi0 = 2, // correlated background: π+ K− π0 - CorrBkgPiPi = 3, // correlated background: π+ π− - CorrBkgPiPiPi0 = 4, // correlated background: π+ π− π0 - CorrBkgKK = 5 // correlated background: K+ K− + Undefined = -1, // no truth match / unclassified + Signal = 0, // correctly identified D0(bar), π+ K− + Reflection = 1, // true D0(bar) reconstructed with swapped mass hypothesis + CorrBkgPiKPi0 = 2, // correlated background: π+ K− π0 + CorrBkgPiPi = 3, // correlated background: π+ π− + CorrBkgPiPiPi0 = 4, // correlated background: π+ π− π0 + CorrBkgKK = 5 // correlated background: K+ K− }; void processData(soa::Filtered::iterator const& collision, aod::CandidatesD0Data const& d0Candidates,