From ab17815ac35193fd15b7e346122ac666934471de Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Tue, 12 May 2026 12:31:31 +0200 Subject: [PATCH 1/8] Adding reflections to jetCorrelationD0 task --- PWGJE/Tasks/jetCorrelationD0.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index 1196c7b52a4..01395bc4942 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -36,6 +36,7 @@ #include #include #include +#include #include #include From 0f6d5b68358145e19cb2446ff047091ab26c5cb6 Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Thu, 25 Jun 2026 13:50:42 +0200 Subject: [PATCH 2/8] 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 01395bc4942..236701f988f 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -204,7 +204,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 70bea2d03e0478c4c37905105ca2da165c03f19e Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Mon, 29 Jun 2026 09:13:10 +0200 Subject: [PATCH 3/8] 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 236701f988f..01395bc4942 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -204,7 +204,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 98821abe7cf63d331c55cc0929470d93a90466af Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Wed, 15 Jul 2026 17:01:52 +0200 Subject: [PATCH 4/8] changing reflection and corr bkg handling --- PWGJE/Tasks/jetCorrelationD0.cxx | 34 ++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index 01395bc4942..60c24b26c30 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -87,8 +87,7 @@ DECLARE_SOA_COLUMN(D0MD, d0MD, float); DECLARE_SOA_COLUMN(D0PtD, d0PtD, float); DECLARE_SOA_COLUMN(D0EtaD, d0EtaD, float); DECLARE_SOA_COLUMN(D0PhiD, d0PhiD, float); -DECLARE_SOA_COLUMN(D0MatchedFrom, d0MatchedFrom, int); -DECLARE_SOA_COLUMN(D0SelectedAs, d0SelectedAs, int); +DECLARE_SOA_COLUMN(D0Category, d0Category, int); DECLARE_SOA_COLUMN(D0DecayChannel, d0DecayChannel, int8_t); } // namespace d0Info @@ -115,9 +114,7 @@ DECLARE_SOA_TABLE(D0McDTables, "AOD", "D0MCDTABLE", d0Info::D0Eta, d0Info::D0Phi, d0Info::D0Y, - d0Info::D0MatchedFrom, - d0Info::D0SelectedAs, - d0Info::D0DecayChannel); + d0Info::D0Category); DECLARE_SOA_TABLE(D0McPTables, "AOD", "D0MCPTABLE", o2::soa::Index<>, @@ -358,6 +355,7 @@ struct JetCorrelationD0 { int matchedFrom = 0; int selectedAs = 0; + int category; // 0 signal, 1 reflection, 2-5 correlated backgrounds if (d0DecayChannel > 0) { // matched to a D0 on truth level (any channel) matchedFrom = 1; @@ -369,6 +367,28 @@ struct JetCorrelationD0 { } else if (d0Candidate.candidateSelFlag() & BIT(1)) { // CandidateSelFlag == BIT(1) -> selected as D0bar selectedAs = -1; } + if ((d0DecayChannel == 1) && (selectedAs == matchedFrom)) { + category = 0; // signal -> D0 or D0bar, π+ K− π+ + } + if ((d0DecayChannel == 1) && (selectedAs == -1*matchedFrom)) { + category = 1; // reflection + } + if (d0DecayChannel == 2) { + category = 2; // corr bkg: π+ K− π0 + } + + if (d0DecayChannel == 3) { + category = 3; // corr bkg: π+ π− + } + if (d0DecayChannel == 4) { + category = 4; // corr bkg: π+ π− π0 + } + if (d0DecayChannel == 5) { + category = 5; // corr bkg: K+ K− + } + + + tableD0McDetector(tableCollision.lastIndex(), // might want to add some more detector level D0 quantities like prompt or non prompt info scores[2], @@ -379,9 +399,7 @@ struct JetCorrelationD0 { d0Candidate.eta(), d0Candidate.phi(), d0Candidate.y(), - matchedFrom, - selectedAs, - d0DecayChannel); + category); for (const auto& jet : jets) { if (jet.pt() < jetPtCutMin) { continue; From 19d6f782e1b0011c9721d0e4f072dd53a808e528 Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Tue, 4 Aug 2026 16:30:49 +0200 Subject: [PATCH 5/8] removing magic numbers --- PWGJE/Tasks/jetCorrelationD0.cxx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index 60c24b26c30..93fd40039c1 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -356,6 +356,11 @@ struct JetCorrelationD0 { int matchedFrom = 0; int selectedAs = 0; int category; // 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; if (d0DecayChannel > 0) { // matched to a D0 on truth level (any channel) matchedFrom = 1; @@ -367,23 +372,23 @@ struct JetCorrelationD0 { } else if (d0Candidate.candidateSelFlag() & BIT(1)) { // CandidateSelFlag == BIT(1) -> selected as D0bar selectedAs = -1; } - if ((d0DecayChannel == 1) && (selectedAs == matchedFrom)) { + if ((d0DecayChannel == kD0ToKPi) && (selectedAs == matchedFrom)) { category = 0; // signal -> D0 or D0bar, π+ K− π+ } - if ((d0DecayChannel == 1) && (selectedAs == -1*matchedFrom)) { + if ((d0DecayChannel == kD0ToKPi) && (selectedAs == -1*matchedFrom)) { category = 1; // reflection } - if (d0DecayChannel == 2) { + if (d0DecayChannel == kD0ToKPiPi) { category = 2; // corr bkg: π+ K− π0 } - if (d0DecayChannel == 3) { + if (d0DecayChannel == kD0ToPiPi) { category = 3; // corr bkg: π+ π− } - if (d0DecayChannel == 4) { + if (d0DecayChannel == kD0ToPiPiPi) { category = 4; // corr bkg: π+ π− π0 } - if (d0DecayChannel == 5) { + if (d0DecayChannel == kD0ToKK) { category = 5; // corr bkg: K+ K− } From cf053b56f5cb7baf8c04ffcd5ecff47ab48e799b Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Tue, 4 Aug 2026 17:01:00 +0200 Subject: [PATCH 6/8] resolving conflicts and fixing bug in D0 bar selection --- PWGJE/Tasks/jetCorrelationD0.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index 93fd40039c1..4389dbe5279 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -355,7 +355,7 @@ struct JetCorrelationD0 { int matchedFrom = 0; int selectedAs = 0; - int category; // 0 signal, 1 reflection, 2-5 correlated backgrounds + 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; @@ -372,23 +372,23 @@ struct JetCorrelationD0 { } else if (d0Candidate.candidateSelFlag() & BIT(1)) { // CandidateSelFlag == BIT(1) -> selected as D0bar selectedAs = -1; } - if ((d0DecayChannel == kD0ToKPi) && (selectedAs == matchedFrom)) { - category = 0; // signal -> D0 or D0bar, π+ K− π+ + if ((std::abs(d0DecayChannel) == kD0ToKPi) && (matchedFrom != 0) && (selectedAs == matchedFrom)) { + category = 0; // signal -> D0 or D0bar, π+ K− } - if ((d0DecayChannel == kD0ToKPi) && (selectedAs == -1*matchedFrom)) { + else if ((d0DecayChannel == kD0ToKPi) && (selectedAs == -1*matchedFrom)) { category = 1; // reflection } - if (d0DecayChannel == kD0ToKPiPi) { + else if (d0DecayChannel == kD0ToKPiPi) { category = 2; // corr bkg: π+ K− π0 } - if (d0DecayChannel == kD0ToPiPi) { + else if (d0DecayChannel == kD0ToPiPi) { category = 3; // corr bkg: π+ π− } - if (d0DecayChannel == kD0ToPiPiPi) { + else if (d0DecayChannel == kD0ToPiPiPi) { category = 4; // corr bkg: π+ π− π0 } - if (d0DecayChannel == kD0ToKK) { + else if (d0DecayChannel == kD0ToKK) { category = 5; // corr bkg: K+ K− } From 02e2b9cbb098b9286d57e9faa6ef446629255dc1 Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Tue, 4 Aug 2026 17:05:28 +0200 Subject: [PATCH 7/8] clang formatting --- PWGJE/Tasks/jetCorrelationD0.cxx | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index 4389dbe5279..92bfe3b613f 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -374,27 +374,20 @@ struct JetCorrelationD0 { } if ((std::abs(d0DecayChannel) == kD0ToKPi) && (matchedFrom != 0) && (selectedAs == matchedFrom)) { category = 0; // signal -> D0 or D0bar, π+ K− - } - else if ((d0DecayChannel == kD0ToKPi) && (selectedAs == -1*matchedFrom)) { + } else if ((d0DecayChannel == kD0ToKPi) && (selectedAs == -1 * matchedFrom)) { category = 1; // reflection - } - else if (d0DecayChannel == kD0ToKPiPi) { + } else if (d0DecayChannel == kD0ToKPiPi) { category = 2; // corr bkg: π+ K− π0 } else if (d0DecayChannel == kD0ToPiPi) { category = 3; // corr bkg: π+ π− - } - else if (d0DecayChannel == kD0ToPiPiPi) { + } else if (d0DecayChannel == kD0ToPiPiPi) { category = 4; // corr bkg: π+ π− π0 - } - else if (d0DecayChannel == kD0ToKK) { + } else if (d0DecayChannel == kD0ToKK) { category = 5; // corr bkg: K+ K− } - - - tableD0McDetector(tableCollision.lastIndex(), // might want to add some more detector level D0 quantities like prompt or non prompt info scores[2], scores[1], From 3d5c4ccb5e223a0c55daabd7ecb5e982c1efa3bc Mon Sep 17 00:00:00 2001 From: MattOckleton Date: Tue, 4 Aug 2026 17:15:58 +0200 Subject: [PATCH 8/8] fixing formatting for megalinter --- PWGJE/Tasks/jetCorrelationD0.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index 92bfe3b613f..d9628e16600 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -378,9 +378,7 @@ struct JetCorrelationD0 { category = 1; // reflection } else if (d0DecayChannel == kD0ToKPiPi) { category = 2; // corr bkg: π+ K− π0 - } - - else if (d0DecayChannel == kD0ToPiPi) { + } else if (d0DecayChannel == kD0ToPiPi) { category = 3; // corr bkg: π+ π− } else if (d0DecayChannel == kD0ToPiPiPi) { category = 4; // corr bkg: π+ π− π0